[xfs-linux:xfs-5.9-merge 95/116] fs/xfs/libxfs/xfs_attr_leaf.c:718:23: warning: variable 'error' set but not used

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

 



tree:   https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git xfs-5.9-merge
head:   9f347d7a7e0ee9b12434b9ef0ccac3a2680960de
commit: cfe3d8821c6fc4358e82ec234940891f353ab03b [95/116] xfs: Add xfs_has_attr and subroutines
config: x86_64-rhel-7.6-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        git checkout cfe3d8821c6fc4358e82ec234940891f353ab03b
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   fs/xfs/libxfs/xfs_attr_leaf.c: In function 'xfs_attr_shortform_add':
>> fs/xfs/libxfs/xfs_attr_leaf.c:718:23: warning: variable 'error' set but not used [-Wunused-but-set-variable]
     718 |  int    offset, size, error;
         |                       ^~~~~

vim +/error +718 fs/xfs/libxfs/xfs_attr_leaf.c

   706	
   707	/*
   708	 * Add a name/value pair to the shortform attribute list.
   709	 * Overflow from the inode has already been checked for.
   710	 */
   711	void
   712	xfs_attr_shortform_add(
   713		struct xfs_da_args		*args,
   714		int				forkoff)
   715	{
   716		struct xfs_attr_shortform	*sf;
   717		struct xfs_attr_sf_entry	*sfe;
 > 718		int				offset, size, error;
   719		struct xfs_mount		*mp;
   720		struct xfs_inode		*dp;
   721		struct xfs_ifork		*ifp;
   722	
   723		trace_xfs_attr_sf_add(args);
   724	
   725		dp = args->dp;
   726		mp = dp->i_mount;
   727		dp->i_d.di_forkoff = forkoff;
   728	
   729		ifp = dp->i_afp;
   730		ASSERT(ifp->if_flags & XFS_IFINLINE);
   731		sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data;
   732		error = xfs_attr_sf_findname(args, &sfe, NULL);
   733		ASSERT(error != -EEXIST);
   734	
   735		offset = (char *)sfe - (char *)sf;
   736		size = XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen);
   737		xfs_idata_realloc(dp, size, XFS_ATTR_FORK);
   738		sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data;
   739		sfe = (xfs_attr_sf_entry_t *)((char *)sf + offset);
   740	
   741		sfe->namelen = args->namelen;
   742		sfe->valuelen = args->valuelen;
   743		sfe->flags = args->attr_filter;
   744		memcpy(sfe->nameval, args->name, args->namelen);
   745		memcpy(&sfe->nameval[args->namelen], args->value, args->valuelen);
   746		sf->hdr.count++;
   747		be16_add_cpu(&sf->hdr.totsize, size);
   748		xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA);
   749	
   750		xfs_sbversion_add_attr2(mp, args->trans);
   751	}
   752	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux