Skip to contentSkip to conversation

e1000: The 'const' qualifier has been added where applicable to enhance code safety and prevent unintended modifications.

PATCH In review joaomboni 3 participants 4 messages Mar 3, 2025 – Mar 4, 2025

Subsystems (3)
lore
Share & tools
lore

joaomboni

author
#0 lore raw

PATCH v2 1/1 e1000: The 'const' qualifier has been added where applicable to enhance code safety and prevent unintended modifications.

---
 drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +1 -1
index 3f089c3d47b2..96bc85f09aaf 100644
@@ -9,7 +9,7 @@
 #include <linux/if_vlan.h>
 
 char e1000_driver_name[] = "e1000";
-static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
+static const char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
 static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
 
 /* e1000_pci_tbl - PCI Device ID Table
Signature · 1 line
2.48.1
maintainer
#1 lore raw
Quoted 1 line · joaomboni

it will be good to use imperative mood in the Subject, and add one more paragraph, like:

Subject: e1000: mark global variables const where possible

Next paragraph:
Mark global variables const, so unintended modification would not be possible.

drivers/net/ethernet/intel/e1000/e1000_main.c line 11

Quoted 12 lines
---
  drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +0 -0
index 3f089c3d47b2..96bc85f09aaf 100644
@@ -9,7 +9,7 @@
  #include <linux/if_vlan.h>
 
  char e1000_driver_name[] = "e1000";

your commit message suggests that you add const "everywhere", but it seems that there are other candidates, like the one above

PS. You have to wait 24h before posting next revision.

Quoted 5 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +1 -1
-static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
+static const char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
  static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
 
  /* e1000_pci_tbl - PCI Device ID Table
#2 lore raw
Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Przemek Kitszel
Sent: Tuesday, March 4, 2025 9:28 AM
To: joaomboni <[email protected]>
Cc: Nguyen, Anthony L <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [Intel-wired-lan] [PATCH v2] e1000: The 'const' qualifier has been added where applicable to enhance code safety and prevent unintended modifications.

Quoted 8 lines
Quoted 1 line · joaomboni

it will be good to use imperative mood in the Subject, and add one more paragraph, like:

Subject: e1000: mark global variables const where possible

I'd suggest 'fix'
e1000: fix global variables const where possible
But anyway the change is useful and so small and well-understandable.

Quoted 31 lines

Next paragraph:
Mark global variables const, so unintended modification would not be possible.

drivers/net/ethernet/intel/e1000/e1000_main.c line 11

Quoted 13 lines
---
  drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +0 -0
index 3f089c3d47b2..96bc85f09aaf 100644
@@ -9,7 +9,7 @@
  #include <linux/if_vlan.h>
 
  char e1000_driver_name[] = "e1000";

your commit message suggests that you add const "everywhere", but it seems that there are other candidates, like the one above

PS. You have to wait 24h before posting next revision.

Quoted 8 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +2 -1
-static char e1000_driver_string[] = "Intel(R) PRO/1000 Network
 Driver";
+static const char e1000_driver_string[] = "Intel(R) PRO/1000 Network
+Driver";
  static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel

Corporation.";

/* e1000_pci_tbl - PCI Device ID Table

Reviewed-by on v2 1/1
#3 lore raw
In reply to joaomboni
Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of joaomboni
Sent: Monday, March 3, 2025 9:48 PM
To: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; joaomboni <[email protected]>
Subject: [Intel-wired-lan] [PATCH v2] e1000: The 'const' qualifier has been added where applicable to enhance code safety and prevent unintended modifications.

Quoted 1 line

Good!

Quoted 22 lines
---
 drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +1 -1
index 3f089c3d47b2..96bc85f09aaf 100644
@@ -9,7 +9,7 @@
 #include <linux/if_vlan.h>
 
 char e1000_driver_name[] = "e1000";
-static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
+static const char e1000_driver_string[] = "Intel(R) PRO/1000 Network
 Driver";
 static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel
 Corporation.";

/* e1000_pci_tbl - PCI Device ID Table
--
2.48.1