Commit 659c1c1b authored by Martin Wilck's avatar Martin Wilck Committed by Martin K. Petersen

scsi: devinfo: use const_ilog2 for array indices

Use the just introduced const_ilog2() macro to avoid sparse errors.
Signed-off-by: default avatarMartin Wilck <mwilck@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent dbef91ec
......@@ -4,7 +4,7 @@
#include <scsi/scsi_dbg.h>
#include "scsi_debugfs.h"
#define SCSI_CMD_FLAG_NAME(name) [ilog2(SCMD_##name)] = #name
#define SCSI_CMD_FLAG_NAME(name)[const_ilog2(SCMD_##name)] = #name
static const char *const scsi_cmd_flags[] = {
SCSI_CMD_FLAG_NAME(TAGGED),
SCSI_CMD_FLAG_NAME(UNCHECKED_ISA_DMA),
......
......@@ -968,7 +968,7 @@ sdev_show_wwid(struct device *dev, struct device_attribute *attr,
static DEVICE_ATTR(wwid, S_IRUGO, sdev_show_wwid, NULL);
#define BLIST_FLAG_NAME(name) \
[ilog2((__force unsigned int)BLIST_##name)] = #name
[const_ilog2((__force unsigned int)BLIST_##name)] = #name
static const char *const sdev_bflags_name[] = {
#include "scsi_devinfo_tbl.c"
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment