Re: [External] [PATCH] platform/x86: thinkpad-lmi: Remove unused display_name member from struct tlmi_pwd_setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2021-05-31 9:59 a.m., Hans de Goede wrote:
> The struct tlmi_pwd_setting display_name member is initialized,
> but never read. Remove it and the TLMI_PWDTYPE_MAXLEN define.
> 
> While at it also remove some other unused [MAX]LEN defines.
> 
> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> ---
>  drivers/platform/x86/think-lmi.c | 2 --
>  drivers/platform/x86/think-lmi.h | 9 ---------
>  2 files changed, 11 deletions(-)
> 
> diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
> index 854427fed1a9..782d8e3fe7a1 100644
> --- a/drivers/platform/x86/think-lmi.c
> +++ b/drivers/platform/x86/think-lmi.c
> @@ -819,7 +819,6 @@ static int tlmi_analyze(void)
>  		ret = -ENOMEM;
>  		goto fail_clear_attr;
>  	}
> -	strscpy(tlmi_priv.pwd_admin->display_name, "admin", TLMI_PWDTYPE_MAXLEN);
>  	strscpy(tlmi_priv.pwd_admin->kbdlang, "us", TLMI_LANG_MAXLEN);
>  	tlmi_priv.pwd_admin->encoding = TLMI_ENCODING_ASCII;
>  	tlmi_priv.pwd_admin->pwd_type = "pap";
> @@ -836,7 +835,6 @@ static int tlmi_analyze(void)
>  		ret = -ENOMEM;
>  		goto fail_clear_attr;
>  	}
> -	strscpy(tlmi_priv.pwd_power->display_name, "power-on", TLMI_PWDTYPE_MAXLEN);
>  	strscpy(tlmi_priv.pwd_power->kbdlang, "us", TLMI_LANG_MAXLEN);
>  	tlmi_priv.pwd_power->encoding = TLMI_ENCODING_ASCII;
>  	tlmi_priv.pwd_power->pwd_type = "pop";
> diff --git a/drivers/platform/x86/think-lmi.h b/drivers/platform/x86/think-lmi.h
> index 6cd5325cc50e..6fa8da7af6c7 100644
> --- a/drivers/platform/x86/think-lmi.h
> +++ b/drivers/platform/x86/think-lmi.h
> @@ -8,15 +8,7 @@
>  #define TLMI_SETTINGS_COUNT  256
>  #define TLMI_SETTINGS_MAXLEN 512
>  #define TLMI_PWD_BUFSIZE     129
> -#define TLMI_PWDTYPE_MAXLEN   64
> -#define TLMI_ENC_MAXLEN       64
>  #define TLMI_LANG_MAXLEN       4
> -#define TLMI_PWDTYPE_LEN       4
> -/*
> - * Longest string should be in the set command: allow size of BIOS
> - * option and choice
> - */
> -#define TLMI_GETSET_MAXLEN (TLMI_SETTINGS_MAXLEN + TLMI_SETTINGS_MAXLEN)
>  
>  /* Possible error values */
>  struct tlmi_err_codes {
> @@ -43,7 +35,6 @@ struct tlmi_pwdcfg {
>  struct tlmi_pwd_setting {
>  	struct kobject kobj;
>  	bool valid;
> -	char display_name[TLMI_PWDTYPE_MAXLEN];
>  	char password[TLMI_PWD_BUFSIZE];
>  	const char *pwd_type;
>  	const char *role;
> 
Thanks Hans - good catch.
Mark



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux