Re: [PATCH] fbdev: pvr2fb: correct user pointer annotation and sentinel initializer
Uwe Kleine-König <[email protected]> Sat, 18 Jul 2026 23:57:40 +0200
| Newsgroups | org.kernel.vger.linux-fbdev,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <alv10qYL3K8_Tjqv@monoceros> |
On Mon, Jul 13, 2026 at 12:16:38PM +0200, Florian Fuchs wrote:
> Add __user annotation to buf, as it is passed as a user pointer in
> pin_user_pages_fast(). Use an empty initializer for the sentinel
> board-table entry to avoid initializing a function pointer with an
> integer literal.
FTR: Using 0 in an initializer is covered by the C standard. Anyhow, I
agree that { } is nicer.
Having said that, I think the right thing to do here is to drop the
sentinel entry, because board_driver[] is only used in for loops that
iterate between 0 (inclusive) and ARRAY_SIZE(board_driver) (exclusive).
Also I would split this patch in two.
Best regards
Uwe
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmpb9tIACgkQj4D7WH0S /k6qngf9HPcjOLFf9ebMiIVzfNiUMnp3nKAf85kikPbocb6uZIoVWVmOOAbdaj/C Tt7C7ycDzH1+PbhZFJ+1x3bKOQdYwHpeejamFt/nD2ZAeBxz+9n3ffyHgl2A1mtz NG5iP2KvP12HrLUBl77GyHrNRc8lSNQPDjNoig1hoD/BXQovkL+vHqmarxeGO0b1 8mM+IEnlVfafEVlywlgSPst6xDnp75HoXQeBxEn0URZosnkm5V6qQklbEpIYXc3E MN5ANqf3R7WzP2B2QTJl/fmW5c3QwxhwBUrNHp4GPC3MQI6o5zYgfQ6Ma9RGsTEv j32/Xe/K4MPfVPlfaJrPyCX4JjJmtg== =FAiA -----END PGP SIGNATURE-----