Message ID | 8b133e7ec0e9aef728be301ac019c5ddcb3bbf51.1704908087.git.jani.nikula@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: enable W=1 warnings by default across the subsystem | expand |
On Wed, 10 Jan 2024, Jani Nikula <jani.nikula@intel.com> wrote: > Fix the W=1 warning -Wunused-but-set-variable. > > Cc: Karol Herbst <kherbst@redhat.com> > Cc: Lyude Paul <lyude@redhat.com> > Cc: Danilo Krummrich <dakr@redhat.com> > Cc: nouveau@lists.freedesktop.org > Signed-off-by: Jani Nikula <jani.nikula@intel.com> Ping? > --- > drivers/gpu/drm/nouveau/nouveau_svm.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c > index cc03e0c22ff3..4d1008915499 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_svm.c > +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c > @@ -112,7 +112,7 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, > { > struct nouveau_cli *cli = nouveau_cli(file_priv); > struct drm_nouveau_svm_bind *args = data; > - unsigned target, cmd, priority; > + unsigned target, cmd; > unsigned long addr, end; > struct mm_struct *mm; > > @@ -136,9 +136,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, > return -EINVAL; > } > > - priority = args->header >> NOUVEAU_SVM_BIND_PRIORITY_SHIFT; > - priority &= NOUVEAU_SVM_BIND_PRIORITY_MASK; > - > /* FIXME support CPU target ie all target value < GPU_VRAM */ > target = args->header >> NOUVEAU_SVM_BIND_TARGET_SHIFT; > target &= NOUVEAU_SVM_BIND_TARGET_MASK; > @@ -926,15 +923,14 @@ nouveau_pfns_map(struct nouveau_svmm *svmm, struct mm_struct *mm, > unsigned long addr, u64 *pfns, unsigned long npages) > { > struct nouveau_pfnmap_args *args = nouveau_pfns_to_args(pfns); > - int ret; > > args->p.addr = addr; > args->p.size = npages << PAGE_SHIFT; > > mutex_lock(&svmm->mutex); > > - ret = nvif_object_ioctl(&svmm->vmm->vmm.object, args, > - struct_size(args, p.phys, npages), NULL); > + nvif_object_ioctl(&svmm->vmm->vmm.object, args, > + struct_size(args, p.phys, npages), NULL); > > mutex_unlock(&svmm->mutex); > }
On 1/10/24 18:39, Jani Nikula wrote: > Fix the W=1 warning -Wunused-but-set-variable. > > Cc: Karol Herbst <kherbst@redhat.com> > Cc: Lyude Paul <lyude@redhat.com> > Cc: Danilo Krummrich <dakr@redhat.com> > Cc: nouveau@lists.freedesktop.org > Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Danilo Krummrich <dakr@redhat.com> > --- > drivers/gpu/drm/nouveau/nouveau_svm.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c > index cc03e0c22ff3..4d1008915499 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_svm.c > +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c > @@ -112,7 +112,7 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, > { > struct nouveau_cli *cli = nouveau_cli(file_priv); > struct drm_nouveau_svm_bind *args = data; > - unsigned target, cmd, priority; > + unsigned target, cmd; > unsigned long addr, end; > struct mm_struct *mm; > > @@ -136,9 +136,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, > return -EINVAL; > } > > - priority = args->header >> NOUVEAU_SVM_BIND_PRIORITY_SHIFT; > - priority &= NOUVEAU_SVM_BIND_PRIORITY_MASK; > - > /* FIXME support CPU target ie all target value < GPU_VRAM */ > target = args->header >> NOUVEAU_SVM_BIND_TARGET_SHIFT; > target &= NOUVEAU_SVM_BIND_TARGET_MASK; > @@ -926,15 +923,14 @@ nouveau_pfns_map(struct nouveau_svmm *svmm, struct mm_struct *mm, > unsigned long addr, u64 *pfns, unsigned long npages) > { > struct nouveau_pfnmap_args *args = nouveau_pfns_to_args(pfns); > - int ret; > > args->p.addr = addr; > args->p.size = npages << PAGE_SHIFT; > > mutex_lock(&svmm->mutex); > > - ret = nvif_object_ioctl(&svmm->vmm->vmm.object, args, > - struct_size(args, p.phys, npages), NULL); > + nvif_object_ioctl(&svmm->vmm->vmm.object, args, > + struct_size(args, p.phys, npages), NULL); > > mutex_unlock(&svmm->mutex); > }
On Wed, 31 Jan 2024, Danilo Krummrich <dakr@redhat.com> wrote: > On 1/10/24 18:39, Jani Nikula wrote: >> Fix the W=1 warning -Wunused-but-set-variable. >> >> Cc: Karol Herbst <kherbst@redhat.com> >> Cc: Lyude Paul <lyude@redhat.com> >> Cc: Danilo Krummrich <dakr@redhat.com> >> Cc: nouveau@lists.freedesktop.org >> Signed-off-by: Jani Nikula <jani.nikula@intel.com> > > Reviewed-by: Danilo Krummrich <dakr@redhat.com> Thanks, pushed to drm-misc-next.
diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c index cc03e0c22ff3..4d1008915499 100644 --- a/drivers/gpu/drm/nouveau/nouveau_svm.c +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c @@ -112,7 +112,7 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, { struct nouveau_cli *cli = nouveau_cli(file_priv); struct drm_nouveau_svm_bind *args = data; - unsigned target, cmd, priority; + unsigned target, cmd; unsigned long addr, end; struct mm_struct *mm; @@ -136,9 +136,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, return -EINVAL; } - priority = args->header >> NOUVEAU_SVM_BIND_PRIORITY_SHIFT; - priority &= NOUVEAU_SVM_BIND_PRIORITY_MASK; - /* FIXME support CPU target ie all target value < GPU_VRAM */ target = args->header >> NOUVEAU_SVM_BIND_TARGET_SHIFT; target &= NOUVEAU_SVM_BIND_TARGET_MASK; @@ -926,15 +923,14 @@ nouveau_pfns_map(struct nouveau_svmm *svmm, struct mm_struct *mm, unsigned long addr, u64 *pfns, unsigned long npages) { struct nouveau_pfnmap_args *args = nouveau_pfns_to_args(pfns); - int ret; args->p.addr = addr; args->p.size = npages << PAGE_SHIFT; mutex_lock(&svmm->mutex); - ret = nvif_object_ioctl(&svmm->vmm->vmm.object, args, - struct_size(args, p.phys, npages), NULL); + nvif_object_ioctl(&svmm->vmm->vmm.object, args, + struct_size(args, p.phys, npages), NULL); mutex_unlock(&svmm->mutex); }
Fix the W=1 warning -Wunused-but-set-variable. Cc: Karol Herbst <kherbst@redhat.com> Cc: Lyude Paul <lyude@redhat.com> Cc: Danilo Krummrich <dakr@redhat.com> Cc: nouveau@lists.freedesktop.org Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/nouveau/nouveau_svm.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)