Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35757238rwd; Mon, 10 Jul 2023 12:06:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlE3XmGCCKPPKtexqXE0vuvx7JSX1hOhuRdxS1oYjIUPlnQXjR1dPEjRcqVCknSmEzGa3Wut X-Received: by 2002:a05:6a21:33a0:b0:131:eb99:d518 with SMTP id yy32-20020a056a2133a000b00131eb99d518mr1354756pzb.41.1689016012932; Mon, 10 Jul 2023 12:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689016012; cv=none; d=google.com; s=arc-20160816; b=Cz0/onZI7E/gEsLWqMj0eTghgzlcmwugQisaMCLRpdTM1VoRZe16DujTFcxgZ3To62 HkvO72f0gjNFyaz/SNy5+2vnFRC2LIIBe8/9nz5cfhDWgMZhcnXwHe96vjB3MdQxOU4t iort58NRg0qw6VOEJDh31dKN4ZSdOWeQ7BbagSE47WSwLx6ov31l7HeamthU77etwetS grBeafVzuVXjJRYv3UOs7ruXyGF6VY034CE14pOmj/V6aE4A9YcuoPlpomKeTLwJw56W zflYrLL5h8jyYu9tautoWPBCuvrU/vVk4HDq7rb5aERmQ7vbCAbKtPgplcs/nqk6eKBK EdFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XsZNfqD+qCYxTR5DTiRhkoewxQaOjpqIrkrlAx10mbs=; fh=FR1TuMeeSkO8NrfcwD6Pn+GCDkn3IwyNRlohVX/xlRU=; b=gp6lPaeWEsMrbZV4G71LqURxSIUWQ7U0dJ/4lyI0joB8rjgokprdjJexoedjqAr97Q K9M2aDgqrBhRDewEzGYCPggFPr2eXAp0arBFmgMnnRBpHDku9JPUmKXH2nzDJHVcd65h /K0d9taZaMNxQTgfSimCxIDsJ+aLiO26rXGNa85KO0AxSEaBv33mrwM24sbr9pRZ5QjU w4NUehyKyeZhn9JX5kHaPYFS0E75ppVCXVNJ6D+8LmC4sxsBQYz92p1dh+bXUYA8pgT1 OpFlSZjF0mJQD86M5SAyBHgGAQcgskVpmXhmPPInY14AKsSeOVzlYW9invCOp3Aos0cf U6bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t2qoXUnS; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j64-20020a638b43000000b00534e68cc8f5si86672pge.270.2023.07.10.12.06.41; Mon, 10 Jul 2023 12:06:52 -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=@kernel.org header.s=k20201202 header.b=t2qoXUnS; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231894AbjGJRav (ORCPT + 99 others); Mon, 10 Jul 2023 13:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbjGJRar (ORCPT ); Mon, 10 Jul 2023 13:30:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E48095; Mon, 10 Jul 2023 10:30:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D15E96116A; Mon, 10 Jul 2023 17:30:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B727C433C9; Mon, 10 Jul 2023 17:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689010245; bh=8daJmCsRggn9xziEjmtzfB/+TEmSHGqfTrQOxt4tg1U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t2qoXUnSHuV+TbWU69K3xBxeG6UAs5r8JvEuI+8qIwEdTjDJX9HPZn++uZHMNIQaD 86g42vDDjo+xgTS9/scrmuWADvN0R48PLgUPQA8lzB5uIE7gczU7YsGie2UjWiD40Y soETF0P1p+D4lt8Jw6O9FNAf5+tzNnhQ6U1GTpxDacTetMTQd4tHQO7p92dxIvPKDo vCacGl+XShxk3g8tnOVtoXP+PJNeX8VjY17MSNUMQyZxhOaFwy902auPvHxrZTYMla iILw2xA2Gbqp0/Iihh6sd5pNaL6Cxsx8tHLlJ00pYbON+m3jOCfuniILkrN7AJJX38 Zx5bmFaJNvHKA== Date: Mon, 10 Jul 2023 18:30:32 +0100 From: Mark Brown To: Andy Shevchenko 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: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IbZ/DrTRficzGRpW" Content-Disposition: inline In-Reply-To: <20230710154932.68377-5-andriy.shevchenko@linux.intel.com> X-Cookie: Do you have lysdexia? X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, 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 --IbZ/DrTRficzGRpW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. > + u32 speed_hz = xfer->speed_hz ?: 100000; Not only the ternery operator, but the version without the second argument for extra clarity! --IbZ/DrTRficzGRpW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSsQDcACgkQJNaLcl1U h9DEzgf/dy9EpgGVS5JKG+2sOnEEWzJ1/z92vL5sQoHWJT0M7rzfGdRlGddYvj2k yOJg6fvzzY2vbGoYuqkSlYi95WyUFmwqjd+BwayzJ5gH0xKRXo4MwCHKIET3z44z 8pD55r1ow40GOeztLTsLwgiADUQSMRLm/Y33rrf2I1J+/AgrEV6V+oZnbWsmoI+I 0QS2ZIQk8m1oDghyOmEOzW+jqJQbDR6HAP0L9dUbd/zcJK9LDXHE5hepkLjQbC6v oGrJJVbs+IYFbaNJrDNtxtF3JwlAtVWWSten66FG3fmreSDQwcKATVKiHWtLlhJb a/T8TlFW3ianwYVf2yMOEojOIbZvQw== =d1Us -----END PGP SIGNATURE----- --IbZ/DrTRficzGRpW--