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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7A8EC77B6E for ; Thu, 13 Apr 2023 18:08:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 30EA485A4A; Thu, 13 Apr 2023 20:08:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="d6Fra/ku"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0592F85B19; Thu, 13 Apr 2023 20:08:55 +0200 (CEST) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 45AA585A42 for ; Thu, 13 Apr 2023 20:08:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=nm@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33DI8nc1097524; Thu, 13 Apr 2023 13:08:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1681409329; bh=OiWIU1ym31lB1CtKogrLvOhxYD2MSUx2hDN5vUJKUak=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=d6Fra/kuDQtc1WtrAeD7XydQqJoQWtkUnwQlubutJlNASrckXDuJ/CTtAk0JzTW6P ZoFsY9M30KEg1epJ0XqcA8NMhHApwU44bfy9jtL6HcGMx09X56D5ZbTaV0Ffvph5Iq TYMPrZMi5SvIGtv3aPtLxg5viMPwe0ZF2zPJjyAE= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33DI8nAU019166 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Apr 2023 13:08:49 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 13 Apr 2023 13:08:48 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 13 Apr 2023 13:08:48 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33DI8mVT100557; Thu, 13 Apr 2023 13:08:48 -0500 Date: Thu, 13 Apr 2023 13:08:48 -0500 From: Nishanth Menon To: Marek Vasut , Tom Rini CC: Siddharth Vadapalli , Vignesh Raghavendra , Michal Simek , Ramon Fried , Subject: Re: [PATCH 0/2] net: phy: Make phy_interface_is_sgmii|rgmii a switch statement Message-ID: <20230413180848.w56pgpcefrmx6ml7@suffix> References: <20230413180713.2922524-1-nm@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230413180713.2922524-1-nm@ti.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 13:07-20230413, Nishanth Menon wrote: > Originally reported by Tom[1], turned out to be that recent commit > 75d28899e3e9 ("net: phy: Synchronize PHY interface modes with Linux") > reordered the enum definitions which in turn broke the range checks. > > we are left with two options: > a) check against explicit values to help reuse as much as possible and > let compiler optimize where applicable > or > b) be very explicit in phy drivers and drop these helpers. > > I have chosen to go with (a) approach. > > Tested on am64x, though the dp83867 is used elsewhere as well. > > Nishanth Menon (2): > net: phy: Make phy_interface_is_sgmii a switch statement > net: phy: Make phy_interface_is_rgmii a switch statement > > include/phy.h | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > > -- > 2.40.0 > Oops.. forgot to provide the link of the report: [1] https://libera.irclog.whitequark.org/u-boot/2023-04-07#34130437; -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D