Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751324AbdGQMNr (ORCPT ); Mon, 17 Jul 2017 08:13:47 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:32993 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbdGQMNq (ORCPT ); Mon, 17 Jul 2017 08:13:46 -0400 Subject: Re: [PATCH] staging: unisys: visorbus: constify attribute_group structures. To: Greg KH References: <20170717104522.GA32372@kroah.com> 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 From: Arvind Yadav Message-ID: Date: Mon, 17 Jul 2017 17:43:14 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170717104522.GA32372@kroah.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 915 Lines: 25 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'. > > thanks, > > greg k-h Thanks, ~arvind