Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35640868rwd; Mon, 10 Jul 2023 10:14:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlHG2I2kzswsNVD2VVG1zrrLhrwSPwZWm98DEuYOB4fnTfn6NVXKKAJAgeJX1Rb2B270oAQs X-Received: by 2002:a17:903:1c5:b0:1b6:8863:8c9f with SMTP id e5-20020a17090301c500b001b688638c9fmr11450026plh.6.1689009254955; Mon, 10 Jul 2023 10:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689009254; cv=none; d=google.com; s=arc-20160816; b=XRX2/1mMgti3nbnSupAbDdoacsRCU8+UWW5rufW6A7QNG9f0QKS9XUhU5vXxU4aQLK QL5hnZ9dPN/8lbKIWDxgDVnqmG4/oEtlqUtPVU2rIklqbEatoUc4WgzDElanM7OJZ4eX Ag9bfKrWgAIi7wXqmeTtqfpXkBQ4MG4h3vv17C2N9gjCnSiH478lCwcQpD4Z9vJaetMi JwJ5AETCZSAewAuUFXxoObSh/t9CypmDnQNEITv/qgFwTfqEq442ia8S53c9JelSHyF8 IbH87o23QQ85aBOum5gQNvOxcK8v/K6KVEyvE8JIUXDHYcGi+FBdmlhDXlEQCkYe1EgS iAqA== 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=vf+hINBxnQmKHxnN5HSIKugguSQ4LsFli3CGiHsqCYw=; fh=FR1TuMeeSkO8NrfcwD6Pn+GCDkn3IwyNRlohVX/xlRU=; b=zIiA9DF0uy4yMttrWW17Z+UNWMv6DeAQUgP56BhBaIiJHwxVVe3hB0HnsFlRPpERYd ClJ9lmgThEJmAJ8mnOzWJL+iXdZ1YHMwTCeEYbrvGFA3bcIxRFqLQ39/VZlYAm7SUhao iYZiGp7Z4bKEo6CkB4vpdYs5TaPRulhik19ERcU0F3ux35CahWEafCrnRhoJ0F4X6KQj mqV+Tj7+U1rpq4gPYkNy+hpGWZZZ5OHzl9V68UQTji8U1lQ5OtKu5LXeuuwcBgytKbWE g3DyFnZGpdt7eXxx1NqGHva95e+eV6MDk1yRQCPZkgbpm/j39YmUehJ2246/8TD72gIf caOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p7yUWoNb; 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 z16-20020a170903019000b001b9d5f07068si110535plg.585.2023.07.10.10.14.03; Mon, 10 Jul 2023 10:14:14 -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=p7yUWoNb; 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 S231673AbjGJQ5V (ORCPT + 99 others); Mon, 10 Jul 2023 12:57:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231418AbjGJQ5R (ORCPT ); Mon, 10 Jul 2023 12:57:17 -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 BAFF9198; Mon, 10 Jul 2023 09:57:15 -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 4A3D161130; Mon, 10 Jul 2023 16:57:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 013E7C433C8; Mon, 10 Jul 2023 16:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689008234; bh=IIro+PYudoCpsNeH2Llkq/gmEiqeLq8TswCPO5UnD6k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p7yUWoNb8JNe5qIMp13em9m8Rzsc1ghhta/kWFSe5/qi4pD5l1Kdd3nTIbhSAnB41 W8C1J2axQqESm/vo5JFAn+FCzJ9O92y9klVgFoPPFBocvgHANqPMFGPKWSy1cah2AJ 6B66a+6OSbM4vJnoAPeTpJQU1ZveA0PYXoTV6fut7sflD58+Jtel0GfBpq6p2nXiCt M0xsvZQxCC0EolQkXizKejaZaayP6VSNsobrYWwUH758W9Nr9zRBh1oYMDG5FsShL0 zQI22BV9Iz/Ww1LFbCTyWKHKLILGMYlknCcvjk0BqOW9V/aTLFc+59pabBeheGKNwr 5euI/OtpKjArA== Date: Mon, 10 Jul 2023 17:56:59 +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 03/15] spi: Replace if-else-if by bitops and multiplications Message-ID: <24e71654-bc79-42ac-86d1-4e6100f6893a@sirena.org.uk> References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> <20230710154932.68377-4-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fI+fdz2D5/EEE42m" Content-Disposition: inline In-Reply-To: <20230710154932.68377-4-andriy.shevchenko@linux.intel.com> X-Cookie: Do you have lysdexia? X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 --fI+fdz2D5/EEE42m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --fI+fdz2D5/EEE42m Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSsOFsACgkQJNaLcl1U h9A2Ywf+KXUPki4n4OHbYfUF8KSXIYSkZGLAugrUbcI1dW/wY8+0fLYP8+4w9V+j f81LA7/NDs1aRdnIEAvy6JRWhsUGKyHHKw42xpXD6MqtamipzOaVSYaL2Hr3ZuqC 22p4KuNl0BAuHc+iyOWLpX7/btG8mweyZNWYjDbaB3duv4usx8Pis5kQu9HrTvfw e1repiQ4pqd5PGfhReO1fGbR6QIhoswiEm/9yfkZTQs1HAIOpRAePL2XPZD3sBuj pehvlOvP2yRq1fOxYVWGxXH8dhavS5t/mUlzyTYI7VxMD2HUZD1EiZ2uYcmntUEl y8tiLDQIFQRb++F+IFf0SjU+vXe0UQ== =tuUl -----END PGP SIGNATURE----- --fI+fdz2D5/EEE42m--