Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756742Ab1D0TiF (ORCPT ); Wed, 27 Apr 2011 15:38:05 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:34319 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755141Ab1D0TiD convert rfc822-to-8bit (ORCPT ); Wed, 27 Apr 2011 15:38:03 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=t1Rb8/THU4Gd0ISLcjluJkf73EyaJyW181EX/ehG9SZyHV1wEQfzav1QF80Spg1BW7 psUDYXkwwMk8bhMwIEopsuBwFpzf4ujKXRymErQXU2FbSX0EC7vbpnXgcOSgiNKoyjua /hfRLipVHj4V4S2BV7KbtqraMMns3rKhdu2xQ= MIME-Version: 1.0 In-Reply-To: <1303931761.18763.101.camel@gandalf.stny.rr.com> References: <1303926576.18763.75.camel@gandalf.stny.rr.com> <4DB86163.2070201@zytor.com> <1303931761.18763.101.camel@gandalf.stny.rr.com> Date: Wed, 27 Apr 2011 22:38:01 +0300 X-Google-Sender-Auth: g_Y4qaWa8e4xpEsOQTqioncltnM Message-ID: Subject: Re: [PATCH] linux/string.h: Introduce streq macro. From: Pekka Enberg To: Steven Rostedt Cc: "H. Peter Anvin" , Thiago Farina , linux-kernel@vger.kernel.org, Alexey Dobriyan , Rusty Russell , Ingo Molnar , "David S. Miller" , Al Viro , "Ted Ts'o" , Christoph Hellwig Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1434 Lines: 39 On Wed, Apr 27, 2011 at 10:16 PM, Steven Rostedt wrote: > On Wed, 2011-04-27 at 21:51 +0300, Pekka Enberg wrote: > >> It's the same kind of API extension kstrdup(), for example, is. >> Whether or not we should it do it is a separate matter and I think the >> only reasonable argument for and against is whether it (a) reduces the >> number of bugs, > > I did a quick search through the git logs, and found no bug fixes due to > the semantics. At least by the time it got to mainline, they are fixed > (which is a good thing). > > >> ?(b) improves code readability significantly, > > This is a matter of preference. I think I would prefer it, but obviously > others do not. > > >> ?or (c) >> generates better code. > > If we implement streq() separately from strcmp() it gets slightly > better: We'd probably end up with both in the tree, though, which is not an improvement. With kstrdup(), for example, we were able to move code out-of-line which improved the whole kernel. To be honest, I don't think the arguments for streq() are that strong but I wanted to point out that the arguments against it weren't all that great either... Pekka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/