diff mbox series

[v3,4/5] platform/x86: think-lmi: Don't display unnecessary authentication settings

Message ID 20230526171658.3886-4-mpearson-lenovo@squebb.ca (mailing list archive)
State Changes Requested, archived
Headers show
Series [v3,1/5] platform/x86: think-lmi: Enable opcode support on BIOS settings | expand

Commit Message

Mark Pearson May 26, 2023, 5:16 p.m. UTC
If Opcode support is available (which is the standard for all platforms
going forward) then there is no need to have the encoding and kbdlang
attributes visible

Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
---
Changes in v2 & v3: None. Version bumped in series

 drivers/platform/x86/think-lmi.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ilpo Järvinen May 29, 2023, 12:05 p.m. UTC | #1
On Fri, 26 May 2023, Mark Pearson wrote:

> If Opcode support is available (which is the standard for all platforms
> going forward) then there is no need to have the encoding and kbdlang
> attributes visible
> 
> Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
> ---
> Changes in v2 & v3: None. Version bumped in series
> 
>  drivers/platform/x86/think-lmi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
> index 1c02958035ad..64cd453d6e7d 100644
> --- a/drivers/platform/x86/think-lmi.c
> +++ b/drivers/platform/x86/think-lmi.c
> @@ -879,6 +879,12 @@ static umode_t auth_attr_is_visible(struct kobject *kobj,
>  		return 0;
>  	}
>  
> +	/* Don't display un-needed settings if opcode available */
> +	if ((attr == &auth_encoding.attr ||
> +	    attr == &auth_kbdlang.attr) &&

Indentation issue here, attr must be at the same column although putting 
the || on a single line might make this easier to read.

> +	    tlmi_priv.opcode_support)
> +		return 0;
> +
>  	return attr->mode;
>  }
>  
>
Mark Pearson May 29, 2023, 2:50 p.m. UTC | #2
On Mon, May 29, 2023, at 8:05 AM, Ilpo Järvinen wrote:
> On Fri, 26 May 2023, Mark Pearson wrote:
>
>> If Opcode support is available (which is the standard for all platforms
>> going forward) then there is no need to have the encoding and kbdlang
>> attributes visible
>> 
>> Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
>> ---
>> Changes in v2 & v3: None. Version bumped in series
>> 
>>  drivers/platform/x86/think-lmi.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
>> index 1c02958035ad..64cd453d6e7d 100644
>> --- a/drivers/platform/x86/think-lmi.c
>> +++ b/drivers/platform/x86/think-lmi.c
>> @@ -879,6 +879,12 @@ static umode_t auth_attr_is_visible(struct kobject *kobj,
>>  		return 0;
>>  	}
>>  
>> +	/* Don't display un-needed settings if opcode available */
>> +	if ((attr == &auth_encoding.attr ||
>> +	    attr == &auth_kbdlang.attr) &&
>
> Indentation issue here, attr must be at the same column although putting 
> the || on a single line might make this easier to read.

OK - will fix.

>
>> +	    tlmi_priv.opcode_support)
>> +		return 0;
>> +
>>  	return attr->mode;
>>  }
>>  
>> 
>
> -- 
>  i.

Thanks for the review
Mark
diff mbox series

Patch

diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
index 1c02958035ad..64cd453d6e7d 100644
--- a/drivers/platform/x86/think-lmi.c
+++ b/drivers/platform/x86/think-lmi.c
@@ -879,6 +879,12 @@  static umode_t auth_attr_is_visible(struct kobject *kobj,
 		return 0;
 	}
 
+	/* Don't display un-needed settings if opcode available */
+	if ((attr == &auth_encoding.attr ||
+	    attr == &auth_kbdlang.attr) &&
+	    tlmi_priv.opcode_support)
+		return 0;
+
 	return attr->mode;
 }