Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751620AbdG1Ef1 (ORCPT ); Fri, 28 Jul 2017 00:35:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34932 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbdG1Ef0 (ORCPT ); Fri, 28 Jul 2017 00:35:26 -0400 Date: Thu, 27 Jul 2017 21:35:20 -0700 From: Greg KH To: Amitoj Kaur Chawla Cc: david.kershner@unisys.com, sparmaintainer@unisys.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: unisys: visorbus_main: constify attribute_group structures Message-ID: <20170728043520.GA27597@kroah.com> References: <20170725224552.GA3501@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170725224552.GA3501@amitoj-Inspiron-3542> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1610 Lines: 50 On Tue, Jul 25, 2017 at 06:45:52PM -0400, Amitoj Kaur Chawla wrote: > Functions working with attribute_groups provided by > work with const attribute_group. These attribute_group structures do not > change at runtime so mark them as const. > > File size before: > text data bss dec hex filename > 14216 7304 832 22352 5750 > drivers/staging/unisys/visorbus/visorbus_main.o > > File size after: > text data bss dec hex filename > 14408 7112 832 22352 5750 > drivers/staging/unisys/visorbus/visorbus_main.o > > This change was made with the help of Coccinelle. > > Signed-off-by: Amitoj Kaur Chawla > --- > drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c > index 1c785dd..bba10dc 100644 > --- a/drivers/staging/unisys/visorbus/visorbus_main.c > +++ b/drivers/staging/unisys/visorbus/visorbus_main.c > @@ -249,7 +249,7 @@ static struct attribute *channel_attrs[] = { > NULL > }; > > -static struct attribute_group channel_attr_grp = { > +static const struct attribute_group channel_attr_grp = { > .name = "channel", > .attrs = channel_attrs, > }; > @@ -340,7 +340,7 @@ static struct attribute *dev_attrs[] = { > NULL > }; > > -static struct attribute_group dev_attr_grp = { > +static const struct attribute_group dev_attr_grp = { > .attrs = dev_attrs, > }; > Does not apply to my tree :( sorry, greg k-h