All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [jpirko-mlxsw:linecards 55/112] drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:366:33: error: variable 'linecards' set but not used
Date: Sat, 13 Nov 2021 03:22:05 +0800	[thread overview]
Message-ID: <202111130300.HzAVFulP-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4139 bytes --]

tree:   https://github.com/jpirko/linux_mlxsw linecards
head:   7cbf836a1c8105f00dc98c24054feed7640b0dfd
commit: f8f5a8c6910c7716db683cc02eea2fe5e288b74c [55/112] mlxsw: core_linecards: Add line card objects and implement provisioning
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/jpirko/linux_mlxsw/commit/f8f5a8c6910c7716db683cc02eea2fe5e288b74c
        git remote add jpirko-mlxsw https://github.com/jpirko/linux_mlxsw
        git fetch --no-tags jpirko-mlxsw linecards
        git checkout f8f5a8c6910c7716db683cc02eea2fe5e288b74c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/net/ethernet/mellanox/mlxsw/core_linecards.c: In function 'mlxsw_linecard_unprovision':
>> drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:366:33: error: variable 'linecards' set but not used [-Werror=unused-but-set-variable]
     366 |         struct mlxsw_linecards *linecards;
         |                                 ^~~~~~~~~
   cc1: all warnings being treated as errors


vim +/linecards +366 drivers/net/ethernet/mellanox/mlxsw/core_linecards.c

   359	
   360	static int mlxsw_linecard_unprovision(struct devlink_linecard *devlink_linecard,
   361					      void *priv,
   362					      struct netlink_ext_ack *extack)
   363	{
   364		enum mlxsw_reg_mbct_fsm_state fsm_state;
   365		struct mlxsw_linecard *linecard = priv;
 > 366		struct mlxsw_linecards *linecards;
   367		enum mlxsw_reg_mbct_status status;
   368		unsigned int ini_wait_retries = 0;
   369		struct mlxsw_core *mlxsw_core;
   370		int err;
   371	
   372		mutex_lock(&linecard->lock);
   373	
   374		linecards = linecard->linecards;
   375		mlxsw_core = linecard->linecards->mlxsw_core;
   376	
   377	query_ini_status:
   378		err = mlxsw_linecard_query_status(linecard, &status,
   379						  &fsm_state, extack);
   380		if (err)
   381			goto err_out;
   382	
   383		switch (fsm_state) {
   384		case MLXSW_REG_MBCT_FSM_STATE_INI_IN_USE:
   385			if (ini_wait_retries++ > MLXSW_LINECARD_INI_WAIT_RETRIES) {
   386				NL_SET_ERR_MSG_MOD(extack, "Failed to wait for linecard INI to be not used");
   387				goto err_out;
   388			}
   389			mdelay(MLXSW_LINECARD_INI_WAIT_MS);
   390			goto query_ini_status;
   391		default:
   392			break;
   393		}
   394	
   395		mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index,
   396				    MLXSW_REG_MBCT_OP_ERASE_INI_IMAGE, 0,
   397				    false, false, NULL);
   398		err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mbct),
   399				      linecard->mbct_pl);
   400		if (err) {
   401			NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI");
   402			goto err_out;
   403		}
   404		mlxsw_reg_mbct_unpack(linecard->mbct_pl, NULL, &status, &fsm_state);
   405		switch (status) {
   406		case MLXSW_REG_MBCT_STATUS_ERASE_COMPLETE:
   407			break;
   408		default:
   409			/* Should not happen, fall-through. */
   410		case MLXSW_REG_MBCT_STATUS_ERASE_FAILED:
   411			NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI");
   412			goto fix_fsm_err_out;
   413		case MLXSW_REG_MBCT_STATUS_ERROR_INI_IN_USE:
   414			NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI while being used");
   415			goto fix_fsm_err_out;
   416		}
   417		goto out;
   418	
   419	fix_fsm_err_out:
   420		mlxsw_linecard_fix_fsm_state(linecard, fsm_state);
   421	err_out:
   422		mlxsw_linecard_provision_fail(linecard);
   423	out:
   424		mutex_unlock(&linecard->lock);
   425		return err;
   426	}
   427	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 69562 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Jiri Pirko <jiri@nvidia.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [jpirko-mlxsw:linecards 55/112] drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:366:33: error: variable 'linecards' set but not used
Date: Sat, 13 Nov 2021 03:22:05 +0800	[thread overview]
Message-ID: <202111130300.HzAVFulP-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4035 bytes --]

tree:   https://github.com/jpirko/linux_mlxsw linecards
head:   7cbf836a1c8105f00dc98c24054feed7640b0dfd
commit: f8f5a8c6910c7716db683cc02eea2fe5e288b74c [55/112] mlxsw: core_linecards: Add line card objects and implement provisioning
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/jpirko/linux_mlxsw/commit/f8f5a8c6910c7716db683cc02eea2fe5e288b74c
        git remote add jpirko-mlxsw https://github.com/jpirko/linux_mlxsw
        git fetch --no-tags jpirko-mlxsw linecards
        git checkout f8f5a8c6910c7716db683cc02eea2fe5e288b74c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/net/ethernet/mellanox/mlxsw/core_linecards.c: In function 'mlxsw_linecard_unprovision':
>> drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:366:33: error: variable 'linecards' set but not used [-Werror=unused-but-set-variable]
     366 |         struct mlxsw_linecards *linecards;
         |                                 ^~~~~~~~~
   cc1: all warnings being treated as errors


vim +/linecards +366 drivers/net/ethernet/mellanox/mlxsw/core_linecards.c

   359	
   360	static int mlxsw_linecard_unprovision(struct devlink_linecard *devlink_linecard,
   361					      void *priv,
   362					      struct netlink_ext_ack *extack)
   363	{
   364		enum mlxsw_reg_mbct_fsm_state fsm_state;
   365		struct mlxsw_linecard *linecard = priv;
 > 366		struct mlxsw_linecards *linecards;
   367		enum mlxsw_reg_mbct_status status;
   368		unsigned int ini_wait_retries = 0;
   369		struct mlxsw_core *mlxsw_core;
   370		int err;
   371	
   372		mutex_lock(&linecard->lock);
   373	
   374		linecards = linecard->linecards;
   375		mlxsw_core = linecard->linecards->mlxsw_core;
   376	
   377	query_ini_status:
   378		err = mlxsw_linecard_query_status(linecard, &status,
   379						  &fsm_state, extack);
   380		if (err)
   381			goto err_out;
   382	
   383		switch (fsm_state) {
   384		case MLXSW_REG_MBCT_FSM_STATE_INI_IN_USE:
   385			if (ini_wait_retries++ > MLXSW_LINECARD_INI_WAIT_RETRIES) {
   386				NL_SET_ERR_MSG_MOD(extack, "Failed to wait for linecard INI to be not used");
   387				goto err_out;
   388			}
   389			mdelay(MLXSW_LINECARD_INI_WAIT_MS);
   390			goto query_ini_status;
   391		default:
   392			break;
   393		}
   394	
   395		mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index,
   396				    MLXSW_REG_MBCT_OP_ERASE_INI_IMAGE, 0,
   397				    false, false, NULL);
   398		err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mbct),
   399				      linecard->mbct_pl);
   400		if (err) {
   401			NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI");
   402			goto err_out;
   403		}
   404		mlxsw_reg_mbct_unpack(linecard->mbct_pl, NULL, &status, &fsm_state);
   405		switch (status) {
   406		case MLXSW_REG_MBCT_STATUS_ERASE_COMPLETE:
   407			break;
   408		default:
   409			/* Should not happen, fall-through. */
   410		case MLXSW_REG_MBCT_STATUS_ERASE_FAILED:
   411			NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI");
   412			goto fix_fsm_err_out;
   413		case MLXSW_REG_MBCT_STATUS_ERROR_INI_IN_USE:
   414			NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI while being used");
   415			goto fix_fsm_err_out;
   416		}
   417		goto out;
   418	
   419	fix_fsm_err_out:
   420		mlxsw_linecard_fix_fsm_state(linecard, fsm_state);
   421	err_out:
   422		mlxsw_linecard_provision_fail(linecard);
   423	out:
   424		mutex_unlock(&linecard->lock);
   425		return err;
   426	}
   427	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 69562 bytes --]

             reply	other threads:[~2021-11-12 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 19:22 kernel test robot [this message]
2021-11-12 19:22 ` [jpirko-mlxsw:linecards 55/112] drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:366:33: error: variable 'linecards' set but not used kernel test robot

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=202111130300.HzAVFulP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.