From: Stuart Swales <stuart.swales.croftnuisk@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Russell King <rmk+kernel@arm.linux.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] adfs: add hexadecimal filetype suffix option
Date: Wed, 23 Mar 2011 23:08:43 +0000 [thread overview]
Message-ID: <4D8A7D7B.1080001@gmail.com> (raw)
In-Reply-To: <20110323135835.0c2e296c.akpm@linux-foundation.org>
The file typing code is using -1 (truncated to __u16) to represent the
case when no explicit 12-bit file type was set on the file, such as is
the case where the file has explicit 32-bit load and execute addresses
(Acorn specific legacy stuff, started with the BBC Micro). It would
seem to be best if the -1 were replaced by 0xffffu.
Stuart
On 23/03/2011 20:58, Andrew Morton wrote:
> On Wed, 23 Mar 2011 21:36:48 +0100
> Geert Uytterhoeven<geert@linux-m68k.org> 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
>>
>
> hm, OK, I'll add a cast.
>
> The code seems a bit fishy - it wants 0xffff but the comment says it's
> handling a 12-bit quantity. Obviously the all-ones pattern has some
> magical out-of-band meaning here, but it is not explained what that
> meaning *is*. Perhaps that is described elsewhere.
>
--
Stuart Swales
prev parent reply other threads:[~2011-03-23 23:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4D2DEDDB.1070605@gmail.com>
2011-01-19 23:49 ` [PATCH] adfs: add hexadecimal filetype suffix option Andrew Morton
2011-01-21 14:34 ` Stuart Swales
2011-01-21 16:47 ` Arnd Bergmann
2011-01-21 17:26 ` Russell King
2011-01-21 22:02 ` Arnd Bergmann
2011-01-22 0:57 ` Stuart Swales
2011-01-21 14:43 ` Stuart Swales
2011-01-21 18:26 ` Andrew Morton
2011-03-23 20:36 ` Geert Uytterhoeven
2011-03-23 20:56 ` Al Viro
2011-03-23 20:58 ` Andrew Morton
2011-03-23 23:08 ` Stuart Swales [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D8A7D7B.1080001@gmail.com \
--to=stuart.swales.croftnuisk@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.