Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp2280366rdb; Thu, 17 Aug 2023 17:00:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+QgDoVOZyXGYuLBhSIQTnWrvoWYLElMzmNYXO3/quhK1kuIiDhcaEYLL3SHJKtUVShTj+ X-Received: by 2002:a17:902:64c2:b0:1bc:2d43:c74d with SMTP id y2-20020a17090264c200b001bc2d43c74dmr791815pli.34.1692316825358; Thu, 17 Aug 2023 17:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692316825; cv=none; d=google.com; s=arc-20160816; b=Rhv2eTTHThdZdo9bTZz+yrf3HkmFtVlLnn1T/SEa5qXEbvVZRW316b9jb8t42sCnBE pdYKVsfELFPP6Ett4+8R1fC9vfSGXXSZjW+hBfnlbIImfNowy4RE00hGfkoAquySU5DB 4/NMk4TxV+n8pKzToxGfyHUpC9iUIwg4PTw75C+T+MPbhoFzwRmPDUgBendBV9inGnXf wkPyM/uaA9iF9lUQ+EkM6HO44eOqMoCUechEHKb4yNzyCxby+ZVVqgb53IzqI2EtdD3L 775SuRcn/HBqWk8CYupu6F10zdRPKhcteaB9HXJMaU0KI6ZdR3J7aPClOyJlMXbrX+1f lcHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PQWH+MrNbIKCXp2w3LxkAE2JezPSmrxdkPFotICw1jo=; fh=2wmxViZvdUyKvqBo4pQxvjri/xVQR9Z1I2emaRgYrcA=; b=vs0ehfddD2Is+BgHZ4iUKiwqTd9u47YRZMGdkUm/JAmUklCFt0uMR677bRFtPyIR5h o4sal8dMOyLOlYE9s9+xXQGVn18rlRm8c82OtXMI3HlTB3pzn5bkiW4lqCUg3I9qfPWq WY60ffScXUgczXIWSwCwMNAuB9pW9Uu3eshOX9SURslB2zkiwSL/137zoLygJGvc5uAA 9nOX48SmBBlqiZg5ljxSzdYnroEQvbxx3sX4s7eZA+b4Yv83YehprIlLzkqmeT/A+htS VLGQU6dC6tUJMZO8MYRGVYVIYn7+GJ+qW7+cYnlIDlXBBSzWMMs0S3izen+h5S5UFnpW J65Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B4yhcg4O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id je7-20020a170903264700b001b86ddfd49bsi459202plb.6.2023.08.17.17.00.12; Thu, 17 Aug 2023 17:00:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B4yhcg4O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239514AbjHOTJn (ORCPT + 99 others); Tue, 15 Aug 2023 15:09:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239920AbjHOTJl (ORCPT ); Tue, 15 Aug 2023 15:09:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20645213A; Tue, 15 Aug 2023 12:09:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7E24861633; Tue, 15 Aug 2023 19:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DB3AC433C7; Tue, 15 Aug 2023 19:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692126552; bh=drMk97XVyKCReqvo0twNj8qWYEWg10p1ckwl8tzVNBA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B4yhcg4O90wKEMrx6eDICyuJ5FVGKESOwrgPDmJj7h5k8Dt9xumIm45W4HXOP+sKe FYo8uYUywe2h0MILLpYTJ5sY4N1Fnh5X85ru4Y7BqmBnDcPJ1rY2Dj6upC9+xcm9XN eRZsx67reSsMDkSu8sY4d/q5n4mylCql0Vn1t0ts5rLlobMDdQ/SlN5Zys5KCNMQyu NMx8HSJdPxQqvNTApHOngRa5KEjLcYUYT1AfvOB9j5Il7SxI2I1oL7eNYjMihrzzCd IW3k2zJoJEhZUzsAQo6+QlXFg6KCT/N47znNx3zabXs+TZiMxTuqfSbWz0DF7K9JGK JzxYRrZ9C+Drw== Date: Tue, 15 Aug 2023 12:09:10 -0700 From: Nathan Chancellor To: Artur Weber Cc: Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH] backlight: lp855x: Drop ret variable in brightness change function Message-ID: <20230815190910.GA2908446@dev-arch.thelio-3990X> References: <20230809114216.4078-1-aweber.kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230809114216.4078-1-aweber.kernel@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 09, 2023 at 01:42:16PM +0200, Artur Weber wrote: > Fixes the following warning: > > drivers/video/backlight/lp855x_bl.c:252:7: warning: variable 'ret' is used > uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] > > Signed-off-by: Artur Weber > Fixes: 5145531be5fb ("backlight: lp855x: Catch errors when changing brightness") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202308091728.NEJhgUPP-lkp@intel.com/ Reviewed-by: Nathan Chancellor > --- > drivers/video/backlight/lp855x_bl.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c > index 61a7f45bfad8..da1f124db69c 100644 > --- a/drivers/video/backlight/lp855x_bl.c > +++ b/drivers/video/backlight/lp855x_bl.c > @@ -241,19 +241,17 @@ static int lp855x_bl_update_status(struct backlight_device *bl) > { > struct lp855x *lp = bl_get_data(bl); > int brightness = bl->props.brightness; > - int ret; > > if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) > brightness = 0; > > if (lp->mode == PWM_BASED) > - ret = lp855x_pwm_ctrl(lp, brightness, > + return lp855x_pwm_ctrl(lp, brightness, > bl->props.max_brightness); > else if (lp->mode == REGISTER_BASED) > - ret = lp855x_write_byte(lp, lp->cfg->reg_brightness, > + return lp855x_write_byte(lp, lp->cfg->reg_brightness, > (u8)brightness); > - > - return ret; > + return -EINVAL; > } > > static const struct backlight_ops lp855x_bl_ops = { > > base-commit: 21ef7b1e17d039053edaeaf41142423810572741 > -- > 2.41.0 >