Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp402897imm; Tue, 24 Jul 2018 22:23:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpctDOSlwgYohKQRsOme5c3O4iiDMjt4VXAdis0WPjgEDca4b1y+a0v8KngEJR19MHJPzPcO X-Received: by 2002:a17:902:aa07:: with SMTP id be7-v6mr19468165plb.109.1532496199570; Tue, 24 Jul 2018 22:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532496199; cv=none; d=google.com; s=arc-20160816; b=adkUNlkimr5JloNnua1UtYuWfxvFPPQTkHfqxVi36M6pXUNq6Lv7aeNIeg+jxXbLxO frp9CTvgBl3DOduU8lqdLNSLp730hb+ZQAVqZ8K0GAHMztlBn2dxqPuq2WC65yU3ZAuO Cz4D22/EmW02y4mRoAi++WSDCMEn0GgHNSGkCE/W6P6ouoUXhJ85MgJ1FIRMLN9S8+S4 JZzrHEEh/NsKhBhXcUwKqRQzAFJDtrF8iKc2GSAdtx/QfZaRPR22cjhAqaMQF9ikFli+ RT8hQc8O+WgIyxMAdhmMOFm66rV+TEZebbT1yc0lIOM8yIdBdZLTpxaXwofj8QH0/24R fWew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=xmBehj3++Bf8c4xWsg0sQCIbto8gy5/8bznLBjD7bGA=; b=ay8Zu4dFo/PBKY/Ei5FSR481JafW1AC6BAx4XjQP43+NJZW4QhApbYyZsjWnlGyOz5 HBZ7KxnhCrg+Kmzm/4uIdzziRa8yK/4Osv3/K2E6X+k9uOqyHTE5PbLrfGipuFfSgn5z rsWajDa9szglSnB67gLVBsjnNXKqvQD9zw8VuNn08pGf1vvI2jIbCd8rF4uLpy8VgDkl WiTrhFkHgPMdRrzm7AZrEgGFGjTcp0NHkYtXoNH/s+ZlizufhtDxDvxFjQxPYhg6j5J0 xX33DXYJIto5T4TWxe3Baam+DKLVuKi7RjP2e3HpqrXiLBud+mJnwAIQuka/vSRWDQTC OXDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LK5Buoeq; 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 n10-v6si13691874pfb.316.2018.07.24.22.23.04; Tue, 24 Jul 2018 22:23:19 -0700 (PDT) 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=LK5Buoeq; 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 S1727883AbeGYGcN (ORCPT + 99 others); Wed, 25 Jul 2018 02:32:13 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55866 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbeGYGcN (ORCPT ); Wed, 25 Jul 2018 02:32:13 -0400 Received: by mail-wm0-f65.google.com with SMTP id f21-v6so4636153wmc.5 for ; Tue, 24 Jul 2018 22:22:14 -0700 (PDT) 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:content-transfer-encoding:in-reply-to :user-agent; bh=xmBehj3++Bf8c4xWsg0sQCIbto8gy5/8bznLBjD7bGA=; b=LK5Buoeq8MfNoN1zA1HDDClT4syg0kntB7Z0ip9xU1/XT6cBMof8KClc4tKWDa25v0 kTZnh4Hy8P6luCKuaphAVZ876J+7go3gYCy1py9IiMZkVZnI5Blg7ErbUxx3DYrhbUCE Bcfwq4wpdMR85wAO9cfg4TUH5D8xPKfJ7vqpw= 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:content-transfer-encoding :in-reply-to:user-agent; bh=xmBehj3++Bf8c4xWsg0sQCIbto8gy5/8bznLBjD7bGA=; b=F3W/tr17/aW6ZZncoj2lRMvdGoE34Pp5q700DfKMf2qt86xik3dUOgjLU89KRMj+rJ 4Nn9DkiGCFQT8rv2fMhvlh9Et3KIv5T6Ru7jZvbfjX7lqQYDywWgK5ouSw25aXIDSF+T kUN7tKM3VWiEChEjbc+0Fy1OhJph+ummrz6O/xbQAImfD7oeBYEdJMP6YFybaqoml565 H2pgn6CdfOObxKz48teAoabRIs1C9TFp+rfXx8eqrHru7JouJigEgHM3lJF61WftGboI 8r14b/OMaRmDmQXY0WIkA/zEatWYmx/Gf9sXQ+1QG2RO0eqzVDLyBYvhQ7FBFffIAdmn JCYg== X-Gm-Message-State: AOUpUlElmSWCcI1ByMuQGYHk781QxjjxGHY/cR3pJdb6cOCKcXjdjlXN qVuLxGaepST5p2CVLotcExyL/Q== X-Received: by 2002:a1c:7d47:: with SMTP id y68-v6mr3402088wmc.62.1532496133806; Tue, 24 Jul 2018 22:22:13 -0700 (PDT) Received: from dell ([95.149.164.105]) by smtp.gmail.com with ESMTPSA id t186-v6sm825443wmf.14.2018.07.24.22.22.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Jul 2018 22:22:12 -0700 (PDT) Date: Wed, 25 Jul 2018 06:22:11 +0100 From: Lee Jones To: Daniel Thompson Cc: Jingoo Han , Thierry Reding , Bartlomiej Zolnierkiewicz , Marcel Ziswiler , linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, patches@linaro.org Subject: Re: [PATCH v3] backlight: pwm_bl: Fix uninitialized variable Message-ID: <20180725052211.GA5835@dell> References: <20180716210241.9457-1-daniel.thompson@linaro.org> <20180724071223.18901-1-daniel.thompson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180724071223.18901-1-daniel.thompson@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Jul 2018, Daniel Thompson wrote: > Currently, if the DT does not define num-interpolated-steps then > num_steps is undefined and the interpolation code will deploy randomly. > Fix with a simple initialize to zero. > > Fixes: 573fe6d1c25c ("backlight: pwm_bl: Linear interpolation between > brightness-levels") > Reported-by: Marcel Ziswiler > Signed-off-by: Daniel Thompson > Tested-by: Marcel Ziswiler > --- > > Notes: > v3: > - Switch to the simplest fix and zero the uninitialized variable. git > grep indicates that ~25% of calls to of_property_read_u32() use this > pattern (pre-initialize optional properties with sane values and > ignore the return code). > > v2: > - Simplify SoB chain (with Marcel's permission) > - Separate complex if statement and make other similar calls use same > return code checking approach > - Tidy up comment formatting and fix pre-existing grammar error > > drivers/video/backlight/pwm_bl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Once the 'Fixes:' line has been repaired: Acked-by: Lee Jones -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog