From patchwork Thu Jun 1 20:05:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 102170 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp586614vqr; Thu, 1 Jun 2023 13:11:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gyHT6YKYpQ3D0JkD5ivUAvM1hj+DWVBa694BgNbwk9p+rp4RYBo2X8otGO4gHwCaAd7Yg X-Received: by 2002:a17:90a:1d46:b0:256:bc96:45ad with SMTP id u6-20020a17090a1d4600b00256bc9645admr310867pju.40.1685650304886; Thu, 01 Jun 2023 13:11:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685650304; cv=none; d=google.com; s=arc-20160816; b=N+SgD8zXgE6o3FqkRWrm2hnM4e8s0luSdnxeuPbhN1h4Zinwb3nxShgguwFX6mZTQP pUZkIAvSzg9eLtyTbu4qZW2SPvV2YPHebPgNlINiV3w0pJL/+JC1Y1CZR+ESD5VOEmlD WKzwi/Z1V/eVoRiT+J9xNHhD0P+nZEIyQyBDXcJ//BQQTbJG5yS2vT4H+1yW5ILlULD0 perHOWyiOVKdwCTysXJEIE+T3wUR8h+n0A9SE3H1Zz3Pq9prqZHZVA4u//hCeWIsHduG zZ3UXQY7ioEzGgG5zshwAgMNt6venlSnO7Vm18mdA1rYWxkNmZTGu5NekB9HMiilIgFq 4QZw== 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=o+3ik6sPv/8JEzwolLx/y3xpaXAaNLnim4nqn40eZqA=; b=evz3YHTDRg/rSec8zypz+9ALUDXzDIk8b5YMmlA9bk862duj8q+R6g/3Xvylz6W4eJ hu80iXHSYpOj/b4w0YpD+aPLviDOI4lOg5j1+QaATqA9WvOIqX6vq8M/28KSMy2cGTAW ZUgcgCDMFraBQIaxofv8BNt4/P6iOtgs3Jbwom5POFQhPITII61CnqylEnT7P1hYh5oL k/4RQuP4hBIhXR3bdL1fDxl0efxUwBE+jg9zp6XYIU4qGZaWuOs1Gewd6t6uXU02q6Kw isygpJp2kLZP6ezmK5gRcprZZ8xAvj5ZFHcBavEL5aeN9mdufkAwNeaG+ZAn9qlqAT9w //2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm2 header.b=as5b4FEN; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=pIDHkdtb; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p22-20020a17090b011600b002563e365aeasi1631468pjz.53.2023.06.01.13.11.33; Thu, 01 Jun 2023 13:11:44 -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=as5b4FEN; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=pIDHkdtb; 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 S231724AbjFAUGb (ORCPT + 99 others); Thu, 1 Jun 2023 16:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231669AbjFAUGR (ORCPT ); Thu, 1 Jun 2023 16:06:17 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 049361A4; Thu, 1 Jun 2023 13:06:09 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 28A5A32003CE; Thu, 1 Jun 2023 16:06:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 01 Jun 2023 16:06:08 -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=1685649967; x= 1685736367; bh=o+3ik6sPv/8JEzwolLx/y3xpaXAaNLnim4nqn40eZqA=; b=a s5b4FENdBlIJPyV69bgZMeNamdRI+ULrDkC6tZj9i0kswy/gG2OKlbJMHX6YT+SV Umx7PM++fNj/74SEHbHhvJNFjnYRwdLyT06O3IUOLA1XCjqjyQ6AZstPv7t1zFY3 RdQ0KfW3yMH/3vcUPB1bBCOPOaiJ496vjInvx5b/pxR+yxf8MCq+uxHkdY6O1Spy QwdUQytjgjwm03xVEGvaJNNUb+LPL4NEXyoqavSGoQjULu371MYrsH0+WWrVgt6w fkoxGw2WTAeTa9cxPd6UoHAS00J8Nc2Re9b3OBs7jn4hx9kkCVKuUDjWSNJPSmAx hpd1/CjnPo7jOxWMxjRFg== 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=1685649967; x= 1685736367; bh=o+3ik6sPv/8JEzwolLx/y3xpaXAaNLnim4nqn40eZqA=; b=p IDHkdtbEH3euih4Dchnq0FAnUTsq2/5I09VaSTZ7c2TEed4gMy8rq6bcVVFfPTqL oE4ntgKrAQ3gaLgIvTbqisueyUSeY3fsFVIL5/p+ZD+ffpAy2BC5bXqQLX0JJiIZ ppJMf3HGBA2d6PrtqAYl4hsUvGOAw/Bsgvlhf2qyKV5diUmZBogxT2u7RjWvCalG 4qy0y+tmm+b9srBGG35i4jjrlNeNQt0gAeYGPTolOit0IP8Ylq/vrucAe5NuZgIb eHLB9gCDWIdFG52Qy0vbAxjFrBs6djIFahYePyhbvPGAab3gxfpQhMluZNXg3kYC PscbR+nCFvHr/mC4MkSVw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeluddgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Jun 2023 16:06:07 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 8/8] platform/x86: think-lmi: Don't display unnecessary authentication settings Date: Thu, 1 Jun 2023 16:05:52 -0400 Message-Id: <20230601200552.4396-8-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601200552.4396-1-mpearson-lenovo@squebb.ca> References: <20230601200552.4396-1-mpearson-lenovo@squebb.ca> MIME-Version: 1.0 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,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766167512884632470?= X-GMAIL-MSGID: =?utf-8?q?1767532454216630121?= 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 Reviewed-by: Ilpo Järvinen --- Changes in v2 & v3: - None. Version bumped in series. Changes in v4: - Fixed code alignment as requested. - This patch was previously #4 and is now #8 in series. drivers/platform/x86/think-lmi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index 2aaaee879488..52d1ce8dfe44 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -885,6 +885,11 @@ 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; }