From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2.linux-foundation.org (smtp2.linux-foundation.org [207.189.120.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.linux-foundation.org", Issuer "CA Cert Signing Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTP id 02E1DDDE2F for ; Thu, 19 Jul 2007 19:47:45 +1000 (EST) Date: Thu, 19 Jul 2007 02:47:30 -0700 From: Andrew Morton To: Geert Uytterhoeven Subject: Re: [patch 2/3] ps3: BD/DVD/CD-ROM Storage Driver Message-Id: <20070719024730.03609f1f.akpm@linux-foundation.org> In-Reply-To: References: <20070716161539.075822000@pademelon.sonytel.be> <20070716162206.529280000@pademelon.sonytel.be> <20070718164351.a92ec032.akpm@linux-foundation.org> <20070719021752.35cb7daa.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: Jens Axboe , "James E.J. Bottomley" , linux-scsi@vger.kernel.org, Linux/PPC, Linux Kernel Development , Development , Paul Mackerras List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 19 Jul 2007 11:39:32 +0200 (CEST) Geert Uytterhoeven wrote: > > Oh dear. > > > > ps3rom_priv(dev) = host; > > > > that's 'orrid. We have an identifier pretending to be a function, only we > > go and treat it as an lvalue. > > > > I mean, C code should look like C code, and the above just doesn't. > > > > Sigh. > > Do you prefer > > static inline struct ps3rom_private *ps3rom_priv_get(struct ps3_storage_device > *dev) > { > return dev->sbd.core.driver_data; > } > > static inline void ps3rom_priv_set(struct ps3_storage_device *dev, > struct ps3rom_private *priv) > { > dev->sbd.core.driver_data = priv; > } > > instead? Yes. Not that it's a terribly important issue, particularly down in the dark and dusty corners where this code lurks. The "function" as an lvalue thing would be more obnoxious in some top-level interface. We probably already have some :( If it were mine I'd open-code the "set" and do the "get" as a static inline. Or you could leave it as-is and go off and do something more important ;)