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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA233C433F5 for ; Wed, 9 Feb 2022 17:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238234AbiBIR2R (ORCPT ); Wed, 9 Feb 2022 12:28:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238249AbiBIR2J (ORCPT ); Wed, 9 Feb 2022 12:28:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C78A4C05CB92; Wed, 9 Feb 2022 09:28:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5F6A261AB2; Wed, 9 Feb 2022 17:28:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A8B2C36AF6; Wed, 9 Feb 2022 17:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644427688; bh=YmAIxEno5LTUIboDX0UvlUq4mkk2NIWuBpWmhDK76M0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dQ7+p3ddtsYKQd7tlYazVVgp4esDpAj4OSVjgo1r0CwR1a22sr3UoAL3Awbq95Yky pjG9H8jZ4vm6uqFLKaBDGAcJcDWqZ2qliq2WyBOoKXKy0NfiUfNvpI6QOyfxkNn6sa nC6yXZC9DMiO+DYLINHAExWZb4JYnnB60ZepqoGy/38WxO7Ay9zX5v9caH4+g0gdPa cAd1gzmjYGX1rECoBztUb1hyame+h/DVINUA65a2DP38l/pKjRQxQsqPj7stapH91c yorE+35XALs+stkpY2hiPi3uJMDyzcOZgkOvtLTdxNzdNDoxc/JfBAqirG5do6Ylrt QAiU2St2etqaA== Date: Wed, 9 Feb 2022 17:28:03 +0000 From: Mark Brown To: =?iso-8859-1?Q?Andr=E9?= Almeida Cc: Sanjay R Mehta , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Lucas Tanure , Nehal Bakulchandra Shah , Charles Keepax Subject: Re: [PATCH 3/3] spi: amd: Add support for version AMDI0062 Message-ID: References: <20220209165733.43134-1-andrealmeid@collabora.com> <20220209165733.43134-4-andrealmeid@collabora.com> <2126f6c0-fd6e-1f8e-b450-837270d03d31@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VqjBKmlu1rbTJJPM" Content-Disposition: inline In-Reply-To: <2126f6c0-fd6e-1f8e-b450-837270d03d31@collabora.com> X-Cookie: Disc space -- the final frontier! Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VqjBKmlu1rbTJJPM Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 09, 2022 at 02:18:59PM -0300, Andr=E9 Almeida wrote: > =C0s 14:14 de 09/02/22, Mark Brown escreveu: > >> + > >> + if (amd_spi->version =3D=3D AMD_SPI_V2) > >> + amd_spi_clear_chip(amd_spi, message->spi->chip_select); > >> spi_finalize_current_message(master); > >> =20 > >> return 0; > > Why is this one not a switch statement - what happens with v3? > A switch statement should work as well, but currently v1 does nothing > and there's no v3 for now. I think we can change for a switch if v3 > requires to do something here as well. Please write it in an extensible fashion now so people aren't tempted to add an if/else tree. --VqjBKmlu1rbTJJPM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmID+aMACgkQJNaLcl1U h9DPVAf6AvEeBLe/3krwEBvUdey0nmwvrvQET78+T836ijYPeHfrW1kHcPbH0sVy BZS8DOyz7DDECDqyQ0XaKWnIs7XrlZyLI+PF8wMvwCaYHUBnSAp0TZKnONZ4pNF8 NuvY2SNpfPaVG+hAPlQJQa4NgTGyFwgf7fH8DMJvALCw831QFVCSOnwFmDcwxKoQ BT3WPmAK9FTXxTQ2ZxqCjoFhs5PyS/BR41cTozRweL06XukMMaaXK6+zWyTA3mkH FnVGJbMvNpGH/SLs6AQfT+2OU3MhkoPieJSEG8coOrU3/WWElCRoYjnrrQzZHRFc 4rUfUK9QJCjR0wvGzQB1VNbBHKrTKQ== =yc+e -----END PGP SIGNATURE----- --VqjBKmlu1rbTJJPM--