[PATCH 5/7] powerpc/pseries/papr-sysparm: expose chardev API to user space

kernel test robot lkp at intel.com
Wed Oct 11 08:44:32 AEDT 2023


Hi Nathan,

kernel test robot noticed the following build errors:

[auto build test ERROR on eddc90ea2af5933249ea1a78119f2c8ef8d07156]

url:    https://github.com/intel-lab-lkp/linux/commits/Nathan-Lynch-via-B4-Relay/powerpc-uapi-export-papr-miscdev-h-header/20231007-050832
base:   eddc90ea2af5933249ea1a78119f2c8ef8d07156
patch link:    https://lore.kernel.org/r/20231006-papr-sys_rtas-vs-lockdown-v1-5-3a36bfb66e2e%40linux.ibm.com
patch subject: [PATCH 5/7] powerpc/pseries/papr-sysparm: expose chardev API to user space
config: powerpc64-randconfig-002-20231010 (https://download.01.org/0day-ci/archive/20231011/202310110529.nINDz0Nx-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231011/202310110529.nINDz0Nx-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310110529.nINDz0Nx-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/powerpc/platforms/pseries/papr-sysparm.c: In function 'papr_sysparm_buf_from_user':
>> arch/powerpc/platforms/pseries/papr-sysparm.c:208:24: error: variable 'param' set but not used [-Werror=unused-but-set-variable]
     208 |         papr_sysparm_t param;
         |                        ^~~~~
   cc1: all warnings being treated as errors


vim +/param +208 arch/powerpc/platforms/pseries/papr-sysparm.c

   203	
   204	static struct papr_sysparm_buf *
   205	papr_sysparm_buf_from_user(const struct papr_sysparm_io_block __user *user_iob)
   206	{
   207		struct papr_sysparm_buf *kern_spbuf;
 > 208		papr_sysparm_t param;
   209		long err;
   210		u16 len;
   211	
   212		/*
   213		 * The parameter index that userspace wants to query or update.
   214		 */
   215		if (get_user(param.token, &user_iob->parameter))
   216			return ERR_PTR(-EFAULT);
   217		/*
   218		 * The length of valid data that userspace claims to be in
   219		 * user_iob->data[].
   220		 */
   221		if (get_user(len, &user_iob->length))
   222			return ERR_PTR(-EFAULT);
   223	
   224		static_assert(sizeof(user_iob->data) >= PAPR_SYSPARM_MAX_INPUT);
   225		static_assert(sizeof(kern_spbuf->val) >= PAPR_SYSPARM_MAX_INPUT);
   226	
   227		if (len > PAPR_SYSPARM_MAX_INPUT)
   228			return ERR_PTR(-EINVAL);
   229	
   230		kern_spbuf = papr_sysparm_buf_alloc();
   231		if (!kern_spbuf)
   232			return ERR_PTR(-ENOMEM);
   233	
   234		papr_sysparm_buf_set_length(kern_spbuf, len);
   235	
   236		if (len > 0 && copy_from_user(kern_spbuf->val, user_iob->data, len)) {
   237			err = -EFAULT;
   238			goto free_sysparm_buf;
   239		}
   240	
   241		return kern_spbuf;
   242	
   243	free_sysparm_buf:
   244		papr_sysparm_buf_free(kern_spbuf);
   245		return ERR_PTR(err);
   246	}
   247	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


More information about the Linuxppc-dev mailing list