Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420AbdGQVhD (ORCPT ); Mon, 17 Jul 2017 17:37:03 -0400 Received: from mail-dm3nam03on0087.outbound.protection.outlook.com ([104.47.41.87]:47008 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751318AbdGQVhB (ORCPT ); Mon, 17 Jul 2017 17:37:01 -0400 From: "Kershner, David A" To: Greg KH , Arvind Yadav CC: "Sell, Timothy C" , "Thompson, Bryan E." , "jon.frisch@unisys.com" , "Binder, David Anthony" , *S-Par-Maintainer , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] staging: unisys: visorbus: constify attribute_group structures. Thread-Topic: [PATCH] staging: unisys: visorbus: constify attribute_group structures. Thread-Index: AQHS/unPEuRNZ97hvEeaFYEQ7kKSjaJX9Sd7gACWaHA= Date: Mon, 17 Jul 2017 21:36:58 +0000 Message-ID: References: <20170717104522.GA32372@kroah.com> <20170717123734.GA30411@kroah.com> In-Reply-To: <20170717123734.GA30411@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kroah.com; dkim=none (message not signed) header.d=none;kroah.com; dmarc=none action=none header.from=unisys.com; x-originating-ip: [192.63.205.31] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR07MB3126;7:g3CYSDC18V86vsXcF6QsGnqNnLTzVbBCDnVqSN5uVYL0g0VupNsYuFHT4eLx2Dhg48AlC8ZZBp9nopHOri4k23qnLJJTzFQouPyS76tp1Irm0BFtnjinysgSuLyZg8P7PxPS1R2rFD4T5Z6AgWslEtune1OZ6MThhPb8+3UknLnDYIlf68zip+Skn0t+HuEH89JX8+iCLpEbxr8pVSQb4hoEmZlPeb5o/N13iXglxUWhvXAJKyuaQ+pDdzpSh65yiscL5CSDAM2Yx83IGS/hbSe8NaQFPSu9zrk6LKe9cWFR+YkMEjCpaEXNBy4aiT8OUAr6y7OGaaQ0aPLpE7sl5QerB5mKj9Ns9fsZRJRE8hdU0+DORg+sscGKxx5LcvuuiUjKXBXfqCnhfORb/2x8D/LNs09aOund0L2yNPfw9pEhAjTRyuK/YoVcO9oc+SyINtWkGe+LVk3xkoCV8Cuh64xHtPIaFtYMyT4R1G2WN9V4G66VQBEZoL5Oq3Rz8kGHYbdn2Hp/yL02f8fYi6DAROKe4wWzA9g62d6Ff6xtH2hJ380bg9g24uVAH02qawI98m1JRcola9MynrnRqBJlKBOJCOkvC4b+86GoI+zV3N3eA0T+Hy1O+5PWrdFWOrvuznwPrh07sxpOy8YPMzIgylp/WcrRKzlo56Uc2KeFeViqaNZU4aFwGsMLE28YShQ/M72Gyo6hOIrftWK+oLN6pR8AgJeRUnE5Ds/vrOzeQ/wn9gNSJhGEnREL09dWP27l/HAVfIc3A7yy7Awavlrq/OH14j+2gKSZa+aSFmPwdaE= x-ms-office365-filtering-correlation-id: bdfc5ef4-9a67-4ea7-32f7-08d4cd5bf46b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR07MB3126; x-ms-traffictypediagnostic: CY4PR07MB3126: x-exchange-antispam-report-test: UriScan:(236129657087228)(9452136761055)(174360191007938)(48057245064654)(247924648384137); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(8121501046)(5005006)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR07MB3126;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR07MB3126; x-forefront-prvs: 0371762FE7 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39410400002)(39400400002)(39840400002)(39860400002)(39850400002)(39450400003)(377454003)(54534003)(13464003)(24454002)(9686003)(54906002)(6506006)(3280700002)(99286003)(33656002)(2906002)(6436002)(6246003)(53936002)(38730400002)(77096006)(2900100001)(229853002)(55016002)(39060400002)(305945005)(8676002)(81166006)(3660700001)(189998001)(8936002)(7736002)(86362001)(2950100002)(53546010)(66066001)(54356999)(478600001)(25786009)(76176999)(4326008)(50986999)(14454004)(5660300001)(7696004)(93886004)(72206003)(6116002)(74316002)(3846002)(102836003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB3126;H:CY4PR07MB3176.namprd07.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: unisys.com X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2017 21:36:59.0435 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8d894c2b-238f-490b-8dd1-d93898c5bf83 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3126 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6HLb8Xw008255 Content-Length: 2376 Lines: 60 > -----Original Message----- > From: Greg KH [mailto:greg@kroah.com] > Sent: Monday, July 17, 2017 8:38 AM > To: Arvind Yadav > Cc: Kershner, David A ; Sell, Timothy C > ; Thompson, Bryan E. > ; jon.frisch@unisys.com; Binder, David > Anthony ; *S-Par-Maintainer > ; devel@driverdev.osuosl.org; linux- > kernel@vger.kernel.org > Subject: Re: [PATCH] staging: unisys: visorbus: constify attribute_group > structures. > > On Mon, Jul 17, 2017 at 05:43:14PM +0530, Arvind Yadav wrote: > > Hi Greg, > > > > > > On Monday 17 July 2017 04:15 PM, Greg KH wrote: > > > On Mon, Jul 17, 2017 at 02:55:37PM +0530, Arvind Yadav wrote: > > > > 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. > > > > > > > > Signed-off-by: Arvind Yadav > > > > --- > > > > drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++-- > > > > drivers/staging/unisys/visorbus/visorchipset.c | 2 +- > > > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > Why not just use the ATTRIBUTE_GROUPS() macro for these? Or is there > > > something that is preventing that? > > Yes, we can use. if we are only initializing '.attrs'. > > ATTRIBUTE_GROUPS() will not work if we will initialize other member of > > attribute_group like 'bin_attrs', 'is_visible', and 'name'. > > That means you should redo this patch :) > > Also, your changelog text had a typo, it is "attribute_group", not > "attribute_groups". > Greg, are you recommending that we shouldn't be setting the attribute_group .name field? What does it pick up if we don't specify it? Also, for our attribute_groups in visorchipset, we are defining it with two different attribute_group variables. Are you allowed to use two different attribute_group variables in an attribute_groups, or is this frowned upon and we should flatten it out to just one? An example that we used in the kernel was: static const struct attribute_group *l2_cache_pmu_attr_grps[] = { &l2_cache_pmu_format_group, &l2_cache_pmu_cpumask_group, NULL, }; Thanks, David Kershner > thanks, > > greg k-h