[PATCH net-next 7/8] net: smsc91xx: move down struct members

Rosen Penev posted 8 patches 1 month, 4 weeks ago
[PATCH net-next 7/8] net: smsc91xx: move down struct members
Posted by Rosen Penev 1 month, 4 weeks ago
These are only used in these functions.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/smsc/smsc911x.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index e757c5825620..5eea873db853 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -131,9 +131,6 @@ struct smsc911x_data {
 
 	/* register access functions */
 	const struct smsc911x_ops *ops;
-
-	/* Reset GPIO */
-	struct gpio_desc *reset_gpiod;
 };
 
 /* Easy access to information */
@@ -378,14 +375,12 @@ static int smsc911x_enable_resources(struct platform_device *pdev)
  */
 static int smsc911x_request_resources(struct platform_device *pdev)
 {
-	struct net_device *ndev = platform_get_drvdata(pdev);
-	struct smsc911x_data *pdata = netdev_priv(ndev);
+	struct gpio_desc *reset_gpiod;
 	struct clk *clk;
 
 	/* Request optional RESET GPIO */
-	pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,
-						     "reset",
-						     GPIOD_OUT_LOW);
+	reset_gpiod =
+		devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
 
 	/* Request clock */
 	clk = devm_clk_get_optional(&pdev->dev, NULL);
-- 
2.46.2
Re: [PATCH net-next 7/8] net: smsc91xx: move down struct members
Posted by kernel test robot 1 month, 3 weeks ago
Hi Rosen,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Rosen-Penev/net-smsc911x-use-devm_platform_ioremap_resource/20241001-064430
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240930224056.354349-8-rosenp%40gmail.com
patch subject: [PATCH net-next 7/8] net: smsc91xx: move down struct members
config: i386-randconfig-001-20241001 (https://download.01.org/0day-ci/archive/20241001/202410012317.iGlUJQY9-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241001/202410012317.iGlUJQY9-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410012317.iGlUJQY9-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/smsc/smsc911x.c: In function 'smsc911x_request_resources':
>> drivers/net/ethernet/smsc/smsc911x.c:378:27: warning: variable 'reset_gpiod' set but not used [-Wunused-but-set-variable]
     378 |         struct gpio_desc *reset_gpiod;
         |                           ^~~~~~~~~~~


vim +/reset_gpiod +378 drivers/net/ethernet/smsc/smsc911x.c

   368	
   369	/*
   370	 * Request resources, currently just regulators.
   371	 *
   372	 * The SMSC911x has two power pins: vddvario and vdd33a, in designs where
   373	 * these are not always-on we need to request regulators to be turned on
   374	 * before we can try to access the device registers.
   375	 */
   376	static int smsc911x_request_resources(struct platform_device *pdev)
   377	{
 > 378		struct gpio_desc *reset_gpiod;
   379		struct clk *clk;
   380	
   381		/* Request optional RESET GPIO */
   382		reset_gpiod =
   383			devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
   384	
   385		/* Request clock */
   386		clk = devm_clk_get_optional(&pdev->dev, NULL);
   387		if (IS_ERR(clk))
   388			return dev_err_probe(&pdev->dev, PTR_ERR(clk),
   389					     "couldn't get clock");
   390	
   391		return 0;
   392	}
   393	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH net-next 7/8] net: smsc91xx: move down struct members
Posted by Kalesh Anakkur Purayil 1 month, 4 weeks ago
On Tue, Oct 1, 2024 at 4:13 AM Rosen Penev <rosenp@gmail.com> wrote:
>
> These are only used in these functions.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
LGTM,
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>


-- 
Regards,
Kalesh A P