* [PATCH] kconfig: do not use OR-assignment for zero-cleared structure
@ 2020-04-13 15:33 Masahiro Yamada
2020-04-25 16:59 ` Masahiro Yamada
0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2020-04-13 15:33 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel
The simple assignment is enough because memset() three lines above
has zero-cleared the structure.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/kconfig/symbol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 3dc81397d003..9363e37b8870 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -831,7 +831,7 @@ struct symbol *sym_lookup(const char *name, int flags)
memset(symbol, 0, sizeof(*symbol));
symbol->name = new_name;
symbol->type = S_UNKNOWN;
- symbol->flags |= flags;
+ symbol->flags = flags;
symbol->next = symbol_hash[hash];
symbol_hash[hash] = symbol;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kconfig: do not use OR-assignment for zero-cleared structure
2020-04-13 15:33 [PATCH] kconfig: do not use OR-assignment for zero-cleared structure Masahiro Yamada
@ 2020-04-25 16:59 ` Masahiro Yamada
0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2020-04-25 16:59 UTC (permalink / raw)
To: Linux Kbuild mailing list; +Cc: Linux Kernel Mailing List
On Tue, Apr 14, 2020 at 12:33 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> The simple assignment is enough because memset() three lines above
> has zero-cleared the structure.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> scripts/kconfig/symbol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index 3dc81397d003..9363e37b8870 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -831,7 +831,7 @@ struct symbol *sym_lookup(const char *name, int flags)
> memset(symbol, 0, sizeof(*symbol));
> symbol->name = new_name;
> symbol->type = S_UNKNOWN;
> - symbol->flags |= flags;
> + symbol->flags = flags;
>
> symbol->next = symbol_hash[hash];
> symbol_hash[hash] = symbol;
> --
> 2.25.1
>
Applied to linux-kbuild.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-25 17:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 15:33 [PATCH] kconfig: do not use OR-assignment for zero-cleared structure Masahiro Yamada
2020-04-25 16:59 ` Masahiro Yamada
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.