]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
scsi: ilog2: create truly constant version for sparse
authorMartin Wilck <mwilck@suse.com>
Tue, 17 Apr 2018 23:35:06 +0000 (01:35 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Apr 2018 19:57:32 +0000 (15:57 -0400)
commitdbef91ec5482239055dd2db8ec656fc13d382add
tree713484f124faf033bd7970cfbb8cdcfd080891b2
parent2217a47de42f85b69714c2a621af13cfeae35b40
scsi: ilog2: create truly constant version for sparse

Sparse emits errors about ilog2() in array indices because of the use of
__ilog2_32() and __ilog2_64(), rightly so
(https://www.spinics.net/lists/linux-sparse/msg03471.html).

Create a const_ilog2() variant that works with sparse for this scenario.

(Note: checkpatch.pl complains about missing parentheses, but that
appears to be a false positive. I can get rid of the warning simply by
inserting whitespace, making checkpatch "see" the whole macro).

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
include/linux/log2.h