Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3900062rdb; Thu, 14 Sep 2023 06:17:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/bDHiC5nlEg2iPeEkeuZS1av79+j35ZiMsRU8xJPwzU5yWlNVLOTZy/o54KNU71BwxvTC X-Received: by 2002:a05:6a20:ce9f:b0:137:74f8:62ee with SMTP id if31-20020a056a20ce9f00b0013774f862eemr4970938pzb.18.1694697444613; Thu, 14 Sep 2023 06:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694697444; cv=none; d=google.com; s=arc-20160816; b=yCB210dWTQ4mbm5mKnAKaF1gycxwF1ySFqAPhJuxovmbbRA/LU3FsOuZqodStIqHz9 hzNJKp15fB2QWPVRsowXS8i2zBNaVLmZ+lAHMmHJ8fwbZnjpnJYh+7mnsNcHXXuBLb2+ RX+y3TXEyC8TTYqeSgi2lLYcPU/WXCGpFLWLwInACbCbuh9CX1k9BxRMjaHPpvPmsjBs +SnwQD63O+BzGG/5VPjU2ZabTr2ggYjJ9GCZSiR/9UhOAcUK25dh0QjYgoKuXaRRIaf7 BwRyn0UYqCgFfmrIn1ceDcVolCWEZEHxSsozvKTh1Kc88vkplYVityzkHqhspTycz+rr 0rIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dcnj2jl85WCt6XjMogIPi+D+NjI0MJKsl4u3FKX3EwA=; fh=V3FOp2x1qD1Imbim6j04GU+WriVa4Pb49KghutoBw98=; b=jG1zDT2AOLA4GWw8WWuc9lhozAOumz1fuRDCpMqG7ITkbbe3RZBQDae8DOr8Cf1JrJ dV20UNRyAVhdKJyvJzF3I0J0MORsPBUg7aP/xwrL8HeynjpHM1NDWJRTUFZg69/6hVb3 Y3xZYTfykJVkLD7KfPODfMTtwkpS39ghcHrShDUdQyjfFgYWQbhfvw/tTydgf1hJxp0g lKztUgHPP7fRwqav6CVORmdg/vagTL/Sxu5x0tts4ntGFSQhHdc3uX/5BRYCb9yUKOK2 G4nCCxuOqmQDRzvKJRBteXBBs2FHGX6579J7nA8CSQoE4IRZ8Ju/YVHhqzcfHHmc/zx9 O7BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=a32Xgi1U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y14-20020a056a001c8e00b0068fd642fc12si1590918pfw.12.2023.09.14.06.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 06:17:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=a32Xgi1U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B2DA0821FD11; Thu, 14 Sep 2023 01:43:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236420AbjINIn3 (ORCPT + 99 others); Thu, 14 Sep 2023 04:43:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236398AbjINIn1 (ORCPT ); Thu, 14 Sep 2023 04:43:27 -0400 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D7A11FC2 for ; Thu, 14 Sep 2023 01:43:23 -0700 (PDT) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-57361de8878so409287eaf.0 for ; Thu, 14 Sep 2023 01:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694681002; x=1695285802; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dcnj2jl85WCt6XjMogIPi+D+NjI0MJKsl4u3FKX3EwA=; b=a32Xgi1UmJRMHAAC/Kdar66rCOxrtiBoN4BojWAf3v8FtCw5kypDXe3p1WcQm1oZnQ mV8iU0SyatBl9tPNB30nbCwgi76CIJMBVly5GH1/tXasZNkbcaaVUNMA5ErIeZtDXJrh 2NsuhTYVg8vqfwFuQPwEBiUvFzVpwaoqSU32pwElRlV02fhGSYQhZ6BX5RlpQF8wff3c q11brcPhsiVUN5IdQ63NYeYeeneb3ch/HB156JXQnZdF1UlvgOw0sICbYSG7L5czLw6E yX9DcVvs6bH35ykArn8BZoxHMocKNPzd0stDKcO6yvmQPUHMR/+D8U/B0lqJHbBJLIyt W0Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694681002; x=1695285802; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dcnj2jl85WCt6XjMogIPi+D+NjI0MJKsl4u3FKX3EwA=; b=rb3nz4tNmblkCVQAOpdn4/BKc6ZDX2JGSMvK1KLC0jRgrx+ijVIEnQmsjoetswxxHB uGowGSrDukkUKUzfSF6PlnRS/aOONQPCljafKw/aiIo57jSneAXpE+w4w8XGuDdNKplN 1A38bBo2Pdl6GhBO41IZ6XuVIWvc6aWrvx+eJEXH060MqMOdsNEtJlFP57QI6iQ4V+bK mCUq4l8utVBmISpu07h8yjMiPwJg75hqv5LELqBaOV5CUms5IMafKQ1XCdp9zQoNZcng FKXno9q4bEP4lDMQcHuYMskOfQriOFQzDz2/nXOCnjSKJ0kJsAcbqKpZmzxNr+wSgFfv pTdg== X-Gm-Message-State: AOJu0Ywv1sjmkkECAvgumcPA9/HrtvGCalV7aueE3574M0jADW7CdvVA RXG0TmyAmSaUnWfZTvIkUai6BE6Osd2c3v4EK7o= X-Received: by 2002:a4a:2a47:0:b0:567:4e58:6aaf with SMTP id x7-20020a4a2a47000000b005674e586aafmr5121606oox.6.1694681002226; Thu, 14 Sep 2023 01:43:22 -0700 (PDT) MIME-Version: 1.0 References: <20230913180111.85397-1-hdegoede@redhat.com> In-Reply-To: <20230913180111.85397-1-hdegoede@redhat.com> From: Andy Shevchenko Date: Thu, 14 Sep 2023 11:42:46 +0300 Message-ID: Subject: Re: [PATCH v2] x86/platform/uv: Rework NMI "action" modparam handling 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 01:43:35 -0700 (PDT) On Wed, Sep 13, 2023 at 9:01=E2=80=AFPM Hans de Goede = wrote: > > Rework NMI "action" modparam handling: > > 1. Replace the uv_nmi_action string with an enum; and > 2. Use sysfs_match_string() for string parsing in param_set_action() ... Don't you need to include string.h? ... > +enum action_t { > + nmi_act_kdump, > + nmi_act_dump, > + nmi_act_ips, > + nmi_act_kdb, > + nmi_act_kgdb, > + nmi_act_health, > }; > + > +static_assert(ARRAY_SIZE(actions) =3D=3D ARRAY_SIZE(actions_desc)); I believe with enum in place you don't need this, just add a terminator to = it enum action_t { ... nmi_act_max }; and use as an array size both arrays. ... > - int i; > - int n =3D ARRAY_SIZE(valid_acts); > + int i, n =3D ARRAY_SIZE(actions); Since you are changing them, why not make them unsigned? ... > - pr_err("UV: Invalid NMI action:%s, valid actions are:\n", arg); > + pr_err("UV: Invalid NMI action:%s, valid actions are:\n", val); As mentioned previously the val may or may not have a new line in it. I dunno about comma removal, but a new line presence can be easily checked. Either way it's not so critical, hence removing comma. or replacing it by '-' (dash) may be enough. --=20 With Best Regards, Andy Shevchenko