mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: Fix LibC MISRA 17.7 in os/linux
MISRA Rule-17.7 requires the return value of all functions to be used. Fix is either to use the return value or change the function to return void. This patch contains fix for all 17.7 violations instandard C functions in OS/Linux interface. JIRA NVGPU-1036 Change-Id: I39b20f1d0e1a1da56d452f2c3d5ee049666cefe8 Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1929900 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
e059f3cb12
commit
b9e7ea65e1
@@ -198,7 +198,7 @@ static ssize_t nvgpu_clk_arb_read_event_dev(struct file *filp, char __user *buf,
|
||||
if ((size - *off) < sizeof(info))
|
||||
return 0;
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
(void) memset(&info, 0, sizeof(info));
|
||||
/* Get the oldest event from the queue */
|
||||
while (!__pending_event(dev, &info)) {
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
@@ -257,7 +257,7 @@ static long nvgpu_clk_arb_ioctl_event_dev(struct file *filp, unsigned int cmd,
|
||||
|
||||
BUG_ON(_IOC_SIZE(cmd) > NVGPU_EVENT_IOCTL_MAX_ARG_SIZE);
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
(void) memset(buf, 0, sizeof(buf));
|
||||
if (_IOC_DIR(cmd) & _IOC_WRITE) {
|
||||
if (copy_from_user(buf, (void __user *) arg, _IOC_SIZE(cmd)))
|
||||
return -EFAULT;
|
||||
@@ -327,7 +327,7 @@ static int nvgpu_clk_arb_install_fd(struct gk20a *g,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
snprintf(name, sizeof(name), "%s-clk-fd%d", g->name, fd);
|
||||
(void) snprintf(name, sizeof(name), "%s-clk-fd%d", g->name, fd);
|
||||
file = anon_inode_getfile(name, fops, dev, O_RDWR);
|
||||
if (IS_ERR(file)) {
|
||||
err = PTR_ERR(file);
|
||||
|
||||
Reference in New Issue
Block a user