From patchwork Sat Jul 15 01:04:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 120722 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2836523vqm; Fri, 14 Jul 2023 19:46:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlGVmlTFWj3dHw1FdvxJoJP1pMbYl1bzFQSV+5LcTSC8Ayf+5riux4yvtlxMT4VEDgpris68 X-Received: by 2002:a17:906:9614:b0:993:f9d4:eaac with SMTP id s20-20020a170906961400b00993f9d4eaacmr5039327ejx.24.1689389219562; Fri, 14 Jul 2023 19:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689389219; cv=none; d=google.com; s=arc-20160816; b=c9/iXoeNo/eydq3T/Xu5vO+ZHgqH0tQZDvCXgR43PlpV/tRzNqXV+IFzQG/Fdc89mg Qdl9eGyefjHb8vzTbIbKfPLfxUdNMTq77mXBOBZbDZmUZgj0jy/kMQSVJ7ggWcvzoRMG bEOSpu4sMyITnVruZBsFvTqNQim1pDiOAn3TGdhxbYfF2CszfzupavN5GTWp2ddwUYAd 1FJqth0wMV83R0XoRFwSbjQe5qPWcof+N6N2U02aLzO1sXv1XtBkY9ROuBSgf6cVolao pjghUsi/vuUZx0BjRGTw46babdFQnCwcLWyW3OTqYj6i8yeklFkz9kv+F9EwwZp8tgGp BRXg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fAtEu7Fuh9Zpf8JH8xxmJ+z5LjVk8hBYwmDaFinb864=; fh=8SPOXdXcsbbrdLjCtKFrhdDDaSSTCLFzjvpt84tri9w=; b=ZbXqlhrdVL7KvtcvIAd5WDP4vpAdSzNRZNmtZC5t/l3wODHSyCeWnHLBruouFL9OBP jVlBYRjRUhRLZQh2KIAnylJtar/E/9UT2rhSrw6h8x6+Kq1W7Zhaa5yDzvUUTGuGFArk FD+UWaHT2JcgpY4TxNYk7MqYQw9sU8f1xuC6P9EgVCmPL0DsX4zM+GPmJVz5TqvWaVKO ZGlOC462LEslzpDTzEgZP0Q6rHD7NakVoysBUtNIwk+DZF5qYCMXHLjc+RMZlFHDkmC5 q5G6sk3mQlGoHjMmRYX06XkfFTJcaV/SdWtWqIbO+NoJyM0PoK6ZjUO6CckGFoIQc+3F 8EMQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a1709060a0a00b0099364d9f0e0si3091160ejf.540.2023.07.14.19.46.36; Fri, 14 Jul 2023 19:46:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbjGOBEp (ORCPT + 99 others); Fri, 14 Jul 2023 21:04:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbjGOBEn (ORCPT ); Fri, 14 Jul 2023 21:04:43 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1B7963AAF; Fri, 14 Jul 2023 18:04:33 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.01,206,1684767600"; d="scan'208";a="172657821" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 15 Jul 2023 10:04:33 +0900 Received: from mulinux.home (unknown [10.226.92.194]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 14F9340C4DAF; Sat, 15 Jul 2023 10:04:29 +0900 (JST) From: Fabrizio Castro To: Mark Brown , Geert Uytterhoeven Cc: Fabrizio Castro , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Paterson , Biju Das , Lad Prabhakar , linux-renesas-soc@vger.kernel.org Subject: [PATCH 05/10] spi: rzv2m-csi: Replace unnecessary ternary operators Date: Sat, 15 Jul 2023 02:04:02 +0100 Message-Id: <20230715010407.1751715-6-fabrizio.castro.jz@renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230715010407.1751715-1-fabrizio.castro.jz@renesas.com> References: <20230715010407.1751715-1-fabrizio.castro.jz@renesas.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771452990344911145 X-GMAIL-MSGID: 1771452990344911145 The ternary operators used to initialize tx_completed and rx_completed are not necessary, replace them with a better implementation. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven --- drivers/spi/spi-rzv2m-csi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-rzv2m-csi.c b/drivers/spi/spi-rzv2m-csi.c index 1c65cd5f2039..038f1486b7d7 100644 --- a/drivers/spi/spi-rzv2m-csi.c +++ b/drivers/spi/spi-rzv2m-csi.c @@ -439,8 +439,8 @@ static int rzv2m_csi_setup(struct spi_device *spi) static int rzv2m_csi_pio_transfer(struct rzv2m_csi_priv *csi) { - bool tx_completed = csi->txbuf ? false : true; - bool rx_completed = csi->rxbuf ? false : true; + bool tx_completed = !csi->txbuf; + bool rx_completed = !csi->rxbuf; int ret = 0; /* Make sure the TX FIFO is empty */