[scsi:misc 62/294] drivers/scsi/qla2xxx/qla_edif.c:713:45: warning: taking address of packed member 'u' of class or structure 'auth_complete_cmd' may result in an unaligned pointer value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Quinn,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git misc
head:   9b5ac8ab4e8bf5636d1d425aee68ddf45af12057
commit: 8a4bb2c1dd623b5a71609de5b04ef3b5086b0a3e [62/294] scsi: qla2xxx: edif: Add authentication pass + fail bsgs
config: i386-randconfig-a002-20210829 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4e1a164d7bd53653f79decc121afe784d2fde0a7)
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/jejb/scsi.git/commit/?id=8a4bb2c1dd623b5a71609de5b04ef3b5086b0a3e
        git remote add scsi https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
        git fetch --no-tags scsi misc
        git checkout 8a4bb2c1dd623b5a71609de5b04ef3b5086b0a3e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 

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

All warnings (new ones prefixed by >>):

   clang-14: warning: optimization flag '-falign-jumps=0' is not supported [-Wignored-optimization-argument]
   In file included from drivers/scsi/qla2xxx/qla_edif.c:6:
   In file included from drivers/scsi/qla2xxx/qla_def.h:12:
   In file included from include/linux/module.h:14:
   In file included from include/linux/buildid.h:5:
   In file included from include/linux/mm_types.h:9:
   In file included from include/linux/spinlock.h:51:
   In file included from include/linux/preempt.h:78:
   In file included from arch/x86/include/asm/preempt.h:7:
   In file included from include/linux/thread_info.h:60:
   arch/x86/include/asm/thread_info.h:172:13: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
           oldframe = __builtin_frame_address(1);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/thread_info.h:174:11: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
                   frame = __builtin_frame_address(2);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla2xxx/qla_edif.c:463:6: warning: no previous prototype for function 'qla2x00_release_all_sadb' [-Wmissing-prototypes]
   void qla2x00_release_all_sadb(struct scsi_qla_host *vha, struct fc_port *fcport)
        ^
   drivers/scsi/qla2xxx/qla_edif.c:463:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void qla2x00_release_all_sadb(struct scsi_qla_host *vha, struct fc_port *fcport)
   ^
   static 
>> drivers/scsi/qla2xxx/qla_edif.c:713:45: warning: taking address of packed member 'u' of class or structure 'auth_complete_cmd' may result in an unaligned pointer value [-Waddress-of-packed-member]
                   fcport = qla2x00_find_fcport_by_pid(vha, &appplogiok.u.d_id);
                                                             ^~~~~~~~~~~~~~~~~
   drivers/scsi/qla2xxx/qla_edif.c:822:45: warning: taking address of packed member 'u' of class or structure 'auth_complete_cmd' may result in an unaligned pointer value [-Waddress-of-packed-member]
                   fcport = qla2x00_find_fcport_by_pid(vha, &appplogifail.u.d_id);
                                                             ^~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla2xxx/qla_edif.c:1306:44: warning: taking address of packed member 'port_id' of class or structure 'qla_sa_update_frame' may result in an unaligned pointer value [-Waddress-of-packed-member]
           fcport = qla2x00_find_fcport_by_pid(vha, &sa_frame.port_id);
                                                     ^~~~~~~~~~~~~~~~
   6 warnings generated.


vim +713 drivers/scsi/qla2xxx/qla_edif.c

   682	
   683	/**
   684	 * qla_edif_app_authok - authentication by app succeeded.  Driver can proceed
   685	 *   with prli
   686	 * @vha: host adapter pointer
   687	 * @bsg_job: user request
   688	 */
   689	static int
   690	qla_edif_app_authok(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
   691	{
   692		int32_t			rval = 0;
   693		struct auth_complete_cmd appplogiok;
   694		struct app_plogi_reply	appplogireply = {0};
   695		struct fc_bsg_reply	*bsg_reply = bsg_job->reply;
   696		fc_port_t		*fcport = NULL;
   697		port_id_t		portid = {0};
   698	
   699		sg_copy_to_buffer(bsg_job->request_payload.sg_list,
   700		    bsg_job->request_payload.sg_cnt, &appplogiok,
   701		    sizeof(struct auth_complete_cmd));
   702	
   703		switch (appplogiok.type) {
   704		case PL_TYPE_WWPN:
   705			fcport = qla2x00_find_fcport_by_wwpn(vha,
   706			    appplogiok.u.wwpn, 0);
   707			if (!fcport)
   708				ql_dbg(ql_dbg_edif, vha, 0x911d,
   709				    "%s wwpn lookup failed: %8phC\n",
   710				    __func__, appplogiok.u.wwpn);
   711			break;
   712		case PL_TYPE_DID:
 > 713			fcport = qla2x00_find_fcport_by_pid(vha, &appplogiok.u.d_id);
   714			if (!fcport)
   715				ql_dbg(ql_dbg_edif, vha, 0x911d,
   716				    "%s d_id lookup failed: %x\n", __func__,
   717				    portid.b24);
   718			break;
   719		default:
   720			ql_dbg(ql_dbg_edif, vha, 0x911d,
   721			    "%s undefined type: %x\n", __func__,
   722			    appplogiok.type);
   723			break;
   724		}
   725	
   726		if (!fcport) {
   727			SET_DID_STATUS(bsg_reply->result, DID_ERROR);
   728			goto errstate_exit;
   729		}
   730	
   731		/*
   732		 * if port is online then this is a REKEY operation
   733		 * Only do sa update checking
   734		 */
   735		if (atomic_read(&fcport->state) == FCS_ONLINE) {
   736			ql_dbg(ql_dbg_edif, vha, 0x911d,
   737			    "%s Skipping PRLI complete based on rekey\n", __func__);
   738			appplogireply.prli_status = 1;
   739			SET_DID_STATUS(bsg_reply->result, DID_OK);
   740			qla_edif_app_chk_sa_update(vha, fcport, &appplogireply);
   741			goto errstate_exit;
   742		}
   743	
   744		/* make sure in AUTH_PENDING or else reject */
   745		if (fcport->disc_state != DSC_LOGIN_AUTH_PEND) {
   746			ql_dbg(ql_dbg_edif, vha, 0x911e,
   747			    "%s wwpn %8phC is not in auth pending state (%x)\n",
   748			    __func__, fcport->port_name, fcport->disc_state);
   749			SET_DID_STATUS(bsg_reply->result, DID_OK);
   750			appplogireply.prli_status = 0;
   751			goto errstate_exit;
   752		}
   753	
   754		SET_DID_STATUS(bsg_reply->result, DID_OK);
   755		appplogireply.prli_status = 1;
   756		if (!(fcport->edif.rx_sa_set && fcport->edif.tx_sa_set)) {
   757			ql_dbg(ql_dbg_edif, vha, 0x911e,
   758			    "%s: wwpn %8phC Both SA indexes has not been SET TX %d, RX %d.\n",
   759			    __func__, fcport->port_name, fcport->edif.tx_sa_set,
   760			    fcport->edif.rx_sa_set);
   761			SET_DID_STATUS(bsg_reply->result, DID_OK);
   762			appplogireply.prli_status = 0;
   763			goto errstate_exit;
   764	
   765		} else {
   766			ql_dbg(ql_dbg_edif, vha, 0x911e,
   767			    "%s wwpn %8phC Both SA(s) updated.\n", __func__,
   768			    fcport->port_name);
   769			fcport->edif.rx_sa_set = fcport->edif.tx_sa_set = 0;
   770			fcport->edif.rx_sa_pending = fcport->edif.tx_sa_pending = 0;
   771		}
   772	
   773		if (qla_ini_mode_enabled(vha)) {
   774			ql_dbg(ql_dbg_edif, vha, 0x911e,
   775			    "%s AUTH complete - RESUME with prli for wwpn %8phC\n",
   776			    __func__, fcport->port_name);
   777			qla_edif_reset_auth_wait(fcport, DSC_LOGIN_PEND, 1);
   778			qla24xx_post_prli_work(vha, fcport);
   779		}
   780	
   781	errstate_exit:
   782		bsg_job->reply_len = sizeof(struct fc_bsg_reply);
   783		sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
   784		    bsg_job->reply_payload.sg_cnt, &appplogireply,
   785		    sizeof(struct app_plogi_reply));
   786	
   787		return rval;
   788	}
   789	

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

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux