lkml.org 
[lkml]   [2022]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] platform/x86: acerhdf: Cleanup str_starts_with()
    From
    Date
    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)) {


    \
     
     \ /
      Last update: 2022-03-26 03:23    [W:6.237 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site