diff mbox series

kernel: auditfilter: Remove unnecessary ‘0’ values from ret

Message ID 20231228025600.9796-1-zeming@nfschina.com (mailing list archive)
State Accepted
Delegated to: Paul Moore
Headers show
Series kernel: auditfilter: Remove unnecessary ‘0’ values from ret | expand

Commit Message

Li zeming Dec. 28, 2023, 2:56 a.m. UTC
The ret variable is assigned when it does not need to be defined, as it
has already been assigned before use.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 kernel/auditfilter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Moore Jan. 4, 2024, 9:30 p.m. UTC | #1
On Wed, Dec 27, 2023 at 9:56 PM Li zeming <zeming@nfschina.com> wrote:
>
> The ret variable is assigned when it does not need to be defined, as it
> has already been assigned before use.
>
> Signed-off-by: Li zeming <zeming@nfschina.com>
> ---
>  kernel/auditfilter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for the patch, as this is not a critical change it will be
processed after the upcoming merge window closes.

> diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
> index 8317a37dea0bb..be8c680121e46 100644
> --- a/kernel/auditfilter.c
> +++ b/kernel/auditfilter.c
> @@ -788,7 +788,7 @@ static int audit_compare_rule(struct audit_krule *a, struct audit_krule *b)
>  static inline int audit_dupe_lsm_field(struct audit_field *df,
>                                            struct audit_field *sf)
>  {
> -       int ret = 0;
> +       int ret;
>         char *lsm_str;
>
>         /* our own copy of lsm_str */
> --
> 2.18.2
Paul Moore Jan. 25, 2024, 2:59 p.m. UTC | #2
On Dec 27, 2023 Li zeming <zeming@nfschina.com> wrote:
> 
> The ret variable is assigned when it does not need to be defined, as it
> has already been assigned before use.
> 
> Signed-off-by: Li zeming <zeming@nfschina.com>
> ---
>  kernel/auditfilter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Merged into audit/dev, thanks.

--
paul-moore.com
diff mbox series

Patch

diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 8317a37dea0bb..be8c680121e46 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -788,7 +788,7 @@  static int audit_compare_rule(struct audit_krule *a, struct audit_krule *b)
 static inline int audit_dupe_lsm_field(struct audit_field *df,
 					   struct audit_field *sf)
 {
-	int ret = 0;
+	int ret;
 	char *lsm_str;
 
 	/* our own copy of lsm_str */