LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@impinj.com>
To: "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>,
	Trent Piepho <tpiepho@impinj.com>, Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: [PATCH 5/5] net: phy: dp83867: Use unsigned variables to store unsigned properties
Date: Fri, 10 May 2019 21:46:13 +0000	[thread overview]
Message-ID: <20190510214550.18657-5-tpiepho@impinj.com> (raw)
In-Reply-To: <20190510214550.18657-1-tpiepho@impinj.com>

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.

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;
-- 
2.14.5


  parent reply	other threads:[~2019-05-10 21:46 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 ` Trent Piepho [this message]
2019-05-11 10:41   ` [PATCH 5/5] net: phy: dp83867: Use unsigned variables to store unsigned properties Heiner Kallweit
2019-05-11 12:32     ` Heiner Kallweit
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=20190510214550.18657-5-tpiepho@impinj.com \
    --to=tpiepho@impinj.com \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH 5/5] net: phy: dp83867: Use unsigned variables to store unsigned properties' \
    /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

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).