Commit 4a21d31d authored by Hongbo Li's avatar Hongbo Li Committed by Michael S. Tsirkin
Browse files

fw_cfg: 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
   5974   1008     96   7078   1ba6    drivers/firmware/qemu_fw_cfg.o

[After]
   text   data    bss    dec    hex    filename
   6038    944     96   7078   1ba6    drivers/firmware/qemu_fw_cfg.o
```

Signed-off-by: default avatarHongbo Li <lihongbo22@huawei.com>
Message-Id: <20240904011743.2010319b-1-lihongbo22@huawei.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 62111654
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment