Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2743546rwd; Fri, 26 May 2023 10:31:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ilgWNZzv6jAP677BrsGZ0hLZkV+5KNFn7Q7RzV9lm1BEThKwJfpVmtn3+F3DsZ9GTsPhg X-Received: by 2002:a05:6a21:339c:b0:10a:e8c2:7227 with SMTP id yy28-20020a056a21339c00b0010ae8c27227mr20882pzb.45.1685122285733; Fri, 26 May 2023 10:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685122285; cv=none; d=google.com; s=arc-20160816; b=WsiWXHC2MY9gWsoz/v6dh2sKAkt6VKlBCsMz2+7hFQGMUw/OcFSTzV9mgH4v73TO+4 URB2wLBVbAmegj6EMOVOw/2B4IJdrEuT+F8cCVApW8rvJ62BRIP2Vt3u4mVLr1vscxrY i9QQY88mxbEikmYht4wyqe7cBb4jF+1dnNCqSVWwIKOb9oRXBVP0DAtyKhobgJcevBAw nlRJ7ruLfvjQeUMwN0PFaNgKGjeeFAIyA05yHMeCxhX1zw5eT2hWa1+PFc8Ab/81AJiL TJEuv5cS1LKLzyB4nIlisyGFNxG6kQbhd6mfljBGAMWx2cyJ8llvlvN9HgQ96xxStbC/ qbDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=RNFRaulRZtonrbQIqKCzQ4tfrIbNodUWfk4Zt2pE2sM=; b=Zn2ER1A+FGO6gjybUNmLSQX6LdntSPAw8PtFXlAr82sHcjsNj6g+sVMrNoDiI5glTB YwhbZplFt1foQ6LnSDwqwAtyZqELCVKNEb9YjFwQMvr0z5YgAN440PdR6ifw8aU1G3er Lmj4j9t5Ltaq+kFPG1mycYbBn2PbLfHRO8CrrQ8JMcKrY6xS8l+qQcI7IW84aagHdRhu RSYhEhnk4EAqrtTcX7DG77V1YqFKNeO5DDs/i8SraN+GyIdLq41jvO9djImo96kr9FsY xPP5SU8boskYz8xZnU+3e9Sc8ybhbpgDPeWcbms9IoRsLBL6yyR54jJ0S/8KknQR8qUv W9XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm2 header.b=D+4f5aGh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=x5MAv+cU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j21-20020a637a55000000b0053b8f59ac25si819020pgn.194.2023.05.26.10.31.13; Fri, 26 May 2023 10:31:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm2 header.b=D+4f5aGh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=x5MAv+cU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242465AbjEZRRa (ORCPT + 99 others); Fri, 26 May 2023 13:17:30 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; } -- 2.40.1