All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Trent Piepho <tpiepho@impinj.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH 5/5] net: phy: dp83867: Use unsigned variables to store unsigned properties
Date: Sat, 11 May 2019 14:32:28 +0200	[thread overview]
Message-ID: <3a42c0cc-4a4b-e168-c03e-1cc13bd2f5d4@gmail.com> (raw)
In-Reply-To: <49c6afc4-6c5b-51c9-74ab-9a6e8c2460a5@gmail.com>

On 11.05.2019 12:41, Heiner Kallweit wrote:
> On 10.05.2019 23:46, Trent Piepho wrote:
>> The variables used to store u32 DT properties were signed ints.  This
>> doesn't work properly if the value of the property were to overflow.
>> Use unsigned variables so this doesn't happen.
>>
> In patch 3 you added a check for DT properties being out of range.
> I think this would be good also for the three properties here.
> The delay values are only 4 bits wide, so you might also consider
> to switch to u8 or u16.
> 
I briefly looked over the rest of the driver. What is plain wrong
is to allocate memory for the private data structure in the
config_init callback. This has to be done in the probe callback.
An example is marvell_probe(). As you seem to work on this driver,
can you provide a patch for this?

> Please note that net-next is closed currently. Please resubmit the
> patches once it's open again, and please annotate them properly
> with net-next.
> 
>> Cc: Andrew Lunn <andrew@lunn.ch>
>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>> Cc: Heiner Kallweit <hkallweit1@gmail.com>
>> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
>> ---
>>  drivers/net/phy/dp83867.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
>> index a46cc9427fb3..edd9e27425e8 100644
>> --- a/drivers/net/phy/dp83867.c
>> +++ b/drivers/net/phy/dp83867.c
>> @@ -82,9 +82,9 @@ enum {
>>  };
>>  
>>  struct dp83867_private {
>> -	int rx_id_delay;
>> -	int tx_id_delay;
>> -	int fifo_depth;
>> +	u32 rx_id_delay;
>> +	u32 tx_id_delay;
>> +	u32 fifo_depth;
>>  	int io_impedance;
>>  	int port_mirroring;
>>  	bool rxctrl_strap_quirk;
>>
> 

  reply	other threads:[~2019-05-11 12:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 21:46 [PATCH 1/5] dt-bindings: phy: dp83867: Describe how driver behaves w.r.t rgmii delay Trent Piepho
2019-05-10 21:46 ` [PATCH 2/5] dt-bindings: phy: dp83867: Add documentation for disabling clock output Trent Piepho
2019-05-10 21:46 ` [PATCH 3/5] net: phy: dp83867: Add ability to disable output clock Trent Piepho
2019-05-10 21:46 ` [PATCH 4/5] net: phy: dp83867: Disable tx/rx delay when not configured Trent Piepho
2019-05-10 21:46 ` [PATCH 5/5] net: phy: dp83867: Use unsigned variables to store unsigned properties Trent Piepho
2019-05-11 10:41   ` Heiner Kallweit
2019-05-11 12:32     ` Heiner Kallweit [this message]
2019-05-13 19:58       ` Trent Piepho
2019-05-13 20:12         ` Heiner Kallweit
2019-05-13 20:46           ` Andrew Lunn
2019-05-13 21:26             ` Trent Piepho
2019-05-13 21:43               ` Andrew Lunn
2019-05-14 15:37                 ` Trent Piepho

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=3a42c0cc-4a4b-e168-c03e-1cc13bd2f5d4@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tpiepho@impinj.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.