linux-brain/drivers/gpu/drm/nouveau/nvkm/engine/device
Guenter Roeck 3825263486 drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV
commit e8f71f89236ef82d449991bfbc237e3cb6ea584f upstream.

nvkm test builds fail with the following error.

  drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c: In function 'nvkm_control_mthd_pstate_info':
  drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c:60:35: error: overflow in conversion from 'int' to '__s8' {aka 'signed char'} changes value from '-251' to '5'

The code builds on most architectures, but fails on parisc where ENOSYS
is defined as 251.

Replace the error code with -ENODEV (-19).  The actual error code does
not really matter and is not passed to userspace - it just has to be
negative.

Fixes: 7238eca4cf ("drm/nouveau: expose pstate selection per-power source in sysfs")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-26 14:07:14 +02:00
..
Kbuild drm/nouveau: fix bogus GPL-2 license header 2019-07-19 16:26:51 +10:00
acpi.c drm/nouveau/device: prepare for new-style subdevs 2015-08-28 12:40:35 +10:00
acpi.h drm/nouveau: fix bogus GPL-2 license header 2019-07-19 16:26:50 +10:00
base.c drm/nouveau/core: recognise TU116 chipset 2019-07-19 16:26:50 +10:00
ctrl.c drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV 2021-09-26 14:07:14 +02:00
ctrl.h drm/nouveau: fix bogus GPL-2 license header 2019-07-19 16:26:50 +10:00
pci.c drm/nouveau: consolidate handling of dma mask 2017-11-02 13:32:32 +10:00
priv.h drm/nouveau: fix bogus GPL-2 license header 2019-07-19 16:26:50 +10:00
tegra.c drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping 2018-07-16 18:06:36 +10:00
user.c drm/nouveau/fault/gp100: expose MaxwellFaultBufferA 2019-02-20 09:00:00 +10:00