lkml.org 
[lkml]   [2011]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] adfs: add hexadecimal filetype suffix option
On Wed, Mar 23, 2011 at 09:36:48PM +0100, Geert Uytterhoeven wrote:
> On Thu, Jan 20, 2011 at 00:49, Andrew Morton <akpm@linux-foundation.org> wrote:
> > On Wed, 12 Jan 2011 18:07:23 +0000
> > Stuart Swales <stuart.swales.croftnuisk@gmail.com> wrote:
> >> From: Stuart Swales<stuart.swales.croftnuisk@gmail.com>
>
> >> +static inline int append_filetype_suffix(char *buf, __u16 filetype)
> >> +{
> >> + ?? ?? if ((__u16) -1 == filetype)
> >
> > unneeded cast.
>
> My compiler tends to disagree. On current mainline, it says:
>
> fs/adfs/adfs.h: In function ???append_filetype_suffix???:
> fs/adfs/adfs.h:115: warning: comparison is always false due to limited
> range of data type

And it's absolutely right - unsigned short it promoted to int as part of
usual arithmetic conversions and the value is not changed. And it's *not*
going to be equal to -1.


\
 
 \ /
  Last update: 2011-03-23 21:59    [W:0.060 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site