Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11636602rwl; Tue, 3 Jan 2023 02:21:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXtYhIqN7IvF5ZCuF4XRjT1ocNckM440hvKybugMe8RIuqDQQkHUm9uRVMfliQqnkAnTr6wV X-Received: by 2002:a17:90a:5891:b0:226:620b:6ae5 with SMTP id j17-20020a17090a589100b00226620b6ae5mr9595499pji.22.1672741306077; Tue, 03 Jan 2023 02:21:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672741306; cv=none; d=google.com; s=arc-20160816; b=yG26Qe19uy/kzT4qWNWT8UCOj2lyWoKRsurKl4NEvk/dMGU0jc8vcY4lObPu7VlsAw e6eQMxHq4JHJx60BRMIFbGTpNKC8DqqZW4e3L7iLJSH3KM0OBppy6OWxg2Eee3WFOkXH Q6L1cK+mBqU/xMnrU+Iainy7sHAb+PnOGP1dATFxiHohVyIqEKZzTlpY2nBDryPYqSHP P+LdPn2vriCg6VFp5SsHKp8GWv7dmBTBz6jPpVZrXBapnDTB4fx9M9uVDhAdmfZ3tAke pr3uT9dXjASXk5GSEV64Trb9i39QsrmM4jJm63MXb5m4UgPe1I5ZUyskOqdjX7HcyT5u IcAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4Q1GrCJ59du2h0puSmV0cg1ql+FbTrfyCDAcQA8w9QY=; b=XeDWByEFCM0t3P7nczwHUfHRaU3BICveedT3tszPo/O5skYG3YfabGrt0x0wZoXTjW eLO7anhpinmUBx489oMA0Z8qmmaqZOhsrgya7crDt/1xPwFjj1nAwG/mYQ+hqb1QswQ6 z4I0owyv0DTBHyLjqi27U3H7cjG6H5lwQ34Bmdrz9vEiCpsRcAGTiXZ0pMSt8oE1Tf1l wTL25RiEi+DsvduYbm++PQnBFf9foTj+E7PUDCvPEqq+ResePDfKUoHVZ2asOIzK+hcc Den5KxD+DoXn8hnK/oDqulqxZUq8IQ+mxnKoEMSchiDBrodiLotOZvOAIihRrR7HYQuJ 9c4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=vcyJR7ch; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020a631403000000b0045f7fc4b812si33634925pgl.295.2023.01.03.02.21.38; Tue, 03 Jan 2023 02:21:46 -0800 (PST) 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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=vcyJR7ch; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237327AbjACKOd (ORCPT + 61 others); Tue, 3 Jan 2023 05:14:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237352AbjACKOU (ORCPT ); Tue, 3 Jan 2023 05:14:20 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D148E81; Tue, 3 Jan 2023 02:14:19 -0800 (PST) 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> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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 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!