From patchwork Wed Jul 5 05:34:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9825859 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 8D2E460237 for ; Wed, 5 Jul 2017 05:34:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F0F822B1F for ; Wed, 5 Jul 2017 05:34:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7362026CFF; Wed, 5 Jul 2017 05:34:34 +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=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 2F27A22B1F for ; Wed, 5 Jul 2017 05:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752246AbdGEFeX (ORCPT ); Wed, 5 Jul 2017 01:34:23 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33541 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752063AbdGEFeW (ORCPT ); Wed, 5 Jul 2017 01:34:22 -0400 Received: by mail-pg0-f68.google.com with SMTP id u62so29959459pgb.0; Tue, 04 Jul 2017 22:34:22 -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=YWBQvqB5Y/zLFlTAFHEYme2sNSB8jA3tdZb7+pV+A08=; b=G9HoRKA3f2CCWWes28FHKiYgh2oDsqtTgcpfqt5CwL9vigvogpxkqnFxFZJ97jr50o rD1Gde4e3Occ1oRYwp/T7aS3KzHdQGQywRaVK8t65JSNbUXpRZ+fp+GQS6/mUO7kLGoE drLNoiqKyuSIz6UgrP7+8ESTgwFEsbbBbJBJNm/tBDTX7kur4dit4gQ1oYqXylnI3sAX vyRyT4mqf3bCBdZ8snzd79G+YZjRzFmHyYRH4waWML0F+kKzVogcvQDGb7G/hvz3gLNF PCTdJoCPJVdi4tu3nH9sgBZlPr0MoKOZ8k3HpVHMrAxSHGTLMwAUzJaRa2gEP9WyktQX mppg== 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=YWBQvqB5Y/zLFlTAFHEYme2sNSB8jA3tdZb7+pV+A08=; b=RHPJfdUdN4l3tLsn5Wbai0D+U2zSrgmNBORwdwN4BxMQoVo4AQLp8Kq4RUw59fPfk5 w7KUOa9ixIDGZUQGpdwjVMY4P5FEcGmbiKwKITlf8vk5gm479DX6u/B5exqzpa2bePNt wTlrqD4Q9ZWsEeGwtCI4g9DcXv8uJ/6w1irB8EeCFFuu+Y6XCTskrfBbuB3GO5MikeSF Xr0YPY8e6buHpGm5EpIuon/DEe1yAEgg3OACuZAzm3qP3VC9hy9teHtn4P/x0We8ZPMH 0P6uxj+KR56JmO+6p7awc9mu7+ZClswj9xrKLdidg6HTvt6Bc17aCe4xiTmGs/73gCnv vfBg== X-Gm-Message-State: AIVw1124fpPc5neIlN7WdMss2UUOwpESPUT6+XFjHmAoYeYSH5nzkodV VnQQ3o0Y6xr01w== X-Received: by 10.99.16.65 with SMTP id 1mr18921451pgq.208.1499232861579; Tue, 04 Jul 2017 22:34:21 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id g79sm43495048pfg.121.2017.07.04.22.34.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 22:34:21 -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: adt7475: constify attribute_group structures. Date: Wed, 5 Jul 2017 11:04:04 +0530 Message-Id: <6f75a80453097e5f05f26782b42ab48f0da8e502.1499232764.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 10055 7032 0 17087 42bf drivers/hwmon/adt7475.o File size After adding 'const': text data bss dec hex filename 10567 6520 0 17087 42bf drivers/hwmon/adt7475.o Signed-off-by: Arvind Yadav --- drivers/hwmon/adt7475.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index c803e3c..973f17a 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c @@ -1205,14 +1205,14 @@ static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_pwm, S_IRUGO | S_IWUSR, show_pwm, NULL }; -static struct attribute_group adt7475_attr_group = { .attrs = adt7475_attrs }; -static struct attribute_group fan4_attr_group = { .attrs = fan4_attrs }; -static struct attribute_group pwm2_attr_group = { .attrs = pwm2_attrs }; -static struct attribute_group in0_attr_group = { .attrs = in0_attrs }; -static struct attribute_group in3_attr_group = { .attrs = in3_attrs }; -static struct attribute_group in4_attr_group = { .attrs = in4_attrs }; -static struct attribute_group in5_attr_group = { .attrs = in5_attrs }; -static struct attribute_group vid_attr_group = { .attrs = vid_attrs }; +static const struct attribute_group adt7475_attr_group = { .attrs = adt7475_attrs }; +static const struct attribute_group fan4_attr_group = { .attrs = fan4_attrs }; +static const struct attribute_group pwm2_attr_group = { .attrs = pwm2_attrs }; +static const struct attribute_group in0_attr_group = { .attrs = in0_attrs }; +static const struct attribute_group in3_attr_group = { .attrs = in3_attrs }; +static const struct attribute_group in4_attr_group = { .attrs = in4_attrs }; +static const struct attribute_group in5_attr_group = { .attrs = in5_attrs }; +static const struct attribute_group vid_attr_group = { .attrs = vid_attrs }; static int adt7475_detect(struct i2c_client *client, struct i2c_board_info *info)