public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Dan Murphy <dmurphy@ti.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 21:34:47 +0200	[thread overview]
Message-ID: <48fc16c5-9f43-e5c3-e756-514f9f3eb254@gmail.com> (raw)
In-Reply-To: <de1bb95d-d5ca-6f8f-e758-b03479091f99@ti.com>

Dan,

On 8/26/19 4:53 PM, Dan Murphy wrote:
> 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

You don't need to remove, just do the conversions I proposed.
Unless it introduces some other problems I am currently not aware of.

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2019-08-26 19:34 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
2019-08-26 19:34     ` Jacek Anaszewski [this message]
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=48fc16c5-9f43-e5c3-e756-514f9f3eb254@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=dmurphy@ti.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