Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2552688pxb; Fri, 25 Mar 2022 21:24:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZkJqjyeA3LQgQL5wFFGLd0V8wbtnGC+WNUN9qUmJaSgTsXW6f6ZdTiqyOBbkW08X7QVnn X-Received: by 2002:a05:6402:3496:b0:419:82d5:f1d9 with SMTP id v22-20020a056402349600b0041982d5f1d9mr2487705edc.36.1648268660805; Fri, 25 Mar 2022 21:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648268660; cv=none; d=google.com; s=arc-20160816; b=B6hWyac9vZCeRZK2OVb5s8gob1xEnCDqJ5H/ktmIsoTctC+5co5/GBOiS/zqJ9kI4+ XNcIhk0KJse1LCAx3RL1ch40Dp7tm9ed51A/UVTNsuy/aLOrWQd+q3DFFxRpVexP+2lw o7wiUFw6HkvZ+pevls5K8U9wy9VQtf17Ye9+ceiZaCMPPQltBJuPEpfcOUDDi18WGGvC o2L9KXA0a+9MSeVgjk+cxpyC9g5EDyXjmIKLrq+5uIyZqITJLFyWNqHOKGj+tbHxn8Pz hGFPqswNGUBCJT94brb9z4U283YMPg68PGZmBw6Hpqs+pN/72vYEl6a8Ok14DFO3e0Ze AGkg== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=ytzuy0h1kofBr2+nhIQrYtFeY571EAG5Gd8oUIKMa9U=; b=Sv2v83ZsUW4TE1yGjS3ajyG2w3lkzOG94FHQeUWevgaEqyrHmFZZNVfV7O5qZPRzTx TsrHBI6fgsxDjoWZIh66XlbnefN8LoBw6rlTcjyTPk7pXXlxPxialCAF8TabPNL7EjOX CiawJdE41owk+iHdCSUx9Z+sCEJ9JE73xF9g59pobzs8JvZJsR85iPnYJx1z7k0+i46v Bo3mDAwxuqGCiT2WJZWcjyLESEBLydi3PTHmpN/DqmzlU0nLMIdaUeuVEBMnPtEPGPVv GwdMGYccP2LbShUxvcRklekScg1W4NPp5vHDGYviUWE98fAcv5PcN8iksXYomnfEpaAE 9wzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 a5-20020aa7c805000000b00418c2b5bec2si1068282edt.420.2022.03.25.21.23.55; Fri, 25 Mar 2022 21:24: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; 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 S230216AbiCZCZN (ORCPT + 99 others); Fri, 25 Mar 2022 22:25:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbiCZCZK (ORCPT ); Fri, 25 Mar 2022 22:25:10 -0400 Received: from relay5.hostedemail.com (relay5.hostedemail.com [64.99.140.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FFC59D for ; Fri, 25 Mar 2022 19:23:25 -0700 (PDT) Received: from omf15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EE77621E63; Sat, 26 Mar 2022 02:23:23 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA id A04FB1E; Sat, 26 Mar 2022 02:23:17 +0000 (UTC) Message-ID: <0641d577f58f836a6c14a73e78d4545e44e61631.camel@perches.com> Subject: Re: [PATCH] platform/x86: acerhdf: Cleanup str_starts_with() From: Joe Perches To: Wei Li , Peter Kaestle , Hans de Goede , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, rui.xiang@huawei.com Date: Fri, 25 Mar 2022 19:23:16 -0700 In-Reply-To: <20220326020249.3266561-1-liwei391@huawei.com> References: <20220326020249.3266561-1-liwei391@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: A04FB1E X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Stat-Signature: hk4j7joqepxzxtriwinaxhpxtan9t6fk X-Rspamd-Server: rspamout03 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18Xtu31bFcK6k4cm2+mxix8XAv5THAQtxo= X-HE-Tag: 1648261397-942810 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 Sat, 2022-03-26 at 10:02 +0800, Wei Li wrote: > Since there is already a generic function strstarts() that check if a > string starts with a given prefix, cleanup str_starts_with(). [] > diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c > @@ -651,9 +636,9 @@ static int __init acerhdf_check_hardware(void) > * check if actual hardware BIOS vendor, product and version > * IDs start with the strings of BIOS table entry > */ > - if (str_starts_with(vendor, bt->vendor) && > - str_starts_with(product, bt->product) && > - str_starts_with(version, bt->version)) { > + if (strstarts(vendor, bt->vendor) && > + strstarts(product, bt->product) && > + strstarts(version, bt->version)) { IMO: It'd be easier for humans to read if aligned like: if (strstarts(vendor, bt->vendor) && strstarts(product, bt->product) && strstarts(version, bt->version)) {