Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp77539rdb; Wed, 29 Nov 2023 21:12:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3KWP2ha7BKObUMo9/O7Spcil751PxxsY929JcpnF9TLfiFJYu+D+jmpP/BCWp3odERcFS X-Received: by 2002:a05:6808:1b1e:b0:3a7:2390:3583 with SMTP id bx30-20020a0568081b1e00b003a723903583mr26656045oib.38.1701321165325; Wed, 29 Nov 2023 21:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701321165; cv=none; d=google.com; s=arc-20160816; b=M9J0svuUf5DeiT284jsD7npGz4uKnsCPc8uTIXk5GtnkNTLlFM18fN9BMuH7e/fjPw sVt5uXbhBEsM3MySjTwLU/+UJTolfLHQHdvB4I5OV/OeSmTtfLxA2Z8s95i+x9UqsaGS bF+K1+ypwqg05J4fMSyQebc6T6Qawidd4LTkc6U1nTNL9K3hee35m6rwyD2B2Wqeg64v RaCRl4F40mBP9mQyczmFgF4REp1xWemUuQah6tDSmykgmhv6kt0fMsAkWeBNh6LQIEfR lSu/6gt0LX2A7GtplkCPdsPeqK78Byfh6ynlu0/O+GBg/nHHZRkIZL/2wcUVjEoqnS28 pwBw== 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; bh=CGA17sQb7S+wdvlvvDkv4iLwO5yCOV3yxtfug1cxNDY=; fh=eFL8Haggwk6iH68iY1U0rtEM31USzC/QoPqJfzsU+d0=; b=DTLoExvZjXweN/a7eo0f9B+NBwh62nS1eLl0//eDRGYAciNNPeuTBpJtyVxE6U1y2G WFVRpct8PDMuy58jZvssHXpnFkF3cKSNd6SloK9bARH6Gl7r4Mjs07IziHP2/2jfwKqZ hSQhhIqselSqKXqb+ohYTd6vaMLuKjaItwtIROEIS7zG2aY8WTmVlDEihURGyvnvsOXb OpwPTU6XOR1GH+ujPtc8J4kvalibATwfbzbNOze1rG/BQS2C3HfxJn1G1YK2bbfWmUiv CLzg2v5zIMHHPbpa5JfrLIqC1w0XWYW5aGb7jqJMnhdYGZmDO3ZM4rMvKsjog+PtyYg/ 9Kow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id n127-20020a632785000000b005898e10f9b9si564924pgn.213.2023.11.29.21.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 21:12:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 08908801B42A; Wed, 29 Nov 2023 21:12:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231493AbjK3FMV (ORCPT + 99 others); Thu, 30 Nov 2023 00:12:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjK3FMT (ORCPT ); Thu, 30 Nov 2023 00:12:19 -0500 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 3AB17D7F; Wed, 29 Nov 2023 21:12:25 -0800 (PST) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 74E2861FB526E; Thu, 30 Nov 2023 13:12:15 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, deller@gmx.de, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com Cc: Su Hui , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel-janitors@vger.kernel.org Subject: [PATCH] backlight: ili922x: add an error code check in ili922x_write Date: Thu, 30 Nov 2023 13:11:56 +0800 Message-Id: <20231130051155.1235972-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 21:12:43 -0800 (PST) Clang static analyzer complains that value stored to 'ret' is never read. Return the error code when spi_sync() failed. Signed-off-by: Su Hui --- drivers/video/backlight/ili922x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c index e7b6bd827986..47b872ac64a7 100644 --- a/drivers/video/backlight/ili922x.c +++ b/drivers/video/backlight/ili922x.c @@ -269,6 +269,10 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value) spi_message_add_tail(&xfer_regindex, &msg); ret = spi_sync(spi, &msg); + if (ret < 0) { + dev_err(&spi->dev, "Error sending SPI message 0x%x", ret); + return ret; + } spi_message_init(&msg); tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG, -- 2.30.2