linux/drivers/vfio/mdev
Hongbo Li 27a8204b26 vfio/mdev: Constify struct kobj_type
This 'struct kobj_type' is not modified. It is only used in
kobject_init_and_add() which takes a 'const struct kobj_type *ktype'
parameter.

Constifying this structure and moving it to a read-only section,
and this can increase over all security.

```
[Before]
   text   data    bss    dec    hex    filename
   2372    600      0   2972    b9c    drivers/vfio/mdev/mdev_sysfs.o

[After]
   text   data    bss    dec    hex    filename
   2436    568      0   3004    bbc    drivers/vfio/mdev/mdev_sysfs.o
```

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240904011837.2010444-1-lihongbo22@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2024-09-06 08:20:52 -06:00
..
Kconfig
Makefile
mdev_core.c
mdev_driver.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
mdev_private.h vfio: mdev: Remove unused function declarations 2024-09-03 08:42:07 -06:00
mdev_sysfs.c vfio/mdev: Constify struct kobj_type 2024-09-06 08:20:52 -06:00