From: Dan Murphy <dmurphy@ti.com>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>, <pavel@ucw.cz>
Cc: <linux-leds@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] leds: ti-lmu-common: Fix coccinelle issue in TI LMU
Date: Mon, 26 Aug 2019 09:53:05 -0500 [thread overview]
Message-ID: <de1bb95d-d5ca-6f8f-e758-b03479091f99@ti.com> (raw)
In-Reply-To: <4a1872e8-89a5-4bc4-6aa4-bcadbc48697a@gmail.com>
Jacek
On 8/24/19 10:18 AM, Jacek Anaszewski wrote:
> Hi Dan,
>
> Thank you for the patch.
>
> On 8/23/19 9:55 PM, Dan Murphy wrote:
>> Fix the coccinelle issues found in the TI LMU common code
>>
>> drivers/leds/leds-ti-lmu-common.c:97:20-29: WARNING: Unsigned expression compared with zero: ramp_down < 0
>> drivers/leds/leds-ti-lmu-common.c:97:5-12: WARNING: Unsigned expression compared with zero: ramp_up < 0
> Wouldn't it make more sense to remove those pointless checks?
> Clearly a correct index of an array cannot be negative.
> Looking at the code I would make more int -> unsigned int conversions:
>
> - ramp_table should be unsigned int
> - ti_lmu_common_convert_ramp_to_index should return unsigned int
>
Yeah I was going to just remove the code but when I was writing the
original code my intent was
to extend the ramp call to allow other TI LMU driver to pass in the
device specific ramp table.
But since I don't currently have any devices on my plate that require
that I can just remove the code as well
Dan
[...]
next prev parent reply other threads:[~2019-08-26 14:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-23 19:55 [PATCH] leds: ti-lmu-common: Fix coccinelle issue in TI LMU Dan Murphy
2019-08-24 15:18 ` Jacek Anaszewski
2019-08-26 14:53 ` Dan Murphy [this message]
2019-08-26 19:34 ` Jacek Anaszewski
2019-08-27 13:37 ` Dan Murphy
2019-08-27 21:02 ` Jacek Anaszewski
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=de1bb95d-d5ca-6f8f-e758-b03479091f99@ti.com \
--to=dmurphy@ti.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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;
as well as URLs for NNTP newsgroup(s).