From patchwork Fri Jul 14 08:23:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9840141 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 415B560381 for ; Fri, 14 Jul 2017 08:24:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3112827FB6 for ; Fri, 14 Jul 2017 08:24:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2607228751; Fri, 14 Jul 2017 08:24:27 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 D367127FB6 for ; Fri, 14 Jul 2017 08:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753357AbdGNIYN (ORCPT ); Fri, 14 Jul 2017 04:24:13 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33265 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbdGNIYJ (ORCPT ); Fri, 14 Jul 2017 04:24:09 -0400 Received: by mail-pf0-f193.google.com with SMTP id e199so10186820pfh.0; Fri, 14 Jul 2017 01:24:09 -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=aB0Rb30RaB4HeMmh0+1B09tWIE/JvN6Ag/4rp8pK9Z4=; b=DcF1IDX37/aHZvcGOJQl1pGQe5dwE39CAeTY/OjAgEm56xpT0H5K+FqB1fQv77SnR0 akVdSQan0c95CW+0ieZW/wB3Hdm6DXClGmwaIyrdfIIk3OzbKsnZNAvQTHbROtbKONOC 2jd5QzE6tnH8R1MKokNgPqJwo8vbelCzOB9yt8NyT1q2NunwgG82h4E2SgtaSH0fF/Tt RikSn/fWe8t5SlYJ3kP7NkYyVILSCdOlQM4PTe26ixcWRk5mzOKMGQRA+y9c9IvBi6k7 A+WpUKoG/j8V0EGMetrUAxv8KD76bLfMG7Psau34FgVAZc5i/wszSGK5ecT6zyjxT4uh zVrQ== 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=aB0Rb30RaB4HeMmh0+1B09tWIE/JvN6Ag/4rp8pK9Z4=; b=B9pRGdxYgaw1ymjEP7oQm9URRXniLRzF1H4GSotRRdKBnvF1snEQMwQovnlYA+j1t2 QOlXu6oRzb5JKgENDpqarZIt1MvgQiQpRE/QLIOA64mJ7Qf/GfE7CLaAMmWVyIzTfOd3 38YH/MvIZvDeLSfjdMgpx+Vrwk0GuESqCFc/bYAbbwlHp7Pxe2V7zJej/mbzCF8xTw7W Rl4fh+Obd+WwqbRXvCPFqoUQrzHORBwRD+kvKcx9VLz1oehHczIa8SBr9ju/hynfca4L xUmBSrdv4PwqQVYY/pK4ai2PEUnHspmyGDhJo30Nnlg5d2Yr1+j5Lrs8D+cCbA5oQ9+G 7TPQ== X-Gm-Message-State: AIVw113JZ/jadj7QBfH9UVy8jp6ZsT5L7zukw9wu1JseXlKRenl9ywSl KzHSvvHlIqhh5Q== X-Received: by 10.101.76.140 with SMTP id m12mr13322482pgt.159.1500020649131; Fri, 14 Jul 2017 01:24:09 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Jul 2017 01:24:08 -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 1/4] scsi: scsi_transport_iscsi: constify attribute_group structures. Date: Fri, 14 Jul 2017 13:53:27 +0530 Message-Id: <1500020610-15973-2-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 40380 10422 44 50846 c69e scsi/scsi_transport_iscsi.o File size After adding 'const': text data bss dec hex filename 40764 10070 44 50878 c6be scsi/scsi_transport_iscsi.o Signed-off-by: Arvind Yadav --- drivers/scsi/scsi_transport_iscsi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index a424eae..55393b3 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -139,7 +139,7 @@ static void iscsi_transport_release(struct device *dev) NULL, }; -static struct attribute_group iscsi_transport_group = { +static const struct attribute_group iscsi_transport_group = { .attrs = iscsi_transport_attrs, }; @@ -177,7 +177,7 @@ static void iscsi_endpoint_release(struct device *dev) NULL, }; -static struct attribute_group iscsi_endpoint_group = { +static const struct attribute_group iscsi_endpoint_group = { .attrs = iscsi_endpoint_attrs, }; @@ -680,7 +680,7 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj, NULL, }; -static struct attribute_group iscsi_iface_group = { +static const struct attribute_group iscsi_iface_group = { .attrs = iscsi_iface_attrs, .is_visible = iscsi_iface_attr_is_visible, }; @@ -3922,7 +3922,7 @@ static umode_t iscsi_conn_attr_is_visible(struct kobject *kobj, return t->attr_is_visible(ISCSI_PARAM, param); } -static struct attribute_group iscsi_conn_group = { +static const struct attribute_group iscsi_conn_group = { .attrs = iscsi_conn_attrs, .is_visible = iscsi_conn_attr_is_visible, }; @@ -4217,7 +4217,7 @@ static umode_t iscsi_session_attr_is_visible(struct kobject *kobj, return t->attr_is_visible(ISCSI_PARAM, param); } -static struct attribute_group iscsi_session_group = { +static const struct attribute_group iscsi_session_group = { .attrs = iscsi_session_attrs, .is_visible = iscsi_session_attr_is_visible, }; @@ -4285,7 +4285,7 @@ static umode_t iscsi_host_attr_is_visible(struct kobject *kobj, return priv->iscsi_transport->attr_is_visible(ISCSI_HOST_PARAM, param); } -static struct attribute_group iscsi_host_group = { +static const struct attribute_group iscsi_host_group = { .attrs = iscsi_host_attrs, .is_visible = iscsi_host_attr_is_visible, };