dmaengine: idxd: remove set but unused 'rc'
Subsystems (2)
Vinod Koul
maintainerPATCH 1/1 dmaengine: idxd: remove set but unused 'rc'
The driver assigns result of check_vma() to rc and never checks the result, so remove the assignment
drivers/dma/idxd/cdev.c: In function ‘idxd_cdev_mmap’:drivers/dma/idxd/cdev.c:136:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
136 | int rc;
| ^~---
Dave, if you want the result of the check_vma() to be checked, feel free to send the patch for that
drivers/dma/idxd/cdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma/idxd/cdev.c +1 -2
@@ -133,10 +133,9 @@ static int idxd_cdev_mmap(struct file *filp, struct vm_area_struct *vma)struct pci_dev *pdev = idxd->pdev;phys_addr_t base =pci_resource_start (pdev,IDXD_WQ_BAR );unsigned long pfn; -int rc;dev_dbg (&pdev->dev,"%s called\n" , __func__); - rc =check_vma (wq, vma, __func__); +check_vma (wq, vma, __func__); vma->vm_flags |=VM_DONTCOPY ; pfn = (base + idxd_get_wq_portal_full_offset(wq->id,
Signature · 1 line
2.24.1
Dave Jiang
reviewerQuoted 5 lines · Vinod Koul
The driver assigns result of
check_vma()to rc and never checks the result, so remove the assignment
drivers/dma/idxd/cdev.c: In function ‘idxd_cdev_mmap’:drivers/dma/idxd/cdev.c:136:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
Quoted 8 lines
136 | int rc; | ^~Signed-off-by Vinod Koul <[email protected]>---
Dave, if you want the result of the
check_vma()to be checked, feel free to send the patch for that
Yes I will send a fix. Mistake from several code merges. Oops.
Quoted 21 lines
drivers/dma/idxd/cdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/dma/idxd/cdev.c +1
-2@@ -133,10 +133,9 @@ static int idxd_cdev_mmap(struct file *filp, struct vm_area_struct *vma)struct pci_dev *pdev = idxd->pdev;phys_addr_t base =pci_resource_start (pdev,IDXD_WQ_BAR );unsigned long pfn; -int rc;dev_dbg (&pdev->dev,"%s called\n" , __func__); - rc =check_vma (wq, vma, __func__); +check_vma (wq, vma, __func__); vma->vm_flags |=VM_DONTCOPY ; pfn = (base + idxd_get_wq_portal_full_offset(wq->id,
Vinod Koul
maintainerQuoted 11 lines · Dave Jiang
Quoted 8 lines · Vinod Koul
The driver assigns result of
check_vma()to rc and never checks the result, so remove the assignment
drivers/dma/idxd/cdev.c: In function ‘idxd_cdev_mmap’:drivers/dma/idxd/cdev.c:136:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]136 | int rc; | ^~
Quoted 7 lines
Quoted 5 lines
Signed-off-by Vinod Koul <[email protected]>---
Dave, if you want the result of the
check_vma()to be checked, feel free to send the patch for thatYes I will send a fix. Mistake from several code merges. Oops.
Ok, no issues
Signature · 1 line
~Vinod