[PATCH 5/11v2] ata: replace macro with static inline in libata.h

2008-02-15 Thread Harvey Harrison
Move to using a static inline which will force the same typechecking that min_t/max_t do (in this case, short). As a bonus, avoid a ton of sparse warnings like: drivers/ata/pata_ali.c:176:14: warning: symbol '__x' shadows an earlier one drivers/ata/pata_ali.c:176:14: originally declared here

Re: [PATCH 5/11v2] ata: replace macro with static inline in libata.h

2008-02-15 Thread Alan Cox
NAK. This is a sparse bug, fix sparse. Yes, fair enough, but that's not all the patch is about. 1) it's using a max_t and min_t to force the comparisons as shorts, why not just make it a static inline? Because max_t and min_t also force the comparsion types 2) the static inline is a

Re: [PATCH 5/11v2] ata: replace macro with static inline in libata.h

2008-02-15 Thread Harvey Harrison
On Fri, 2008-02-15 at 22:53 +, Alan Cox wrote: NAK. This is a sparse bug, fix sparse. Yes, fair enough, but that's not all the patch is about. 1) it's using a max_t and min_t to force the comparisons as shorts, why not just make it a static inline? Because max_t and min_t

Re: [PATCH 5/11v2] ata: replace macro with static inline in libata.h

2008-02-15 Thread Harvey Harrison
On Fri, 2008-02-15 at 22:30 +, Alan Cox wrote: On Fri, 15 Feb 2008 14:06:55 -0800 Harvey Harrison [EMAIL PROTECTED] wrote: Move to using a static inline which will force the same typechecking that min_t/max_t do (in this case, short). As a bonus, avoid a ton of sparse warnings like:

Re: [PATCH 5/11v2] ata: replace macro with static inline in libata.h

2008-02-15 Thread Harvey Harrison
On Sat, 2008-02-16 at 00:05 +, Alan Cox wrote: On Fri, 15 Feb 2008 15:08:50 -0800 Harvey Harrison [EMAIL PROTECTED] wrote: On Fri, 2008-02-15 at 22:53 +, Alan Cox wrote: NAK. This is a sparse bug, fix sparse. Yes, fair enough, but that's not all the patch is about.

Re: [PATCH 5/11v2] ata: replace macro with static inline in libata.h

2008-02-15 Thread Harvey Harrison
From: Harvey Harrison [EMAIL PROTECTED] Subject: [PATCH 3/3] ata: simplify clock divisor logic in pata_amd.c Current code is essentially choosing between dividing by 1 or dividing by two, make the conditions a little more obvious. As a bonus, removes a sparse error: drivers/ata/pata_amd.c:59:11:

Re: [PATCH 5/11v2] ata: replace macro with static inline in libata.h

2008-02-15 Thread Alan Cox
On Fri, 15 Feb 2008 15:08:50 -0800 Harvey Harrison [EMAIL PROTECTED] wrote: On Fri, 2008-02-15 at 22:53 +, Alan Cox wrote: NAK. This is a sparse bug, fix sparse. Yes, fair enough, but that's not all the patch is about. 1) it's using a max_t and min_t to force the