From: Aaron Brown <aaron.f.brown@intel.com>
To: davem@davemloft.net
Cc: Jacob Keller <jacob.e.keller@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
Aaron Brown <aaron.f.brown@intel.com>
Subject: [net-next 2/6] ixgbe: don't use magic size number to assign ptp_caps.name
Date: Tue, 25 Feb 2014 17:58:54 -0800 [thread overview]
Message-ID: <1393379938-1415-3-git-send-email-aaron.f.brown@intel.com> (raw)
In-Reply-To: <1393379938-1415-1-git-send-email-aaron.f.brown@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
Rather than using a magic size number, just use sizeof since that will
work and is more robust to future changes.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index 5184e2a..9e54fcc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -840,7 +840,9 @@ void ixgbe_ptp_init(struct ixgbe_adapter *adapter)
switch (adapter->hw.mac.type) {
case ixgbe_mac_X540:
- snprintf(adapter->ptp_caps.name, 16, "%s", netdev->name);
+ snprintf(adapter->ptp_caps.name,
+ sizeof(adapter->ptp_caps.name),
+ "%s", netdev->name);
adapter->ptp_caps.owner = THIS_MODULE;
adapter->ptp_caps.max_adj = 250000000;
adapter->ptp_caps.n_alarm = 0;
@@ -854,7 +856,9 @@ void ixgbe_ptp_init(struct ixgbe_adapter *adapter)
adapter->ptp_caps.enable = ixgbe_ptp_enable;
break;
case ixgbe_mac_82599EB:
- snprintf(adapter->ptp_caps.name, 16, "%s", netdev->name);
+ snprintf(adapter->ptp_caps.name,
+ sizeof(adapter->ptp_caps.name),
+ "%s", netdev->name);
adapter->ptp_caps.owner = THIS_MODULE;
adapter->ptp_caps.max_adj = 250000000;
adapter->ptp_caps.n_alarm = 0;
--
1.8.5.GIT
next prev parent reply other threads:[~2014-02-26 2:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 1:58 [net-next 0/6] Intel Wired LAN Driver Updates Aaron Brown
2014-02-26 1:58 ` [net-next 1/6] ixgbe: modify behavior on receiving a HW ECC error Aaron Brown
2014-02-26 1:58 ` Aaron Brown [this message]
2014-02-26 1:58 ` [net-next 3/6] ixgbe: Add WoL support for a new device Aaron Brown
2014-02-26 1:58 ` [net-next 4/6] igb: make local functions static and remove dead code Aaron Brown
2014-02-26 1:58 ` [net-next 5/6] igb: Update license text to remove FSF address and update copyright Aaron Brown
2014-02-26 1:58 ` [net-next 6/6] doc: update SubmittingPatches about the Fixed tag Aaron Brown
2014-02-26 20:54 ` David Miller
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=1393379938-1415-3-git-send-email-aaron.f.brown@intel.com \
--to=aaron.f.brown@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=jacob.e.keller@intel.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.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.