Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4557509ybi; Tue, 30 Jul 2019 04:11:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNZPkSWuX7LV/Q+N4nwpJ0iJzEi2aP6QmqtNBUCbxJmftS5ODRByqfLSeP1xSech/uZWkp X-Received: by 2002:a17:90a:f98a:: with SMTP id cq10mr116851895pjb.43.1564485099962; Tue, 30 Jul 2019 04:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564485099; cv=none; d=google.com; s=arc-20160816; b=LOzFhXJa0IdBmYZ1WUGNrm3jJCospBFOXUNZbdeo0ZaN1Fe/dbaKzHm6LN/IiPGIeH ynnGNlFDfqaRtI5HHrYHTsSXTnj0TIVIsoPCiYJ07g0T+kJXI1PHcU+DqVg1ptoYqzsr hpj2kIXcD9/CLFSR0lLdyoU/iYvKigknDEaE5C44v0nYLEsla66vJYVxiBPTCHImRIda fbjqOnCihhsLS7dMijePyMwWmY4pTgzhmb1GYU3kC5TVpH3UoAFiMDNicrbhV5WosakD RgLtbT9Syr655X4Ge28QcruL5gSuSCVMgeBQobFKk/kD3Tr7VKwM9DiAGtOYvZDsWq2R PIPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=lhidcqaS61Lzm2DxUM3fGL0ZyUA1E3pKoyXo0j0QTJA=; b=JvVXmp32kuX0fBx1uzrpst/iw32Xabs1MtxBziwcDeLIyNm751/qP4Gse8xoKcrz83 TkZd5i2E1daKUFSgfcL/jnSxVz2tB0LGF/ZDBGlSzPdQ8y+TeGR8hw1wj6lQ2+lqBTne 2nkEIL0dfX+YBVeUj5P4y7lx5ydZ1OK82NcyIvmiyTf8ihva3CEYZAO1q0jwb2MpIZlO ANNavQXYV6TAwef8kZnDIi5Sb7PP432sV9epNKAmFv7AY1LOMn22B4EQtax4E7vwpdOj WRraTD5A51PU5sNJvorWhQUqebNo3df0/LXIXLwpiVmZvXsgSDqKXPeN9NPGrsFm40wX bihA== 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 bi3si25158752plb.226.2019.07.30.04.11.25; Tue, 30 Jul 2019 04:11:39 -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 S1730574AbfG3JR7 (ORCPT + 99 others); Tue, 30 Jul 2019 05:17:59 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:56169 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727036AbfG3JR7 (ORCPT ); Tue, 30 Jul 2019 05:17:59 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hsOGb-0003Bm-GN; Tue, 30 Jul 2019 11:17:57 +0200 Date: Tue, 30 Jul 2019 11:17:57 +0200 (CEST) From: Thomas Gleixner To: Chuhong Yuan cc: LKML , Marc Zyngier Subject: Re: [PATCH 05/12] genirq/debugfs: Replace strncmp with str_has_prefix In-Reply-To: <20190729151435.9498-1-hslester96@gmail.com> Message-ID: References: <20190729151435.9498-1-hslester96@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 Jul 2019, Chuhong Yuan wrote: > strncmp(str, const, len) is error-prone. > We had better use newly introduced > str_has_prefix() instead of it. Can you please provide a proper explanation why the below strncmp() is error prone? Just running a script and copying some boiler plate changelog saying 'strncmp() is error prone' does not cut it. > - if (!strncmp(buf, "trigger", size)) { > + if (str_has_prefix(buf, "trigger")) { Especially when the resulting code is not equivalent. Thanks, tglx