Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3416417rdb; Wed, 13 Sep 2023 11:17:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFG+wOPP89fDNTlDG5HNPyTLk5natrVKasYFU+KIFPmmPkXZ66M/Y/0L3tWPNhE1VdJVvny X-Received: by 2002:a05:6a20:1443:b0:153:3d8f:cb29 with SMTP id a3-20020a056a20144300b001533d8fcb29mr3335331pzi.24.1694629023803; Wed, 13 Sep 2023 11:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694629023; cv=none; d=google.com; s=arc-20160816; b=s7OyNOukh78QcQ3+xyNwukRSs8bPmXQnIWCSjMJDZpp6cejcsXz5ZA/Zf7RzA4WK7C r6m7XaLmLr/H5PdzwyJNtXgjMtQC1BiZK0RVUUSH9A0S6c0I/8m+/LkfwPbQPGFwFUw8 Hi+WKZ4+TfZ1wkwQF3s/K823kHTQ3G+76A+3ym3bSLnPnR2B0SeYdzLbuA/42KbNXp+W cFYGjWltvWzmxoDskVFn4xma2uMB5Zf+hxXHc2pZKTCNox9iRvc0XNC2Hu1Eu5vgtRpq 38/plpumEAPrFQEus7BSglEynOjMgYmM+QI1T4LV60djMdgA3+KMmI1Am2QAT9CHWbw1 2tWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pVECDLxvzfx4s7I/ZnWducAjxQ0HjHhAJL3zG/uCzm4=; fh=V3FOp2x1qD1Imbim6j04GU+WriVa4Pb49KghutoBw98=; b=hd1TtQuk/PwLnuBO64BrQvbLezTMk0NdNNuPPjIz11kEi4rPLjR/ej2s0ErvAt3UzX YsaWJEcmNcVLRDLDKxjYenl5mM5Yh4kc5gGHGbQiPveLMoFbyOixhw0JE6CrSCjBgpd2 NAO6sBI8rcwQFHRUVCi/ZSVJULFe0hEo1mpMYJHbhaLktqZe1qFxtmbLl5cN8jzf05x8 G4kO3oX6e1kqondXRGGyvHVzcSqpO1qtjrnr2Ft+F40PlWUeedd8Qwb8prWNCbVbM//6 HN1n0NqAnIL+DF9lFu4hpnQHsfxdyiT6Lh+vaoLfVqqujt8Q5pCn0SHmvreHb/ChaqE8 ZxsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=UzbqRuJm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p20-20020a056a000a1400b0068fba6a7375si7110557pfh.321.2023.09.13.11.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 11:17:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=UzbqRuJm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 230D08077A7F; Wed, 13 Sep 2023 09:57:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbjIMQ5O (ORCPT + 99 others); Wed, 13 Sep 2023 12:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjIMQ5N (ORCPT ); Wed, 13 Sep 2023 12:57:13 -0400 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10D401BE4 for ; Wed, 13 Sep 2023 09:57:09 -0700 (PDT) Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38DGYwHK028385; Wed, 13 Sep 2023 16:56:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pps0720; bh=pVECDLxvzfx4s7I/ZnWducAjxQ0HjHhAJL3zG/uCzm4=; b=UzbqRuJmipaj3TwFX9gAJPEC7clQAqsOL8hYY0MZcKjlEOYJ1d3Pl18Fi7tzuakeIlF7 0DUMGxp36/jkqPCpt08u1IUbJt12ndRC5H7ofmXRjBzQMXaoCLzbaTHRLZFl8u9Ktd9D hUvt0OONbco0FAduLon/CH795Gd7c4WIPtwhrjKFPmr1EgOSJOTlA8v4NntOB9jTpFSi HwUe52KHKjb1r7akJ4FOjheh2oZqEYgwrYTaH0cd5MIazuP5ovx/tp6Mx1p3LBS/Mg6c U5L8TT5PCJZf9sBLYwSoVbqDBGWyzCw73KzOE55yZ7sVoYMSH3rnQR0Mw8LxBwriV1UX EA== Received: from p1lg14878.it.hpe.com ([16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3t3gqq06ha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Sep 2023 16:56:16 +0000 Received: from p1lg14886.dc01.its.hpecorp.net (unknown [10.119.18.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id BE6781318C; Wed, 13 Sep 2023 16:56:15 +0000 (UTC) Received: from swahl-linux (unknown [16.231.227.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by p1lg14886.dc01.its.hpecorp.net (Postfix) with ESMTPS id 82F18804F51; Wed, 13 Sep 2023 16:56:13 +0000 (UTC) Date: Wed, 13 Sep 2023 11:56:11 -0500 From: Steve Wahl To: Hans de Goede Cc: Steve Wahl , Justin Ernst , Kyle Meyer , Dimitri Sivanich , Russ Anderson , Darren Hart , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Justin Stitt Subject: Re: [PATCH] x86/platform/uv: Use sysfs_match_string() for string parsing in param_set_action() Message-ID: References: <20230913151656.52792-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230913151656.52792-1-hdegoede@redhat.com> X-Proofpoint-ORIG-GUID: a7cgYSSXsIntcacUm0yWmz98B41zcu13 X-Proofpoint-GUID: a7cgYSSXsIntcacUm0yWmz98B41zcu13 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-13_10,2023-09-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 suspectscore=0 impostorscore=0 mlxscore=0 malwarescore=0 clxscore=1011 lowpriorityscore=0 adultscore=0 phishscore=0 mlxlogscore=951 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309130140 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Sep 2023 09:57:16 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email On Wed, Sep 13, 2023 at 05:16:56PM +0200, Hans de Goede wrote: > Remove the custom, hard to read code to: > > 1. Make a copy of "val" with any potential '\n' at the end stripped > 2. Compare the copy against an array of allowed string values > > Linux has the sysfs_match_string() helper exactly for cases like this, > switch to this. Hans, I like this patch, compiling and testing now. I was wondering, as long as we're in the neighborhood, how you feel about changing the stored variable uv_nmi_action to an int or enum rather than a string, since it can only be one of 6 values, and the string compare while processing an NMI strikes me as inefficent. It could extend this patch, or be done as a follow on. And I'm willing to supply the effort if you want me to. --> Steve Wahl -- Steve Wahl, Hewlett Packard Enterprise