From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37389C00140 for ; Thu, 18 Aug 2022 20:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GmHrqoi4DXWzs30kIaQLNT3m7cq9jYf7VZvBk/C+FbM=; b=nt0kZnbcH8WoaA lgY5qnWZCG+T/xLr7FxqeQIPMCKLLAiPXmrl6igvZ9cDhY3oWDFCR0yzKJgn6qtm/oryhYaisbIOV oKur8Cwa2TV2gD2u1LGOLpzdxfWQtKmph3S28QFt5tSf6hkSPj4WsvDT6zv2bldC6hJ8l/IcZUakq LuB+EAC7ixWWFNcIyEjN1+RWuNMvPjuGvcCV262ywztsL+HsR1iv3DwSSicJo71XGC34370Jun55s SmK9gT9QYKHauUPLU/wc4poW9fx47QJKQW8PavmJQ6DWIoNKINGSFe+v8eemSnvzLnAy5FR7KKJz+ IwL3Glq+FCB5rNG78RKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOlkC-008wgJ-Fk; Thu, 18 Aug 2022 20:03:56 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOlk9-008wdM-Sm for linux-phy@lists.infradead.org; Thu, 18 Aug 2022 20:03:55 +0000 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 9A43E61348; Thu, 18 Aug 2022 20:03:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F3FBC433C1; Thu, 18 Aug 2022 20:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660853027; bh=IeUfviVB25387GkpWnclXYp8ePJifeEM+3lrJ3qxfwM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZG4UqLSfbXDvPv8EIV23mRe6BfblTvnqOMdcHvLUKp2+AhZk71SXjlr2EglrMefSs yb0hWyDhJSEa+5W9kB++u/dymS58r7nwgBfYNpKUDpBGjt1dVXFAuMQ7cK7rKM64nH UxiGYtdVFdVYHk3f5SyhG9WsCZ4+SpoN5vtPtKauDQuJifGjmVJqI0W5gvFnBo5nbR B3tVzeUatQt0l+wKQ1GmxAkksTKPgi27iNYFMVnegLKkzKvaE36G12piO0OAB7vFJH nhvaSU2O69ea+fI0VsA8hUHgyKxn/XyP3kMXZbYZqNSwhHk8itVFjgEPRNBKqZt2VG KgH/7SLleK0Ew== Date: Thu, 18 Aug 2022 22:03:40 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Andy Shevchenko Cc: Vinod Koul , Kishon Vijay Abraham I , Linux Phy , Kees Cook , Andy Shevchenko , Daniel Scally , Gregory Clement , Heikki Krogerus , Sakari Ailus , Linux Kernel Mailing List , Pali =?UTF-8?B?Um9ow6Fy?= , josef.schlehofer@nic.cz Subject: Re: [PATCH linux-phy v2 1/4] string.h: Add str_has_proper_prefix() Message-ID: <20220818220340.78901438@thinkpad> In-Reply-To: References: <20220817200335.911-1-kabel@kernel.org> <20220817200335.911-2-kabel@kernel.org> <20220818214828.22023dc7@thinkpad> X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220818_130354_011410_62D21EA3 X-CRM114-Status: GOOD ( 21.88 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org T24gVGh1LCAxOCBBdWcgMjAyMiAyMjo1NjoxNCArMDMwMApBbmR5IFNoZXZjaGVua28gPGFuZHku c2hldmNoZW5rb0BnbWFpbC5jb20+IHdyb3RlOgoKPiBPbiBUaHUsIEF1ZyAxOCwgMjAyMiBhdCAx MDo0OCBQTSBNYXJlayBCZWjDum4gPGthYmVsQGtlcm5lbC5vcmc+IHdyb3RlOgo+ID4gT24gVGh1 LCAxOCBBdWcgMjAyMiAyMjoxMDo1OCArMDMwMAo+ID4gQW5keSBTaGV2Y2hlbmtvIDxhbmR5LnNo ZXZjaGVua29AZ21haWwuY29tPiB3cm90ZTogIAo+ID4gPiBPbiBXZWQsIEF1ZyAxNywgMjAyMiBh dCAxMTowNiBQTSBNYXJlayBCZWjDum4gPGthYmVsQGtlcm5lbC5vcmc+IHdyb3RlOiAgCj4gCj4g Li4uCj4gCj4gPiA+IEJlc2lkZXMgbm90IHRoZSBnb29kIG5hbWluZyAod2hhdCAncHJvcGVyJyBt ZWFucyksICAKPiA+Cj4gPiBUaGUgbmFtaW5nIGNvbWVzIGZyb20gc2ltaWxhciBuYW1pbmcgaW4g bWF0aDogcHJvcGVyIHN1YnNldCBpcyBhcwo+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RoZSByZXZpZXcuCgpNYXJlawoKLS0gCmxpbnV4LXBoeSBtYWlsaW5n IGxpc3QKbGludXgtcGh5QGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cHM6Ly9saXN0cy5pbmZyYWRl YWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtcGh5Cg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F962C00140 for ; Thu, 18 Aug 2022 20:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345896AbiHRUKG (ORCPT ); Thu, 18 Aug 2022 16:10:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345892AbiHRUJo (ORCPT ); Thu, 18 Aug 2022 16:09: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 32594D21DB for ; Thu, 18 Aug 2022 13:04:35 -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 9CCD461458 for ; Thu, 18 Aug 2022 20:03:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F3FBC433C1; Thu, 18 Aug 2022 20:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660853027; bh=IeUfviVB25387GkpWnclXYp8ePJifeEM+3lrJ3qxfwM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZG4UqLSfbXDvPv8EIV23mRe6BfblTvnqOMdcHvLUKp2+AhZk71SXjlr2EglrMefSs yb0hWyDhJSEa+5W9kB++u/dymS58r7nwgBfYNpKUDpBGjt1dVXFAuMQ7cK7rKM64nH UxiGYtdVFdVYHk3f5SyhG9WsCZ4+SpoN5vtPtKauDQuJifGjmVJqI0W5gvFnBo5nbR B3tVzeUatQt0l+wKQ1GmxAkksTKPgi27iNYFMVnegLKkzKvaE36G12piO0OAB7vFJH nhvaSU2O69ea+fI0VsA8hUHgyKxn/XyP3kMXZbYZqNSwhHk8itVFjgEPRNBKqZt2VG KgH/7SLleK0Ew== Date: Thu, 18 Aug 2022 22:03:40 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Andy Shevchenko Cc: Vinod Koul , Kishon Vijay Abraham I , Linux Phy , Kees Cook , Andy Shevchenko , Daniel Scally , Gregory Clement , Heikki Krogerus , Sakari Ailus , Linux Kernel Mailing List , Pali =?UTF-8?B?Um9ow6Fy?= , josef.schlehofer@nic.cz Subject: Re: [PATCH linux-phy v2 1/4] string.h: Add str_has_proper_prefix() Message-ID: <20220818220340.78901438@thinkpad> In-Reply-To: References: <20220817200335.911-1-kabel@kernel.org> <20220817200335.911-2-kabel@kernel.org> <20220818214828.22023dc7@thinkpad> X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Aug 2022 22:56:14 +0300 Andy Shevchenko wrote: > On Thu, Aug 18, 2022 at 10:48 PM Marek Beh=C3=BAn wrot= e: > > On Thu, 18 Aug 2022 22:10:58 +0300 > > Andy Shevchenko wrote: =20 > > > On Wed, Aug 17, 2022 at 11:06 PM Marek Beh=C3=BAn = wrote: =20 >=20 > ... >=20 > > > Besides not the good naming (what 'proper' means), =20 > > > > The naming comes from similar naming in math: proper subset is as > > subset that is not equal to the superset. See > > https://en.wikipedia.org/wiki/Substring : > > "A proper prefix of a string is not equal to the string itself" =20 >=20 > It's nice to learn something, but I still think that name has too > broad meaning(s) that may easily confuse the developers. >=20 > > =20 > > > the entire function is not needed. You may simply call > > > > > > str_has_prefix() && p[len] !=3D '\0'; > > > > > > Correct? =20 > > > > Do you mean that I should implement this function to simply return > > str_has_prefix() && p[len] !=3D '\0' > > or that this function should not exist at all and I should do that in > > the code where I would have used the function? =20 >=20 > The latter since this seems do not have users, except a single newcomer, >=20 Very well. Thanks for the review. Marek