From patchwork Wed Jul 5 05:01:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9825831 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 8783A60317 for ; Wed, 5 Jul 2017 05:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8627526E16 for ; Wed, 5 Jul 2017 05:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A5BE26E40; Wed, 5 Jul 2017 05:01:28 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 29D9626E16 for ; Wed, 5 Jul 2017 05:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752125AbdGEFB1 (ORCPT ); Wed, 5 Jul 2017 01:01:27 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33133 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbdGEFB0 (ORCPT ); Wed, 5 Jul 2017 01:01:26 -0400 Received: by mail-pg0-f67.google.com with SMTP id u62so29830408pgb.0; Tue, 04 Jul 2017 22:01:26 -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; bh=HdrbZKr4taDvBps7r3vka5Fw90Sj1mwgCzLFi5QSROU=; b=RmpsTrvCmoG+jd1HS8ulaXQfbzre6FWCvBdrd19TdcyF/hijPeHPjEIW/TJCFWEvW7 CnZvqVo70MnsGbZhBrBYAuT/fwG/GYuajG7BZOIQ/Xfo/Q82AZMnTJmV/JFID+APk6TG xnkEIZE6J8h7uSb5YYm79gzjqFrVGBmYTzx2WIXzSZOCxtp3N3fVVhhQphsDsD7y/DQh tMWqMckQ+uDSnLw0LSIY3BqXASoM/O4bHgVU/r9/2ZFhS2o3m11fRwbLmuKEmev69B6L 4XC49W753V6nd8ie2jFSGy5Fo+mfll6xqdI3srD0HhDmuYxWtElsJRjSKhIZNZEX/Nbo EWuA== 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; bh=HdrbZKr4taDvBps7r3vka5Fw90Sj1mwgCzLFi5QSROU=; b=nctPOwJLlrM42MwsozO8FcKxtOyboDs9+E+zAHDBY+dde0hUfki7emCGYAuJbGc9aA fTZraBjSP+2Fdtft7ppLDIcK8L8hosX/vDwowGwuZc3ikGt3giesoozzQwuwzcRbUU5B mgYSdflZl+SnyrtoZaPe+0EhBQyouGPSAbrx5h0uqeg2VYdGjuZ10IpvsF2EczkXpT4D HhPFpXHbLxY2Ge5DGFFcVze5kcJGlRzt4hlX8QaffimMASdJAfgRBs6dDmWK7nYGVqMx u0Xy6Qa72mrjZZbxuDMkYtnDaVgwR4ktOGTcaDOb13rni1zn6Bw1FNi1QG7TFULDjhyu 4Egg== X-Gm-Message-State: AIVw113GoT0HVxq8uTlaEkPDeLYUFl/l6vn3PaN/NiowmQf61uzt5sYP geIaIwuKIP6io5zE X-Received: by 10.98.19.78 with SMTP id b75mr18377051pfj.212.1499230885702; Tue, 04 Jul 2017 22:01:25 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id u9sm48187082pfg.127.2017.07.04.22.01.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 22:01:24 -0700 (PDT) From: Arvind Yadav To: jdelvare@suse.com, linux@roeck-us.net Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: constify attribute_group structures. Date: Wed, 5 Jul 2017 10:31:05 +0530 Message-Id: <916222c47f3f47d11b6fca5b0ad2e8a7384ddcc2.1499230740.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@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 6655 304 0 6959 1b2f drivers/hwmon/hwmon.o File size After adding 'const': text data bss dec hex filename 6703 240 0 6943 1b1f drivers/hwmon/hwmon.o Signed-off-by: Arvind Yadav --- drivers/hwmon/hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index dd6e17c..2ac578a 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -85,7 +85,7 @@ static umode_t hwmon_dev_name_is_visible(struct kobject *kobj, return attr->mode; } -static struct attribute_group hwmon_dev_attr_group = { +static const struct attribute_group hwmon_dev_attr_group = { .attrs = hwmon_dev_attrs, .is_visible = hwmon_dev_name_is_visible, };