linux-stable/drivers/gpu/drm
Linus Torvalds fca7526b7d drm/tests/drm_buddy: fix build failure on 32-bit targets
Guenter Roeck reports that commit a64056bb5a ("drm/tests/drm_buddy:
add alloc_contiguous test") causes build failures on 32-bit targets:

 "This patch breaks the build on all 32-bit systems since it introduces
  an unhandled direct 64-bit divide operation.

  ERROR: modpost: "__umoddi3" [drivers/gpu/drm/tests/drm_buddy_test.ko] undefined!
  ERROR: modpost: "__moddi3" [drivers/gpu/drm/tests/drm_buddy_test.ko] undefined!"

and the uses of 'u64' are all entirely pointless.  Yes, the arguments to
drm_buddy_init() and drm_buddy_alloc_blocks() are in fact of type 'u64',
but none of the values here are remotely relevant, and the compiler will
happily just do the type expansion.

Of course, in a perfect world the compiler would also have just noticed
that all the values in question are tiny, and range analysis would have
shown that doing a 64-bit divide is pointless, but that is admittedly
expecting a fair amount of the compiler.

IOW, we shouldn't write code that the compiler then has to notice is
unnecessarily complicated just to avoid extra work.  We do have fairly
high expectations of compilers, but kernel code should be reasonable to
begin with.

It turns out that there are also other issues with this code: the KUnit
assertion messages have incorrect types in the format strings, but
that's a widely spread issue caused by the KUnit infrastructure not
having enabled format string verification.  We'll get that sorted out
separately.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: a64056bb5a ("drm/tests/drm_buddy: add alloc_contiguous test")
Link: https://lore.kernel.org/all/538327ff-8d34-41d5-a9ae-1a334744f5ae@roeck-us.net/
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-02-20 12:16:47 -08:00
..
amd drm/amdgpu: Fix implicit assumtion in gfx11 debug flags 2024-02-15 14:18:44 -05:00
arm
armada
aspeed
ast This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
atmel-hlcdc
bridge drm: bridge: samsung-dsim: Don't use FORCE_STOP_STATE 2024-01-26 22:48:47 +09:00
ci Merge tag 'drm-msm-next-2023-12-15' of https://gitlab.freedesktop.org/drm/msm into drm-next 2023-12-20 07:54:03 +10:00
display drm/dp_mst: Separate @failing_port list in drm_dp_mst_atomic_check_mgr() comment 2024-01-22 19:20:36 +02:00
etnaviv
exynos Several fixups 2024-01-25 14:22:15 +10:00
fsl-dcu
gma500 drm: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
gud
hisilicon drm: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
hyperv drm/hyperv: Remove firmware framebuffers with aperture helper 2024-01-12 12:38:37 +01:00
i2c
i915 drm/i915/dp: Limit SST link rate to <=8.1Gbps 2024-02-12 11:39:19 +02:00
imagination One fix for drm/plane to avoid a use-after-free and some additional 2024-01-05 10:31:54 +10:00
imx
ingenic
kmb
lib
lima drm-next for 6.8: 2024-01-12 11:32:19 -08:00
logicvc
loongson This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
mcde
mediatek This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
meson
mgag200 This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
msm Merge tag 'drm-msm-fixes-2024-02-15' of https://gitlab.freedesktop.org/drm/msm into drm-fixes 2024-02-16 15:47:15 +10:00
mxsfb
nouveau A suspend/resume error fix for ivpu, a couple of scheduler fixes for 2024-02-16 14:33:38 +10:00
omapdrm
panel Linux 6.8-rc1 2024-01-22 09:44:15 +01:00
panfrost
pl111
qxl
radeon This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
renesas
rockchip drm/rockchip: vop2: add a missing unlock in vop2_crtc_atomic_enable() 2024-02-13 20:33:39 +01:00
scheduler drm/sched: Re-queue run job worker when drm_sched_entity_pop_job() returns NULL 2024-02-06 12:47:43 +10:00
solomon pwm: Changes for v6.8-rc1 2024-01-12 14:59:50 -08:00
sprd
sti
stm
sun4i drm: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
tegra drm/tegra: Do not assume that a NULL domain means no DMA IOMMU 2024-02-01 13:17:21 +01:00
tests drm/tests/drm_buddy: fix build failure on 32-bit targets 2024-02-20 12:16:47 -08:00
tidss
tilcdc
tiny
ttm A null pointer dereference fix for v3d and a protection fault fix for 2024-02-05 12:20:52 +01:00
tve200
udl
v3d drm/v3d: Free the job and assign it to NULL if initialization fails 2024-01-11 11:23:13 -03:00
vboxvideo
vc4 drm-next for 6.8: 2024-01-12 11:32:19 -08:00
vgem
virtio drm/virtio: Set segment size for virtio_gpu device 2024-01-29 11:44:34 +03:00
vkms
vmwgfx
xe drm/xe: avoid function cast warnings 2024-02-15 09:53:38 +01:00
xen
xlnx
drm_aperture.c
drm_atomic.c
drm_atomic_helper.c
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_auth.c drm-next for 6.8: 2024-01-12 11:32:19 -08:00
drm_blend.c
drm_bridge.c
drm_bridge_connector.c
drm_buddy.c drm/buddy: Fix alloc_range() error handling code 2024-02-14 15:22:05 +01:00
drm_cache.c
drm_client.c
drm_client_modeset.c
drm_color_mgmt.c
drm_connector.c
drm_crtc.c drm/crtc: fix uninitialized variable use even harder 2024-02-13 18:03:58 +02:00
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h
drm_damage_helper.c
drm_debugfs.c
drm_debugfs_crc.c
drm_displayid.c
drm_drv.c
drm_dumb_buffers.c
drm_edid.c drm-next for 6.8: 2024-01-12 11:32:19 -08:00
drm_edid_load.c
drm_eld.c
drm_encoder.c
drm_encoder_slave.c
drm_exec.c
drm_fb_dma_helper.c
drm_fb_helper.c
drm_fbdev_dma.c
drm_fbdev_generic.c
drm_file.c
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c drm: Warn when freeing a framebuffer that's still on a list 2023-12-23 07:31:29 +02:00
drm_gem.c
drm_gem_atomic_helper.c
drm_gem_dma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c
drm_gem_ttm_helper.c
drm_gem_vram_helper.c
drm_gpuvm.c Merge tag 'drm-msm-next-2023-12-15' of https://gitlab.freedesktop.org/drm/msm into drm-next 2023-12-20 07:54:03 +10:00
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_kms_helper_common.c
drm_lease.c
drm_managed.c
drm_mipi_dbi.c
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c
drm_pci.c
drm_plane.c drm: Don't unref the same fb many times by mistake due to deadlock handling 2023-12-23 07:31:05 +02:00
drm_plane_helper.c
drm_prime.c drm/prime: Support page array >= 4GB 2024-02-13 16:36:04 +01:00
drm_print.c
drm_privacy_screen.c
drm_privacy_screen_x86.c
drm_probe_helper.c
drm_property.c
drm_rect.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_suballoc.c
drm_syncobj.c drm-next for 6.8: 2024-01-12 11:32:19 -08:00
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c
drm_vblank_work.c
drm_vma_manager.c
drm_writeback.c
Kconfig
Makefile