From patchwork Mon Aug 7 06:19:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9884429 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 895B560364 for ; Mon, 7 Aug 2017 06:20:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75D812844B for ; Mon, 7 Aug 2017 06:20:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6610D2856B; Mon, 7 Aug 2017 06:20: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.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 07D792844B for ; Mon, 7 Aug 2017 06:20:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbdHGGUR (ORCPT ); Mon, 7 Aug 2017 02:20:17 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36169 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdHGGUR (ORCPT ); Mon, 7 Aug 2017 02:20:17 -0400 Received: by mail-pf0-f194.google.com with SMTP id t83so8116991pfj.3; Sun, 06 Aug 2017 23:20:16 -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=asb5zzUafuYPSF/vsuTPUNHacvqzebVX1XwiEuEmvww=; b=OF+DiLU6pxUrD/KYcbb+X20SFYNkK773D7+CAs65D137RsKSTKMR1oIAX9z+ugY141 KjjF0h/gpB+Pl0/oPOI+VaC8T/5i1XvORkKtv1uW/GC+xkCvz0wR2X4bdNiAegN5eXp1 +R2qFB3GldS0aaPKfqOEQaluL/Ga4cpfbenZDJ5brVYFAeZ3pCD6iK50OB8Lqykf7Gj5 GTd4yhLUs+0WelHfM6Q1HqggYY+hnz161v0jP9j+8s0rko2gsm1jzDnU6bwdwUF7cUAm 4rLTDI5miWeKuREIXqe9xTRs9+6Jhlgh7BqtEMqq3J56mMj23AwEojEtJmqIxHcwbOca NWSA== 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=asb5zzUafuYPSF/vsuTPUNHacvqzebVX1XwiEuEmvww=; b=Pei74z42Tw/Xd8AAo4F0g3gURe0uw1BNR1x06GhyPPSlgA6VQnfZ8kobSBRgaWKi1j L/pcYdkFzQVQ5OrVr+dWZqlkqggAQaKb332IEmMZE5PIPqpfjeeqO02NcuEFUPmGKWYX 4/5FfUeNi3Y+Vnlp9lfIDA+333r89mtNbxvWnxl94iE7CiwwoDtWu8RbuG7vRs+VMoEu yYcS0gik0HP2PVa/fhLxsSO7a4cnJqh3WBjt5/e9UYQtAc59bWNnqlbhyddy1mg2kdpZ WLEr1tuF1vyBwXHJknw2a07a+fitzwKF8CdKluAPqQcVXWah/dzaOwNb6l7EQwtgbAid LTRw== X-Gm-Message-State: AIVw113QTdVEZs+jOV1OczutRIVx9MuJw8JPVmC844s3yMG8J21rHpMq acmvnFUYbnKjdw== X-Received: by 10.99.0.151 with SMTP id 145mr10925589pga.115.1502086816531; Sun, 06 Aug 2017 23:20:16 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id n184sm11501401pga.89.2017.08.06.23.20.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 Aug 2017 23:20:15 -0700 (PDT) From: Arvind Yadav To: jdelvare@suse.com, linux@roeck-us.net Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Subject: [PATCH] hwmon: adt7475: wusbhc: constify attribute_group structures. Date: Mon, 7 Aug 2017 11:49:53 +0530 Message-Id: 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_group are not supposed to change at runtime. All functions working with attribute_group provided by work with const attribute_group. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Reviewed-by: Jean Delvare --- 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 1baa213..9ef8499 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c @@ -1319,14 +1319,14 @@ static SENSOR_DEVICE_ATTR_2(pwm3_stall_disable, S_IRUGO | S_IWUSR, 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)