mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karim Eshapa <karim.eshapa@gmail.com>
To: davem@davemloft.net
Cc: tremyfr@gmail.com, a@unstable.cc, fw@strlen.de,
	clabbe.montjoie@gmail.com, edumazet@google.com, jarod@redhat.com,
	adi-buildroot-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Karim Eshapa <karim.eshapa@gmail.com>
Subject: [PATCH 1/1] drivers:net:ethernet:adi:bfin_mac: Use FIELD_SIZEOF defined kernel macro
Date: Sun, 23 Apr 2017 20:02:04 +0200	[thread overview]
Message-ID: <1492970524-12607-1-git-send-email-karim.eshapa@gmail.com> (raw)

Use FIELD_SIZEOF defined kernel macro kernel.h

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
 drivers/net/ethernet/adi/bfin_mac.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index a9ac58c..60346e0 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -452,10 +452,14 @@ static irqreturn_t bfin_mac_wake_interrupt(int irq, void *dev_id)
 static void bfin_mac_ethtool_getdrvinfo(struct net_device *dev,
 					struct ethtool_drvinfo *info)
 {
-	strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
-	strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
-	strlcpy(info->bus_info, dev_name(&dev->dev), sizeof(info->bus_info));
+	strlcpy(info->driver, KBUILD_MODNAME, FIELD_SIZEOF(
+		struct ethtool_drvinfo, driver));
+	strlcpy(info->version, DRV_VERSION, FIELD_SIZEOF(
+		struct ethtool_drvinfo, version));
+	strlcpy(info->fw_version, "N/A", FIELD_SIZEOF(
+		struct ethtool_drvinfo, fw_version));
+	strlcpy(info->bus_info, dev_name(&dev->dev), FIELD_SIZEOF(
+		struct ethtool_drvinfo, bus_info));
 }
 
 static void bfin_mac_ethtool_getwol(struct net_device *dev,
@@ -785,7 +789,7 @@ static int bfin_mac_hwtstamp_get(struct net_device *netdev,
 	struct bfin_mac_local *lp = netdev_priv(netdev);
 
 	return copy_to_user(ifr->ifr_data, &lp->stamp_cfg,
-			    sizeof(lp->stamp_cfg)) ?
+			    FILD_SIZEOF(struct bfin_mac_local, stamp_cfg)) ?
 		-EFAULT : 0;
 }
 
-- 
2.7.4

             reply	other threads:[~2017-04-23 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-23 18:02 Karim Eshapa [this message]
2017-04-23 20:14 ` kbuild test robot
2017-04-23 20:56 ` Geert Uytterhoeven
2017-04-24  0:23 ` Karim Eshapa

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=1492970524-12607-1-git-send-email-karim.eshapa@gmail.com \
    --to=karim.eshapa@gmail.com \
    --cc=a@unstable.cc \
    --cc=adi-buildroot-devel@lists.sourceforge.net \
    --cc=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=jarod@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tremyfr@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®