From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751366AbdGQMhk (ORCPT ); Mon, 17 Jul 2017 08:37:40 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35819 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbdGQMhj (ORCPT ); Mon, 17 Jul 2017 08:37:39 -0400 X-ME-Sender: X-Sasl-enc: oM3iI8cblITyxBLyhmULDLqyFlfupXk9OvYjb4rxunHz 1500295058 Date: Mon, 17 Jul 2017 14:37:34 +0200 From: Greg KH To: Arvind Yadav Cc: david.kershner@unisys.com, Timothy.Sell@unisys.com, bryan.thompson@unisys.com, jon.frisch@unisys.com, david.binder@unisys.com, sparmaintainer@unisys.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: unisys: visorbus: constify attribute_group structures. Message-ID: <20170717123734.GA30411@kroah.com> References: <20170717104522.GA32372@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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". thanks, greg k-h