linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Murphy <dmurphy@ti.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <davem@davemloft.net>, <andrew@lunn.ch>, <f.fainelli@gmail.com>,
	<hkallweit1@gmail.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v3 3/3] net: dp83869: Add speed optimization feature
Date: Thu, 10 Sep 2020 12:34:34 -0500	[thread overview]
Message-ID: <9d5c56ab-fe37-f132-8891-f20f2bfddb9f@ti.com> (raw)
In-Reply-To: <20200908104719.0b8aced3@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

Jakub

On 9/8/20 12:47 PM, Jakub Kicinski wrote:
> On Tue, 8 Sep 2020 09:07:22 -0500 Dan Murphy wrote:
>> On 9/5/20 1:38 PM, Jakub Kicinski wrote:
>>> On Thu, 3 Sep 2020 06:42:59 -0500 Dan Murphy wrote:
>>>> +static int dp83869_set_downshift(struct phy_device *phydev, u8 cnt)
>>>> +{
>>>> +	int val, count;
>>>> +
>>>> +	if (cnt > DP83869_DOWNSHIFT_8_COUNT)
>>>> +		return -E2BIG;
>>> ERANGE
>> This is not checking a range but making sure it is not bigger then 8.
>>
>> IMO I would use ERANGE if the check was a boundary check for upper and
>> lower bounds.
> Yeah, ERANGE is not perfect, but the strerror for E2BIG is
> "Argument list too long" - IDK if users seeing that will know that it
> means the value is too large. Perhaps we should stick to EINVAL?

EINVAL works for me to.

Dan


      reply	other threads:[~2020-09-10 17:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 11:42 [PATCH net-next v3 0/3] DP83869 Feature additions Dan Murphy
2020-09-03 11:42 ` [PATCH net-next v3 1/3] net: dp83869: Add ability to advertise Fiber connection Dan Murphy
2020-09-05 18:17   ` Jakub Kicinski
2020-09-07 14:29     ` Andrew Lunn
2020-09-10 17:54       ` Dan Murphy
2020-09-10 18:09         ` Andrew Lunn
2020-09-03 11:42 ` [PATCH net-next v3 2/3] net: phy: dp83869: support Wake on LAN Dan Murphy
2020-09-05 18:34   ` Jakub Kicinski
2020-09-10 17:34     ` Dan Murphy
2020-09-10 18:02       ` Andrew Lunn
2020-09-10 18:21         ` Dan Murphy
2020-09-03 11:42 ` [PATCH net-next v3 3/3] net: dp83869: Add speed optimization feature Dan Murphy
2020-09-05 18:38   ` Jakub Kicinski
2020-09-08 14:07     ` Dan Murphy
2020-09-08 17:47       ` Jakub Kicinski
2020-09-10 17:34         ` Dan Murphy [this message]

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=9d5c56ab-fe37-f132-8891-f20f2bfddb9f@ti.com \
    --to=dmurphy@ti.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).