Re: [PATCH 1/2] libfc: move scsi/fc_encode.h to libfc

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

 



Hi Arnd,

I love your patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next soc/for-next v5.10-rc1 next-20201026]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/libfc-move-scsi-fc_encode-h-to-libfc/20201027-000828
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: riscv-randconfig-r033-20201026 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/fc5c97b36d0d6d4adba894820c9a412f0467438e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Arnd-Bergmann/libfc-move-scsi-fc_encode-h-to-libfc/20201027-000828
        git checkout fc5c97b36d0d6d4adba894820c9a412f0467438e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

   In file included from drivers/scsi/libfc/fc_elsct.c:18:
   In function 'fc_ct_ns_fill',
       inlined from 'fc_ct_fill' at drivers/scsi/libfc/fc_encode.h:483:8,
       inlined from 'fc_elsct_send' at drivers/scsi/libfc/fc_elsct.c:47:8:
>> drivers/scsi/libfc/fc_encode.h:153:3: warning: 'strncpy' output may be truncated copying between 0 and 255 bytes from a string of length 255 [-Wstringop-truncation]
     153 |   strncpy(ct->payload.snn.fr_name,
         |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     154 |    fc_host_symbolic_name(lport->host), len);
         |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/libfc/fc_encode.h:143:3: warning: 'strncpy' output may be truncated copying between 0 and 255 bytes from a string of length 255 [-Wstringop-truncation]
     143 |   strncpy(ct->payload.spn.fr_name,
         |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     144 |    fc_host_symbolic_name(lport->host), len);
         |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/strncpy +153 drivers/scsi/libfc/fc_encode.h

42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09   81  
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09   82  /**
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22   83   * fc_ct_ns_fill() - Fill in a name service request frame
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25   84   * @lport: local port.
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25   85   * @fc_id: FC_ID of non-destination rport for GPN_ID and similar inquiries.
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25   86   * @fp: frame to contain payload.
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25   87   * @op: CT opcode.
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25   88   * @r_ctl: pointer to FC header R_CTL.
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25   89   * @fh_type: pointer to FC-4 type.
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09   90   */
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22   91  static inline int fc_ct_ns_fill(struct fc_lport *lport,
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25   92  		      u32 fc_id, struct fc_frame *fp,
a46f327aa5caf2 include/scsi/fc_encode.h Joe Eykholt   2009-08-25   93  		      unsigned int op, enum fc_rctl *r_ctl,
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09   94  		      enum fc_fh_type *fh_type)
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09   95  {
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09   96  	struct fc_ct_req *ct;
5f9a056db9c797 include/scsi/fc_encode.h Joe Eykholt   2009-11-03   97  	size_t len;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09   98  
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09   99  	switch (op) {
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  100  	case FC_NS_GPN_FT:
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  101  		ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_gid_ft),
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  102  				    FC_FST_DIR, FC_NS_SUBTYPE);
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  103  		ct->payload.gid.fn_fc4_type = FC_TYPE_FCP;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  104  		break;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  105  
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25  106  	case FC_NS_GPN_ID:
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  107  		ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_fid),
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  108  				    FC_FST_DIR, FC_NS_SUBTYPE);
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  109  		ct->payload.gid.fn_fc4_type = FC_TYPE_FCP;
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25  110  		hton24(ct->payload.fid.fp_fid, fc_id);
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25  111  		break;
2ab7e1ecb81ce3 include/scsi/fc_encode.h Joe Eykholt   2009-08-25  112  
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  113  	case FC_NS_RFT_ID:
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  114  		ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft),
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  115  				    FC_FST_DIR, FC_NS_SUBTYPE);
7b2787ec15b9d1 include/scsi/fc_encode.h Robert Love   2010-05-07  116  		hton24(ct->payload.rft.fid.fp_fid, lport->port_id);
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  117  		ct->payload.rft.fts = lport->fcts;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  118  		break;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  119  
ab593b187391bd include/scsi/fc_encode.h Joe Eykholt   2009-11-03  120  	case FC_NS_RFF_ID:
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  121  		ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id),
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  122  				    FC_FST_DIR, FC_NS_SUBTYPE);
7b2787ec15b9d1 include/scsi/fc_encode.h Robert Love   2010-05-07  123  		hton24(ct->payload.rff.fr_fid.fp_fid, lport->port_id);
ab593b187391bd include/scsi/fc_encode.h Joe Eykholt   2009-11-03  124  		ct->payload.rff.fr_type = FC_TYPE_FCP;
ab593b187391bd include/scsi/fc_encode.h Joe Eykholt   2009-11-03  125  		if (lport->service_params & FCP_SPPF_INIT_FCN)
ab593b187391bd include/scsi/fc_encode.h Joe Eykholt   2009-11-03  126  			ct->payload.rff.fr_feat = FCP_FEAT_INIT;
ab593b187391bd include/scsi/fc_encode.h Joe Eykholt   2009-11-03  127  		if (lport->service_params & FCP_SPPF_TARG_FCN)
ab593b187391bd include/scsi/fc_encode.h Joe Eykholt   2009-11-03  128  			ct->payload.rff.fr_feat |= FCP_FEAT_TARG;
ab593b187391bd include/scsi/fc_encode.h Joe Eykholt   2009-11-03  129  		break;
ab593b187391bd include/scsi/fc_encode.h Joe Eykholt   2009-11-03  130  
c9c7bd7a5e7321 include/scsi/fc_encode.h Chris Leech   2009-11-03  131  	case FC_NS_RNN_ID:
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  132  		ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id),
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  133  				    FC_FST_DIR, FC_NS_SUBTYPE);
7b2787ec15b9d1 include/scsi/fc_encode.h Robert Love   2010-05-07  134  		hton24(ct->payload.rn.fr_fid.fp_fid, lport->port_id);
c9c7bd7a5e7321 include/scsi/fc_encode.h Chris Leech   2009-11-03  135  		put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn);
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  136  		break;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  137  
c9866a548024c3 include/scsi/fc_encode.h Chris Leech   2009-11-03  138  	case FC_NS_RSPN_ID:
5f9a056db9c797 include/scsi/fc_encode.h Joe Eykholt   2009-11-03  139  		len = strnlen(fc_host_symbolic_name(lport->host), 255);
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  140  		ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len,
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  141  				    FC_FST_DIR, FC_NS_SUBTYPE);
7b2787ec15b9d1 include/scsi/fc_encode.h Robert Love   2010-05-07  142  		hton24(ct->payload.spn.fr_fid.fp_fid, lport->port_id);
c9866a548024c3 include/scsi/fc_encode.h Chris Leech   2009-11-03  143  		strncpy(ct->payload.spn.fr_name,
5f9a056db9c797 include/scsi/fc_encode.h Joe Eykholt   2009-11-03  144  			fc_host_symbolic_name(lport->host), len);
5f9a056db9c797 include/scsi/fc_encode.h Joe Eykholt   2009-11-03  145  		ct->payload.spn.fr_name_len = len;
c9866a548024c3 include/scsi/fc_encode.h Chris Leech   2009-11-03  146  		break;
c9866a548024c3 include/scsi/fc_encode.h Chris Leech   2009-11-03  147  
5baa17c3e66fc2 include/scsi/fc_encode.h Chris Leech   2009-11-03  148  	case FC_NS_RSNN_NN:
5f9a056db9c797 include/scsi/fc_encode.h Joe Eykholt   2009-11-03  149  		len = strnlen(fc_host_symbolic_name(lport->host), 255);
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  150  		ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rsnn) + len,
1ea2c1daf4476a include/scsi/fc_encode.h Neerav Parikh 2012-01-22  151  				    FC_FST_DIR, FC_NS_SUBTYPE);
5baa17c3e66fc2 include/scsi/fc_encode.h Chris Leech   2009-11-03  152  		put_unaligned_be64(lport->wwnn, &ct->payload.snn.fr_wwn);
5baa17c3e66fc2 include/scsi/fc_encode.h Chris Leech   2009-11-03 @153  		strncpy(ct->payload.snn.fr_name,
5f9a056db9c797 include/scsi/fc_encode.h Joe Eykholt   2009-11-03  154  			fc_host_symbolic_name(lport->host), len);
5f9a056db9c797 include/scsi/fc_encode.h Joe Eykholt   2009-11-03  155  		ct->payload.snn.fr_name_len = len;
5baa17c3e66fc2 include/scsi/fc_encode.h Chris Leech   2009-11-03  156  		break;
5baa17c3e66fc2 include/scsi/fc_encode.h Chris Leech   2009-11-03  157  
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  158  	default:
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  159  		return -EINVAL;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  160  	}
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  161  	*r_ctl = FC_RCTL_DD_UNSOL_CTL;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  162  	*fh_type = FC_TYPE_CT;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  163  	return 0;
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  164  }
42e9a92fe6a909 include/scsi/fc_encode.h Robert Love   2008-12-09  165  

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