From patchwork Wed May 17 18:19:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13245518 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 D4402C77B7F for ; Wed, 17 May 2023 18:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229458AbjEQSUF (ORCPT ); Wed, 17 May 2023 14:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjEQSUD (ORCPT ); Wed, 17 May 2023 14:20:03 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E27201708; Wed, 17 May 2023 11:20:01 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 5A1995C00CF; Wed, 17 May 2023 14:20:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 17 May 2023 14:20:01 -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=1684347601; x= 1684434001; bh=+82eXvQj/5RebZRCTI0l45z9r2QlOLsinwQcEFJrwa8=; b=c cAn1S9xi5hKJORFlrRzdSxw9wBU18ZAr2cHLoTvZHd1QmNEmYDSegPDVMX+WeGO3 pqYDicdACEsmJ4HYI3p3LkTf+IqGJZA9xFPhu2enhspXNiAa55hc2Oc3G2GDIv+p noZZ60T3YQv1vPkGz6I/KxLTR29pFNCsU42IunRk7mqmXOHax5DKAXP88JLVGkfA FFfU6vDM8EIjVYzmsq7Xv2BlBiTdsnP1S67UFYC+/+7B+lXk8ThfKVxd1eiK+vqf yfkzm6v+BHAH5b8KOYicNi89WygrbJjHuYcA3aGedUJ956QDU3RcVOqsp4VFyXtV 5qHTsJ9LrNMsaAhmFc3VQ== 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=1684347601; x= 1684434001; bh=+82eXvQj/5RebZRCTI0l45z9r2QlOLsinwQcEFJrwa8=; b=h HVnbXq6wQRbOxW8gXAqCpZ2hAT6GLFTzfWxX/9dw2DLRYqYCbF1+LnzhXZS2eav5 otz/SE0aun5qV1pJBPpfi/wjSdJze//ASz6SD6yAUZlKxKDxa1n6dOLHPY0j4656 N28CdbHkHR67zGe6Gw6fhMeuUvDFWZ9vi/MecaCjvyEl5W7ZJJcRKXIYbbH7T2tz jTLT64jyDqQt1BtVVFRDr0jrtZ63gSupre+KgxTR2OQ74Zv1aFQeV+A3xVjUuJtX j0uVyXAxcnNgWbMdMFUf16oFf9DbQjCd/eQL+IV1QEgofqn7M+CaA24v9FFzKBUs TQSvbDGOHfHv1LM7C86MA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeiuddguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdludehmdenucfjughrpe fhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforghrkhcurfgvrghr shhonhcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggrqeenucggtf frrghtthgvrhhnpeeftddvjeefleffvefhgfejjeehudetteeigeeugfekhffhgeejudeu teehgfdvffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 May 2023 14:20:00 -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 4/4] platform/x86: think-lmi: Don't display unnecessary authentication settings Date: Wed, 17 May 2023 14:19:45 -0400 Message-Id: <20230517181945.3725-4-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517181945.3725-1-mpearson-lenovo@squebb.ca> References: <20230517181945.3725-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 --- 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 2d95b1a199fa..46500707f939 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; }