Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2650346imu; Sun, 23 Dec 2018 04:52:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN7F4anq0ImEFiR+hnaBKR3Cp2VZwXLJHqod1ud7ifj19fMXIOJh+8wPeVk4atFfhCC2i7w0 X-Received: by 2002:a62:6ac8:: with SMTP id f191mr4306614pfc.13.1545569551187; Sun, 23 Dec 2018 04:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545569551; cv=none; d=google.com; s=arc-20160816; b=Zm0ExDO4RCwyfvfUweFXIeRIEY5FEkldhPrt/US0NNKI+0jMxN4lQmtd1S30cytLAH piXXIdcxpjWJBy8aLm04f8TCnuvjYnCcucUGNeaCmNit+F/doVS8WGZI5Wyya25VWYjT 4gKA37NxFAFh5SQcNEEcTVh2gfLNTJt+T+UbSrdeGAiiuBajhvM7u4h4FNg/Zg410z7y Ak0UmFcS1tvmFYo5x3cH+nDDOuoM1vtkwlID28czgu78LZ5wCs9amN06/X+6DZCQV7Y1 yWrDdUqzBwhS9hCTiHrqFNVoK2MyqZLn6Mqc/PgxhFFuE3/kuDf9A63vP1ziHmRypfdH 60dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=d6F/ntyeS0LimzOMvDEhUtehPjr1FxHPx5RemdaDyDo=; b=t3dA1Z2hGkPWhyxmCdkcn25lX9NyFSsuIdFn2w+Wo229wLJvAIENaWHWXON+1L0NRm iYW7D/wD5P3qm7S33xCBL7nUnEkWmVdlwuEnxrJZreaE/EpRdP8/f+xq2m3p5zVnN66g +1GHuba2T1G3UfDpCQAOErOMzmTT3Hf5PhXFsgV4/L8Fx2xJP4BOIRPyByKND+pwRM3y zOTisv1YwWFt5e3zt4GUplO9nnwCrJUGylhFmiTbQmLPkapmlbpo8KLUhbkD5VS8KBU8 ko58bk62kCjwZjaTPYjK6P7RWLiIV5ddxt7zKBjMowDP8BPw/Xe7Dwm9pqQPbQuVoWic ocwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=IqHU1uzx; 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 s13si8973923pgc.509.2018.12.23.04.51.46; Sun, 23 Dec 2018 04:52:31 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=IqHU1uzx; 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 S2392114AbeLUW3v (ORCPT + 99 others); Fri, 21 Dec 2018 17:29:51 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34027 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388822AbeLUW3u (ORCPT ); Fri, 21 Dec 2018 17:29:50 -0500 Received: by mail-lj1-f193.google.com with SMTP id u89-v6so6060515lje.1 for ; Fri, 21 Dec 2018 14:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d6F/ntyeS0LimzOMvDEhUtehPjr1FxHPx5RemdaDyDo=; b=IqHU1uzx+SCFh2O2GRUNpfW15C/DK82UXXVEnR/NXmKcX5UqBy4LAchcJB/k6UsSw8 XnBB+ks/IZhoteINfxbXzFCG1cnYUhiE0wHKoIPB7nP2yo3aTMlA/bwrS3tbqRc/A45z 1UEOgAFRJqxd4PUWOWcdY2mk0RYTU5Tu9RhyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d6F/ntyeS0LimzOMvDEhUtehPjr1FxHPx5RemdaDyDo=; b=Vvw6nKoNA4Uy9+OvhvwD7xbo0a6H0Of4B9jx6qu7RxjgQppCA+4PODjgC9t1tiJon5 aY9DacwZyDIZRjemVJb+U5+liX93A9jHn+PtfAbIRkAihpOZu39B1mWZcDykMrha0n6B Jtj6urcpyKyXiuUF+0/u37/eBNDFuTUDacHeQd9Owj0mtjLsGpBuH6HcJ6OrzwTMOOFY aoQk1p8INxVcExMbSevrTNEqblu7rwfUP45WM35y18yKD83OD1Cb55uV0AwOMaIf0X9T PWvZ9dRHVJaR01ja0L6Jm7iAuuTqah3lWIC+/B4jU5g0eBmRDY20FI1DekhksfEtP8UA AeTA== X-Gm-Message-State: AJcUukdZ7keTVwcAssO+Z8RKGbjoru4TLwrJ2Iqd8Xr+f+5ey6r7R0jP ueR8srt240kYgxnodNGoS9+NkAjiqnY= X-Received: by 2002:a2e:6c04:: with SMTP id h4-v6mr2592965ljc.92.1545431388012; Fri, 21 Dec 2018 14:29:48 -0800 (PST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id y11-v6sm4860924ljc.85.2018.12.21.14.29.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Dec 2018 14:29:47 -0800 (PST) Received: by mail-lj1-f173.google.com with SMTP id g11-v6so6050119ljk.3 for ; Fri, 21 Dec 2018 14:29:46 -0800 (PST) X-Received: by 2002:a2e:95c6:: with SMTP id y6-v6mr2599069ljh.59.1545431386374; Fri, 21 Dec 2018 14:29:46 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <84199633fd49db573c9ba71f1992936422e907d4.camel@perches.com> From: Linus Torvalds Date: Fri, 21 Dec 2018 14:29:30 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [for-next][PATCH 23/24] string.h: Add strncmp_prefix() helper macro To: Joe Perches Cc: Steven Rostedt , Andreas Schwab , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , Namhyung Kim , Masami Hiramatsu , Tom Zanussi , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 21, 2018 at 2:20 PM Joe Perches wrote: > > Using > > static inline bool str_has_prefix(const char *str, const char prefix[]) > { > return !strncmp(str, prefix, strlen(prefix)); > } > > eliminates the strlen with gcc 4.8 (oldest I still have) Ok, that looks like the right thing to do. Side note: in the kernel we disable the whole "unsigned vs signed" pointer warning entirely, exactly because of the "char *" vs "unsigned char *" problem. Linus