From patchwork Fri Jul 14 08:23:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9840153 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 A8E9460381 for ; Fri, 14 Jul 2017 08:25:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98F5427FB6 for ; Fri, 14 Jul 2017 08:25:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E0042874F; Fri, 14 Jul 2017 08:25:18 +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 4387527FB6 for ; Fri, 14 Jul 2017 08:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753378AbdGNIYU (ORCPT ); Fri, 14 Jul 2017 04:24:20 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35144 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbdGNIYS (ORCPT ); Fri, 14 Jul 2017 04:24:18 -0400 Received: by mail-pf0-f195.google.com with SMTP id q85so10173872pfq.2; Fri, 14 Jul 2017 01:24:18 -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=GuZjNV1hOmUuzfq9S05Kal3dKRZet6LhXpwb5tp90ng=; b=cZvi5C2Pi+Ab4fTU8iyqS0gmTNt5cxLSdWIXfGndselPbZW6ThFZETkOl2bm0vlgjq i6gh5euHAUHlc5Ogp7mqLtSGKYrVuTXGUugL+LjuI/D7MQNyJK5Co/IaCdk6D3lnL8VO ASbcnsDeMhJN40ZR+rrKwLnld/8LoE6TrjJXXZmbcW4GK4uRjHmFN3rFoFvJ3/0Ho6kT vETCtJF+W6bn0AQvchcQTx3zt1Ng0HUOpGVMEG9ADyPzsc2fqDdFltspJA/Cw9R5UaLK qjpMq+btHgNO6pK+Msa+5A6RqOK28G2O9B648vkn7rr/yrmHznSPb3GZxPgyfKsCzawh Gu9w== 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=GuZjNV1hOmUuzfq9S05Kal3dKRZet6LhXpwb5tp90ng=; b=FhjFc/p9Csgzx7/MdpeJl88TkM0PJ2tER2WdWIayboBatxjt0hecHYow7TIaBTHFGX ijJ095vMUf2HCV46C3SNHazD3/yMUD/ebP5PUYx5aYvi+bgSOBxZ2zUCJfX/iOkrqwBZ vhCnGsMw6w+Owe+lpuEyaFFvvX8K9LhjR0Brgb8ar+o/NbbpnD7w4n2kiPbR9XHgdZga y83qEkupm/ZHoJ1YUnBQkHDxNtku4nUw1eV0wfomH4KmuVh45kbprVnVtwrlVIxEzHq0 Q296UlcmDMeV2gnoi/8AaqfKJe1FCz0So0gOEgt2lTiiQxdbZHFVqEKVG9M7evhWzPUJ jo2w== X-Gm-Message-State: AIVw1103SHun4kfllkG2JVtKyHk6ard+rNm0sxPxX6ElT+QxSDYit6YP zA+GZVngQ0AP4A== X-Received: by 10.99.47.66 with SMTP id v63mr13799696pgv.4.1500020658115; Fri, 14 Jul 2017 01:24:18 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Jul 2017 01:24:17 -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 4/4] scsi: scsi_transport_spi: constify attribute_group structures. Date: Fri, 14 Jul 2017 13:53:30 +0530 Message-Id: <1500020610-15973-5-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 and work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 15444 1616 0 17060 42a4 drivers/scsi/scsi_transport_spi.o File size After adding 'const': text data bss dec hex filename 15572 1488 0 17060 42a4 drivers/scsi/scsi_transport_spi.o Signed-off-by: Arvind Yadav --- drivers/scsi/scsi_transport_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index d0219e3..ec723b2 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -1426,7 +1426,7 @@ static DECLARE_ANON_TRANSPORT_CLASS(spi_device_class, NULL }; -static struct attribute_group host_attribute_group = { +static const struct attribute_group host_attribute_group = { .attrs = host_attributes, }; @@ -1536,7 +1536,7 @@ static umode_t target_attribute_is_visible(struct kobject *kobj, NULL }; -static struct attribute_group target_attribute_group = { +static const struct attribute_group target_attribute_group = { .attrs = target_attributes, .is_visible = target_attribute_is_visible, };