All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Nelson <snelson@pensando.io>
To: Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, gregkh@linuxfoundation.org,
	rafael@kernel.org, saravanak@google.com, mw@semihalf.com,
	jeremy.linton@arm.com
Subject: Re: [RFC] fwnode: change the return type of mac address helpers
Date: Wed, 6 Oct 2021 09:55:59 -0700	[thread overview]
Message-ID: <7d33d634-a6ba-e189-b2a0-77cfcd3a8643@pensando.io> (raw)
In-Reply-To: <20211006084916.2d924104@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

On 10/6/21 8:49 AM, Jakub Kicinski wrote:
> On Wed, 6 Oct 2021 16:49:36 +0200 Andrew Lunn wrote:
>>> --- a/drivers/net/ethernet/apm/xgene-v2/main.c
>>> +++ b/drivers/net/ethernet/apm/xgene-v2/main.c
>>> @@ -36,7 +36,7 @@ static int xge_get_resources(struct xge_pdata *pdata)
>>>   		return -ENOMEM;
>>>   	}
>>>   
>>> -	if (!device_get_ethdev_addr(dev, ndev))
>>> +	if (device_get_ethdev_addr(dev, ndev))
>>>   		eth_hw_addr_random(ndev);
>> That is going to be interesting for out of tree drivers.
> Indeed :(  But I think it's worth it - I thought it's only device tree
> that has the usual errno return code but inside eth.c there are also
> helpers for platform and nvmem mac retrieval which also return errno.

As the maintainer of an out-of-tree driver, this kind of change with 
little warning really can ruin my day.

I understand that as Linux kernel developers we really can't spend much 
time coddling the outer fringe, but we can at least give them hints.  
Changing the sense of the non-zero return from good to bad in several 
functions without something else that the compiler can warn on 
needlessly sets up time bombs for the unsuspecting.  Can we find a way 
to break their compile rather than surprise them with a broken runtime?

sln


  reply	other threads:[~2021-10-06 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06  2:24 [RFC] fwnode: change the return type of mac address helpers Jakub Kicinski
2021-10-06 14:49 ` Andrew Lunn
2021-10-06 15:49   ` Jakub Kicinski
2021-10-06 16:55     ` Shannon Nelson [this message]
2021-10-06 17:49       ` Jakub Kicinski
2021-10-06 18:13         ` Shannon Nelson
2021-10-06 15:23 ` Marcin Wojtas

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=7d33d634-a6ba-e189-b2a0-77cfcd3a8643@pensando.io \
    --to=snelson@pensando.io \
    --cc=andrew@lunn.ch \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeremy.linton@arm.com \
    --cc=kuba@kernel.org \
    --cc=mw@semihalf.com \
    --cc=netdev@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=saravanak@google.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.