From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC66AEB64DD for ; Tue, 11 Jul 2023 14:25:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D03AAEC5; Tue, 11 Jul 2023 16:24:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D03AAEC5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1689085530; bh=g5docwgn1sedQFCIUNy5vO+RB2jnG5735hob/X5gUzk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OMTHYS/jpXktSmEQKMHAhGGoYPFzzdg5YPbQ9OoxyTo0t0iFRQapq9KdZWfeCp7J6 E/oHMi9qanyewWTw/abcI5nTDuu2BG3KouLJcXf9ERbSSFO/dMav6tJvoXRIJmtN6F zyI/8ztq+cxhK1ABn25eQsTQDVaIEB6RG2qEZvMU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A32C2F805F6; Tue, 11 Jul 2023 16:21:54 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 35614F805F6; Tue, 11 Jul 2023 16:21:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D6822F80236; Tue, 11 Jul 2023 13:01:41 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6446FF800E4 for ; Tue, 11 Jul 2023 13:01:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6446FF800E4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=gn+op04x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689073299; x=1720609299; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=g5docwgn1sedQFCIUNy5vO+RB2jnG5735hob/X5gUzk=; b=gn+op04xEtU/Y7R7NcC64GkAbjscdCuyYF2kgK9rjRPB3OVZsRs5oQsR l/Fmb0Qu1AUQE8DfKEfiOswZ5yjccMWyehu+IjdTtC/VTtmkSNU6sTfLZ t3AYX+NSZ7xOB+J6IGiMk8jKlErweRNuu4m98qwI/lt3xvzc/tAYprF9j t/+EENxX9dtY5g7QUk7j6iGZP7oSygtMguXVFEIyaiHL1WdldRXB32STN 58GN3ROxXJ5XtNfq+Q5XFQSs15bE7MwAwjHGBeOQMWmCnh1qtNUZnu1cL Sw+JxA/Xn7qvm66tPV1nb4ilHllSZdjO8dBcM17IVWvXlFr5mRrmyK5aD Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="368087972" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="368087972" 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-MailFrom: andriy.shevchenko@linux.intel.com X-Mailman-Rule-Hits: max-recipients X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-size; news-moderation; no-subject; digests; suspicious-header Message-ID-Hash: I3APFRGDMVH73FIJT7PPK4HJGAP66ZU2 X-Message-ID-Hash: I3APFRGDMVH73FIJT7PPK4HJGAP66ZU2 X-Mailman-Approved-At: Tue, 11 Jul 2023 14:21:47 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CF90EB64DD for ; Tue, 11 Jul 2023 11:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VJGEdgT6+g6ovU/sM/bvZoxywu11tktASzhV6kFxaAc=; b=aU/sJHvCftFhFU gumb5P5/sZYwnOMiNSmHHnEmURdB6qEMIT0zkbOCI+ZemSnsALnkKR5JjQx4Gm2o4vskM25PylbKS nH0jmNxddf4CQz1Lh3WCyAPGeA0gks+SxrzxpZmJrjYX0u+OKkbHXD7bDZoO1O5NkWKAj8p1C4tyt 9uIMqYggAWB6tAR7TFpOmWwvGUrUjCa6YXB7T9kRcvM3AKdMfY0kwab9iylUoainTP5a3fveW33xg oZSP7Cdud03ajLfeCr55ncsx9evrj1EkhwpKD1UsgwpylL4YiNGV7A7Z9EVzx8hPQ0HpQlTuDY4vU Z0szFnc51qwhHwESs59A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJB7i-00EiJZ-0b; Tue, 11 Jul 2023 11:01:38 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJB7f-00EiIq-0z; Tue, 11 Jul 2023 11:01:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689073295; x=1720609295; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=g5docwgn1sedQFCIUNy5vO+RB2jnG5735hob/X5gUzk=; b=S4JD8JGVdhC7U4fxxI10woMBXFGSFmc6RztWeLvNRXdrHzaU/4Cg62N7 uWDY9/ZF/m2RxTvNiS259QMUJ3ypVBU30YG2Zdn5Fl7zg3ZhIQfQbNwsq CywVaPHzueARlBtxdS/xBeuhOVlgsn+TXpkWf+RoMxMdl4lyEULbMrAeu nebf35PKswtOx+QUFdMJfNJrGQ5fb3aUcBp1mm4BQzOp/Y8PRSDnQVOT1 XDSJGYGmQrRQAfKtB8A4Y2dXHa4QA50VvEI8B4w1gHYQ3GNzXYlUxtEWY OejQ7efcw33jyIgkVVOBF8J43ZCcYtVHxtP6OAgmZOYK4pevSpkipk7NJ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="368087971" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="368087971" 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-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230711_040135_422284_6EF9E290 X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 884E2EB64DC for ; Tue, 11 Jul 2023 11:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fN9C3/lb1/BUwHrUIpzJWYxSPvEryeu9303w5HoKDFQ=; b=g1/TUczqCCbn8K tw2o4eino0+r9/VY19xdPv9hLkjvjaBeCLv+/5rubyF3BgTytODVkxFptY69UQEQOlLOfWH1WUiKs 9Smci954BjebbA3eG+HdmmLgc7Dn/UPzPOCsNTpgIN+G/r9nXm8Hs4/yRef3Y3OSHPITryCcKVvrD 5htQ4hMU+s5GmrLqA1wPRuBZcHoDOiJO3rPBQDk6mEXyEf330oTVnOsDKxaGsJCyUgaBDDxvW+xL4 Vjxt85dkf6wN+dq+SmAZ4V2/kIKAEsTD5N+dcY4niB4OyA7sGmafMcPPM+jEzx9NUkQfBbuIVu9Vx a/PrSAUi7lQ4DIliyWUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJB7i-00EiJq-2z; Tue, 11 Jul 2023 11:01:38 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJB7f-00EiIq-0z; Tue, 11 Jul 2023 11:01:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689073295; x=1720609295; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=g5docwgn1sedQFCIUNy5vO+RB2jnG5735hob/X5gUzk=; b=S4JD8JGVdhC7U4fxxI10woMBXFGSFmc6RztWeLvNRXdrHzaU/4Cg62N7 uWDY9/ZF/m2RxTvNiS259QMUJ3ypVBU30YG2Zdn5Fl7zg3ZhIQfQbNwsq CywVaPHzueARlBtxdS/xBeuhOVlgsn+TXpkWf+RoMxMdl4lyEULbMrAeu nebf35PKswtOx+QUFdMJfNJrGQ5fb3aUcBp1mm4BQzOp/Y8PRSDnQVOT1 XDSJGYGmQrRQAfKtB8A4Y2dXHa4QA50VvEI8B4w1gHYQ3GNzXYlUxtEWY OejQ7efcw33jyIgkVVOBF8J43ZCcYtVHxtP6OAgmZOYK4pevSpkipk7NJ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="368087971" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="368087971" 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-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230711_040135_422284_6EF9E290 X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.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 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5031CEB64DD for ; Tue, 11 Jul 2023 11:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zmlIBaL0XanVOQ16p84V2PJwupF/hKH2c1BnOAgMTMQ=; b=19qPFDrMSO9TGH +2ftGqtOUEu1KDa+bZgM0l0N9Ma3oi+0BR3n1SpwiN5BTGZp1CqZb1DIOYXnPCS3UsH8Q79/JCL5X 7oYmhbamoefaOZ05gD5zddSsIQTv1b8ytgndxvBhu5BQqXfuPfG/+5ba+Uc9489V0OgIgwalUVTk6 eEqH4NEYX6O6MM3gNBzjGYV9XTLs3KZWDGtzXFJeMaVr1unWAW9R3vkuczzo+zqUXM+hgGnDUxUm7 lzA6rOL4w5FwfjiJqb5HIiL1UJ8Js4DSJtEMi9rP6lJ/VHRV30PQ32WRlIkjv+unfu+caus66ySQQ 8daFG5/mQE+Y6qj34+3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJB7j-00EiKE-2W; Tue, 11 Jul 2023 11:01:39 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJB7f-00EiIq-0z; Tue, 11 Jul 2023 11:01:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689073295; x=1720609295; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=g5docwgn1sedQFCIUNy5vO+RB2jnG5735hob/X5gUzk=; b=S4JD8JGVdhC7U4fxxI10woMBXFGSFmc6RztWeLvNRXdrHzaU/4Cg62N7 uWDY9/ZF/m2RxTvNiS259QMUJ3ypVBU30YG2Zdn5Fl7zg3ZhIQfQbNwsq CywVaPHzueARlBtxdS/xBeuhOVlgsn+TXpkWf+RoMxMdl4lyEULbMrAeu nebf35PKswtOx+QUFdMJfNJrGQ5fb3aUcBp1mm4BQzOp/Y8PRSDnQVOT1 XDSJGYGmQrRQAfKtB8A4Y2dXHa4QA50VvEI8B4w1gHYQ3GNzXYlUxtEWY OejQ7efcw33jyIgkVVOBF8J43ZCcYtVHxtP6OAgmZOYK4pevSpkipk7NJ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="368087971" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="368087971" 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-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230711_040135_422284_6EF9E290 X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv