Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4690303ybl; Wed, 22 Jan 2020 02:56:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzzXqvVayHrZYXEH4AdquTf3YyBBFVayIDks7b7G5U1Csm4MJdnm40Fhut7YXlh0dmXeHBh X-Received: by 2002:a05:6830:1294:: with SMTP id z20mr6905405otp.60.1579690619161; Wed, 22 Jan 2020 02:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579690619; cv=none; d=google.com; s=arc-20160816; b=BcqV3nzC/9R/k3tVfOl0zwys8EZE01PHozEr6uQn9xLhIbCrv/Aeel+fdFXbgNpgTd BiFeqIG3eCpvTE2/U9tDlT7V3ZoB3K0vwsUjO93yJ+/pppHx7upwrybYeBPcbQBkQDck B9mMxRzAjtKQBOsXV363h1SnRvtqSujL8/uT/raEfdpBkenFihxAIjFjxIty8owAzB5X jG7eGuASlvE4r8PU4F0MMwdaUCqGwLLdLYlozjGpkkzy1+B0YJb23wBqUG7LkXIflaHK OCXM0NZM7mYNml+oK2pVrZsbhkL4SsywOZPh+2dLkGoyX+Eoj3uYmeoGO4ZFVMmIGpMe 5BGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yy5Pm6Chzs3nZ800EbMSsW7jSH1HwjtkYzsQKIFnm8w=; b=CKJW/SO9sEk5duSjlJNyzk+Dw5DU+EZ4/lwMabCeZFCpRvRMoq3m7J0o2FT+VTEAUR E0W8t/asnLMkbjlzxYP3+sNYBtbuds0AFmY0K0ThoIZEi8zGNYeYcTkGViqOWsL2kisl 2lu+YMgzM92GnZJ6Cn8FBBO54HmDVvF3l+aNinacip3Lm76syfgJR7mUNfkqI9WJwCdu 0eqvU6eR9puopSlwlbjyTxLvyh4nzjqBN7YMGkEFixajRTQBn36se1hfiiBR5jCvP8Ts i37OxH8BJRfH40zrBhLoacP+iBEl608XC1I9izEasqcVjeo36VKEE7DhYovj9N2R22AQ nTbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rocHCsiC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si21604142oie.41.2020.01.22.02.56.47; Wed, 22 Jan 2020 02:56:59 -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=pass header.i=@linaro.org header.s=google header.b=rocHCsiC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729368AbgAVKzv (ORCPT + 99 others); Wed, 22 Jan 2020 05:55:51 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:39927 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbgAVKzo (ORCPT ); Wed, 22 Jan 2020 05:55:44 -0500 Received: by mail-wm1-f68.google.com with SMTP id 20so6636469wmj.4 for ; Wed, 22 Jan 2020 02:55:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yy5Pm6Chzs3nZ800EbMSsW7jSH1HwjtkYzsQKIFnm8w=; b=rocHCsiCeMC1gpXVMEd5t5GK6MZu9gxeI/GUSwU8+8FCQI16R2LHI3G4MWOh1lr3g3 i1wiLGTmuLwe05mlGIErWGWzGoqLVAABV3NaILq2JqpGu7mjVMG0VWhHTkzHQYAGnHNW w5UKpjmG4Gd1NbGZRzJrNdIP/C0xnSuRunOmteVNAKpUcHu5mklqKMhQn+wY5GlzLYaj zeQwQ2vkEOUjwaMVA0Tjz2cECH5crF8FweVqeBt52Eur64fEAaeJKGW7XhCjUe0/IUTI B/X/CNzrO1eWv0TSaH0s7OQ+Zv9Ob8TeRHde5yOBtBPlR1dWivNW/PIeEIc/nhgezLE8 ju5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yy5Pm6Chzs3nZ800EbMSsW7jSH1HwjtkYzsQKIFnm8w=; b=VdcSSgHqgZm1U7e9wu+eGTiyJajVXiONBgB1a6PRUf/VU7AyQmlEHM8uCHruuuTbhh IwROS0+VwpcmMVeqnwzyyZKUJ8j/8fdwb5yzHAETDXOzng/xy8tWOLNKxuhl+I0t19/i QMrHF4unheo1OUl2YBPt1YLXtK74kMww+5qe5fWVKM9rb/I/2I9I4pt+/jy4EvgokKVT JthpiJMwW/w2JUSXIVdKY4gz0siocfBPp5FeHl9Zsna7T8CkXHX3rCZfKSXyOisXRio1 uByXRiu4LuQIsZut/eVQZDVmaKD4B/XY4uMTaRrx6cu0bxtB0ISxQMY8o8mN+F9tp3Zu MZoA== X-Gm-Message-State: APjAAAXi48sTBSrtzLnm3VJFCZSzaNH3QmVunwCMEcTkssn35y1ZBFiM A0c6K4tYAILQjPw9qXFTXmj0AA== X-Received: by 2002:a7b:cb91:: with SMTP id m17mr2227038wmi.146.1579690542801; Wed, 22 Jan 2020 02:55:42 -0800 (PST) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id z133sm1370588wmb.7.2020.01.22.02.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 02:55:42 -0800 (PST) Date: Wed, 22 Jan 2020 10:55:40 +0000 From: Daniel Thompson To: Chen Zhou Cc: agross@kernel.org, bjorn.andersson@linaro.org, lee.jones@linaro.org, jingoohan1@gmail.com, b.zolnierkie@samsung.com, kgunda@codeaurora.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next v2] backlight: qcom-wled: fix unsigned comparison to zero Message-ID: <20200122105540.w5vrvs34zxmhkjae@holly.lan> References: <20200122013240.132861-1-chenzhou10@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200122013240.132861-1-chenzhou10@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > > 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 >