From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 8CE4D364EB8 for ; Mon, 13 Jul 2026 06:08:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783922891; cv=none; b=OeiI8lgZiggxnPwHyQYRK53dmJkkukve5KsgF+EIquKfHfAaCHM9N1Kt5sJj8fugejgerUmmD3hVM3cnZAiyI3yJ3SsieDoLS6B3ewVJoPOE9V1cJqvc9K/Q5CvuAGcWRwkifTTef3c2klyIuRHfAxm0YGRfDm6xLuBUGcYhGW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783922891; c=relaxed/simple; bh=HDD6MOY/a6TR3gaTIoCre0KRPfakn/CZHN1rFYXjIf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IS3zHKNCx/NLDJ4N02pQu1OB6HcwPj3M2lus9JH5WgsPRazaQ94giLcG/hnWP4kPsi5n/OuhgHpbcvNjX+YLwS0cI3D7CwAhtn9yMKz0dw81XSEEgNLVlYviG7qlXLb8SQG+IZMfpIFRjXYH0HAhC3wxbRcfp9EYPJN1gsdCtmE= 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=X0lPw2pJ; arc=none smtp.client-ip=209.85.210.180 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="X0lPw2pJ" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-8423f236418so1793065b3a.1 for ; Sun, 12 Jul 2026 23:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783922890; x=1784527690; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=S5DuBYLMmVuyNVqyuWFYcjB12jP9JwOPGMRdlqI4bM0=; b=X0lPw2pJY3EAS+JM5rn0KTdIQ+LI2ueotJZhHF22YVfS1zsGbIwkOmJOZ5qnbNfKE8 RQYJbn4zkA8o1EzRc20kobrFwndubWbvwVdj6FvAL92DAJQh9s1y/cfTY+3GTORZ0LxP BuZi2GiBiC6r8S593NIqszRos5FTC17wNFqpa3ooI4rwJB7w+Y+15sOC1oDgcBA8ubg5 CO6ltKF+4H1JfXzY0QmFSQqZjTEF3Zh9cv3gGnhBN7gAO2AH1Na7tmGTMM3EEJ6CP3Ox Hyp2ic1KgcWOlZ2ndDpEe86OrhKzOvNJP8ctCPKpD0DcW/+93CAs3HOhJcAkPx7uQ5M2 ZEfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783922890; x=1784527690; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=S5DuBYLMmVuyNVqyuWFYcjB12jP9JwOPGMRdlqI4bM0=; b=JcI2hlevBIEvkSkjjNCISS0E94xTx8onTaCaTprid6vG0uY3j6sTlluTr12Mvv7/I0 GcK4j9PyeuOi4jUdZveZdu/ZbnoP0CnhVwlJfNEi3h2rT6Yaem5hBNcpRsQiPS2TttO5 BOstBzWPJHlnnOjlKO3JnSSxo+fU7eSeybi11R1aWYQYctN1camZmOY1+YI10kURJkVZ yumnXbpeKed5ry6wyHJ0p0eLiqzi/cU0u6t2z4S9Zx7R5xwi1rf1ephW6yZoEQhc+ZJ+ ySR07oQ9lCKcumFH5hgpC+pt9UuCbJ9WLndx25BsIugPu/9T+oPQVq5uPeunAYhc6HLD COvw== X-Forwarded-Encrypted: i=1; AHgh+RoMyGyLuLAmtETqNLbogJJ8GJHljVcQRKFwgryQGtxu1dnMupDV5tieQBlHc/iGy0DI/lJFGYi7stEnBmM=@vger.kernel.org X-Gm-Message-State: AOJu0Yzzs5HOBN1F6zo/giEmsBsigS3ABv5TMjJnOlPcUYPdk/Y3mrub 0zcX5LuqvlvMOsXne+RBvEN0Wep3QfS6PfMYOhOTepXgoqRjjgDyLOiu X-Gm-Gg: AfdE7clayH3rodpuk7S9P1taRqqppG21p941W3fsR+Heea7OSwyRJKPOmGVvEMOmqV2 POj56EW2SUIvR0GFKp4rFS9mTZQRJvavK3Ls0XJGA/0DgjHxMsOa+IlyEI+DoS1UFUyMCDRLRv/ CTzOQLXcgnYZ4F5DiSdctZdS+THwkwhkhxIhBK1j+8r+A04qCLoAULlxLKBwjq4GC5DXqvWlSXt ja7YFCkvaGjYYk8HB0Y5U3FwN2veTnLdlS2XfpC43gKnAStdIofsKqFIHrnKrDlrXCJ4G3U+uKT JDDAOjwHPZl50o0yq2fL4NeiDyMzgmR3GdTt+LYaFj6GDNnaKgokl+77LJ2LK4THh4wbaVx3fIK S+JeVoNar3Ich4FUIrqWH15J2ReKp3cayADl5jD+vHgFyjF8jFAY9AEL3aVL8iG2HBuTe4mJ0Ca Rz1g0eG2INvjLo X-Received: by 2002:a05:6a00:3d4a:b0:848:2f74:1d5d with SMTP id d2e1a72fcca58-8488971cb6dmr7128041b3a.67.1783922889853; Sun, 12 Jul 2026 23:08:09 -0700 (PDT) Received: from kdev.. ([108.180.130.139]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84a3c16d1adsm771795b3a.38.2026.07.12.23.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 23:08:09 -0700 (PDT) From: Babanpreet Singh To: Mark Brown Cc: Vladimir Moravcevic , Tzu-Hao Wei , Swark Yang , Prasad Bolisetty , Karthikeyan Mitran , kernel test robot , Julia Lawall , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Babanpreet Singh Subject: [PATCH 1/2] spi: axiado: merge identical if/else branches in ax_transfer_one() Date: Mon, 13 Jul 2026 06:08:06 +0000 Message-ID: <20260713060807.7-2-bbnpreetsingh@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260713060807.7-1-bbnpreetsingh@gmail.com> References: <20260713060807.7-1-bbnpreetsingh@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The else-if arm taken for RX-only and full-duplex transfers and the trailing else arm in the RX bookkeeping setup of ax_transfer_one() have identical bodies, so the second condition has no effect: drivers/spi/spi-axiado.c:433:8-10: WARNING: possible condition with no effect (if == else) The trailing else arm (neither TX nor RX buffer) is also unreachable: the SPI core only calls the ->transfer_one() callback for transfers that carry at least one buffer, see spi_transfer_one_message(). Merge the two arms into a single else branch and fold their comments. No functional change. The redundant condition has been present since the driver was added in commit e75a6b00ad79 ("spi: axiado: Add driver for Axiado SPI DB controller"). Reported-by: kernel test robot Reported-by: Julia Lawall Closes: https://lore.kernel.org/r/202607121827.djB0zLAj-lkp@intel.com/ Assisted-by: Claude:claude-fable-5 [coccinelle] Signed-off-by: Babanpreet Singh --- drivers/spi/spi-axiado.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-axiado.c b/drivers/spi/spi-axiado.c index 649f149617ce..c4bc7a50d6c9 100644 --- a/drivers/spi/spi-axiado.c +++ b/drivers/spi/spi-axiado.c @@ -430,15 +430,11 @@ static int ax_transfer_one(struct spi_controller *ctlr, /* TX mode: discard all received data */ xspi->rx_discard = transfer->len; xspi->rx_copy_remaining = 0; - } else if ((!transfer->tx_buf && transfer->rx_buf) || - (transfer->tx_buf && transfer->rx_buf)) { - /* RX mode: generate clock by filling TX FIFO with dummy bytes - * Full-duplex mode: generate clock by filling TX FIFO - */ - xspi->rx_discard = 0; - xspi->rx_copy_remaining = transfer->len; } else { - /* No TX and RX */ + /* RX-only or full-duplex mode: copy received data, with the + * clock generated by filling the TX FIFO (with dummy bytes + * in RX-only mode) + */ xspi->rx_discard = 0; xspi->rx_copy_remaining = transfer->len; } base-commit: 5f1b513690edf51727e6928b97705b6437f9a98e -- 2.43.0