Message ID | 20230804-tc358768-v1-1-1afd44b7826b@ideasonboard.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:44a:b0:3f2:4152:657d with SMTP id ez10csp203564vqb; Fri, 4 Aug 2023 04:51:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJuMqOobzsN73urbnTnU1sIZc7SvSmV7LcjU48uLsD9Rubdm9mtCpthkMJafmrQdM6D8uT X-Received: by 2002:a17:906:8a51:b0:99b:d075:18ba with SMTP id gx17-20020a1709068a5100b0099bd07518bamr1151639ejc.56.1691149870129; Fri, 04 Aug 2023 04:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691149870; cv=none; d=google.com; s=arc-20160816; b=umyMhKU3q78cl1BkvOdSpHbfkmamaz+e6eom9tTRVp0nHS3/KLcT27COHYqhVQVjIo PeFjlx5+LYqr0mwIVQhE0stcscXYIhNU4xp7qp+Z6mfYmkyUePPpue8okWKD8H4a6MAf P7NCRxJ9Id6Fa+uFqTlm+JvJ2pFOfW8gmvCBBD/cPMzgs97r0xS9fHFeCUE2dExPSOq1 aVgcoPVYvAqa8tBYocXG6MlVhJVr3mjZ9trcnIEIAQB/FOg8rA9QcEt4tvrcAF+iUCPi S0jwbcaTZydOeSZBFcVXIXEazjU4HcwBV9j7AP54QPAVtLs/a3KVbsjC92fbWp0gnzG+ iHKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=g3lT3rHInnuiE2J1EkX8+K3Na3EpFrT8uIMc3sBdEro=; fh=7GYuw25cWCmHG5LrbyQUwFOElFQ4tchxd/wzYEHngW8=; b=NIXO5znKH5XQ0yp8DLcTzvHMHhImhv42FZR376gDfalkJg7qv5iP4idi1lKXq6iiWR xGE4GjPeISA7kOaeg/Gp5exzs2Bd1wGsc2k9KdsdZPnSd0Z99WhscqMU31B8umKxmNUO uBWMaN8ssebqJsdzawu2tQF0DjZin0Qqok1/oYgN7iw2SMBTMwvDNDlcqRj3fXrRTwPp PJNas8ZAed4ZBQEDK947AEC0uSFrc5aggl8RZTWmqFd0dz4rNYpSJ06y9jtHCOOOKw3W ms9xXvtGUVpJWfM58NWBRuUlFHO7xX2V5cWEcUgqjZZHnZYYTn8zZdd7O+BSzwKnWinN qvQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=FT+PbaJN; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a170906174900b00993b3881eccsi1564771eje.691.2023.08.04.04.50.42; Fri, 04 Aug 2023 04:51:10 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=FT+PbaJN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229455AbjHDKop (ORCPT <rfc822;sukrut.bellary@gmail.com> + 99 others); Fri, 4 Aug 2023 06:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjHDKom (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Aug 2023 06:44:42 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A9E46BD for <linux-kernel@vger.kernel.org>; Fri, 4 Aug 2023 03:44:41 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AA6BE12E4; Fri, 4 Aug 2023 12:43:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1691145814; bh=3BEyrzp4IUiLGe9w3xtacn7Yy6nvFBbT4HOk9yd56NA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FT+PbaJNlTpwZPIvNYkMtzEJmWRm4vJP236yMj3QUZ5O2XhBrzD1necB+dYoKY6wV GgcPIDSfVxczEKuGBNYKzjwoYx8NSdRYMdoWx9rrk5HHSEU41ytiL7PEcZ4gjeA4HR EmW3pd7FO9GnC2C/2q8CEM8l33wgvTTldB005cG0= From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Date: Fri, 04 Aug 2023 13:44:06 +0300 Subject: [PATCH 01/11] drm/bridge: tc358768: Fix use of uninitialized variable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230804-tc358768-v1-1-1afd44b7826b@ideasonboard.com> References: <20230804-tc358768-v1-0-1afd44b7826b@ideasonboard.com> In-Reply-To: <20230804-tc358768-v1-0-1afd44b7826b@ideasonboard.com> To: Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, =?utf-8?q?P=C3=A9ter_Ujfalusi?= <peter.ujfalusi@gmail.com>, Francesco Dolcini <francesco@dolcini.it> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Aradhya Bhatia <a-bhatia1@ti.com>, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=909; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=3BEyrzp4IUiLGe9w3xtacn7Yy6nvFBbT4HOk9yd56NA=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkzNaRGYqdx9CLtWjNaw71yuxZ7twAVPL/kKywz 73jg/nITEyJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZMzWkQAKCRD6PaqMvJYe 9R/ED/0e1faduwhJY8SxU8fljAbFFDWdEBvarjI1D4D/CRcIKgRU7Mc2sn7RFbrHSOJrYeCYJWS h1pGjDdPvKmhw4njBLZefSGXAaSJTo8oI9ZOEwkbTuEcuFZaLaGwtCOJQGSlLMt0NJgv5LcKi3v u8QJOwmEkzwiANoErF84woZj5cIH22ZuCT/ZIt8KsaAfHR8N8DFNrslZkTFPEMnL3PWVS4NKlxI rTDp/nqU0G9GQUywOp2dQA7IupqBJJZXFh9anZ/yJNhKy58SuMb04Yo5JQjhZqTkMhrB4NTXctu 42hGy57/TkRT0dsm0h5XiK4/s+ldCDn0wjy+hWsbVe1R4NAmfJWdwVIMlrjVQuASMAOfitCwSsA Z4NOWBQjx5Vzo9oJuTos5mabMOGW9Ji6CpycTPPTfnTkLEu8bNlIFC09yOB7PSb0inUNAMaB2W3 BSntU0hS4MgAHptNXQFy5p+BGYUUnZ6P5Da2ByeWbH6/WOj2XgwWGPmchNY+RDoamePLay70lzU xvcdg94Te/QIi2sJTT2dyMoopwJfmQRBE6jTY+nAhw9XgU7LoId9YRffFHwUhPVguLSNGHKhoHX ouVb8j94cHFEMytHccOLohg70pvFxrgNIvcJd1BbMP1X8S2vzcUcC/6FjRoD+yfIP97Uvj0ZXN5 hOnOfe5OhhqfXMA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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_PASS,SPF_PASS,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773299166297190928 X-GMAIL-MSGID: 1773299166297190928 |
Series |
drm/bridge: tc358768: Fixes and timings improvements
|
|
Commit Message
Tomi Valkeinen
Aug. 4, 2023, 10:44 a.m. UTC
smatch reports:
drivers/gpu/drm/bridge/tc358768.c:223 tc358768_update_bits() error: uninitialized symbol 'orig'.
Fix this by bailing out from tc358768_update_bits() if the
tc358768_read() produces an error.
Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/gpu/drm/bridge/tc358768.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
On 04/08/2023 13:44, Tomi Valkeinen wrote: > smatch reports: > > drivers/gpu/drm/bridge/tc358768.c:223 tc358768_update_bits() error: uninitialized symbol 'orig'. > > Fix this by bailing out from tc358768_update_bits() if the > tc358768_read() produces an error. > > Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> > --- > drivers/gpu/drm/bridge/tc358768.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c > index 819a4b6ec2a0..bc97a837955b 100644 > --- a/drivers/gpu/drm/bridge/tc358768.c > +++ b/drivers/gpu/drm/bridge/tc358768.c > @@ -216,6 +216,10 @@ static void tc358768_update_bits(struct tc358768_priv *priv, u32 reg, u32 mask, > u32 tmp, orig; > > tc358768_read(priv, reg, &orig); > + no need for blank line > + if (priv->error) > + return; > + > tmp = orig & ~mask; > tmp |= val & mask; > if (tmp != orig) >
diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c index 819a4b6ec2a0..bc97a837955b 100644 --- a/drivers/gpu/drm/bridge/tc358768.c +++ b/drivers/gpu/drm/bridge/tc358768.c @@ -216,6 +216,10 @@ static void tc358768_update_bits(struct tc358768_priv *priv, u32 reg, u32 mask, u32 tmp, orig; tc358768_read(priv, reg, &orig); + + if (priv->error) + return; + tmp = orig & ~mask; tmp |= val & mask; if (tmp != orig)