Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2469184rdg; Mon, 14 Aug 2023 03:44:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEH+XZLlwPoyvqLXPNCsNqCuqhhNcsmzYIP2/a3jd/yY4FjvwgBwlmYVg+mnR5XOfIFX/Uu X-Received: by 2002:aa7:d053:0:b0:522:4cd7:efb0 with SMTP id n19-20020aa7d053000000b005224cd7efb0mr5632222edo.17.1692009890414; Mon, 14 Aug 2023 03:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692009890; cv=none; d=google.com; s=arc-20160816; b=W7INplVNcvFoJdNbGVw0HREAfY7bVfjNcf652gIicufu67IHZerZfpHZUMnfaO/HSo /rfgsobbVwV1fmE/UVCA3GgG6odqNS5vko0SDBSHtd36AmPqpZRrm4eOcrW/nySdIXNZ yGS5HBbRRIdp7yCZjseOfAUbD0ZXabJfyOf5A9354iyi1cXilO1BL2UBGv2nbtWDcNJ7 e1NBeAfoI8Z6hYOkDKDCtdqFgjfUZyyEDYLP9uKuG9elam0o7FgL2XLI7AqPQB2NAp1b 4CMLJ5WGuUQnobXpMoFrj+FHzxy3xzgouTQ50lR3Yexh0h4tGWWHm3i7kqIaHbq8Ddgz 5iPg== 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=D5aLdYoDzonLAxZ5PSMomSbWxhFnGKGGnvbysSjVTVc=; fh=CN+PH+TP7qcGn8Yb03+NyG2nV4zlT3Sww4EEQbI4ZXY=; b=AMxeezuv9WdSpazxAgQ0BXFhuA8PsIGrZRytjv1NdwvrOH3KFK0bah0/DSrvafY3lI n/rKnJcSs8GHTKDtusA78dHgXv/HmPJ8Jm4CLj3zOz53RnLA4xL5IDCuq8CmNXze4Z19 Ll8H/MHW010lNLKJq3ugRgVnl1eTpRh2tJ3QuaF/BIRvWGDEbOe4zFtiCqRPAXnkPsdK dq59ezBwBMhxoNK36XKtsIHMUTNGRyU++uJ1REVKdl1ZAjEG7Lcfd2CYRG8miXyIaC7V xndG9diB4RiKnAf3Tp0Q6uXO20qXYtVzhCYOFoMIqSwCLAyK04ypgRlVH/ju1k3olIaf VOwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nofShKkv; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p16-20020a056402075000b0051a4adabcb5si7464277edy.618.2023.08.14.03.44.26; Mon, 14 Aug 2023 03:44:50 -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=@linaro.org header.s=google header.b=nofShKkv; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234179AbjHNIlx (ORCPT + 99 others); Mon, 14 Aug 2023 04:41:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234289AbjHNIlW (ORCPT ); Mon, 14 Aug 2023 04:41:22 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 723C510D for ; Mon, 14 Aug 2023 01:41:21 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fe4ad22e36so37582925e9.2 for ; Mon, 14 Aug 2023 01:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692002480; x=1692607280; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=D5aLdYoDzonLAxZ5PSMomSbWxhFnGKGGnvbysSjVTVc=; b=nofShKkvBm0DO7xSJvOuELrwERW3RQEALYLWsAtldEaPqBHXOHp5mq6q4Z+IIwAeGI YFH55cFn6nnypFsgmDfbucGvylbLdOgahjrrmYN9y0rYFtqHwd9Vc6HaqtOwFVf5b5la H370hVR3iiSCbWVK9CKhDvQAjetELuWJC6hTyXN2gjmnJVIPeK32XDAW5R9WmU9Q7FGh XWsZ9+Pgg4E/iu3mQUwWrDEPePMo5MatDfAbZsOc674cSBUbaA0nH5R/pjzziJ8ZOBI6 ho5ASHWnT19j1Cqq5skAl8fPpQydUAX4YW4HK2V3M1SLuQjTjsUNm6QzqpXRoZbUsaQ3 ODxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692002480; x=1692607280; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D5aLdYoDzonLAxZ5PSMomSbWxhFnGKGGnvbysSjVTVc=; b=R0hf5AAO/kTGWdE78z6pQlED5eorlerMJ9Nae0XxhlKvXvw6wvW5lJBmzoif4Kn2hQ FqurqFwVgLF9ba4F7py+/MtnOkRb0vbpUqAFY1mg3jlbl1gHtgFb2WP55iKbVyrcFBtq PpmvIvaoRAs5AS96NFrEi5ihHNCAkEOCStaF4/hCi9GbsXOBNq1x44myYa/KP+2oiM1O f873w0kAJ7K1dPNrDr4TGpt4Vb/Bdw8e9vo7jXvEthixEHMJzJw0R0ma90sjAwIgJnDK gwJ8GdcjoAr5KiK5m/kHbQYDltizqvWhRdxwLts0gFn0oR8nQsuOLLwPhHaD1YCenfZ0 WKeQ== X-Gm-Message-State: AOJu0YxgZUlw2e4j289vWHn1wkxOYqDLU1Opk6GDSVgdSpSMQ3jTWlYy 3w+zy38R0YCpkn4/NvH7PQ8xGg== X-Received: by 2002:a7b:c045:0:b0:3fb:e054:903f with SMTP id u5-20020a7bc045000000b003fbe054903fmr6941460wmc.36.1692002479946; Mon, 14 Aug 2023 01:41:19 -0700 (PDT) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id v23-20020a05600c215700b003fe1ddd6ac0sm16527413wml.35.2023.08.14.01.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 01:41:19 -0700 (PDT) Date: Mon, 14 Aug 2023 09:41:17 +0100 From: Daniel Thompson To: Arnd Bergmann Cc: Lee Jones , Jingoo Han , Helge Deller , Artur Weber , Arnd Bergmann , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Benjamin Mugnier , Krzysztof Kozlowski , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] backlight: lp855x: fix unintialized function return Message-ID: <20230814084117.GD5056@aspen.lan> References: <20230811131600.2380519-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230811131600.2380519-1-arnd@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Fri, Aug 11, 2023 at 03:15:53PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > The function now returns an error code in some cases, but fails to initialize > it in others: > > drivers/video/backlight/lp855x_bl.c:252:11: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] > else if (lp->mode == REGISTER_BASED) > ^~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/video/backlight/lp855x_bl.c:256:9: note: uninitialized use occurs here > return ret; > ^~~ > drivers/video/backlight/lp855x_bl.c:252:7: note: remove the 'if' if its condition is always true > else if (lp->mode == REGISTER_BASED) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Since this case should not actually happen, return the -EINVAL code. > > Fixes: 5145531be5fba ("backlight: lp855x: Catch errors when changing brightness") > Signed-off-by: Arnd Bergmann I think we already received a patch for this: https://lore.kernel.org/lkml/20230809163825.GA5056@aspen.lan/T/ Daniel.