All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Tom Rini <trini@konsulko.com>
Cc: Siddharth Vadapalli <s-vadapalli@ti.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Michal Simek <michal.simek@amd.com>,
	Ramon Fried <rfried.dev@gmail.com>, <u-boot@lists.denx.de>,
	Nishanth Menon <nm@ti.com>
Subject: [PATCH 0/2] net: phy: Make phy_interface_is_sgmii|rgmii a switch statement
Date: Thu, 13 Apr 2023 13:07:11 -0500	[thread overview]
Message-ID: <20230413180713.2922524-1-nm@ti.com> (raw)

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


             reply	other threads:[~2023-04-13 18:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 18:07 Nishanth Menon [this message]
2023-04-13 18:07 ` [PATCH 1/2] net: phy: Make phy_interface_is_sgmii a switch statement Nishanth Menon
2023-04-13 18:56   ` Marek Behún
2023-04-13 19:02     ` Nishanth Menon
2023-04-13 21:22       ` Marek Behún
2023-04-13 22:51         ` Nishanth Menon
2023-04-13 18:07 ` [PATCH 2/2] net: phy: Make phy_interface_is_rgmii " Nishanth Menon
2023-04-25 19:13   ` Ramon Fried
2023-04-13 18:08 ` [PATCH 0/2] net: phy: Make phy_interface_is_sgmii|rgmii " Nishanth Menon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230413180713.2922524-1-nm@ti.com \
    --to=nm@ti.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=michal.simek@amd.com \
    --cc=rfried.dev@gmail.com \
    --cc=s-vadapalli@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.