Thread (13 messages) 13 messages, 5 authors, 2026-06-05

Re: [PATCH v1 6/8] zorro: Simplify storing pointers in device id struct

From: Max Staudt <max@enpas.org>
Date: 2026-05-28 07:58:14
Also in: dri-devel, linux-i2c, linux-ide, linux-m68k, linux-scsi, lkml, netdev

On 5/26/26 11:17 PM, Uwe Kleine-König (The Capable Hub) wrote:
Technically it is fine (on all current Linux architectures) to store a
pointer in an unsigned long variable. However this needs explicit
casting which is an easy source for type mismatches.

By replacing the plain unsigned long .driver_data in struct
zorro_device_id by an anonymous union, most of the casting can be
dropped. There is still some implicit casting involved (between a void *
and a driver specific pointer type), but that's better than the approach
to store a pointer in an unsigned long variable as this doesn't lose the
information that the data being pointed to is const.

All users of struct zorro_device_id are initialized in a way that is
compatible with the new definition, so no adaptions are needed there.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <redacted>

Thanks Uwe!

Reviewed-by: Max Staudt <max@enpas.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help