Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752539AbdGJGgl (ORCPT ); Mon, 10 Jul 2017 02:36:41 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36233 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752333AbdGJGgk (ORCPT ); Mon, 10 Jul 2017 02:36:40 -0400 From: Arvind Yadav To: eric.piel@tremplin-utc.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH] misc: lis3lv02d: constify attribute_group structures. Date: Mon, 10 Jul 2017 12:06:13 +0530 Message-Id: X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1124 Lines: 32 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 7509 753 0 8262 2046 drivers/misc/lis3lv02d/lis3lv02d.o File size After adding 'const': text data bss dec hex filename 7573 689 0 8262 2046 drivers/misc/lis3lv02d/lis3lv02d.o Signed-off-by: Arvind Yadav --- drivers/misc/lis3lv02d/lis3lv02d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index e389b0b..8d53609 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c @@ -856,7 +856,7 @@ static DEVICE_ATTR(rate, S_IRUGO | S_IWUSR, lis3lv02d_rate_show, NULL }; -static struct attribute_group lis3lv02d_attribute_group = { +static const struct attribute_group lis3lv02d_attribute_group = { .attrs = lis3lv02d_attributes }; -- 1.9.1