Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca324099 authored by Jacob Keller's avatar Jacob Keller Committed by David S. Miller
Browse files

ixgbe: don't use magic size number to assign ptp_caps.name



Rather than using a magic size number, just use sizeof since that will
work and is more robust to future changes.

Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d773ce2d
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -840,7 +840,9 @@ void ixgbe_ptp_init(struct ixgbe_adapter *adapter)


	switch (adapter->hw.mac.type) {
	switch (adapter->hw.mac.type) {
	case ixgbe_mac_X540:
	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.owner = THIS_MODULE;
		adapter->ptp_caps.max_adj = 250000000;
		adapter->ptp_caps.max_adj = 250000000;
		adapter->ptp_caps.n_alarm = 0;
		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;
		adapter->ptp_caps.enable = ixgbe_ptp_enable;
		break;
		break;
	case ixgbe_mac_82599EB:
	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.owner = THIS_MODULE;
		adapter->ptp_caps.max_adj = 250000000;
		adapter->ptp_caps.max_adj = 250000000;
		adapter->ptp_caps.n_alarm = 0;
		adapter->ptp_caps.n_alarm = 0;