Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36682755rwd; Tue, 11 Jul 2023 04:29:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlF4hXUGUkEOX1gv20aNh1TGJVQhYf/bzuX8u5PLY4NLO29GdDV1yflPu5Ht/Jg64lgIT5W2 X-Received: by 2002:a05:6a00:398c:b0:67b:8602:aa1e with SMTP id fi12-20020a056a00398c00b0067b8602aa1emr20155753pfb.28.1689074968806; Tue, 11 Jul 2023 04:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689074968; cv=none; d=google.com; s=arc-20160816; b=lwiuknBD3SbgpoRjwbQ8Wyua6sbLxZRefHz0OFMoKj/skjTiI0LFoz/6KxwtO2mVAC AGzlyYt9QlDlDJO1u/paov81fCJQpL4P41CAw3U5ASvWQcd2vqoRYkh7YTcWID8fi9J5 ar0rTfQp0sKTfDVSr6HOJwb9OTKkRl1oxFJ8pa52Q5YHIEPTIO9FUiYFAMcp6+ocvVU4 tP5TrFg4xTRaqeqJMgHscz4NwoDdFE6zSmT0AAQ97h2qJSwxsd4YF2McFYkAhacFHt5r q+osJ4a5prBlQ2q2jruOdZeV5NSwgrJ7uvp7SyrgYf1JtN/hEfnNLaLevQfkEPXBpgw9 +9cw== 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=zkuM88eUpd4lwwF3xUixcqfuJbBS47crOoLESP2lR7s=; fh=xBut9vtegYDRcLjXNIseFeFa7BXxcdxb18VqmH8P67g=; b=FaaU/OhoRpJuZvu6dMCNYCfrprnF8z793/W/TgN++ewTpCjCqi0WT/HaiSgl2miTGI X5H6894EGR+Iu/g4+VjwkuTyqhlS9KsH3Nsp4Kqf3vemGWaahkIX6I25bhoIKry5oNqW GGzm0eDX9HvkIzGO2s8Lebqb7OvpZS/C/MiWevS31EcAs3dWCYvC6IqPcWqcV1XUK0S/ 8P42g9cDYAoEMjHWRjTX9xAS7XEEQ/rVsYeYg+R3fBumrIBP3LmHg8AnHuMopmZk/2lK qLW+sv3jvfoOwbSk/qJWL0dPhIPBbgZXbbPfSJBX6xvdm6Che13X8Tqz/RfUTxZMINji ce5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mTNTKDu7; 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 f20-20020a056a0022d400b00681f56016b6si1396950pfj.57.2023.07.11.04.29.17; Tue, 11 Jul 2023 04:29:28 -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=mTNTKDu7; 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 S231328AbjGKK7W (ORCPT + 99 others); Tue, 11 Jul 2023 06:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbjGKK7T (ORCPT ); Tue, 11 Jul 2023 06:59:19 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B17710E3; Tue, 11 Jul 2023 03:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689073143; x=1720609143; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=+zeFSMPLY2Z95wTb4g4rf/2HnStio6yWOtQ5rXla3Pk=; b=mTNTKDu7LA+Zt1wBLxFqLkILl1YdNUY6QDnzQYtnSr7jte9LeHFAftz2 8rMzbhp7MAt+jLSlRkCvmDK7uiTwJJEvPjLUlXBppb6bff5lk3XMJDQbc 3t50eAeQfSQjP6zL8FaNHlp+y3iUjZP9PFW24U+XIlJole21Uk0BBJKa3 wQ6VlOUI+WenLDX6jcnLSbMXKlyvhoIybxJC1bR0JGuipjwiYyHp5+0mv G/FjrEsO2GXOEM4J6kOH+aAPWbZccn2Eso4hK74NSBsZpmhjr6D6lgmVL kAS2NKLwMZE07iHahbWQUphJ6Erxhth3gGvyxvTpx53tZNv8XnYHqxOZ5 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="450948914" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="450948914" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 03:59:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="721055869" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="721055869" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga002.jf.intel.com with ESMTP; 11 Jul 2023 03:58:49 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qJB4v-001p5g-2V; Tue, 11 Jul 2023 13:58:45 +0300 Date: Tue, 11 Jul 2023 13:58:45 +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 03/15] spi: Replace if-else-if by bitops and multiplications Message-ID: References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> <20230710154932.68377-4-andriy.shevchenko@linux.intel.com> <24e71654-bc79-42ac-86d1-4e6100f6893a@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24e71654-bc79-42ac-86d1-4e6100f6893a@sirena.org.uk> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 05:56:59PM +0100, Mark Brown wrote: > On Mon, Jul 10, 2023 at 06:49:20PM +0300, Andy Shevchenko wrote: > > > - if (xfer->bits_per_word <= 8) > > - maxsize = maxwords; > > - else if (xfer->bits_per_word <= 16) > > - maxsize = 2 * maxwords; > > - else > > - maxsize = 4 * maxwords; > > - > > + maxsize = maxwords * roundup_pow_of_two(BITS_TO_BYTES(xfer->bits_per_word)); > > This will change the behaviour if bits_per_word is more than 32. That > is validated out elsewhere but I shouldn't have had to go around > checking the code to confirm that this is the case. This is the sort of > thing that should be highlighted when doing this sort of edge case > stylistic change. Right, I have to add this into commit message of v3. -- With Best Regards, Andy Shevchenko