diff mbox series

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

Message ID 20250303204751.145171-1-joaoboni017@gmail.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [v2] e1000: The 'const' qualifier has been added where applicable to enhance code safety and prevent unintended modifications. | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: From:/Signed-off-by: email name mismatch: 'From: joaomboni <joaoboni017@gmail.com>' != 'Signed-off-by: Joao Bonifacio <joaoboni017@gmail.com>' WARNING: Missing commit description - Add an appropriate one
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 30 this patch: 30
netdev/source_inline success Was 0 now: 0

Commit Message

Joao Bonifacio March 3, 2025, 8:47 p.m. UTC
Signed-off-by: Joao Bonifacio <joaoboni017@gmail.com>
---
 drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Przemek Kitszel March 4, 2025, 8:27 a.m. UTC | #1
On 3/3/25 21:47, joaomboni wrote:
> Signed-off-by: Joao Bonifacio <joaoboni017@gmail.com>

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 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index 3f089c3d47b2..96bc85f09aaf 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -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.

> -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
Loktionov, Aleksandr March 4, 2025, 9:13 a.m. UTC | #2
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> joaomboni
> Sent: Monday, March 3, 2025 9:48 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; andrew+netdev@lunn.ch;
> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com
> Cc: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; joaomboni <joaoboni017@gmail.com>
> Subject: [Intel-wired-lan] [PATCH v2] e1000: The 'const' qualifier has been
> added where applicable to enhance code safety and prevent unintended
> modifications.
> 
> Signed-off-by: Joao Bonifacio <joaoboni017@gmail.com>
Good!
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

> ---
>  drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c
> b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index 3f089c3d47b2..96bc85f09aaf 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -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
Loktionov, Aleksandr March 4, 2025, 9:15 a.m. UTC | #3
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Przemek Kitszel
> Sent: Tuesday, March 4, 2025 9:28 AM
> To: joaomboni <joaoboni017@gmail.com>
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>;
> andrew+netdev@lunn.ch; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com; intel-wired-lan@lists.osuosl.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [Intel-wired-lan] [PATCH v2] e1000: The 'const' qualifier has been
> added where applicable to enhance code safety and prevent unintended
> modifications.
> 
> On 3/3/25 21:47, joaomboni wrote:
> > Signed-off-by: Joao Bonifacio <joaoboni017@gmail.com>
> 
> 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.

> Next paragraph:
> Mark global variables const, so unintended modification would not be
> possible.
> 
> > ---
> >   drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c
> > b/drivers/net/ethernet/intel/e1000/e1000_main.c
> > index 3f089c3d47b2..96bc85f09aaf 100644
> > --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> > +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> > @@ -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.
> 
> > -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
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 3f089c3d47b2..96bc85f09aaf 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -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