From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Thompson Date: Mon, 09 Oct 2017 10:00:04 +0000 Subject: Re: [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check Message-Id: List-Id: References: <1507499808-12896-1-git-send-email-chris.gekas@gmail.com> In-Reply-To: <1507499808-12896-1-git-send-email-chris.gekas@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christos Gkekas , Lee Jones , Jingoo Han , Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org On 08/10/17 22:56, Christos Gkekas wrote: > Variable val holds the default brightness and is unsigned, therefore > checking whether it is less than zero is redundant. > > Signed-off-by: Christos Gkekas Acked-by: Daniel Thompson > --- > drivers/video/backlight/tps65217_bl.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c > index fd524ad..61ea82d 100644 > --- a/drivers/video/backlight/tps65217_bl.c > +++ b/drivers/video/backlight/tps65217_bl.c > @@ -239,8 +239,7 @@ tps65217_bl_parse_dt(struct platform_device *pdev) > } > > if (!of_property_read_u32(node, "default-brightness", &val)) { > - if (val < 0 || > - val > 100) { > + if (val > 100) { > dev_err(&pdev->dev, > "invalid 'default-brightness' value in the device tree\n"); > err = ERR_PTR(-EINVAL); >