Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp846146rwb; Thu, 18 Aug 2022 13:23:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ItZD7A1pfp6iTM7ks5zuSqGTyaLqynw4kqnUKDO18oNkBeeltGtusztNdELOG+/hNYwOy X-Received: by 2002:a17:907:9627:b0:734:a166:e0c4 with SMTP id gb39-20020a170907962700b00734a166e0c4mr2858231ejc.7.1660854208060; Thu, 18 Aug 2022 13:23:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660854208; cv=none; d=google.com; s=arc-20160816; b=OmhlM+qPqLmWKre0JqteEkGuMAfbs+un/gne4/qqnOqGI7WllwQgZc0He76iFjQCQB li+6Jt134JrYGW9byKG8wyVcBaGIu1Ihbzr1ANMUCYtjBO4RQhFcS3AF78vqy7s+DvQK qhAH7jyI+5MHqFmASafI5PFiWNDb1XPcg6rlF24KNdvuqqy8j2S/mRSasjXKGDndJzJs Lr1BCQeubkoi2nPc7qbJvG0moFGMUcmBQsxY0TQtR4se5WBgQlg128xI0GHzeiLNpkco 5HXIOC8pVQDeVLOtxpN/DzCoFXtXPUK1cQI+aU6U6DoO0i672iySe3oQiSgzWSGkWU1/ iq7Q== 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=0ESmbvcntOtIFESig88BXQM8zSlKs6s9USt/AOnrKXI=; b=DKHls4y2AUWzsigpwaWabsmx6ajmlkIRfntYzWd8VAnWwVPKVPMNMRiPLiaM8suFkM M/VvE+znbcyFGVdSFZtTFXernzXVd6KXSV2Z0cAS1+ALKyOnnZOnOUN3Y4CVRR2PSEKX TDO8125q91Cd3UhZHoJUYEz1AlAm2YpNYA8xnc0yvvZU+fGf8YFwCOeid01SSksVDCaU 9Vp0Dldz2oqthuhQICJzb9BA/CIhWyobXkvZdxjf9yqd9meZ6hjDM/hd+mdk8oKgmRan F3cytbL5Rj84b3J5Rv/LEPfhJltSvoFh3b4ifHIjYxUUlYq/eJvlRGkOSAOvUGsUsqe0 FkFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZG4UqLSf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r2-20020aa7cb82000000b0043bba5ae2bfsi1472334edt.409.2022.08.18.13.23.02; Thu, 18 Aug 2022 13:23:28 -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=@kernel.org header.s=k20201202 header.b=ZG4UqLSf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345509AbiHRUKF (ORCPT + 99 others); Thu, 18 Aug 2022 16:10:05 -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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 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