Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp643552ybl; Wed, 14 Aug 2019 03:51:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/hBpeG+DZ0pqJdJtGVg/IfxcHvw8r3LGVTUY545mBSQWwwGHPVSCdLJYJTFrvB5K6SdjM X-Received: by 2002:a17:90a:26ac:: with SMTP id m41mr6631487pje.59.1565779869852; Wed, 14 Aug 2019 03:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565779869; cv=none; d=google.com; s=arc-20160816; b=0MUONvvddIIn/w8GFIVbR0qqiOGEA56HOhaTricM080l6rpF3g+lo5rSmlvWZtgJBQ 4EYD+i7kWjapd79hGRAeZWA3HQcnWQeROl4fcGpxT7siWabuIJzJb3af/ML77uc/wTH4 YecOV9vcsS+GHZqZSgvhzs31kfRHzPTogjio+p6KhkRXELlcsz+s57BbfrYmUuLrxOF7 +T1oE0M3SErxZi6gyNvpK32ggniZRhlEjPLHAete/R5CA7MGzDFFpqVSNQZs6L52U2yy YoWQSNDgLRHSxAYfqbI6SBnBsmUieM/fBdS6gJCHFxEU9NfykHkI067bfLSeqQbAwmOB Fjqw== 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:from:date; bh=rbSdKP8uHLGcJ5oYm6E3cEsiI/HkfX+nvLz4wHCnbZ8=; b=0KMOKRbo6cNcWK546whAoaJ+8HLDHVSg3XDCscMXCjGCaJYBYzx7AJPKjfLyphouev ymcdBa53TMBvghHJDmf0QWED8n7Prprrwi04QcqgIRPyMvONYhHw6oCu77Hr1SFs2JR2 3IoUNDV6kJm8X6tOR9QdgNsW+TfogFkRY1JezqdS6zwrUeWenlQ2BKbrKcVDLfNNKByz 4adTwChCYL0OTpzHsOaWZWPLdvJuMyuezGghfp4MeLTdtzWLGnAlOGaauDXWIPwYb425 glcz+mBoFRIcmn4ZBl49t6AbvfFc9WcWSuh51HEJESgxg1ArfQmpnzCBb59wP8Dy7oam kSZg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14si61952445ply.347.2019.08.14.03.50.54; Wed, 14 Aug 2019 03:51:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728128AbfHNKtt (ORCPT + 99 others); Wed, 14 Aug 2019 06:49:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:56840 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727226AbfHNKto (ORCPT ); Wed, 14 Aug 2019 06:49:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A0F0CADEF; Wed, 14 Aug 2019 10:49:43 +0000 (UTC) Date: Wed, 14 Aug 2019 12:49:41 +0200 From: Petr Mladek To: Chuhong Yuan Cc: Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 4/8] printk: Replace strncmp with str_has_prefix Message-ID: <20190814104941.qt66ozcau5fdswcs@pathway.suse.cz> References: <20190809071034.17279-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190809071034.17279-1-hslester96@gmail.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Best Regards, Petr