From patchwork Mon Aug 7 09:36:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9884863 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 B853760364 for ; Mon, 7 Aug 2017 09:36:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACA692858F for ; Mon, 7 Aug 2017 09:36:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FE582860B; Mon, 7 Aug 2017 09:36:54 +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 3F4EF2858F for ; Mon, 7 Aug 2017 09:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752584AbdHGJgy (ORCPT ); Mon, 7 Aug 2017 05:36:54 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35273 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbdHGJgx (ORCPT ); Mon, 7 Aug 2017 05:36:53 -0400 Received: by mail-pg0-f65.google.com with SMTP id l64so8255417pge.2; Mon, 07 Aug 2017 02:36:52 -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=Yynh9OYe/GbjEFWsYlbr86bHtxfPshRxWB+2Owq8kT8=; b=SHJbksiiOIeyKlMx9EEDNJBtj55mh4l7c0DzoWBusbpPmB/5rjX7xUDAgRRYSk+p7s LRfDMj6x676xRU8DmwFUw79RHnJfdDvjpvC6DqbwmeiExi1vPqTjwgvWtNV+uptFWoR9 7UKqSAfQ8JUvBBE5uv4BH+dSRBgfV3YfWGG/3kft+PDQyvilPgyIe3r6gjR2gHFivqiT /3nLNKWEUzrc0KBbhcBPYk9qfwLEvaDmuPEssJr3iyvrNhRKxbFvFKKR4AjGrbvjggIH 3mYQb7t2GWARb314TIrzlz2aV+qkDeWaZdPlftQGtt8j/fJv6cR6LFF6Yq6tBjeZPAap Pn0Q== 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=Yynh9OYe/GbjEFWsYlbr86bHtxfPshRxWB+2Owq8kT8=; b=j4osaHmHWxvB39l2UgLsGZKuHSGZOy886/hu1X/9QPZ9iAM6AT9hFC2OTP/1joO/be H0YRzzP76iWh6N1cg98ctWJfmXzaQNA5aPCxdQPoWKX787Nq3OvVvkt3Irt9aHFNXDbw isxBtLd8a38Ufv3xTFfKxDbFqMQNYHwGNW+ysp0HHySNTucQ9TPXH+x3DAEROjmbrRbB soEnYU/FkPlm9Rcfexq9suuIa5drQwudvCcMVmtGw4YX/1145HFrf8V7rrISvxtZTixn v7M23pyBDWR7P+9CbJf+8zNPfO+cXAksTm+23BubR3v1ZL71sRGRvqV0gcQEfIycJQEg vXkQ== X-Gm-Message-State: AIVw111eD3fzfUUuR7qlfThNHMPu6QrXCdv7JcjJ18YKf1SDLGmIWpBJ +N6d8n0DBEHLzg== X-Received: by 10.99.117.90 with SMTP id f26mr10708327pgn.155.1502098612712; Mon, 07 Aug 2017 02:36:52 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id v134sm13866416pgb.58.2017.08.07.02.36.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 02:36:52 -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 v2] hwmon: adt7475: constify attribute_group structures Date: Mon, 7 Aug 2017 15:06:29 +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 --- change in v2: subject was not correct. Removed 'wusbhc' and '.'. 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)