From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754064AbdLDJ3s (ORCPT ); Mon, 4 Dec 2017 04:29:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55890 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983AbdLDJ3e (ORCPT ); Mon, 4 Dec 2017 04:29:34 -0500 Date: Mon, 4 Dec 2017 17:29:28 +0800 From: Dave Young To: Greg Kroah-Hartman Cc: Matt Fleming , Ard Biesheuvel , Linus Torvalds , "Tobin C. Harding" , LKML , "linux-efi@vger.kernel.org" Subject: Re: [GIT PULL] hash addresses printed with %p Message-ID: <20171204092928.GA4421@dhcp-128-65.nay.redhat.com> References: <20171130163235.GA27849@kroah.com> <20171130171036.GB31817@kroah.com> <20171201094846.GE9353@kroah.com> <20171202222244.GA3799@codeblueprint.co.uk> <20171204020216.GA2436@dhcp-128-65.nay.redhat.com> <20171204073642.GC19596@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171204073642.GC19596@kroah.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 04 Dec 2017 09:29:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/04/17 at 08:36am, Greg Kroah-Hartman wrote: > On Mon, Dec 04, 2017 at 10:02:16AM +0800, Dave Young wrote: > > +#define __ATTR_IRUSR(_name) { \ > > + .attr = { .name = __stringify(_name), .mode = S_IRUSR }, \ > > + .show = _name##_show, \ > > +} > > Ick, no, as others, including Linus, have said, using IRUSER is a pain > in the ass to try to look up and remember what it is... > > Just use __ATTR() please, it should be fine for what you need to do, > which is special-case a sysfs attribute. Hmm, I was hesitating to do that because it needs either long code (over 80 chars) or some driver internal macros. There is already same issue in dmi-sysfs.c, it uses an internal macro DMI_SYSFS_ATTR for 0400 attr. I did not search all the kernel code, there might be more for such special cases. Maybe we can add some comment in sysfs.h to mention this is for some special case? I can do something similar as dmi sysfs code though. > > thanks, > > greg k-h Thanks Dave