mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Kyle Switch <kyle.switch@motor-comm.com>
Cc: Frank.Sae@motor-comm.com, hkallweit1@gmail.com,
	linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, ming.xu@motor-comm.com,
	xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com,
	jie.han@motor-comm.com
Subject: Re: [PATCH net-next v18 2/3] net: phy: Add support for Template Control register for PMA
Date: Tue, 15 Sep 2026 14:18:57 +0200	[thread overview]
Message-ID: <14de4b19-254b-4d45-9239-5a3badbbb73d@lunn.ch> (raw)
In-Reply-To: <20260915082152.3104633-3-kyle.switch@motor-comm.com>

> +/**
> + * genphy_c45_template_testmode - configure template testmode registers
> + * @phydev: target phy_device struct
> + * @test_mode: testmode includes Normal to Test mode 7
> + *
> + * Description: Set template testmode include Normal to Test mode 7
> + *
> + * Return: 0 on success, or a negative error code on failure (e.g. register
> + * read/write error).
> + */
> +int genphy_c45_template_testmode(struct phy_device *phydev, int test_mode)
> +{
> +	int ctrl;

I would suggest test_mode is a u16, or at least an unsigned type. ctrl
should be a u16, since phy_modify_mmd() and phy_write() etc take a
u16.

> +
> +	if (test_mode < MDIO_PMA_10GBT_TESTMODE_NORMAL ||
> +	    test_mode > MDIO_PMA_10GBT_TESTMODE_7)
> +		return -EOPNOTSUPP;

And once test_mode is unsigned, you don't need to test if its is less
than 0.

    Andrew

---
pw-bot: cr
	

  reply	other threads:[~2026-09-15 12:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  8:21 [PATCH net-next v18 0/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy Kyle Switch
2026-09-15  8:21 ` [PATCH net-next v18 1/3] dt-bindings: net: Document Motorcomm YT8824 PHY package Kyle Switch
2026-09-15  9:16   ` Krzysztof Kozlowski
2026-09-16  0:37     ` Kyle Switch
2026-09-15  8:21 ` [PATCH net-next v18 2/3] net: phy: Add support for Template Control register for PMA Kyle Switch
2026-09-15 12:18   ` Andrew Lunn [this message]
2026-09-16  0:45     ` Kyle Switch
2026-09-15  8:21 ` [PATCH net-next v18 3/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy Kyle Switch
2026-09-15 12:31   ` Andrew Lunn
2026-09-16  0:44     ` Kyle Switch
2026-09-15 12:33   ` Andrew Lunn
2026-09-16  0:41     ` Kyle Switch

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=14de4b19-254b-4d45-9239-5a3badbbb73d@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Frank.Sae@motor-comm.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jianmin.wang@motor-comm.com \
    --cc=jie.han@motor-comm.com \
    --cc=kuba@kernel.org \
    --cc=kyle.switch@motor-comm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ming.xu@motor-comm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xiaolin.xu@motor-comm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®