Re: [RFC] fwnode: change the return type of mac address helpers
From: Shannon Nelson <hidden>
Date: 2021-10-06 16:56:05
On 10/6/21 8:49 AM, Jakub Kicinski wrote:
On Wed, 6 Oct 2021 16:49:36 +0200 Andrew Lunn wrote:quoted
quoted
--- 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