Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752877AbcLHOce (ORCPT ); Thu, 8 Dec 2016 09:32:34 -0500 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:34840 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752511AbcLHOcc (ORCPT ); Thu, 8 Dec 2016 09:32:32 -0500 Subject: Re: [PATCH] usbip: fix warning in vhci_hcd_probe/lockdep_init_map To: fx IWATA NOBUO , Andrey Konovalov References: <20161205195638.7005-1-shuahkh@osg.samsung.com> <4a3b7e4f-6b5c-d9e8-f26c-1286d4e1f630@osg.samsung.com> <8167945c-36b5-1797-b220-54428d4c7869@osg.samsung.com> Cc: Greg Kroah-Hartman , Valentina Manea , Shuah Khan , "linux-usb@vger.kernel.org" , LKML , Shuah Khan From: Shuah Khan Message-ID: <612ee091-376e-626f-423e-26fc002f878f@osg.samsung.com> Date: Thu, 8 Dec 2016 07:32:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1186 Lines: 35 On 12/07/2016 09:12 PM, fx IWATA NOBUO wrote: > Dear Shuah, > >> I noticed that in many places sysfs_attr_init() is called before populating >> the fields such as name etc. However, I don't think the order matters. >> >> sysfs_attr_init() doesn't depend on name or any other fields being set: >> >> #define sysfs_attr_init(attr) \ >> do { \ >> static struct lock_class_key __key; \ >> \ >> (attr)->key = &__key; \ >> } while (0) >> >> Are you concerned about something else? > > Yes. > > If the macro name is 'attr_set_key', I don't have any concern. > > The name is 'attr_init' so I think there's possibility that some other > items in attr may initialized in future. > > Also I think 'initialize struct first, then set items' is idiomatic order. > > Best Regards, > I am seeing places where sysfs_attr_init() after setting the name as well. As this is more of a better done this way - I will fix this in the next release. It is more important to fix the lockdep warning. thanks, -- Shuah