From patchwork Mon Jul 17 09:16: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: 9844323 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 9CE316037F for ; Mon, 17 Jul 2017 09:18:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F91528338 for ; Mon, 17 Jul 2017 09:18:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8461228408; Mon, 17 Jul 2017 09:18: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=-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 1F5F228338 for ; Mon, 17 Jul 2017 09:18:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751311AbdGQJRO (ORCPT ); Mon, 17 Jul 2017 05:17:14 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35535 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbdGQJRL (ORCPT ); Mon, 17 Jul 2017 05:17:11 -0400 Received: by mail-pg0-f68.google.com with SMTP id d193so18789734pgc.2; Mon, 17 Jul 2017 02:17:10 -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=R6DEkuKkr5nD8gWHo63hYragiG6Rq5DuuIRJ2/11ohU=; b=YvkySo5VtguxlzZ6z/KdWXpqk/VW3GhBMkUFsOdKiMYoK2N6lfY1ja7zuHiPHx3f5/ o5QBk9Oojsvp3Ml4lVzUD1Pdpy4xj0tJaTESJvcFshgYNNiIF2mKS6CVc69KXgH8RptW hGLqPB4RZE+pWFFUkhJBrC3gFQofVWK4pOYgpijGPx6/fdP+lQu7Iw7qwh6S05cl+8qY OpPOEMecGepQ45ZpZkpWRy20AJ5xhYgi1o4tOrl1VPk7SQCXng0ADLGVxYQjQblpUn+e PlqwVN3BCO0TSELTmDS4bgt/B0NAhoP5Llc15Vuh5/TO7IlUsbvDrz/leQna8CRuAYa7 6Exg== 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=R6DEkuKkr5nD8gWHo63hYragiG6Rq5DuuIRJ2/11ohU=; b=MKUKUzqDYbTTNxIa+QqFvwUKGA8gwj95q8kVKM2k+Zaf7t4hi0pTS7JMlmxYxQNmCi 1px3tWepueVHCp0Wu4P0XBl5HMQ2Rh7s1l7L1BzaMU8f84k/aw5j1B/rNVX3iBozdXkp TLmd7d3xMNarnEN10JKkVqCoIYqBb1aeuxnOD+hB21DR/pPAR/qQ983fdpPkUbsLIfhf f+kH6ByIXq7Y5pp3XCOg+l+m0PEqlcFi3oCi1mU4OnQeVlsLQz2iMdWAIibrQg2Wal3R 48TNmyHu/oIAhtyMA1FZ17lak+iVuX5qHxmZxN3V2bISBGjBTMNnbW0uJl0kVFvqdwM6 YQGA== X-Gm-Message-State: AIVw11287aVUtrcco+LZlAb/KLHcNnyJhzZQ7d8gk4poxbtyTMsu2W4F WLZobDHLd6NoFg== X-Received: by 10.101.90.69 with SMTP id z5mr27475693pgs.277.1500283030415; Mon, 17 Jul 2017 02:17:10 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id y5sm14977246pge.38.2017.07.17.02.17.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 02:17:09 -0700 (PDT) From: Arvind Yadav To: dvhart@infradead.org, andy@infradead.org, jwoithe@just42.net, cezary.jackiewicz@gmail.com, corentin.chary@gmail.com, laforge@gnumonks.org, coproscefalo@gmail.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] staging: lustre: constify attribute_group structures. Date: Mon, 17 Jul 2017 14:46:28 +0530 Message-Id: <1500282990-23929-2-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500282990-23929-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1500282990-23929-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 9489 992 40 10521 2919 lustre/lustre/osc/lproc_osc.o 1289 288 0 1577 629 lustre/lustre/lmv/lproc_lmv.o 3794 928 40 4762 129a lustre/lustre/lov/lproc_lov.o 3802 576 40 4418 1142 lustre/lustre/mdc/lproc_mdc.o File size After adding 'const': text data bss dec hex filename 9553 928 40 10521 2919 lustre/lustre/osc/lproc_osc.o 1353 224 0 1577 629 lustre/lustre/lmv/lproc_lmv.o 3858 864 40 4762 129a lustre/lustre/lov/lproc_lov.o 3866 512 40 4418 1142 lustre/lustre/mdc/lproc_mdc.o Signed-off-by: Arvind Yadav --- Changes in v2: Fix kbuild error: conflicting types for 'lprocfs_obd_setup'. By changing protype of 'lprocfs_obd_setup'. drivers/staging/lustre/lustre/include/lprocfs_status.h | 4 ++-- drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 2 +- drivers/staging/lustre/lustre/lov/lproc_lov.c | 2 +- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +- drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +- drivers/staging/lustre/lustre/osc/lproc_osc.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 915283c..9054d37 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -59,7 +59,7 @@ struct lprocfs_vars { struct lprocfs_static_vars { struct lprocfs_vars *obd_vars; - struct attribute_group *sysfs_vars; + const struct attribute_group *sysfs_vars; }; /* if we find more consumers this could be generalized */ @@ -468,7 +468,7 @@ struct dentry *ldebugfs_register(const char *name, void ldebugfs_remove(struct dentry **entryp); int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list, - struct attribute_group *attrs); + const struct attribute_group *attrs); int lprocfs_obd_cleanup(struct obd_device *obd); int ldebugfs_seq_create(struct dentry *parent, diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c index bf25f88..4c13e39 100644 --- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c +++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c @@ -161,7 +161,7 @@ static int lmv_target_seq_open(struct inode *inode, struct file *file) NULL, }; -static struct attribute_group lmv_attr_group = { +static const struct attribute_group lmv_attr_group = { .attrs = lmv_attrs, }; diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c index eb6d30d..ce46821 100644 --- a/drivers/staging/lustre/lustre/lov/lproc_lov.c +++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c @@ -279,7 +279,7 @@ static int lov_target_seq_open(struct inode *inode, struct file *file) NULL, }; -static struct attribute_group lov_attr_group = { +static const struct attribute_group lov_attr_group = { .attrs = lov_attrs, }; diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c index 9021c46..9fea535 100644 --- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c +++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c @@ -219,7 +219,7 @@ static ssize_t max_pages_per_rpc_show(struct kobject *kobj, NULL, }; -static struct attribute_group mdc_attr_group = { +static const struct attribute_group mdc_attr_group = { .attrs = mdc_attrs, }; diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index bc19f19..ba41983 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -1031,7 +1031,7 @@ static void obd_sysfs_release(struct kobject *kobj) }; int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list, - struct attribute_group *attrs) + const struct attribute_group *attrs) { int rc = 0; diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index 86f252d..6e0fd15 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -831,7 +831,7 @@ int lproc_osc_attach_seqstat(struct obd_device *dev) NULL, }; -static struct attribute_group osc_attr_group = { +static const struct attribute_group osc_attr_group = { .attrs = osc_attrs, };