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 733D7C3DA7D for ; Tue, 3 Jan 2023 10:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4Q1GrCJ59du2h0puSmV0cg1ql+FbTrfyCDAcQA8w9QY=; b=Bk4MAd+5+kTkm+LlyiMURv/fdB WB4xM+Ad3WRtp9MWup+RTGxOd5hktkY7XQ8JWcEBjK8w+6kwBAvXzlKCzbtFJEN0ffYK3+AjBUT+b wQ16/CLDHQbMUhqxm5FywzAEEA/JxXyI+uJOCFE77dy+tE/OUmFcGaC7GrP9UItWiYHfFSAs9hLfi y2nFV1m50zONrJTggWaJkUXyiRW913lNdlmDgv8DKzGQ1XdDUUkvKcZAYv8Wtk5HrSOOqCzytoFLd 5ZDP2e31PGPGSqF3Y+qv3z4fmuOZtmCX7Jzcmn3vMPEBj1p52bRacBOehB+veaq/Na7QvUyisiUBe Na8TPvCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCeuZ-000pel-Po; Tue, 03 Jan 2023 10:52:51 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCeJL-000eol-34; Tue, 03 Jan 2023 10:14:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4Q1GrCJ59du2h0puSmV0cg1ql+FbTrfyCDAcQA8w9QY=; b=vcyJR7ch1WQslr9S1ETk+Lpgk2 kdH2Ur811zj51/MrfKpQ+TMRNOAX2myEKZZRg8lbVH6GTtmqOuzjxduFr1/ufIFA2oAwyDavDk82n XxzaeZWOeqpEu6fhFWNm11QUrOTJ6ivXB5+0PQ29ana4QgltlEdX0YHCJPalKWGFtt6tC1SPJuDMf uqHfjQK3oi3HKlQnt2DHPALizEL2ujd/4Ui8I5dL/q6Z3Kjbtbme9kyEvIXUVTvULO+7ilVLXcOKM NuGl5jh7yLr2HV6vg9VP/QIEd4fn+noMAhKNBu/LQnvuwde58x0Kz7HvMw+v8JTAtY015ShiBcz06 nqFSZ4qg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35910) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pCeIz-0005CD-IB; Tue, 03 Jan 2023 10:14:01 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pCeIt-0001yf-7j; Tue, 03 Jan 2023 10:13:55 +0000 Date: Tue, 3 Jan 2023 10:13:55 +0000 From: "Russell King (Oracle)" To: Michael Walle Cc: Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jose Abreu , Sergey Shtylyov , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , Sean Wang , Landen Chao , DENG Qingfang , Florian Fainelli , Vladimir Oltean , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Andrew Lunn , Geert Uytterhoeven Subject: Re: [PATCH RFC net-next v2 03/12] net: mdio: mdiobus_register: update validation test Message-ID: References: <20221227-v6-2-rc1-c45-seperation-v2-0-ddb37710e5a7@walle.cc> <20221227-v6-2-rc1-c45-seperation-v2-3-ddb37710e5a7@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221227-v6-2-rc1-c45-seperation-v2-3-ddb37710e5a7@walle.cc> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230103_021423_247511_1C832DCB X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Hi Michael, Thanks for picking this up! On Wed, Dec 28, 2022 at 12:07:19AM +0100, Michael Walle wrote: > + if (!bus || !bus->name) > + return -EINVAL; > + > + /* An access method always needs both read and write operations */ > + if ((bus->read && !bus->write) || > + (!bus->read && bus->write) || > + (bus->read_c45 && !bus->write_c45) || > + (!bus->read_c45 && bus->write_c45)) I wonder whether the following would be even more readable: if (!bus->read != !bus->write || !bus->read_c45 != !bus->write_c45) which essentially asserts that the boolean of !method for the read and write methods must match. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! 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 DBB32C3DA7D for ; Tue, 3 Jan 2023 15:22:56 +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=WdTDJo6i7y/YaOrlvZs96fkypXm2uWIEyPD9oAaJl2Q=; b=qV0du3t5frISO0 Eh4JzDKgexJpgNdBszFYqix7CeAoIGurGKGDrs7MlcnCUtZwln/ZjSUIkLDpBRw+db93hPls2BQr2 yRDjZqTPPoWHvr70zOaDVaE1nDbqfMuvPS2s/hLoub9z31SjbZcBLE83hyVJujupMrI7S+NaC5hLn L+tDlx7RHHTcfibq/9NV+bImVZp+dfskXhd096+PKmCO+4HdpCugogZwxFrM67v7FIyyvu0By7qpC a26Wtfnyp/V8YDPDDkwZfwyRN6/6zZfhYtHujNFYBLgdG5E4r9fg4K1BnMkF6IO1lh8BiMQzB8Tq/ VUZL7uMPKwfWloec8QGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCj6W-002Ntx-L6; Tue, 03 Jan 2023 15:21:30 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCeJL-000eol-34; Tue, 03 Jan 2023 10:14:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4Q1GrCJ59du2h0puSmV0cg1ql+FbTrfyCDAcQA8w9QY=; b=vcyJR7ch1WQslr9S1ETk+Lpgk2 kdH2Ur811zj51/MrfKpQ+TMRNOAX2myEKZZRg8lbVH6GTtmqOuzjxduFr1/ufIFA2oAwyDavDk82n XxzaeZWOeqpEu6fhFWNm11QUrOTJ6ivXB5+0PQ29ana4QgltlEdX0YHCJPalKWGFtt6tC1SPJuDMf uqHfjQK3oi3HKlQnt2DHPALizEL2ujd/4Ui8I5dL/q6Z3Kjbtbme9kyEvIXUVTvULO+7ilVLXcOKM NuGl5jh7yLr2HV6vg9VP/QIEd4fn+noMAhKNBu/LQnvuwde58x0Kz7HvMw+v8JTAtY015ShiBcz06 nqFSZ4qg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35910) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pCeIz-0005CD-IB; Tue, 03 Jan 2023 10:14:01 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pCeIt-0001yf-7j; Tue, 03 Jan 2023 10:13:55 +0000 Date: Tue, 3 Jan 2023 10:13:55 +0000 From: "Russell King (Oracle)" To: Michael Walle Cc: Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jose Abreu , Sergey Shtylyov , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , Sean Wang , Landen Chao , DENG Qingfang , Florian Fainelli , Vladimir Oltean , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Andrew Lunn , Geert Uytterhoeven Subject: Re: [PATCH RFC net-next v2 03/12] net: mdio: mdiobus_register: update validation test Message-ID: References: <20221227-v6-2-rc1-c45-seperation-v2-0-ddb37710e5a7@walle.cc> <20221227-v6-2-rc1-c45-seperation-v2-3-ddb37710e5a7@walle.cc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221227-v6-2-rc1-c45-seperation-v2-3-ddb37710e5a7@walle.cc> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230103_021423_247511_1C832DCB X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Michael, Thanks for picking this up! On Wed, Dec 28, 2022 at 12:07:19AM +0100, Michael Walle wrote: > + if (!bus || !bus->name) > + return -EINVAL; > + > + /* An access method always needs both read and write operations */ > + if ((bus->read && !bus->write) || > + (!bus->read && bus->write) || > + (bus->read_c45 && !bus->write_c45) || > + (!bus->read_c45 && bus->write_c45)) I wonder whether the following would be even more readable: if (!bus->read != !bus->write || !bus->read_c45 != !bus->write_c45) which essentially asserts that the boolean of !method for the read and write methods must match. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel