Received: by 10.192.165.156 with SMTP id m28csp620095imm; Tue, 17 Apr 2018 16:37:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx48PQsOPylQLAJhLM6Yp4z3k3hWtKkzPhr7BJVcTjzliOaVN291qYwE66hzpISDl2TTcLPZ9 X-Received: by 10.98.185.23 with SMTP id z23mr3641238pfe.180.1524008266858; Tue, 17 Apr 2018 16:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524008266; cv=none; d=google.com; s=arc-20160816; b=ZWsCm86ZvwxbHpYy4YSM0M55gUIZREmOZZiFjcbRnBOEXc6RA/Io1YK0v6hQjCQOhG 9Cn7I18cVu/A1eh1e4Hq/xxonTX6zlXxjdt4SPuM+xMDrA9hJMtgIyDrvWu+DZLgsCjc h6gj9ez4lBJsTO3nKsarTf9N00LjYPraEFXPJkMdd9ix02bHcYEAV26IN7U9f4zzf4Kf Tm9DZSI/+LRWTDkWGUBufgWnjn6f9sc2Aje4vq0Z73SDVUNZawcCXpMFr9C9lwIHAPmy RTHw60LjfV5+YRnfODi2axpEAVzgWOERso4wzNptka6FtfMAn5yd84Q5MKm4dBnei/oV Gx4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=69jihlz+Z3YCouc4WMtRjeR2zsQs9qzNjA3D+4lRUAQ=; b=QWK25bi+jIqkZzgYiw04xebkfzGEXiFbUcAmA+xnCRy5UBkPyNzN7naaiCiAl5krgA I9E+beo6wuB2f22P/JGKGoYKdZe0JqoNm2LJ16lAaOvOWCmr/Sc6bySQZeDtLYbWVnJV 53iBrTRXTOfAK2z/NRgbsRqQ/5zGVNclr3RTpuXMxyOfcVd45WjL3nuBCor9WfbA5XHt +nhhWXTr+OskgeQ91de12QgHsn3G7C8YjHmaddU+KZqkWzbS76Kh9nQoKUkVidvp7nun zmy1JH98Y3wS832y/revIrVRR8H3ztG+CU6Yi857Q7JVNOdPhoIk9hyg0ZlwpRR6+/wy +hSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si8135602pgs.577.2018.04.17.16.37.32; Tue, 17 Apr 2018 16:37:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753199AbeDQXgI (ORCPT + 99 others); Tue, 17 Apr 2018 19:36:08 -0400 Received: from victor.provo.novell.com ([137.65.250.26]:42060 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753162AbeDQXgH (ORCPT ); Tue, 17 Apr 2018 19:36:07 -0400 Received: from apollon.suse.de.de (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Tue, 17 Apr 2018 17:35:56 -0600 From: Martin Wilck To: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Hannes Reinecke , James Bottomley , Xose Vazquez Perez , Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , Bart Van Assche , Christoph Hellwig , Johannes Thumshirn , Jens Axboe , James Bottomley , Omar Sandoval , Bart Van Assche , Ming Lei Subject: [PATCH v3 2/6] scsi: use const_ilog2 for array indices Date: Wed, 18 Apr 2018 01:35:07 +0200 Message-Id: <20180417233511.6573-3-mwilck@suse.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180417233511.6573-1-mwilck@suse.com> References: <20180417233511.6573-1-mwilck@suse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the just introduced const_ilog2() macro to avoid sparse errors. Signed-off-by: Martin Wilck --- drivers/scsi/scsi_debugfs.c | 2 +- drivers/scsi/scsi_sysfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_debugfs.c b/drivers/scsi/scsi_debugfs.c index b784002..c5a8756 100644 --- a/drivers/scsi/scsi_debugfs.c +++ b/drivers/scsi/scsi_debugfs.c @@ -4,7 +4,7 @@ #include #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), diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index e56a4ac..feacd7a 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -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" }; -- 2.16.1