Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1783080ybl; Thu, 15 Aug 2019 00:53:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWxFwF/lLu/KGWxcCdKqzb8h66/V+a08htk7WuA7NZezD0V9tnsQCxnnGwRdq1OwIOsESe X-Received: by 2002:a17:90a:bb91:: with SMTP id v17mr1064561pjr.84.1565855624736; Thu, 15 Aug 2019 00:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565855624; cv=none; d=google.com; s=arc-20160816; b=mx2ofY6yKu8WKCBO/5ZG5lIBZZt+A6365x1qc2dkxEHktY28d9BrKD1479Dl+gUMKt l+/DS3tKDVh2wcQX2kUv3TzqGawNIisXxzKcPcvjfxWoPWdNU7XMKZdZkbzOIzeOMVAB bg+vdGFxaOlW9Qkz0Ifcl0SstgHtkUUCuPgqEKXZLjcxSYM0RQMt3L7iOTnzbi4TBF9t kO7h35I3gfM3qm92jQjfDUxDEQR4ThiklWEz2giYRLeKw5/R2Crx7QkF5K5JCyX+ttYG eXbBm5vlz7xDjuYwYdyrGX6hnApNKwbodtaO0aYbKIHBSX2ikKlzYDXnT0Pes/iOt62u RVjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=+HQ26YjFqd095HuQvJkZw1Unk1E5d9gNZv6ke3nfrfU=; b=bKh7cblF9dfruRaWC8WJU9KFFtupC7vB4Lq4lHjf1xHvoihU4HN6f0RkUygOr8l5Sf O/RVWo7LGyQU9474Dw7AnTtSFWFmOtYr94K6A7xXzqmURqzXmRwDtofKIzVruG5Y6Xza 3CHvWv2dmrK+/BO8jL1VaU0zAogjDeWzJNaIqLXsUO/57VxWdUhuHtCG1rPIUEuhktQf 9CdYywr34rNmwxphdVf3vaY5rpQKUmLxpVaV4NzAFVPXM2XLgzeKGX6HGN0QvyLIHcZk pAL5QnpYNaPNJsBrovdYMmUavfbgiSt5iutPlRcERpQiDdAn8ZUHcYuIZaOqYPQCTDtM Z0VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r+rFIHHq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21si1487146pfe.204.2019.08.15.00.53.28; Thu, 15 Aug 2019 00:53:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r+rFIHHq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730457AbfHOHug (ORCPT + 99 others); Thu, 15 Aug 2019 03:50:36 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43343 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729967AbfHOHug (ORCPT ); Thu, 15 Aug 2019 03:50:36 -0400 Received: by mail-lf1-f68.google.com with SMTP id c19so1060589lfm.10 for ; Thu, 15 Aug 2019 00:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+HQ26YjFqd095HuQvJkZw1Unk1E5d9gNZv6ke3nfrfU=; b=r+rFIHHqW5m0YFQe1g8i7BLnASGugeC2XmMV0v2rXhVAqgAuup9I5P8hJNWRuVWtxD evsDnCtNZbRfrAKslsFUEAGfRiZSIw7t/8YWJCyZM+tCvItHgQLmqGHBhEtVSatfxZ+1 zDewhNUYNHAgGkZfvZ4BXRdZ6Wq2OaZtZMmwl+SOiWrZZID7ZIoMKK0L/U9/EOS9NUhG +Pi6B8DFqwsGnCb6rZBcVrgrXs5Lu3MEN7/gRrhZZiKRQnDP0Mkn1o2o2UBIMOLAaSqa 2+X7n001LrALm1cKCDDZpKyHydiAtOFNIT2gBWMYynGwfqyyFFfzbCqG+kOIYBY7GO4C llWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+HQ26YjFqd095HuQvJkZw1Unk1E5d9gNZv6ke3nfrfU=; b=VrToq53FjM1RTi5Ky+Q7wtZjv4mO/dAia+vjpQDiJZ7UV0lK1Plf2XP1H5bK7TvxfF 4Caucimt3H60zl+cLPfcQtSxP5v429kw0Uec1CSUarjv0BTQYSIg+9lO9RIdnWDS+RiD C5LuS5nHJodsFKkp2lsTRrzBAB1zisWvNlHzle3HjHOT7d1ZJW12IkXXGfnvbNV9uums 4neUg1rG/vhhmC9KnzymZLLUf4jaX+5tvLgxO8c1XMB+HmRo2i6xBt+ovg9jmMv2U4Vr m8B3wd9/8IL/PM1jnlmi/VePy6dSvGUc4Q3JhrgsosoZ2FVaov6lB4dy4gNLozqw+u92 HJrA== X-Gm-Message-State: APjAAAXcXw/VrcgZZWvPr+AqAPnAAFNlYzDua/jmKIa4qvq0t3WcnchK QOA83P6TI+LkAw/4k+zslBs= X-Received: by 2002:ac2:4644:: with SMTP id s4mr1709242lfo.158.1565855434435; Thu, 15 Aug 2019 00:50:34 -0700 (PDT) Received: from localhost ([178.127.188.12]) by smtp.gmail.com with ESMTPSA id b6sm353677ljk.31.2019.08.15.00.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2019 00:50:33 -0700 (PDT) From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky Date: Thu, 15 Aug 2019 16:50:33 +0900 To: Petr Mladek Cc: Chuhong Yuan , Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 4/8] printk: Replace strncmp with str_has_prefix Message-ID: <20190815075033.GA26479@tigerII.localdomain> References: <20190809071034.17279-1-hslester96@gmail.com> <20190814104941.qt66ozcau5fdswcs@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814104941.qt66ozcau5fdswcs@pathway.suse.cz> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (08/14/19 12:49), Petr Mladek wrote: > On Fri 2019-08-09 15:10:34, Chuhong Yuan wrote: > > strncmp(str, const, len) is error-prone because len > > is easy to have typo. > > The example is the hard-coded len has counting error > > or sizeof(const) forgets - 1. > > So we prefer using newly introduced str_has_prefix() > > to substitute such strncmp to make code better. > > > > Signed-off-by: Chuhong Yuan > > Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky -ss