diff mbox series

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

Message ID 20240930224056.354349-8-rosenp@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: smsc911x: clean up with devm | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 9 this patch: 10
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang fail Errors and warnings before: 9 this patch: 11
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 12 this patch: 12
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 26 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Rosen Penev Sept. 30, 2024, 10:40 p.m. UTC
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(-)

Comments

Kalesh Anakkur Purayil Oct. 1, 2024, 8:54 a.m. UTC | #1
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>
kernel test robot Oct. 1, 2024, 3:44 p.m. UTC | #2
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
diff mbox series

Patch

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);