Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3064398imu; Sun, 23 Dec 2018 15:02:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN6luxqGfPN0POjobggSD/8zs+F9NA2vef/kU2CsxuVEYQGznt61FBW5QPBBOcnzdKQ/34Sc X-Received: by 2002:a17:902:2862:: with SMTP id e89mr11136128plb.158.1545606179129; Sun, 23 Dec 2018 15:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545606179; cv=none; d=google.com; s=arc-20160816; b=KBvEW35gEyl4+wA0IKcXWkI6D3P+qewTcwlFxJzZTj8qLKgLq3TK9lgITTOIM4Fabd /PbydJBOSoZlPz0I6Z2nZYpWH705ee/n7v47lNwVL++sl/QFCQdTBtkV/5OvL9nxDCRF UKYzuVWFkF48rSgzVeszBzdvxWAbq43APJiBeT/GNUMZRzlIlu2qYUAVvFwLHFbG1R4x ZAy5z2l5QowlT0MNvbXZE51QzDjX67i0ssVAMbnY0Gpl+IgS0IA2ap144dTkTAmr4f4c JKjbI5/ka7FH7OVKiWvzWLDpcEo7v1yNBTb2SCbHBMpz1/Gr4XHGqngKFT9WFXqgNpJK jqOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=KjiOzo7TahRCm+j3oxJpE1pJvcxsOgW2COBu2rZbstk=; b=mf0GuLPCc9UwvKR9SxTFgHSftm/e79J3bdZzTKPjlfFVcvMWjEaaMDeGlD34ecuDwv M5mEGaQ2CNdaJH87wyof8U0XijuLEFVeA60IqK7N/BW4p5G1rZ8yGM+dGALWKhC0slog mLWDJtWkovdU39zZZL10xqA7IMNOClbNDEfzuMJ3ylnBhAbvGj5UszFYpRP9AgC5CHgp KDBNiRoc4+AG6yOzNUEa28IwucjGxr11e/kbrVW91eGShS2TPCuXRokD1lzi1NY+i8AF 0pSG65YR8PU2M3RnN9RUQgthrnpSxsVYoBOwswxOFxVQSi2OIvLFPXeOacz7PIYwPCuj xYww== 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 a8si13056064pgw.380.2018.12.23.15.02.43; Sun, 23 Dec 2018 15:02:59 -0800 (PST) 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 S1725959AbeLWXBy (ORCPT + 99 others); Sun, 23 Dec 2018 18:01:54 -0500 Received: from smtprelay0102.hostedemail.com ([216.40.44.102]:60671 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725895AbeLWXBy (ORCPT ); Sun, 23 Dec 2018 18:01:54 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 71024182251B3; Sun, 23 Dec 2018 23:01:52 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:599:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1538:1593:1594:1711:1714:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3351:3622:3865:3866:3867:3868:3872:3874:4250:4321:5007:7903:10004:10400:10848:11026:11232:11658:11914:12740:12760:12895:13069:13311:13357:13439:14659:21080:21433:21627:30054:30090:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:28,LUA_SUMMARY:none X-HE-Tag: part92_10193fe49464d X-Filterd-Recvd-Size: 2353 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Sun, 23 Dec 2018 23:01:50 +0000 (UTC) Message-ID: <01c2fe1b83a56e958d1cd329741eaea5be82f47b.camel@perches.com> Subject: Re: [for-next][PATCH 23/24] string.h: Add strncmp_prefix() helper macro From: Joe Perches To: Rasmus Villemoes , Steven Rostedt , Andreas Schwab Cc: Linus Torvalds , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , Namhyung Kim , Masami Hiramatsu , Tom Zanussi , Greg Kroah-Hartman Date: Sun, 23 Dec 2018 15:01:49 -0800 In-Reply-To: <098d7abf-5b62-6a01-a370-97d96bece299@rasmusvillemoes.dk> References: <20181221175618.968519903@goodmis.org> <20181221175659.208858193@goodmis.org> <20181221144054.20bdeb33@gandalf.local.home> <20181221153526.5e6055ca@gandalf.local.home> <077eeb8b09baebe78822819b5f15d671b738a2b2.camel@perches.com> <20181221155435.38a9a221@gandalf.local.home> <871s6ad2br.fsf@igel.home> <20181221160826.34c544e6@gandalf.local.home> <84199633fd49db573c9ba71f1992936422e907d4.camel@perches.com> <098d7abf-5b62-6a01-a370-97d96bece299@rasmusvillemoes.dk> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2018-12-23 at 23:01 +0100, Rasmus Villemoes wrote: > On 21/12/2018 23.20, Joe Perches wrote: [] > > static inline bool str_has_prefix(const char *str, const char prefix[]) [] > We already have exactly that function, it's called strstarts(). Heh. Thanks Rasmus. I didn't remember that one. I think the 'int str_has_prefix' naming and returning the prefix length may be a bit better use than 'bool strstarts' and perhaps a treewide conversion of the existing strstarts to str_has_prefix would be OK as there aren't that many. $ git grep -w strstarts | wc -l 91