Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5092712rwl; Mon, 3 Apr 2023 14:20:29 -0700 (PDT) X-Google-Smtp-Source: AKy350Y1m8Vk1Kc17ivWwaLRD3a5iZ1MSwuXRWGVawP7waH9+4OUOHWKjMMZg7bTElGyX+AU5ra/ X-Received: by 2002:a05:6a20:8923:b0:da:2fdf:385e with SMTP id i35-20020a056a20892300b000da2fdf385emr56729pzg.49.1680556829053; Mon, 03 Apr 2023 14:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680556829; cv=none; d=google.com; s=arc-20160816; b=OeKSaeDmgdP11mO9WY8UwO9V8uIAjSIxj8M4rntJXSQS48EfJSHsbioTHRbAbhMX9c L+eL1HorIEdS5M1jaP4Bx+PxsJzwGKSnVbTdbNrFx8JVTf8gQSn4pI7laO82iO/hjo+b Gle2wG5Gkz6Nw9Ity9lr3WcpKPrKh/O58Fef1Bv0yeEpJKMbS3HfDCeEEA7UfjiUojER BRzlc7RPULlw0tB9F2uMLi+3nLHbE4nncn6uKwW27YzACy0t/QBz4/keZlqLc7HQYO7H Y7Ym4KAbVW6cBVepzx8BBrdz/7UTEV3kVTCnzzou2fdEM5oy8BYWFPPcf6Q08icRdnH8 yJzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=FMMBXuVJRTWF246/02SWbYQN09GAd1monhcgDzsVC8E=; b=mLQyZZnyv+7OaVSHYT5YtP9gWxUXK6R/TDoqVo4Eg3qWLiDg7aW2G4UVKkrJXARf7H JIgDyy/WvLHESWd72fhX+elJ38WR+iYsZtRMcLQuRcIWAo9D5dVeaGhNUUx08Ll5Nkx8 KoTl5w7nkXbD0x/tsQhBYgbvPZqc2wGCWxI4Trg+yvkSCX5pjFvRWH4akczzEutKodV2 tvgx0xCaMEXlJiT/llTs/9yVeHT7CUlW9kXDjw+kg2ZBFn0EGNf8dgeJ1ax7y/tTTreo SU6le25MZ6DTEP7j72MWLHjFq4qZ/bkXFupBNQX3e3Rsv0uHxmfhXoosvYM2/YNpED59 8Ahw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=KLJr4TYl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020a624d03000000b0058bbe6710absi8975310pfb.261.2023.04.03.14.20.17; Mon, 03 Apr 2023 14:20:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=KLJr4TYl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233666AbjDCVQq (ORCPT + 99 others); Mon, 3 Apr 2023 17:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233650AbjDCVQo (ORCPT ); Mon, 3 Apr 2023 17:16:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC1B1E42 for ; Mon, 3 Apr 2023 14:16:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4782262B39 for ; Mon, 3 Apr 2023 21:16:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83D78C433EF; Mon, 3 Apr 2023 21:16:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1680556602; bh=q8GofUuMfaapfTme03j9jsX3YGZomqPFR6QYbw5D7oE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KLJr4TYlnRg2CormlCd/a+KVd8BCYzWLst+s9rE1E+mVzY6nUdDHAqHUQlWVbNJzw c+N88VLvCEloavhVGj9N9sYgmtXdOssGgN5M/dnfgzsj9qQcS5vXTaEPyYGuyciRVo EQMU47XaweCbf+dRPxxfi9+0i7FWLwH8dMuWiq0s= Date: Mon, 3 Apr 2023 14:16:41 -0700 From: Andrew Morton To: Alexey Dobriyan Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] string: implement streq() Message-Id: <20230403141641.6ace0d85fd48fbed5c02d7ef@linux-foundation.org> In-Reply-To: <4b595ab9-238c-43a5-aba0-be5d6afc0f87@p183> References: <4b595ab9-238c-43a5-aba0-be5d6afc0f87@p183> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 1 Apr 2023 20:48:05 +0300 Alexey Dobriyan wrote: > Most of the time strcmp() is being used, strings are checked for equality. > Add wrapper to relay such intent (it is shorter to type, too). > > Use > if (streq(s, "s")) { > } > or > if (!streq(s, "s")) { > } Gee, do we really want this? I mean, we all know how strcmp() works, don't we? I'm thinking it would be better to remove the various cute little streq() macros and open-code strcmp(...)==0.