Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36672324rwd; Tue, 11 Jul 2023 04:20:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlGYOaFQUFk3AGgZAn3qU5/Ejqu8w0NyZUaA/ecT1bkm422zbX8i257u1InalJOgzMWuUFRD X-Received: by 2002:a05:6a20:7f99:b0:131:39cc:4c21 with SMTP id d25-20020a056a207f9900b0013139cc4c21mr8499208pzj.56.1689074420519; Tue, 11 Jul 2023 04:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689074420; cv=none; d=google.com; s=arc-20160816; b=a8YBY43HbzW1/W5lWgRv3MyIcYf2rK4YHLteKogF3CyACiQxJeaRqhcW9WYQcjfcsW YJTBa30wFlfkZ2BvVV36UKBjf0QLWYI+m3BWE5KaV0Wxdn3jDXUMCH/AfvjsWmQ1IbQe AbeQF3XklSMsIsAgmSnT/0RFgTIT6IhWJViYRm2Vn4rSShKL5k4ZRSyUjjVTzNq2l3Ff 8fzWOS3sWH9KvQtbpimD+AkNSn/PdVM8nKqrxNNzdy8rSPCJ+8OlYBMfIlDgXAMbS8Z/ A3aSDfsOQgYkw1JwJiR/8xPXKR6QF34n3ZckhthOEg5eH1SYoBP1p7oxGFZ+NEmQariG 4l1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zSwpf6BIANOM40IZH5A99t060WoeRwXcMpZfwrTn5Mk=; fh=xBut9vtegYDRcLjXNIseFeFa7BXxcdxb18VqmH8P67g=; b=AkccrJ9f80FHUuewIyhoE2YNdLoz2x+JpjZBG4L9SuDowJoRRie0CfZatfm4hVZRqu m4wPWHQqaZYQj3wGGLga2/Y/fXD+LGB+hUh3raopmhawTGuASBR5aDUHNmmnKq+ZDFoB dP4a5rwYfYDs/KD4n0BjKLfSvfL632iGlYXI4Ye+QGdLSM7875Ev/UJKn/NQxZnpm0IR 9G/3G3+U2cts1EtA2gnJb9M2pnufUJbxGVjVJaajtjchnnmv4C+cScF7hin7amxZ+FTY G8+gJfHpXivxkP+DdccJkIPpoV/BWbKaYJS7PiohjdSgNJt+jyR+esEu0jW8/uosDwe+ dJ3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UAHxZlT7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a056a0024c900b00682a8dfe64esi1386657pfv.301.2023.07.11.04.20.06; Tue, 11 Jul 2023 04:20:20 -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 header.i=@intel.com header.s=Intel header.b=UAHxZlT7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbjGKLBi (ORCPT + 99 others); Tue, 11 Jul 2023 07:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbjGKLBf (ORCPT ); Tue, 11 Jul 2023 07:01:35 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81ADDE51; Tue, 11 Jul 2023 04:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689073294; x=1720609294; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=g5docwgn1sedQFCIUNy5vO+RB2jnG5735hob/X5gUzk=; b=UAHxZlT74CdhVAFszHf8/YP/qnudI48ytjXycAzmc5G/W/3vkawJt93q O67ArP6c840w44lX2ZEAKAr30tUJSdH+8QyH9DQ4a4FZimsW5DKPBftPO CjV6Qv88HHwPu10D2kVHPOlGHnzcBAKejOUaBeGARL0uNvQ9F+j4NZgWj 7RQ9wV751zxO9F9mTVNI2MM19GTxWuXJsWY/c4b+sEWHsWCildiHim/QJ pDlgGTvzxCq6GrXeXq7dH8gTKA8ngDR3aBmSx4O80yjOmzqe6GcX9+VJ/ A2k79fsZjqKZbmdeacQPDRxlsgcZW/cLTEjyOJPLiFJ+YIQ7pY26zk0Xo w==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="368087964" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="368087964" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 04:01:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="715143826" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="715143826" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 11 Jul 2023 04:01:17 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qJB7J-001p8E-30; Tue, 11 Jul 2023 14:01:13 +0300 Date: Tue, 11 Jul 2023 14:01:13 +0300 From: Andy Shevchenko To: Mark Brown Cc: Cristian Ciocaltea , Yang Yingliang , Amit Kumar Mahapatra via Alsa-devel , Neil Armstrong , Tharun Kumar P , Vijaya Krishna Nivarthi , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org, Sanjay R Mehta , Radu Pirea , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Tudor Ambarus , Serge Semin , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Matthias Brugger , AngeloGioacchino Del Regno , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heiko Stuebner , Palmer Dabbelt , Paul Walmsley , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Max Filippov , Steven Rostedt , Masami Hiramatsu , Richard Cochran Subject: Re: [PATCH v2 04/15] spi: Replace open coded spi_controller_xfer_timeout() Message-ID: References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> <20230710154932.68377-5-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, 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: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 10, 2023 at 06:30:32PM +0100, Mark Brown wrote: > On Mon, Jul 10, 2023 at 06:49:21PM +0300, Andy Shevchenko wrote: > > > Since the new spi_controller_xfer_timeout() helper appeared, > > we may replace open coded variant in spi_transfer_wait(). > > > + * Assume speed to be 100 kHz if it's not defined at the time of invocation. > > + * > > You didn't mention this bit in the changelog, and I'm not 100% convinced > it was the best idea in the first place. It's going to result in some > very big timeouts if it goes off, and we really should be doing > validation much earlier in the process. Okay, let's drop this change. > > + u32 speed_hz = xfer->speed_hz ?: 100000; > > Not only the ternery operator, but the version without the second > argument for extra clarity! Elvis can be interpreted as "A _or_ B (if A is false/0)". Some pieces related to SPI use Elvis already IIRC. -- With Best Regards, Andy Shevchenko