From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755035Ab2DQBcY (ORCPT ); Mon, 16 Apr 2012 21:32:24 -0400 Received: from mail127.messagelabs.com ([216.82.250.115]:42981 "EHLO mail127.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626Ab2DQBcX (ORCPT ); Mon, 16 Apr 2012 21:32:23 -0400 X-Env-Sender: hartleys@visionengravers.com X-Msg-Ref: server-14.tower-127.messagelabs.com!1334626342!3277003!1 X-Originating-IP: [216.166.12.72] X-StarScan-Version: 6.5.7; banners=-,-,- X-VirusChecked: Checked From: H Hartley Sweeten To: Linux Kernel Subject: [PATCH] drivers/scs/scsi_sysfs.c: local variables should not be exposed globally Date: Mon, 16 Apr 2012 18:32:18 -0700 User-Agent: KMail/1.9.9 CC: , MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201204161832.18848.hartleys@visionengravers.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Variables not referenced outside of a source file should be marked static to prevent it from being exposed globally. This quiets the sparse warnings: warning: symbol 'dev_attr_hstate' was not declared. Should it be static? warning: symbol 'scsi_shost_attr_group' was not declared. Should it be static? Signed-off-by: H Hartley Sweeten Cc: "James E.J. Bottomley" --- diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 04c2a27..fbff014 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -197,7 +197,7 @@ show_shost_state(struct device *dev, struct device_attribute *attr, char *buf) } /* DEVICE_ATTR(state) clashes with dev_attr_state for sdev */ -struct device_attribute dev_attr_hstate = +static struct device_attribute dev_attr_hstate = __ATTR(state, S_IRUGO | S_IWUSR, show_shost_state, store_shost_state); static ssize_t @@ -313,7 +313,7 @@ static struct attribute *scsi_sysfs_shost_attrs[] = { NULL }; -struct attribute_group scsi_shost_attr_group = { +static struct attribute_group scsi_shost_attr_group = { .attrs = scsi_sysfs_shost_attrs, };