Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5487283rwb; Wed, 9 Aug 2023 05:08:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQ4Yn4WBq8KAmG3WKKS9H8IYnfisGYsflZiP1+Z7pIbBygR7HjAjbGqjxuYVvXPy3zQuRa X-Received: by 2002:a05:6870:2048:b0:1b0:5141:4c6e with SMTP id l8-20020a056870204800b001b051414c6emr3316229oad.26.1691582932121; Wed, 09 Aug 2023 05:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691582932; cv=none; d=google.com; s=arc-20160816; b=weL35fsI3fZboBiLwU5vHF9w8FEmOVEQzkq493Dhs3x/rTaWZZzVRlx31EbTAiFZlD ZE/0pesxKYZ/DmblaIBHibuBqW5/c3BJVtfeg2wAEIoJZYPjdtnzr6PP4y7ycKO4ir7j bfiTS+CJXR4IiLQdioLok9KNzKRQ6wcy/ymuA+zxpBdBn2xIax/Fi4N1xu9Th52Coxby ynU8Y2IgxqZGCwF6/3bSuMgS61/jnth66XgFh7WUZBdRAii8SuAT7ZnqQgM+6L2pnbrU l1mnO+PbSMpfU8TnOJxkLjoR5Fg5SHp2S1Kx47iMLHwMPBFkji36sUdiD6oawq+mDBJ9 gAsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7b0FNEltUgJre7QUi/LlASENLPDFiW1RiJtPuEPcdsk=; fh=jm6AO1LXNEtTQDcwTUygbfW4JCbuKY+rRoe1XUo1Lho=; b=VyMyAb8Lm42QsDJJg0QN7RzmZp4z9d9/7OV26kxxopgNpL58O+Q0taHU3/gQ2mLD4s rSy6TLstRlUBsmd2tVZ9Y4oND/vree9lx8E6wKilI5ggVAHiSsb9G++GBJi0c46W+57E sqJrDTuTBudM9T2RJGuZVq620OcaTVW61wbwqexDIJV4AeMQzMmvo8rjXIvz+acZUv2t hPHiqBXPmeZudTCt6g/w7Mo+h+EtvXHZXu9ecZT5Z16znmc17hnM1d+imTqO8ewBr+9l VxXquVz8pWFY8pbDMk70DPpR7YmWW+o8/S/NghSrxwWCHrSZ96jwazhMzyF1lYeO5C4l 9E8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=H8bxlFuE; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g188-20020a636bc5000000b00563e87fdac9si8871397pgc.36.2023.08.09.05.08.39; Wed, 09 Aug 2023 05:08:52 -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=@gmail.com header.s=20221208 header.b=H8bxlFuE; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234278AbjHILmr (ORCPT + 99 others); Wed, 9 Aug 2023 07:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234291AbjHILmq (ORCPT ); Wed, 9 Aug 2023 07:42:46 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 709721FD8; Wed, 9 Aug 2023 04:42:44 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fe4a89e8c4so41039105e9.3; Wed, 09 Aug 2023 04:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691581363; x=1692186163; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7b0FNEltUgJre7QUi/LlASENLPDFiW1RiJtPuEPcdsk=; b=H8bxlFuEJAgtd/W8tH75enhERPJK8n1rNmG7P1oaBuUdwMEbeVDeV8AFbviUIsf0mH L79na/TmkmFu1gjUUH/sP0SO9j8XQgOew6Z5h6lX7S+NBciQ7/gtGkCqB7U7GnJbSbLU JX0V+S4/Vi/pmNYsA+UYUns4yF6HK/6ur3f/YSJaCNPeb0rICJhAoFbMVr8nFXdF8+b7 4Zrpng/iX6JbBvRzpVXE33vXPPaUkp92fxJmqaesWhXDHRYQZsfIWz5+LpKvTbnUonTG LxudexIvdvdxUUgNJMeLVtk0I4MGi0sxootYT7F96hgSLWBFws8YM5Psla7H88O4YARw JtJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691581363; x=1692186163; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7b0FNEltUgJre7QUi/LlASENLPDFiW1RiJtPuEPcdsk=; b=bNAUyb/h/kDGRX+J3+NJZCXJe5NcQzTxzq7G0DjLxlYgu/Z6nxaj1Buihmgctz2SSL BGsSMpIe/BPTVtagZgLwjIqUnqiecAbUClSb6S2hvK3YrQB54mHTzsyDTq3P+FmJGqgr p3HNj8CPIHOP1v7Yy/3O6H430FjBAzPTDbaXemjd0/HuO3EqnsCIQJEONOY0rJwpbsdx C9ItNYhrYCuZl/73Jn29AKPcmbNDMrnKvo3qeaRIYVMj1O/hXmjFCkKGtRUTW89YBrxK i47Hv77DVT50c18LfIiyWJexztALrTl8TirOJklrM+oNtbhdmiSxc9VsUdayNaufJV/C z/tA== X-Gm-Message-State: AOJu0Yw/J2iA/U/tFMwjxbGdlz4jmiY+OtC4uokuDvS36EyASVprAu1S lB4i3a5ZQvUa9bAtI+yJh6w= X-Received: by 2002:a1c:7213:0:b0:3fe:179d:d42e with SMTP id n19-20020a1c7213000000b003fe179dd42emr1932458wmc.23.1691581362742; Wed, 09 Aug 2023 04:42:42 -0700 (PDT) Received: from tablet.my.domain (ip-5-172-235-199.multi.internet.cyfrowypolsat.pl. [5.172.235.199]) by smtp.gmail.com with ESMTPSA id z4-20020a1c4c04000000b003fe11148055sm1727938wmf.27.2023.08.09.04.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 04:42:42 -0700 (PDT) From: Artur Weber To: Lee Jones Cc: Daniel Thompson , Jingoo Han , Helge Deller , Artur Weber , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: [PATCH] backlight: lp855x: Drop ret variable in brightness change function Date: Wed, 9 Aug 2023 13:42:16 +0200 Message-ID: <20230809114216.4078-1-aweber.kernel@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS autolearn=no 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 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/ --- 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