All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: James Smart <jsmart2021@gmail.com>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Hannes Reinecke <hare@suse.de>, Daniel Wagner <dwagner@suse.de>,
	Ram Vegesna <ram.vegesna@broadcom.com>
Subject: drivers/scsi/elx/libefc/efc_device.c:932:6: warning: cast to smaller integer type 'enum efc_nport_topology' from 'void *'
Date: Fri, 13 Aug 2021 07:07:23 +0800	[thread overview]
Message-ID: <202108130719.9yrY4C6p-lkp@intel.com> (raw)

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

Hi James,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f8fbb47c6e86c0b75f8df864db702c3e3f757361
commit: ebc076b3eddc807729bd81f7bc48e798a3ddc477 scsi: elx: efct: Tie into kernel Kconfig and build process
date:   8 weeks ago
config: x86_64-randconfig-a004-20210813 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 767496d19cb9a1fbba57ff08095faa161998ee36)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc076b3eddc807729bd81f7bc48e798a3ddc477
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout ebc076b3eddc807729bd81f7bc48e798a3ddc477
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/scsi/elx/libefc/efc_device.c:932:6: warning: cast to smaller integer type 'enum efc_nport_topology' from 'void *' [-Wvoid-pointer-to-enum-cast]
                                           (enum efc_nport_topology)arg;
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +932 drivers/scsi/elx/libefc/efc_device.c

202bfdffae27a5 James Smart 2021-06-01  909  
202bfdffae27a5 James Smart 2021-06-01  910  void
202bfdffae27a5 James Smart 2021-06-01  911  __efc_d_wait_topology_notify(struct efc_sm_ctx *ctx,
202bfdffae27a5 James Smart 2021-06-01  912  			     enum efc_sm_event evt, void *arg)
202bfdffae27a5 James Smart 2021-06-01  913  {
202bfdffae27a5 James Smart 2021-06-01  914  	int rc;
202bfdffae27a5 James Smart 2021-06-01  915  	struct efc_node *node = ctx->app;
202bfdffae27a5 James Smart 2021-06-01  916  
202bfdffae27a5 James Smart 2021-06-01  917  	efc_node_evt_set(ctx, evt, __func__);
202bfdffae27a5 James Smart 2021-06-01  918  
202bfdffae27a5 James Smart 2021-06-01  919  	node_sm_trace();
202bfdffae27a5 James Smart 2021-06-01  920  
202bfdffae27a5 James Smart 2021-06-01  921  	switch (evt) {
202bfdffae27a5 James Smart 2021-06-01  922  	case EFC_EVT_ENTER:
202bfdffae27a5 James Smart 2021-06-01  923  		efc_node_hold_frames(node);
202bfdffae27a5 James Smart 2021-06-01  924  		break;
202bfdffae27a5 James Smart 2021-06-01  925  
202bfdffae27a5 James Smart 2021-06-01  926  	case EFC_EVT_EXIT:
202bfdffae27a5 James Smart 2021-06-01  927  		efc_node_accept_frames(node);
202bfdffae27a5 James Smart 2021-06-01  928  		break;
202bfdffae27a5 James Smart 2021-06-01  929  
202bfdffae27a5 James Smart 2021-06-01  930  	case EFC_EVT_NPORT_TOPOLOGY_NOTIFY: {
202bfdffae27a5 James Smart 2021-06-01  931  		enum efc_nport_topology topology =
202bfdffae27a5 James Smart 2021-06-01 @932  					(enum efc_nport_topology)arg;
202bfdffae27a5 James Smart 2021-06-01  933  
202bfdffae27a5 James Smart 2021-06-01  934  		WARN_ON(node->nport->domain->attached);
202bfdffae27a5 James Smart 2021-06-01  935  
202bfdffae27a5 James Smart 2021-06-01  936  		WARN_ON(node->send_ls_acc != EFC_NODE_SEND_LS_ACC_PLOGI);
202bfdffae27a5 James Smart 2021-06-01  937  
202bfdffae27a5 James Smart 2021-06-01  938  		node_printf(node, "topology notification, topology=%d\n",
202bfdffae27a5 James Smart 2021-06-01  939  			    topology);
202bfdffae27a5 James Smart 2021-06-01  940  
202bfdffae27a5 James Smart 2021-06-01  941  		/* At the time the PLOGI was received, the topology was unknown,
202bfdffae27a5 James Smart 2021-06-01  942  		 * so we didn't know which node would perform the domain attach:
202bfdffae27a5 James Smart 2021-06-01  943  		 * 1. The node from which the PLOGI was sent (p2p) or
202bfdffae27a5 James Smart 2021-06-01  944  		 * 2. The node to which the FLOGI was sent (fabric).
202bfdffae27a5 James Smart 2021-06-01  945  		 */
202bfdffae27a5 James Smart 2021-06-01  946  		if (topology == EFC_NPORT_TOPO_P2P) {
202bfdffae27a5 James Smart 2021-06-01  947  			/* if this is p2p, need to attach to the domain using
202bfdffae27a5 James Smart 2021-06-01  948  			 * the d_id from the PLOGI received
202bfdffae27a5 James Smart 2021-06-01  949  			 */
202bfdffae27a5 James Smart 2021-06-01  950  			efc_domain_attach(node->nport->domain,
202bfdffae27a5 James Smart 2021-06-01  951  					  node->ls_acc_did);
202bfdffae27a5 James Smart 2021-06-01  952  		}
202bfdffae27a5 James Smart 2021-06-01  953  		/* else, if this is fabric, the domain attach
202bfdffae27a5 James Smart 2021-06-01  954  		 * should be performed by the fabric node (node sending FLOGI);
202bfdffae27a5 James Smart 2021-06-01  955  		 * just wait for attach to complete
202bfdffae27a5 James Smart 2021-06-01  956  		 */
202bfdffae27a5 James Smart 2021-06-01  957  
202bfdffae27a5 James Smart 2021-06-01  958  		efc_node_transition(node, __efc_d_wait_domain_attach, NULL);
202bfdffae27a5 James Smart 2021-06-01  959  		break;
202bfdffae27a5 James Smart 2021-06-01  960  	}
202bfdffae27a5 James Smart 2021-06-01  961  	case EFC_EVT_DOMAIN_ATTACH_OK:
202bfdffae27a5 James Smart 2021-06-01  962  		WARN_ON(!node->nport->domain->attached);
202bfdffae27a5 James Smart 2021-06-01  963  		node_printf(node, "domain attach ok\n");
202bfdffae27a5 James Smart 2021-06-01  964  		/* sm: / efc_node_attach */
202bfdffae27a5 James Smart 2021-06-01  965  		rc = efc_node_attach(node);
202bfdffae27a5 James Smart 2021-06-01  966  		efc_node_transition(node, __efc_d_wait_node_attach, NULL);
202bfdffae27a5 James Smart 2021-06-01  967  		if (rc < 0)
202bfdffae27a5 James Smart 2021-06-01  968  			efc_node_post_event(node,
202bfdffae27a5 James Smart 2021-06-01  969  					    EFC_EVT_NODE_ATTACH_FAIL, NULL);
202bfdffae27a5 James Smart 2021-06-01  970  
202bfdffae27a5 James Smart 2021-06-01  971  		break;
202bfdffae27a5 James Smart 2021-06-01  972  
202bfdffae27a5 James Smart 2021-06-01  973  	default:
202bfdffae27a5 James Smart 2021-06-01  974  		__efc_d_common(__func__, ctx, evt, arg);
202bfdffae27a5 James Smart 2021-06-01  975  	}
202bfdffae27a5 James Smart 2021-06-01  976  }
202bfdffae27a5 James Smart 2021-06-01  977  

:::::: The code at line 932 was first introduced by commit
:::::: 202bfdffae27a50d6fae0a259cde1333d9833127 scsi: elx: libefc: FC node ELS and state handling

:::::: TO: James Smart <jsmart2021@gmail.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

---
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: 40516 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/scsi/elx/libefc/efc_device.c:932:6: warning: cast to smaller integer type 'enum efc_nport_topology' from 'void *'
Date: Fri, 13 Aug 2021 07:07:23 +0800	[thread overview]
Message-ID: <202108130719.9yrY4C6p-lkp@intel.com> (raw)

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

Hi James,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f8fbb47c6e86c0b75f8df864db702c3e3f757361
commit: ebc076b3eddc807729bd81f7bc48e798a3ddc477 scsi: elx: efct: Tie into kernel Kconfig and build process
date:   8 weeks ago
config: x86_64-randconfig-a004-20210813 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 767496d19cb9a1fbba57ff08095faa161998ee36)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc076b3eddc807729bd81f7bc48e798a3ddc477
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout ebc076b3eddc807729bd81f7bc48e798a3ddc477
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/scsi/elx/libefc/efc_device.c:932:6: warning: cast to smaller integer type 'enum efc_nport_topology' from 'void *' [-Wvoid-pointer-to-enum-cast]
                                           (enum efc_nport_topology)arg;
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +932 drivers/scsi/elx/libefc/efc_device.c

202bfdffae27a5 James Smart 2021-06-01  909  
202bfdffae27a5 James Smart 2021-06-01  910  void
202bfdffae27a5 James Smart 2021-06-01  911  __efc_d_wait_topology_notify(struct efc_sm_ctx *ctx,
202bfdffae27a5 James Smart 2021-06-01  912  			     enum efc_sm_event evt, void *arg)
202bfdffae27a5 James Smart 2021-06-01  913  {
202bfdffae27a5 James Smart 2021-06-01  914  	int rc;
202bfdffae27a5 James Smart 2021-06-01  915  	struct efc_node *node = ctx->app;
202bfdffae27a5 James Smart 2021-06-01  916  
202bfdffae27a5 James Smart 2021-06-01  917  	efc_node_evt_set(ctx, evt, __func__);
202bfdffae27a5 James Smart 2021-06-01  918  
202bfdffae27a5 James Smart 2021-06-01  919  	node_sm_trace();
202bfdffae27a5 James Smart 2021-06-01  920  
202bfdffae27a5 James Smart 2021-06-01  921  	switch (evt) {
202bfdffae27a5 James Smart 2021-06-01  922  	case EFC_EVT_ENTER:
202bfdffae27a5 James Smart 2021-06-01  923  		efc_node_hold_frames(node);
202bfdffae27a5 James Smart 2021-06-01  924  		break;
202bfdffae27a5 James Smart 2021-06-01  925  
202bfdffae27a5 James Smart 2021-06-01  926  	case EFC_EVT_EXIT:
202bfdffae27a5 James Smart 2021-06-01  927  		efc_node_accept_frames(node);
202bfdffae27a5 James Smart 2021-06-01  928  		break;
202bfdffae27a5 James Smart 2021-06-01  929  
202bfdffae27a5 James Smart 2021-06-01  930  	case EFC_EVT_NPORT_TOPOLOGY_NOTIFY: {
202bfdffae27a5 James Smart 2021-06-01  931  		enum efc_nport_topology topology =
202bfdffae27a5 James Smart 2021-06-01 @932  					(enum efc_nport_topology)arg;
202bfdffae27a5 James Smart 2021-06-01  933  
202bfdffae27a5 James Smart 2021-06-01  934  		WARN_ON(node->nport->domain->attached);
202bfdffae27a5 James Smart 2021-06-01  935  
202bfdffae27a5 James Smart 2021-06-01  936  		WARN_ON(node->send_ls_acc != EFC_NODE_SEND_LS_ACC_PLOGI);
202bfdffae27a5 James Smart 2021-06-01  937  
202bfdffae27a5 James Smart 2021-06-01  938  		node_printf(node, "topology notification, topology=%d\n",
202bfdffae27a5 James Smart 2021-06-01  939  			    topology);
202bfdffae27a5 James Smart 2021-06-01  940  
202bfdffae27a5 James Smart 2021-06-01  941  		/* At the time the PLOGI was received, the topology was unknown,
202bfdffae27a5 James Smart 2021-06-01  942  		 * so we didn't know which node would perform the domain attach:
202bfdffae27a5 James Smart 2021-06-01  943  		 * 1. The node from which the PLOGI was sent (p2p) or
202bfdffae27a5 James Smart 2021-06-01  944  		 * 2. The node to which the FLOGI was sent (fabric).
202bfdffae27a5 James Smart 2021-06-01  945  		 */
202bfdffae27a5 James Smart 2021-06-01  946  		if (topology == EFC_NPORT_TOPO_P2P) {
202bfdffae27a5 James Smart 2021-06-01  947  			/* if this is p2p, need to attach to the domain using
202bfdffae27a5 James Smart 2021-06-01  948  			 * the d_id from the PLOGI received
202bfdffae27a5 James Smart 2021-06-01  949  			 */
202bfdffae27a5 James Smart 2021-06-01  950  			efc_domain_attach(node->nport->domain,
202bfdffae27a5 James Smart 2021-06-01  951  					  node->ls_acc_did);
202bfdffae27a5 James Smart 2021-06-01  952  		}
202bfdffae27a5 James Smart 2021-06-01  953  		/* else, if this is fabric, the domain attach
202bfdffae27a5 James Smart 2021-06-01  954  		 * should be performed by the fabric node (node sending FLOGI);
202bfdffae27a5 James Smart 2021-06-01  955  		 * just wait for attach to complete
202bfdffae27a5 James Smart 2021-06-01  956  		 */
202bfdffae27a5 James Smart 2021-06-01  957  
202bfdffae27a5 James Smart 2021-06-01  958  		efc_node_transition(node, __efc_d_wait_domain_attach, NULL);
202bfdffae27a5 James Smart 2021-06-01  959  		break;
202bfdffae27a5 James Smart 2021-06-01  960  	}
202bfdffae27a5 James Smart 2021-06-01  961  	case EFC_EVT_DOMAIN_ATTACH_OK:
202bfdffae27a5 James Smart 2021-06-01  962  		WARN_ON(!node->nport->domain->attached);
202bfdffae27a5 James Smart 2021-06-01  963  		node_printf(node, "domain attach ok\n");
202bfdffae27a5 James Smart 2021-06-01  964  		/* sm: / efc_node_attach */
202bfdffae27a5 James Smart 2021-06-01  965  		rc = efc_node_attach(node);
202bfdffae27a5 James Smart 2021-06-01  966  		efc_node_transition(node, __efc_d_wait_node_attach, NULL);
202bfdffae27a5 James Smart 2021-06-01  967  		if (rc < 0)
202bfdffae27a5 James Smart 2021-06-01  968  			efc_node_post_event(node,
202bfdffae27a5 James Smart 2021-06-01  969  					    EFC_EVT_NODE_ATTACH_FAIL, NULL);
202bfdffae27a5 James Smart 2021-06-01  970  
202bfdffae27a5 James Smart 2021-06-01  971  		break;
202bfdffae27a5 James Smart 2021-06-01  972  
202bfdffae27a5 James Smart 2021-06-01  973  	default:
202bfdffae27a5 James Smart 2021-06-01  974  		__efc_d_common(__func__, ctx, evt, arg);
202bfdffae27a5 James Smart 2021-06-01  975  	}
202bfdffae27a5 James Smart 2021-06-01  976  }
202bfdffae27a5 James Smart 2021-06-01  977  

:::::: The code@line 932 was first introduced by commit
:::::: 202bfdffae27a50d6fae0a259cde1333d9833127 scsi: elx: libefc: FC node ELS and state handling

:::::: TO: James Smart <jsmart2021@gmail.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

---
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: 40516 bytes --]

             reply	other threads:[~2021-08-12 23:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 23:07 kernel test robot [this message]
2021-08-12 23:07 ` drivers/scsi/elx/libefc/efc_device.c:932:6: warning: cast to smaller integer type 'enum efc_nport_topology' from 'void *' 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=202108130719.9yrY4C6p-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=jsmart2021@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ram.vegesna@broadcom.com \
    /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.