diff mbox series

[net,2/5] ice: remove dead code for allocating pin_config

Message ID 20210827204358.792803-3-anthony.l.nguyen@intel.com
State New
Headers show
Series Intel Wired LAN Driver Updates 2021-08-27 | expand

Commit Message

Tony Nguyen Aug. 27, 2021, 8:43 p.m. UTC
From: Jacob Keller <jacob.e.keller@intel.com>

We have code in the ice driver which allocates the pin_config structure
if n_pins is > 0, but we never set n_pins to be greater than zero.
There's no reason to keep this code until we actually have pin_config
support. Remove this. We can re-add it properly when we implement
support for pin_config for E810-T devices.

Fixes: 172db5f91d5f ("ice: add support for auxiliary input/output pins")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 11 -----------
 1 file changed, 11 deletions(-)

Comments

Jakub Kicinski Aug. 28, 2021, 12:43 a.m. UTC | #1
On Fri, 27 Aug 2021 13:43:55 -0700 Tony Nguyen wrote:
> From: Jacob Keller <jacob.e.keller@intel.com>

> 

> We have code in the ice driver which allocates the pin_config structure

> if n_pins is > 0, but we never set n_pins to be greater than zero.

> There's no reason to keep this code until we actually have pin_config

> support. Remove this. We can re-add it properly when we implement

> support for pin_config for E810-T devices.

> 

> Fixes: 172db5f91d5f ("ice: add support for auxiliary input/output pins")

> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

> Tested-by: Gurucharan G <gurucharanx.g@intel.com>

> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>


Removing dead code is not really a fix. Let's see if Linus cuts 5.14
this weekend, in which case it won't matter.
Jacob Keller Aug. 30, 2021, 7:21 p.m. UTC | #2
> -----Original Message-----

> From: Jakub Kicinski <kuba@kernel.org>

> Sent: Friday, August 27, 2021 5:44 PM

> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>

> Cc: davem@davemloft.net; Keller, Jacob E <jacob.e.keller@intel.com>;

> netdev@vger.kernel.org; richardcochran@gmail.com; Machnikowski, Maciej

> <maciej.machnikowski@intel.com>; G, GurucharanX <gurucharanx.g@intel.com>

> Subject: Re: [PATCH net 2/5] ice: remove dead code for allocating pin_config

> 

> On Fri, 27 Aug 2021 13:43:55 -0700 Tony Nguyen wrote:

> > From: Jacob Keller <jacob.e.keller@intel.com>

> >

> > We have code in the ice driver which allocates the pin_config structure

> > if n_pins is > 0, but we never set n_pins to be greater than zero.

> > There's no reason to keep this code until we actually have pin_config

> > support. Remove this. We can re-add it properly when we implement

> > support for pin_config for E810-T devices.

> >

> > Fixes: 172db5f91d5f ("ice: add support for auxiliary input/output pins")

> > Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

> > Tested-by: Gurucharan G <gurucharanx.g@intel.com>

> > Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

> 

> Removing dead code is not really a fix. Let's see if Linus cuts 5.14

> this weekend, in which case it won't matter.


It's a fix in my mind because the code was included in the original due to a mishandled rebase when working on series of patches. But yea, from outside that context its not really a fix since it doesn't change things from an external perspective.

Thanks,
Jake
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index f54148fb0e21..09d74e94feae 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -1064,17 +1064,6 @@  static long ice_ptp_create_clock(struct ice_pf *pf)
 	info = &pf->ptp.info;
 	dev = ice_pf_to_dev(pf);
 
-	/* Allocate memory for kernel pins interface */
-	if (info->n_pins) {
-		info->pin_config = devm_kcalloc(dev, info->n_pins,
-						sizeof(*info->pin_config),
-						GFP_KERNEL);
-		if (!info->pin_config) {
-			info->n_pins = 0;
-			return -ENOMEM;
-		}
-	}
-
 	/* Attempt to register the clock before enabling the hardware. */
 	clock = ptp_clock_register(info, dev);
 	if (IS_ERR(clock))