Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1307674rwr; Wed, 3 May 2023 13:11:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60XOPbODNJ2kkR2Fe94NajmnAY5i5enpEdwEogEnYVGnSdLNYemCaFYEVsJnm/L1Rpvfuf X-Received: by 2002:a17:903:183:b0:1a9:86ca:38cd with SMTP id z3-20020a170903018300b001a986ca38cdmr1329925plg.2.1683144680987; Wed, 03 May 2023 13:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683144680; cv=none; d=google.com; s=arc-20160816; b=gBeJj67vLD/cOrQaSD5EBdi8vSlIUdnPrhh9adrc80QoxUhEdlAwvJWnQBIIjJ9X1E +QGs0SdWDbhw6CGSDk6q4pAZGhtwm71iZ8POsGcCQyPmUCtxCiA2EDVrjRymmas9cNlj sEJxJk3FqEtKxnivQh/r5GLv+PjHQjauXNulwX0tjtBj6k91hGbEFXFZoUi1qWx7cG8O uOetdl2ThTWEPPMovASAixM9JCoizqceSrd6rLZberMUSn7j2NpenBQn7Qi68/PdOsx/ fhfOFC6/MFEvuhvMhNVMSbsqiGFdppD5mTmw+N/ieGZ5+n067AcMVgGaTBE6DnVvz+zf P6gQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=bAZw7YqEudz4ukH3BQ9iW/3beuLyeglZFi1ghM2qpBA=; b=x/VKxsR/3nL3QaYkRFMrtUhMHPA2ImIWUd30pCjpzk0g0DrgMjI+9ii8E642lYkhzi x+uesinAYfyIZAl80qDU4VeCFF2mevLk/BTdnLYRx8rzLnooUEoXYog5w2pi3AdpvXdy s0OLc7uaUpZkHbOJ2qYpLQntQwlkSV9TMZf22PrMJFF8FGtQiB9hw86YjwIMGm90D2Ze pcZzEAVhmXucv7sPiiGwqD4pQHwxcXX7TUer0zSZhi1kEFwMKXifh1S9kV8oLtYXuORj CSZm3dk1C0P9I4Wl3p0a1un86NfAhY3kM+sBlwSiy7YWB2/Aa0GCFp8tWGGtfDJiYKju EXlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b="Mu1eIq/3"; 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 j3-20020a170903028300b001ab0d0f6175si5060382plr.481.2023.05.03.13.11.07; Wed, 03 May 2023 13:11:20 -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=@t-8ch.de header.s=mail header.b="Mu1eIq/3"; 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 S229940AbjECUKi (ORCPT + 99 others); Wed, 3 May 2023 16:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbjECUKh (ORCPT ); Wed, 3 May 2023 16:10:37 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35A0B420B; Wed, 3 May 2023 13:10:36 -0700 (PDT) Date: Wed, 3 May 2023 22:10:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1683144633; bh=sG7jgizKAtfeEAfcw9DHzY1yRc+hKz8BfkNK3ux4v9U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mu1eIq/33V22794xaBoXgdBDO98QgFUR8zfUwwtLuaf9E6UbEGt1UDdzJ8j8CQB+T ZOt9SzRTSudqlp55a666gpiVdVacgqrPG7cjr4xWX9PUixNaYZWjpugIDeXQeDM5JD wjCE7I5dL7uerB1KznLLVjU+SZMLKi4+NL4subLU= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Jorge Lopez Cc: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v11 09/14] HP BIOSCFG driver - enum-attributes Message-ID: References: <20230420165454.9517-1-jorge.lopez2@hp.com> <20230420165454.9517-10-jorge.lopez2@hp.com> <951adb9c-dd5c-4c40-a786-2025ebe1650f@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,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 On 2023-05-03 14:42:37-0500, Jorge Lopez wrote: > On Sun, Apr 23, 2023 at 7:55 AM Thomas Weißschuh wrote: > > > > On 2023-04-20 11:54:49-0500, Jorge Lopez wrote: > > > .../x86/hp/hp-bioscfg/enum-attributes.c | 543 ++++++++++++++++++ > > > 1 file changed, 543 insertions(+) > > > create mode 100644 drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c > > > > > > diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c > > > +/* > > > + * validate_enumeration_input() - > > > + * Validate input of current_value against possible values > > > + * > > > + * @instance_id: The instance on which input is validated > > > + * @buf: Input value > > > + */ > > > +static int validate_enumeration_input(int instance_id, const char *buf) > > > +{ > > > + int ret = 0; > > > + int found = 0; > > > + int i; > > > + int possible_values; > > > + > > > + /* Is it a read only attribute */ > > > + if (bioscfg_drv.enumeration_data[instance_id].common.is_readonly) > > > + return -EIO; > > > + > > > + possible_values = bioscfg_drv.enumeration_data[instance_id].possible_values_size; > > > + for (i = 0; i < possible_values && !found; i++) > > > + if (!strcasecmp(bioscfg_drv.enumeration_data[instance_id].possible_values[i], buf)) > > > > Is this also intentionally case-insensitive? > > Yes Why? It is surprising. The behavior differs from sysfs_match_string() and friends. Thinking about it, this function should be able to use __sysfs_match_string(). (Same for the ordered list type)