[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [dmidecode] [PATCH] dmioem: Incorrect use of static
From: |
Jean Delvare |
Subject: |
Re: [dmidecode] [PATCH] dmioem: Incorrect use of static |
Date: |
Sat, 18 Jun 2022 11:16:12 +0200 |
Hi Jerry,
On Fri, 17 Jun 2022 10:58:19 -0600, Jerry Hoemann wrote:
> The *str = "Reserved" is intended as the default value when index is
> outside of the array. str shouldn't retain values from an earlier
> invocation of the function.
>
> Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
> ---
> dmioem.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/dmioem.c b/dmioem.c
> index 1b4fcd8..c26fff9 100644
> --- a/dmioem.c
> +++ b/dmioem.c
> @@ -243,7 +243,7 @@ static void dmi_hp_203_bayenc(const char *fname, u8 num)
>
> static void dmi_hp_203_devtyp(const char *fname, unsigned int code)
> {
> - static const char *str = "Reserved";
> + const char *str = "Reserved";
> static const char *type[] = {
> "Unknown", /* 0x00 */
> "Reserved",
> @@ -273,7 +273,7 @@ static void dmi_hp_203_devtyp(const char *fname, unsigned
> int code)
>
> static void dmi_hp_203_devloc(const char *fname, unsigned int code)
> {
> - static const char *str = "Reserved";
> + const char *str = "Reserved";
> static const char *location[] = {
> "Unknown", /* 0x00 */
> "Embedded",
> @@ -301,7 +301,7 @@ static void dmi_hp_203_devloc(const char *fname, unsigned
> int code)
>
> static void dmi_hp_238_loc(const char *fname, unsigned int code)
> {
> - static const char *str = "Reserved";
> + const char *str = "Reserved";
> static const char *location[] = {
> "Internal", /* 0x00 */
> "Front of Server",
> @@ -321,7 +321,7 @@ static void dmi_hp_238_loc(const char *fname, unsigned
> int code)
>
> static void dmi_hp_238_flags(const char *fname, unsigned int code)
> {
> - static const char *str = "Reserved";
> + const char *str = "Reserved";
> static const char *flags[] = {
> "Not Shared", /* 0x00 */
> "Shared with physical switch",
> @@ -336,7 +336,7 @@ static void dmi_hp_238_flags(const char *fname, unsigned
> int code)
>
> static void dmi_hp_238_speed(const char *fname, unsigned int code)
> {
> - static const char *str = "Reserved";
> + const char *str = "Reserved";
> static const char *speed[] = {
> "Reserved", /* 0x00 */
> "USB 1.1 Full Speed",
Nice catch. Applied, thanks.
--
Jean Delvare
SUSE L3 Support