linux-stable/include
Greg Kroah-Hartman 7ebe49b76a driver core: allow kobj_to_dev() to take a const pointer
If a const * to a kobject is passed to kobj_to_dev(), we want to return
back a const * to a device as the driver core shouldn't be modifying a
constant structure.  But when dealing with container_of() the pointer
const attribute is cast away, so we need to manually handle this by
determining the type of the pointer passed in to know the type of the
pointer to pass out.

Luckily _Generic can do this type of magic, and as the kernel now
supports C11 it is availble to us to handle this type of build-time type
detection.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221016104126.1259809-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-10-20 12:05:12 +02:00
..
acpi platform-drivers-x86 for v6.1-1 2022-10-05 10:38:24 -07:00
asm-generic - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
clocksource
crypto
drm Driver core changes for 6.1-rc1 2022-10-07 17:04:10 -07:00
dt-bindings These are the pin control changes for the v6.1 kernel cycle: 2022-10-11 10:59:59 -07:00
keys
kunit kunit: declare kunit_assert structs as const 2022-10-07 10:19:18 -06:00
kvm
linux driver core: allow kobj_to_dev() to take a const pointer 2022-10-20 12:05:12 +02:00
math-emu
media USB/Thunderbolt changes for 6.1-rc1 2022-10-07 16:48:26 -07:00
memory
misc
net Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
pcmcia
ras
rdma
rv
scsi SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
soc RISC-V Patches for the 6.1 Merge Window, Part 2 2022-10-14 11:21:11 -07:00
sound ALSA: hda: Update register polling macros 2022-10-09 12:34:32 +02:00
target
trace f2fs-for-6.1-rc1 2022-10-10 20:28:41 -07:00
uapi This pull request contains updates for UBI and UBIFS 2022-10-14 18:23:23 -07:00
ufs SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
vdso
video
xen xen/virtio: enable grant based virtio on x86 2022-10-10 14:31:26 +02:00