From patchwork Fri May 26 17:16:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13257213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02C61C77B7A for ; Fri, 26 May 2023 17:17:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237095AbjEZRRW (ORCPT ); Fri, 26 May 2023 13:17:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237404AbjEZRRU (ORCPT ); Fri, 26 May 2023 13:17:20 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 908BA135; Fri, 26 May 2023 10:17:16 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id F3DCF5C012E; Fri, 26 May 2023 13:17:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 26 May 2023 13:17:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1685121435; x= 1685207835; bh=RNFRaulRZtonrbQIqKCzQ4tfrIbNodUWfk4Zt2pE2sM=; b=D +4f5aGhaiKIMIqVN9RVsftqZu1j9FU8KVq+IHarrm7JYfwXjHU/k0ggckSufyYV5 fP201O0Mpp347Qsz+ZQZ0CnYbyuYvbqXuTRgLNqMqN6R97jujnd5jADkvAnZznah vkYI3foLrEWfpExV7chzArDE4zbm+cGw4W3uJoznSrZtj+RdngvI3ZCUOdIMblwg /u1E9pDEOABUjWn9C0TSXT6bTwb3L4oSCpCBcvAHbwOSOj7ShqoVef7bk8BYmqv/ cRhWDdjDAheEEnwe+F3bfZbJwvUL5y52azd1HvgM0Liq4K4jprJcrF6yfTPajG7t +b6THK0LQzkWWbtsCmNbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1685121435; x= 1685207835; bh=RNFRaulRZtonrbQIqKCzQ4tfrIbNodUWfk4Zt2pE2sM=; b=x 5MAv+cUqHN67ZiN40Hnj+WczAv6yaqA5VNKYnUg9ST4F3Vqr+Kk+H8vkWJcgN/+4 gaw3rTT0yMuFaI37HaI3JsDomePCtX3XyOyEo41WsltHk9kh00/G30kW0/GoXF/O Z3y7Bef1/PQI9P6Pfk6FmV+VltvbgXHyJtLtZPg2x3gLiuyKN83qx4EsYIgIetkL Bnl9T/u7hRsJ2i89Ry2YhiVlhif0drLqsAR97V9g8xJa09NGN4nNvzIt8zygiuAR YY8RVuO1/r6MQm5ze0MrH/wAna5Y+jECc9xUlSGw0C3diW43Lk4X6L7B7MzjhBil COSb9kIflZf2qOaIN/8sw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejledguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 26 May 2023 13:17:15 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/5] platform/x86: think-lmi: Don't display unnecessary authentication settings Date: Fri, 26 May 2023 13:16:57 -0400 Message-Id: <20230526171658.3886-4-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230526171658.3886-1-mpearson-lenovo@squebb.ca> References: <20230526171658.3886-1-mpearson-lenovo@squebb.ca> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org 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 --- 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) && + tlmi_priv.opcode_support) + return 0; + return attr->mode; }