Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decide what to do with uaccess.h constness #186

Open
shenki opened this issue Sep 6, 2018 · 4 comments
Open

Decide what to do with uaccess.h constness #186

shenki opened this issue Sep 6, 2018 · 4 comments

Comments

@shenki
Copy link
Member

shenki commented Sep 6, 2018

Back in b91c1e3e7a6f22a6b898e345b745b6a43273c973 (powerpc: Fix duplicate const clang warning in user access code, May 2015) Anton removed the const specifiers from the __get_user macros to fix clang warnings.

in f84ed59a612d866cde0bd17ad2a52acb524d44c9 (powerpc/sparse: Constify the address pointer in __get_user_check()) and similar commits, dja re-added these to fix some sparse warnings.

The clang warnings are still there. I assume if we undo Daniel's changes we will reintroduce the sparse warnings. Which should we choose?

@shenki
Copy link
Member Author

shenki commented Sep 10, 2018

@shenki
Copy link
Member Author

shenki commented Oct 12, 2018

We ended up doing the revert of dja's patch which will land in 4.20: https://patchwork.ozlabs.org/patch/969614/

In addition, clang has fixed this to match GCC's behaviour, which will appear in the clang 8 release.

@mpe
Copy link
Member

mpe commented Oct 12, 2018

I don't think @daxtens original patch was actually fixing a sparse warning was it? It was just a "hey const makes sense here so let's use it".

@mpe
Copy link
Member

mpe commented Oct 12, 2018

No it was fixing a warning:

Looking through the sparse warnings, I noticed that we were getting
warnings about dropping const qualifiers in get_user calls. This took
a while to figure out: it turns out that if you pass a const pointer
in, sparse will complain when we drop the const qualifier deep inside
the _get_user macros. This simple series fixes that, squashing over
60 warnings.

https://lore.kernel.org/linuxppc-dev/20170130064155.30281-1-dja@axtens.net/

But I don't seem to be seeing them as of now, so perhaps they've gone away for some other reason.

@mpe mpe transferred this issue from linuxppc/linux Jan 7, 2019
@mpe mpe moved this to 🆕 New in linuxppc backlog Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants