Re: [PATCH net] net: axienet: fix a signedness bug in probe

2019-09-27 Thread David Miller
From: Dan Carpenter Date: Wed, 25 Sep 2019 13:59:11 +0300 > The "lp->phy_mode" is an enum but in this context GCC treats it as an > unsigned int so the error handling is never triggered. > > Fixes: ee06b1728b95 ("net: axienet: add support for standard phy-mode > binding") > Signed-off-by: Dan C

Re: [PATCH net] net: axienet: fix a signedness bug in probe

2019-09-26 Thread Andrew Lunn
> The get_phy_mode() function seem like they lend themselves to creating > these bugs. The ->phy_mode variables tend to be declared in the driver > so it would require quite a few patches to make them all int and I'm not > sure that's more beautiful. Andrew Lunn's idea to update the API would > p

Re: [PATCH net] net: axienet: fix a signedness bug in probe

2019-09-26 Thread Dan Carpenter
On Wed, Sep 25, 2019 at 01:05:43PM +0200, Alvaro G. M wrote: > Hi, Dan > > On Wed, Sep 25, 2019 at 01:59:11PM +0300, Dan Carpenter wrote: > > The "lp->phy_mode" is an enum but in this context GCC treats it as an > > unsigned int so the error handling is never triggered. > > > > lp->ph

Re: [PATCH net] net: axienet: fix a signedness bug in probe

2019-09-25 Thread Andrew Lunn
On Wed, Sep 25, 2019 at 01:35:07PM +0200, David Miller wrote: > From: "Alvaro G. M" > Date: Wed, 25 Sep 2019 13:05:43 +0200 > > > Hi, Dan > > > > On Wed, Sep 25, 2019 at 01:59:11PM +0300, Dan Carpenter wrote: > >> The "lp->phy_mode" is an enum but in this context GCC treats it as an > >> unsigne

RE: [PATCH net] net: axienet: fix a signedness bug in probe

2019-09-25 Thread Radhey Shyam Pandey
> -Original Message- > From: Dan Carpenter > Sent: Wednesday, September 25, 2019 4:29 PM > To: Radhey Shyam Pandey ; Alvaro G. M > > Cc: David S. Miller ; Michal Simek > ; Russell King ; > netdev@vger.kernel.org; kernel-janit...@vger.kernel.org > Subject: [PATCH net] net: axienet: fix a s

Re: [PATCH net] net: axienet: fix a signedness bug in probe

2019-09-25 Thread David Miller
From: "Alvaro G. M" Date: Wed, 25 Sep 2019 13:05:43 +0200 > Hi, Dan > > On Wed, Sep 25, 2019 at 01:59:11PM +0300, Dan Carpenter wrote: >> The "lp->phy_mode" is an enum but in this context GCC treats it as an >> unsigned int so the error handling is never triggered. >> >> lp->phy_mo

Re: [PATCH net] net: axienet: fix a signedness bug in probe

2019-09-25 Thread Alvaro G. M
Hi, Dan On Wed, Sep 25, 2019 at 01:59:11PM +0300, Dan Carpenter wrote: > The "lp->phy_mode" is an enum but in this context GCC treats it as an > unsigned int so the error handling is never triggered. > > lp->phy_mode = of_get_phy_mode(pdev->dev.of_node); > - if (lp->phy_