From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] leds: renesas-tpu: cleanup a small type issue
Date: Wed, 29 May 2013 17:34:39 +0000 [thread overview]
Message-ID: <51A63C2F.30203@bfs.de> (raw)
In-Reply-To: <20130529070150.GC25133@debian>
Am 29.05.2013 18:59, schrieb Bryan Wu:
> On Wed, May 29, 2013 at 12:45 AM, Dan Carpenter
> <dan.carpenter@oracle.com> wrote:
>> On Wed, May 29, 2013 at 09:21:00AM +0200, walter harms wrote:
>>>
>>>
>>> Am 29.05.2013 09:02, schrieb Dan Carpenter:
>>>> Static checkers complain that this is declared as an unsigned long
>>>> but we only ever use the low 32 bits (ignoring sign expansion).
>>>> But from the context, it should just be an unsigned short.
>>>>
>>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>>>
>>>> diff --git a/drivers/leds/leds-renesas-tpu.c b/drivers/leds/leds-renesas-tpu.c
>>>> index 9483f1c..fe1fbd0 100644
>>>> --- a/drivers/leds/leds-renesas-tpu.c
>>>> +++ b/drivers/leds/leds-renesas-tpu.c
>>>> @@ -93,7 +93,8 @@ static inline void r_tpu_write(struct r_tpu_priv *p, int reg_nr,
>>>> static void r_tpu_start_stop_ch(struct r_tpu_priv *p, int start)
>>>> {
>>>> struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
>>>> - unsigned long flags, value;
>>>> + unsigned long flags;
>>>> + unsigned short value;
>>>>
>>>
>>>
>>> When it is using the lower 32bit may "int" is better ?
>>
>> The static checkers think it's using the lower 32 bits, but it's
>> actually using the lower 16 bits.
>>
>
> Is "u16" better? I think we can replace all the unsigned short value
> to u16 value.
>
int would be a more "natural" choice.
re,
wh
next prev parent reply other threads:[~2013-05-29 17:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 7:02 [patch] leds: renesas-tpu: cleanup a small type issue Dan Carpenter
2013-05-29 7:21 ` walter harms
2013-05-29 7:45 ` Dan Carpenter
2013-05-29 16:59 ` Bryan Wu
2013-05-29 21:09 ` [patch v2] " Dan Carpenter
2013-05-29 17:34 ` walter harms [this message]
2013-05-29 21:15 ` [patch] " Dan Carpenter
2013-05-30 8:59 ` walter harms
2013-05-30 12:02 ` Dan Carpenter
2013-05-30 17:59 ` Bryan Wu
2013-05-30 18:01 ` Bryan Wu
2013-05-31 5:44 ` Dan Carpenter
2013-05-31 5:45 ` Dan Carpenter
2013-05-31 6:38 ` Bryan Wu
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=51A63C2F.30203@bfs.de \
--to=wharms@bfs.de \
--cc=kernel-janitors@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox