* [mchinth:sep_socwatch_linux_5.8 17/38] drivers/platform/x86/socperf/socperfdrv.c:1299:9: warning: Variable 'status' is reassigned a value before the old one has been used.
@ 2020-08-07 2:01 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-08-07 2:01 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 20805 bytes --]
tree: https://github.com/mchinth/linux sep_socwatch_linux_5.8
head: 9b0862a82e9ad6b0eec974f450499ed714da96cd
commit: ec64fc1d1d301f55264c7da61b5fd063981a6dc2 [17/38] platform/x86: SOCPERF3 support for sep & socwatch
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> drivers/platform/x86/socperf/socperfdrv.c:1299:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = socperf_Service_IOCTL(IOCTL_USE_INODE filp, _IOC_NR(cmd),
^
drivers/platform/x86/socperf/socperfdrv.c:1295:10: note: Variable 'status' is reassigned a value before the old one has been used.
status = copy_from_user(&local_args, (void __user *)arg,
^
drivers/platform/x86/socperf/socperfdrv.c:1299:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = socperf_Service_IOCTL(IOCTL_USE_INODE filp, _IOC_NR(cmd),
^
drivers/platform/x86/socperf/socperfdrv.c:1368:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = socperf_Finish_Stop();
^
drivers/platform/x86/socperf/socperfdrv.c:1365:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = socperf_Prepare_Stop();
^
drivers/platform/x86/socperf/socperfdrv.c:1368:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = socperf_Finish_Stop();
^
drivers/platform/x86/socperf/socperfdrv.c:1371:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = socperf_Terminate();
^
drivers/platform/x86/socperf/socperfdrv.c:1368:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = socperf_Finish_Stop();
^
drivers/platform/x86/socperf/socperfdrv.c:1371:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = socperf_Terminate();
^
>> drivers/platform/x86/socperf/socperfdrv.c:1300:12: warning: Uninitialized variable: local_args [uninitvar]
local_args);
^
drivers/platform/x86/socperf/socperfdrv.c:1336:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = socperf_Service_IOCTL(filp, _IOC_NR(cmd), local_args);
^
drivers/platform/x86/socperf/socperfdrv.c:1325:10: note: Variable 'status' is reassigned a value before the old one has been used.
status = copy_from_user(&local_args_compat,
^
drivers/platform/x86/socperf/socperfdrv.c:1336:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = socperf_Service_IOCTL(filp, _IOC_NR(cmd), local_args);
^
--
>> drivers/platform/x86/sepdk/sep/lwpmudrv.c:3279:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = lwpmudrv_Read_MSRs(arg);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3244:10: note: Variable 'status' is reassigned a value before the old one has been used.
status = lwpmudrv_Pause();
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3279:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = lwpmudrv_Read_MSRs(arg);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:6250:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = OS_INVALID;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:6248:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = put_user(-1, (U32 __user *)args->buf_drv_to_usr);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:6250:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = OS_INVALID;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:6962:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = lwpmu_Service_IOCTL(IOCTL_USE_INODE filp, _IOC_NR(cmd),
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:6958:10: note: Variable 'status' is reassigned a value before the old one has been used.
status = copy_from_user(&local_args, (void __user *)arg,
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:6962:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = lwpmu_Service_IOCTL(IOCTL_USE_INODE filp, _IOC_NR(cmd),
^
>> drivers/platform/x86/sepdk/sep/lwpmudrv.c:377:28: warning: Local variable devices shadows outer variable [shadowVar]
LWPMU_DEVICE_acc_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:377:28: note: Shadow variable
LWPMU_DEVICE_acc_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:402:29: warning: Local variable devices shadows outer variable [shadowVar]
LWPMU_DEVICE_prev_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:402:29: note: Shadow variable
LWPMU_DEVICE_prev_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:390:29: warning: Local variable devices shadows outer variable [shadowVar]
LWPMU_DEVICE_acc_value(&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:377:28: note: Shadowed declaration
LWPMU_DEVICE_acc_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:390:29: note: Shadow variable
LWPMU_DEVICE_acc_value(&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:395:8: warning: Local variable devices shadows outer variable [shadowVar]
&devices[i])[j][k][l] = 0LL;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:390:29: note: Shadowed declaration
LWPMU_DEVICE_acc_value(&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:395:8: note: Shadow variable
&devices[i])[j][k][l] = 0LL;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:406:30: warning: Local variable devices shadows outer variable [shadowVar]
LWPMU_DEVICE_prev_value(&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:377:28: note: Shadowed declaration
LWPMU_DEVICE_acc_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:406:30: note: Shadow variable
LWPMU_DEVICE_prev_value(&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:434:29: warning: Local variable devices shadows outer variable [shadowVar]
LWPMU_DEVICE_prev_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:434:29: note: Shadow variable
LWPMU_DEVICE_prev_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:454:29: warning: Local variable devices shadows outer variable [shadowVar]
LWPMU_DEVICE_acc_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:454:29: note: Shadow variable
LWPMU_DEVICE_acc_value(&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:448:8: warning: Local variable devices shadows outer variable [shadowVar]
&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:448:8: note: Shadow variable
&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:794:8: warning: Local variable devices shadows outer variable [shadowVar]
&devices[id])[i] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:794:8: note: Shadow variable
&devices[id])[i] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1365:27: warning: Local variable devices shadows outer variable [shadowVar]
LWPMU_DEVICE_cur_group(&devices[cur_device])[i] = 0;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1365:27: note: Shadow variable
LWPMU_DEVICE_cur_group(&devices[cur_device])[i] = 0;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1494:9: warning: Local variable devices shadows outer variable [shadowVar]
&devices[i])[j]++;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1494:9: note: Shadow variable
&devices[i])[j]++;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1502:9: warning: Local variable devices shadows outer variable [shadowVar]
&devices[i])[j] %=
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1502:9: note: Shadow variable
&devices[i])[j] %=
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1498:10: warning: Local variable devices shadows outer variable [shadowVar]
&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1494:9: note: Shadowed declaration
&devices[i])[j]++;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:1498:10: note: Shadow variable
&devices[i])[j] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2128:8: warning: Local variable devices shadows outer variable [shadowVar]
&devices[i])[j]++;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2128:8: note: Shadow variable
&devices[i])[j]++;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2130:8: warning: Local variable devices shadows outer variable [shadowVar]
&devices[i])[j] %=
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2130:8: note: Shadow variable
&devices[i])[j] %=
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2150:9: warning: Local variable devices shadows outer variable [shadowVar]
&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2128:8: note: Shadowed declaration
&devices[i])[j]++;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2150:9: note: Shadow variable
&devices[i])[j][k] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3651:34: warning: Local variable devices shadows outer variable [shadowVar]
LWPMU_DEVICE_PMU_register_data(&devices[cur_device])[group_id] = ecb;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:143:14: note: Shadowed declaration
LWPMU_DEVICE devices;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3651:34: note: Shadow variable
LWPMU_DEVICE_PMU_register_data(&devices[cur_device])[group_id] = ecb;
^
>> drivers/platform/x86/sepdk/sep/lwpmudrv.c:5821:34: warning: Local variable log_control shadows outer variable [shadowVar]
DRV_LOG_CONTROL_verbosities(&log_control)[i] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5790:23: note: Shadowed declaration
DRV_LOG_CONTROL_NODE log_control;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5821:34: note: Shadow variable
DRV_LOG_CONTROL_verbosities(&log_control)[i] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5897:34: warning: Local variable log_control shadows outer variable [shadowVar]
DRV_LOG_CONTROL_verbosities(&log_control)[i] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5790:23: note: Shadowed declaration
DRV_LOG_CONTROL_NODE log_control;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5897:34: note: Shadow variable
DRV_LOG_CONTROL_verbosities(&log_control)[i] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5913:33: warning: Local variable log_control shadows outer variable [shadowVar]
DRV_LOG_CONTROL_verbosities(&log_control)[i] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5790:23: note: Shadowed declaration
DRV_LOG_CONTROL_NODE log_control;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5913:33: note: Shadow variable
DRV_LOG_CONTROL_verbosities(&log_control)[i] =
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5925:5: warning: Local variable log_control shadows outer variable [shadowVar]
&log_control)[DRV_LOG_CONTROL_MAX_DATA_SIZE - 1] = 0;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5790:23: note: Shadowed declaration
DRV_LOG_CONTROL_NODE log_control;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:5925:5: note: Shadow variable
&log_control)[DRV_LOG_CONTROL_MAX_DATA_SIZE - 1] = 0;
^
>> drivers/platform/x86/sepdk/sep/lwpmudrv.c:2874:17: warning: Variable 'buf' is not assigned a value. [unassignedVariable]
EVENT_REG_NODE buf;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:7003:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = lwpmu_Service_IOCTL(filp, _IOC_NR(cmd), local_args);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:6991:10: note: Variable 'status' is reassigned a value before the old one has been used.
status = copy_from_user(&local_args_compat,
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:7003:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = lwpmu_Service_IOCTL(filp, _IOC_NR(cmd), local_args);
^
>> drivers/platform/x86/sepdk/sep/lwpmudrv.c:2667:15: warning: Variable 'cpu_idx' is reassigned a value before the old one has been used. [redundantAssignment]
for (cpu_idx = 0; cpu_idx < GLOBAL_STATE_num_cpus(driver_state);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2647:11: note: Variable 'cpu_idx' is reassigned a value before the old one has been used.
cpu_idx = (S32)CONTROL_THIS_CPU();
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2667:15: note: Variable 'cpu_idx' is reassigned a value before the old one has been used.
for (cpu_idx = 0; cpu_idx < GLOBAL_STATE_num_cpus(driver_state);
^
>> drivers/platform/x86/sepdk/sep/lwpmudrv.c:2667:15: warning: Variable 'cpu_idx' is reassigned a value before the old one has been used. [redundantAssignment]
for (cpu_idx = 0; cpu_idx < GLOBAL_STATE_num_cpus(driver_state);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2650:11: note: Variable 'cpu_idx' is reassigned a value before the old one has been used.
cpu_idx = *(S32 *)param;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2667:15: note: Variable 'cpu_idx' is reassigned a value before the old one has been used.
for (cpu_idx = 0; cpu_idx < GLOBAL_STATE_num_cpus(driver_state);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2835:15: warning: Variable 'cpu_idx' is reassigned a value before the old one has been used. [redundantAssignment]
for (cpu_idx = 0; cpu_idx < GLOBAL_STATE_num_cpus(driver_state);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2808:11: note: Variable 'cpu_idx' is reassigned a value before the old one has been used.
cpu_idx = (S32)CONTROL_THIS_CPU();
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2835:15: note: Variable 'cpu_idx' is reassigned a value before the old one has been used.
for (cpu_idx = 0; cpu_idx < GLOBAL_STATE_num_cpus(driver_state);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2835:15: warning: Variable 'cpu_idx' is reassigned a value before the old one has been used. [redundantAssignment]
for (cpu_idx = 0; cpu_idx < GLOBAL_STATE_num_cpus(driver_state);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2811:11: note: Variable 'cpu_idx' is reassigned a value before the old one has been used.
cpu_idx = *(S32 *)param;
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:2835:15: note: Variable 'cpu_idx' is reassigned a value before the old one has been used.
for (cpu_idx = 0; cpu_idx < GLOBAL_STATE_num_cpus(driver_state);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3282:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = lwpmudrv_Read_Metrics(arg);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3279:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = lwpmudrv_Read_MSRs(arg);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3282:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = lwpmudrv_Read_Metrics(arg);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3439:9: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
status = lwpmudrv_Read_Metrics(arg);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3437:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = lwpmudrv_Read_MSRs(arg);
^
drivers/platform/x86/sepdk/sep/lwpmudrv.c:3439:9: note: Variable 'status' is reassigned a value before the old one has been used.
status = lwpmudrv_Read_Metrics(arg);
^
vim +/status +1299 drivers/platform/x86/socperf/socperfdrv.c
1273
1274 long socperf_Device_Control(IOCTL_USE_INODE struct file *filp,
1275 unsigned int cmd, unsigned long arg)
1276 {
1277 int status = OS_SUCCESS;
1278 IOCTL_ARGS_NODE local_args;
1279
1280 #if !defined(DRV_USE_UNLOCKED_IOCTL)
1281 SOCPERF_PRINT_DEBUG(
1282 "lwpmu_DeviceControl(0x%x) called on inode maj:%d, min:%d\n",
1283 cmd, imajor(inode), iminor(inode));
1284 #endif
1285 SOCPERF_PRINT_DEBUG("type: %d, subcommand: %d\n", _IOC_TYPE(cmd),
1286 _IOC_NR(cmd));
1287
1288 if (_IOC_TYPE(cmd) != LWPMU_IOC_MAGIC) {
1289 SOCPERF_PRINT_ERROR("Unknown IOCTL magic:%d\n", _IOC_TYPE(cmd));
1290 return OS_ILLEGAL_IOCTL;
1291 }
1292
1293 MUTEX_LOCK(ioctl_lock);
1294 if (arg) {
1295 status = copy_from_user(&local_args, (void __user *)arg,
1296 sizeof(IOCTL_ARGS_NODE));
1297 }
1298
> 1299 status = socperf_Service_IOCTL(IOCTL_USE_INODE filp, _IOC_NR(cmd),
> 1300 local_args);
1301 MUTEX_UNLOCK(ioctl_lock);
1302
1303 return status;
1304 }
1305
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-07 2:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07 2:01 [mchinth:sep_socwatch_linux_5.8 17/38] drivers/platform/x86/socperf/socperfdrv.c:1299:9: warning: Variable 'status' is reassigned a value before the old one has been used kernel test robot
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.