diff options
| author | Rasmus Villemoes <[email protected]> | 2018-10-30 22:04:59 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2018-10-31 15:54:12 +0000 |
| commit | 7275b097851a5e2e0dd4da039c7e96b59ac5314e (patch) | |
| tree | e5242c165fd62279c74f1951a93f23e427203d0a /lib/parser.c | |
| parent | lib/bitmap.c: remove wrong documentation (diff) | |
| download | kernel-7275b097851a5e2e0dd4da039c7e96b59ac5314e.tar.gz kernel-7275b097851a5e2e0dd4da039c7e96b59ac5314e.zip | |
linux/bitmap.h: handle constant zero-size bitmaps correctly
The static inlines in bitmap.h do not handle a compile-time constant
nbits==0 correctly (they dereference the passed src or dst pointers,
despite only 0 words being valid to access). I had the 0-day buildbot
chew on a patch [1] that would cause build failures for such cases without
complaining, suggesting that we don't have any such users currently, at
least for the 70 .config/arch combinations that was built. Should any
turn up, make sure they use the out-of-line versions, which do handle
nbits==0 correctly.
This is of course not the most efficient, but it's much less churn than
teaching all the static inlines an "if (zero_const_nbits())", and since we
don't have any current instances, this doesn't affect existing code at
all.
[1] lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Rasmus Villemoes <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Cc: Yury Norov <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Sudeep Holla <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/parser.c')
0 files changed, 0 insertions, 0 deletions
