* [PATCH] staging: rtl8192e: Constify struct pci_device_id
@ 2024-08-31 16:08 Riyan Dhiman
2024-09-02 17:37 ` Philipp Hortmann
0 siblings, 1 reply; 2+ messages in thread
From: Riyan Dhiman @ 2024-08-31 16:08 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-staging, Riyan Dhiman
static variable struct pci_device_id rtl8192_pci_id_tbl is not modified
in file rtl_core.c.
Constifying this structure moves some data to a read-only section, so
increase overall security.
Before
======
text data bss dec hex filename
17838 893 1 18732 492c drivers/staging/rtl8192e/rtl8192e/rtl_core.o
After
=====
text data bss dec hex filename
18006 725 1 18732 492c drivers/staging/rtl8192e/rtl8192e/rtl_core.o
Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
---
Compile tested only
--
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index ad21263e725f..22a203d01b8a 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -25,7 +25,7 @@
int hwwep = 1;
static char *ifname = "wlan%d";
-static struct pci_device_id rtl8192_pci_id_tbl[] = {
+static const struct pci_device_id rtl8192_pci_id_tbl[] = {
{PCI_DEVICE(0x10ec, 0x8192)},
{PCI_DEVICE(0x07aa, 0x0044)},
{PCI_DEVICE(0x07aa, 0x0047)},
--
2.46.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: rtl8192e: Constify struct pci_device_id
2024-08-31 16:08 [PATCH] staging: rtl8192e: Constify struct pci_device_id Riyan Dhiman
@ 2024-09-02 17:37 ` Philipp Hortmann
0 siblings, 0 replies; 2+ messages in thread
From: Philipp Hortmann @ 2024-09-02 17:37 UTC (permalink / raw)
To: Riyan Dhiman, gregkh; +Cc: linux-kernel, linux-staging
On 8/31/24 18:08, Riyan Dhiman wrote:
> static variable struct pci_device_id rtl8192_pci_id_tbl is not modified
> in file rtl_core.c.
>
> Constifying this structure moves some data to a read-only section, so
> increase overall security.
>
> Before
> ======
> text data bss dec hex filename
> 17838 893 1 18732 492c drivers/staging/rtl8192e/rtl8192e/rtl_core.o
>
> After
> =====
> text data bss dec hex filename
> 18006 725 1 18732 492c drivers/staging/rtl8192e/rtl8192e/rtl_core.o
>
> Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
> ---
> Compile tested only
> --
> drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> index ad21263e725f..22a203d01b8a 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> @@ -25,7 +25,7 @@
> int hwwep = 1;
> static char *ifname = "wlan%d";
>
> -static struct pci_device_id rtl8192_pci_id_tbl[] = {
> +static const struct pci_device_id rtl8192_pci_id_tbl[] = {
> {PCI_DEVICE(0x10ec, 0x8192)},
> {PCI_DEVICE(0x07aa, 0x0044)},
> {PCI_DEVICE(0x07aa, 0x0047)},
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-02 17:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-31 16:08 [PATCH] staging: rtl8192e: Constify struct pci_device_id Riyan Dhiman
2024-09-02 17:37 ` Philipp Hortmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).