From nobody Mon May 25 08:48:32 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45B7B48C3FA for ; Wed, 6 May 2026 18:35:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778092523; cv=none; b=KBUc77p7C+5XuG+ScKJfEi2JZq7EtrvueC+seuoCJQG3v96y2RhE9wyk6Em7m8ZV1IkW5JnenjP925NaNy9WHrzAbtzo/F0DQhqyLkmR2bVAiTWXDc7X20R1ds9yhsgh9E5XmHe0gDZxtH0X2GeSn+yyimbi0QMsNWwnj8y5BCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778092523; c=relaxed/simple; bh=+WMqCy21w3Lz7NVM3I657Lea12MlKzLhBcyc8rycgYU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=D1vlKEqPQ9gUK6lCCMgmh/PubSUSpJLZCBdY7SWZVOUTt3kuzNFmmxjc7DTehY1Pz4Qmg3fz0X18ejqzQB1oyEU28/cNBrxC6oyzv+PgWKwkhMQTE1ebB0/g5IH8xIuAW+JXZngXjPQmiz2Y61EiqagzPTFyonJly+esn2XKUvY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kUjRk2m+; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kUjRk2m+" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-488ac04e13dso6675e9.1 for ; Wed, 06 May 2026 11:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778092521; x=1778697321; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9aiXsZhpAfPQ3ReCQcd6NEJTNdjNAL2vg0ii0mpvxDg=; b=kUjRk2m+OcCTNMc3PYRVG7Pkxt/btwHZxBMzmMbOJBDpi3AnknmXMKwehQtNmbLrW8 1p8ZlNPbZOqvFYyU61egrRYv28F0hs16kqJdjzWFJtFVh9vSqQ/sWCvs04ADzWwELqid RndDWe6RgxxdSLIiFEqL5TQlpzojPdQS2g750VDBubqIMm5LyFX8LafAooj2sYZAbmhP DAwEUyg8fJZ3FdgZ/CbH8fEuZ0YCGeeRAL2QLDgAgWR4XxUr1VF21MQCX9AL7W6QL+YX HrVStAa2RdSw4pg6blqgKtCM5KqaSTtyU1GmJ/4d3TXIBXLLbkK23Q9NIMM2dZU/zoWr SCcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778092521; x=1778697321; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9aiXsZhpAfPQ3ReCQcd6NEJTNdjNAL2vg0ii0mpvxDg=; b=HjSCZGtPUoq273p7gX8EARPX+T3TBR5P3ZhttsTyRJP+hBlR11BpXJh392YvopDx0a b/3O83IGq0cRf0PhCVlc3Y7KPHpap9l6guFIoVxCISNzv/Nt66QCzgleMxN3YE7kWhFM pSimkw+62ySdwU4EVAp64gWe4ZMnud0hhr22rFpTOh3gemGpp3GEMNT5M/LmyJZMQm6E qOFrL2sg4WXynVJBC/PiZvpsVOiMctDa638hqiTe4fmbkCuVTZObjKqFxdJnS5JMBn8a NbI26AVK+TGuxOc4m5FQ0uhHylN1x2QmUu+lZE03+jZs9g5g3kpig1UIu1QkfcOs1RSS 0jOQ== X-Forwarded-Encrypted: i=1; AFNElJ8p+2hsxuXwMQjgWJ5KlbeR5v/tlMMLSaGQlDZGD15F9FRT04bttf+rcqF92dnSSEF5gHBP50mMkUJ826I=@vger.kernel.org X-Gm-Message-State: AOJu0Yxc3g6a9FBWg9B+xwJVgrNs7rgkPnKIxgXh6RAkOxtUa8qlswS2 PUuhglzSWgfgLMt9VPiRvSKE83oiGBMPwIRK1rC93t0Ww+a8/W4PPY9V X-Gm-Gg: AeBDieu9LdGjppu1Jd+BwDDlmQFTQQwnZfbC59mGlbA9wpUv4NMZJSGf54/xaZzTmsw 6WNieSWEh0u1g7rwYN2FKPxqPiud+CtD0lkg0PbYT8d+AvpSwokJcrJOMQxsT+0cuhjMaJU58d1 ukrK4YWWN5phBQkParLSbDk/aXVPC5FrqZajI82jP0PK2jkIiSk5E7CghYu1DkKnwqxJ/jf0WTJ ZqKr8FgCDQyQW7WndRlryz8AZii6+yGkcmz0iVM3xTudBgSdq8SvtRBFovme0IhAKg3ckXBIuuL uOSvHUHqjXgBiJWAIXjni2roYRY4g8IFoO+l+f8il4qObpbM3ChA8l1vo91LoRYD9H9gmmAy3Wz EWfoTVjXL4hzC2QpG/1p2JBe/L/PydkVScBBXnt+VhvaqL8j9hfYUMPnOJocMJvaKVz4z7zLQy5 OnwJe4v2mMlUizRyJVazlqSkOsbutM1Gi3vzwvIMU9TsNB4S7qH21q X-Received: by 2002:a05:600c:1908:b0:489:1ca4:c999 with SMTP id 5b1f17b1804b1-48e530d8a88mr35424575e9.8.1778092520483; Wed, 06 May 2026 11:35:20 -0700 (PDT) Received: from LAPTOP-9UC0RPH4.localdomain ([82.215.118.79]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45052a48911sm14398468f8f.11.2026.05.06.11.35.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 11:35:19 -0700 (PDT) From: Stepan Ionichev To: sunny.luo@amlogic.com Cc: xianwei.zhao@amlogic.com, broonie@kernel.org, linux-amlogic@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Stepan Ionichev Subject: [PATCH] spi: amlogic-spisg: drop misleading NULL check on exdesc Date: Wed, 6 May 2026 23:35:12 +0500 Message-ID: <20260506183513.482-1-sozdayvek@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" aml_spisg_setup_transfer() takes a non-NULL exdesc pointer; the function dereferences exdesc unconditionally later in the body to populate the SPI scatter-gather descriptors (tx_ccsg / rx_ccsg). The sole caller, aml_spisg_transfer_one_message(), always passes a valid pointer derived from kcalloc(). The "if (exdesc)" guard around the memset() at the start of the function is therefore dead and misleading -- it suggests callers may pass NULL when in fact they may not. smatch flags the inconsistency: drivers/spi/spi-amlogic-spisg.c:314 aml_spisg_setup_transfer() error: we previously assumed 'exdesc' could be null (see line 261) Drop the check; the unconditional memset matches the unconditional dereferences elsewhere in the function and removes the inconsistency that smatch reports. No functional change. Signed-off-by: Stepan Ionichev Reviewed-by: Xianwei Zhao --- drivers/spi/spi-amlogic-spisg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spis= g.c index 19c5eba41..b2a916496 100644 --- a/drivers/spi/spi-amlogic-spisg.c +++ b/drivers/spi/spi-amlogic-spisg.c @@ -258,8 +258,7 @@ static int aml_spisg_setup_transfer(struct spisg_device= *spisg, int ret; =20 memset(desc, 0, sizeof(*desc)); - if (exdesc) - memset(exdesc, 0, sizeof(*exdesc)); + memset(exdesc, 0, sizeof(*exdesc)); aml_spisg_set_speed(spisg, xfer->speed_hz); xfer->effective_speed_hz =3D spisg->effective_speed_hz; =20 --=20 2.43.0