Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbdHEIfa (ORCPT ); Sat, 5 Aug 2017 04:35:30 -0400 Received: from mga01.intel.com ([192.55.52.88]:60919 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144AbdHEIf1 (ORCPT ); Sat, 5 Aug 2017 04:35:27 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,325,1498546800"; d="scan'208";a="1159483010" Date: Sat, 5 Aug 2017 11:35:20 +0300 From: Mika Westerberg To: Amitoj Kaur Chawla Cc: andreas.noever@gmail.com, michael.jamet@intel.com, yehezkel.bernat@intel.com, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] thunderbolt: constify attribute_group structure Message-ID: <20170805083520.GF2369@lahna.fi.intel.com> References: <20170805014209.GA5095@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170805014209.GA5095@amitoj-Inspiron-3542> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1521 Lines: 42 On Fri, Aug 04, 2017 at 09:42:09PM -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 > 28565 7300 0 35865 8c19 drivers/thunderbolt/switch.o > > File size after: > text data bss dec hex filename > 28661 7204 0 35865 8c19 drivers/thunderbolt/switch.o > > This change was made with the help of Coccinelle. > > Signed-off-by: Amitoj Kaur Chawla Acked-by: Mika Westerberg Unfortunately you forgot to Cc Greg. He has been gathering Thunderbolt related patches. I added him now but it may be that you need to resend the patch to make it easier for him to apply. > --- > drivers/thunderbolt/switch.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c > index e9391bb..6cd4f14 100644 > --- a/drivers/thunderbolt/switch.c > +++ b/drivers/thunderbolt/switch.c > @@ -970,7 +970,7 @@ static umode_t switch_attr_is_visible(struct kobject *kobj, > return sw->safe_mode ? 0 : attr->mode; > } > > -static struct attribute_group switch_group = { > +static const struct attribute_group switch_group = { > .is_visible = switch_attr_is_visible, > .attrs = switch_attrs, > }; > -- > 2.7.4