From patchwork Fri Jul 14 08:23:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9840147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 30B6660381 for ; Fri, 14 Jul 2017 08:24:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2047127FB6 for ; Fri, 14 Jul 2017 08:24:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 149A12874C; Fri, 14 Jul 2017 08:24:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C05E127FB6 for ; Fri, 14 Jul 2017 08:24:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753458AbdGNIYb (ORCPT ); Fri, 14 Jul 2017 04:24:31 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35783 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbdGNIY2 (ORCPT ); Fri, 14 Jul 2017 04:24:28 -0400 Received: by mail-pg0-f66.google.com with SMTP id d193so9858282pgc.2; Fri, 14 Jul 2017 01:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tmS65vaartCwpuXXUz9wbzUNLN5oQb17KTZOjz9WxLg=; b=WlG+AaPyI2M5tz/t0907Pqdu0lTWGXK2BCV6hwUXAX2sT0g/aUTZprsk3wG++Dhef/ KB5hoTvNkxrkHWRwRmJQI8wjt4xFDIQdnGFXOoXxiIMy2usHHs9/w1+gP5Odq3pSs9ju 3BX8X8qTdzlwFo4602oXn5l7ooa8LSpG3dCFWZaPyEWL0+1Dyl5N1hu6hmYX01r8zEE5 H6eXWQQsz7sdzV0U2NxrAcEXvoc+jI2OJ4RGScJLgsnvUI33rP+oXX+ir6GGEwoTLdtr +R9igwHL1wPF55JiMkjqHraFoppZzMY78kF0JvLmjbriv0ZfkjTpsUBZsccHyWGIAav/ GQeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tmS65vaartCwpuXXUz9wbzUNLN5oQb17KTZOjz9WxLg=; b=bAYux/ZAHvmhOTwYChQgeNLLIEht9keaRFiisrnyI9tONXExMUV1Gl5Fwzgn7QleVj q+jcouxgVmlNen7wElnyOeeaaYHKmodDbGF5f2GZ0cUzGZwgYwHcqfov1WymvRlx9jxE UvJoCP8GtRjn7xo1eqeYH1SSfC3Wi/MQ/AzXSiPWPDuzc37C6BgTHYqf5+/ufxcjjaTO Ife5vpvv6okTegbHk9R0LDmpg90jo6EEQol5tIhfVr4BuC1MnU0xh8eVMoFyzfq1Kfyl OUEfbH4tyeJNq2VJ3hM7GsTM5Zokr6TAGMRaMnnv15e92oyxRsdxYCOKox3/FH+q19KC yHnQ== X-Gm-Message-State: AIVw111c8DSbMCxmAPJUi4pb9BU0QDHe2bi3oo9IouKTuwRMyovNiH/a brxNoYmbZy8UHQ== X-Received: by 10.99.113.66 with SMTP id b2mr13487429pgn.216.1500020652163; Fri, 14 Jul 2017 01:24:12 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id d18sm22925586pgn.27.2017.07.14.01.24.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Jul 2017 01:24:11 -0700 (PDT) From: Arvind Yadav To: lduncan@suse.com, cleech@redhat.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] scsi: iscsi_boot_sysfs: constify attribute_group structures. Date: Fri, 14 Jul 2017 13:53:28 +0530 Message-Id: <1500020610-15973-3-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500020610-15973-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1500020610-15973-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 2548 1768 0 4316 10dc drivers/scsi/iscsi_boot_sysfs.o File size After adding 'const': text data bss dec hex filename 2804 1512 0 4316 10dc drivers/scsi/iscsi_boot_sysfs.o Signed-off-by: Arvind Yadav --- drivers/scsi/iscsi_boot_sysfs.c | 10 +++++----- include/linux/iscsi_boot_sysfs.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/iscsi_boot_sysfs.c b/drivers/scsi/iscsi_boot_sysfs.c index d453667..9670a04 100644 --- a/drivers/scsi/iscsi_boot_sysfs.c +++ b/drivers/scsi/iscsi_boot_sysfs.c @@ -157,7 +157,7 @@ static umode_t iscsi_boot_tgt_attr_is_visible(struct kobject *kobj, return 0; } -static struct attribute_group iscsi_boot_target_attr_group = { +static const struct attribute_group iscsi_boot_target_attr_group = { .attrs = target_attrs, .is_visible = iscsi_boot_tgt_attr_is_visible, }; @@ -243,7 +243,7 @@ static umode_t iscsi_boot_eth_attr_is_visible(struct kobject *kobj, return 0; } -static struct attribute_group iscsi_boot_ethernet_attr_group = { +static const struct attribute_group iscsi_boot_ethernet_attr_group = { .attrs = ethernet_attrs, .is_visible = iscsi_boot_eth_attr_is_visible, }; @@ -301,7 +301,7 @@ static umode_t iscsi_boot_ini_attr_is_visible(struct kobject *kobj, return 0; } -static struct attribute_group iscsi_boot_initiator_attr_group = { +static const struct attribute_group iscsi_boot_initiator_attr_group = { .attrs = initiator_attrs, .is_visible = iscsi_boot_ini_attr_is_visible, }; @@ -337,14 +337,14 @@ static umode_t iscsi_boot_acpitbl_attr_is_visible(struct kobject *kobj, return 0; } -static struct attribute_group iscsi_boot_acpitbl_attr_group = { +static const struct attribute_group iscsi_boot_acpitbl_attr_group = { .attrs = acpitbl_attrs, .is_visible = iscsi_boot_acpitbl_attr_is_visible, }; static struct iscsi_boot_kobj * iscsi_boot_create_kobj(struct iscsi_boot_kset *boot_kset, - struct attribute_group *attr_group, + const struct attribute_group *attr_group, const char *name, int index, void *data, ssize_t (*show) (void *data, int type, char *buf), umode_t (*is_visible) (void *data, int type), diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h index 10923d7..3fb07e0 100644 --- a/include/linux/iscsi_boot_sysfs.h +++ b/include/linux/iscsi_boot_sysfs.h @@ -74,7 +74,7 @@ enum iscsi_boot_acpitbl_properties_enum { struct iscsi_boot_kobj { struct kobject kobj; - struct attribute_group *attr_group; + const struct attribute_group *attr_group; struct list_head list; /*