Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp258047ybl; Wed, 22 Jan 2020 20:57:05 -0800 (PST) X-Google-Smtp-Source: APXvYqykHCcRLnPSafPU9YM74Ds8UaN0x0ADP88e3XPlNmC65Y/e8MARLwqaKT/ZK07ThbaVbY7k X-Received: by 2002:a9d:7519:: with SMTP id r25mr9960668otk.284.1579755425870; Wed, 22 Jan 2020 20:57:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579755425; cv=none; d=google.com; s=arc-20160816; b=NtSftEUbR3aEJrFjMFbGEOqyRuKAbD8M7ZshMPg3LN/jgMeJb9t95sUCzWKyKNsvyW XZ0duyehJCpvsNY+UKc40Z4pQdPv2DSfm+SdvHLcoBlW4A7qY5WpA9gcE1tZzhdem5hp jjaAumy20nrAUAasG7tD0ZBUM7FmuyUeABWqtlPDbEm4yPk081HaJtF+8SHgdDwv7bvv ViyUKJHvdbo4+8rtb0GPaX0RqcxFaU4SscS4YdMUcQxAsWSW2JuYYsJ82H3Dz3SjB3Pu a/NlhlPap4MrGo7cSKPVtJdd9D5i98J6FVjTvNxGm62VgYxa7y3pdwHjSpLOt6Kae+h9 /Sbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=99PdJyM1Ez87NeZe2HjnZWq1VMrDCTFIbcSGdc8l8U4=; b=oWm5eAN+NDcvMB7OmavNdy6+minoPRebpTZ+F1grW8E0CRlxoC9pSf0PwRBPd785iD 98W26fDJQ8xTi19zLGvemn2bnn2mhzg2nSJrJidG904EO3B8YLjqeTT9edwlZl4lawL4 pwB7Dxc7XG90eAJcOooEWz4/XZt6qS7bMzS+CXMykz5a885KRMZa1QrxsT5dJCtmTQsM yx0k7UrypLF+OYvAGjjNHSpupvgW1kj3pn0Q5dwIqMjL34jJoxhPEZt1+QIAuO/3UEQh I5PG73M9ujfhprv9wUuzL2z8Zya2pactP+vUBOWYdwf0427Jcs8eK9n03ZK4HZvitiCM On4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=M+sOXDa4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si619453otn.123.2020.01.22.20.56.53; Wed, 22 Jan 2020 20:57:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=M+sOXDa4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726204AbgAWEza (ORCPT + 99 others); Wed, 22 Jan 2020 23:55:30 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:63889 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbgAWEz3 (ORCPT ); Wed, 22 Jan 2020 23:55:29 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1579755329; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=99PdJyM1Ez87NeZe2HjnZWq1VMrDCTFIbcSGdc8l8U4=; b=M+sOXDa4QLTMhDi0V/ee1rWESsruOmqLurQgo2Kdr+MnL7Q4TPk7zclR/hQ7Ie07zmreU0tL /wqrS8Hx0x7gLAW4HGyaAG+mnE1dSn/sCOOeuVEiWnOpxhk4Hwo5Oj7QH+QiofA5bQZ3o8zQ jUx21kGOfcIbgAj/QhQw+kOCAQk= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e29273d.7fc7ea9d0d88-smtp-out-n01; Thu, 23 Jan 2020 04:55:25 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 824BDC433CB; Thu, 23 Jan 2020 04:55:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: kgunda) by smtp.codeaurora.org (Postfix) with ESMTPSA id 99255C43383; Thu, 23 Jan 2020 04:55:24 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 23 Jan 2020 10:25:24 +0530 From: kgunda@codeaurora.org To: Daniel Thompson Cc: Chen Zhou , agross@kernel.org, bjorn.andersson@linaro.org, lee.jones@linaro.org, jingoohan1@gmail.com, b.zolnierkie@samsung.com, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm-owner@vger.kernel.org Subject: Re: [PATCH -next v2] backlight: qcom-wled: fix unsigned comparison to zero In-Reply-To: <20200122105540.w5vrvs34zxmhkjae@holly.lan> References: <20200122013240.132861-1-chenzhou10@huawei.com> <20200122105540.w5vrvs34zxmhkjae@holly.lan> Message-ID: X-Sender: kgunda@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-22 16:25, Daniel Thompson wrote: > On Wed, Jan 22, 2020 at 09:32:40AM +0800, Chen Zhou wrote: >> Fixes coccicheck warning: >> ./drivers/video/backlight/qcom-wled.c:1104:5-15: >> WARNING: Unsigned expression compared with zero: string_len > 0 >> >> The unsigned variable string_len is assigned a return value from the >> call >> to of_property_count_elems_of_size(), which may return negative error >> code. >> >> Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for >> WLED3") >> Signed-off-by: Chen Zhou >> Reviewed-by: Bjorn Andersson > > Reviewed-by: Daniel Thompson > Reviewed-by: Kiran Gunda >> --- >> >> changes in v2: >> - fix commit message description. >> >> --- >> drivers/video/backlight/qcom-wled.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/video/backlight/qcom-wled.c >> b/drivers/video/backlight/qcom-wled.c >> index d46052d..3d276b3 100644 >> --- a/drivers/video/backlight/qcom-wled.c >> +++ b/drivers/video/backlight/qcom-wled.c >> @@ -956,8 +956,8 @@ static int wled_configure(struct wled *wled, int >> version) >> struct wled_config *cfg = &wled->cfg; >> struct device *dev = wled->dev; >> const __be32 *prop_addr; >> - u32 size, val, c, string_len; >> - int rc, i, j; >> + u32 size, val, c; >> + int rc, i, j, string_len; >> >> const struct wled_u32_opts *u32_opts = NULL; >> const struct wled_u32_opts wled3_opts[] = { >> -- >> 2.7.4 >>