Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp842079rwb; Thu, 18 Aug 2022 13:17:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR73ypfs8/dYBbwvrEEMl1qD/NQ3Hx7k2NjcMDxGT2wUocDTNKG6fQMBVfk2cgL1ANYBp75R X-Received: by 2002:a05:6402:424d:b0:43e:95d8:eb46 with SMTP id g13-20020a056402424d00b0043e95d8eb46mr3546127edb.306.1660853872071; Thu, 18 Aug 2022 13:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660853872; cv=none; d=google.com; s=arc-20160816; b=Mc49/r+SbI0InFxzo9ySyrRt67IjBCQn4sKvyONWP0IRz3QJ7LnaUy4MoCW/pXp5sa Pi70mV5P7XWeEGRBuMm7dHVn/zsBgk+QlC53VSSmkXTkPn7i2o63nX4tPQoXPhfoPC0k yi2datw7a1rcMUkR6SqjcKrHt2dGX8vJ+7479bHPJ3CjAmYL75RaTkmD4/sHQTAXrkwm GeZQynLMPTxXQAabXrXYcZDVGYD0wJ2lr80dljlzV8Ul92y6q4t0Paj7ahA+1YrNrYPm y7Lskr3Nuvf0zVeBUuatrb+lfqvCYWE6uZoYSNIucS14J/dK3W5Gq4zKq2/5iH7r6MhB melg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=x6C9oaqjzTmMIXnSanHNNBqmdNheWpmGgKycJO3HRsM=; b=QmF7OQMAgQYtUmx2bHYkCTVwE0lRoC8E9OLqcpBIZ1P++YzwEObgGqZF1swEHgTYzI mLzGIolUkJ9r4IrpxODzgSzRp+RYNOpvj3GuZq/944d+vnwxHs9XqzHn1E0KDWHGRKrh clc7CWmPCdFt96eX5YRLpvfUEojnVV2kVa4g/z9fY2pnJVKaoNphmgcKLgUzkP8XjeLK oi5SH6OtGQkWakWseuy1a9AvKR13pMj9g5yUcc4v/4KAqjbAOuV9NIaPsMr3oVWYp2+V 6s5IZF/vGSOLUYW+EwjzIQl7sPc0QrROxUPSm6DJE04ELJ708iFOorSIhO86ATjXdSbz i2Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gfAiGgfU; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a17090632c100b0073301a22cb7si1438555ejk.294.2022.08.18.13.17.25; Thu, 18 Aug 2022 13:17:52 -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=@gmail.com header.s=20210112 header.b=gfAiGgfU; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237121AbiHRT4z (ORCPT + 99 others); Thu, 18 Aug 2022 15:56:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235080AbiHRT4w (ORCPT ); Thu, 18 Aug 2022 15:56:52 -0400 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01952D077B for ; Thu, 18 Aug 2022 12:56:52 -0700 (PDT) Received: by mail-qv1-xf2c.google.com with SMTP id d1so1999888qvs.0 for ; Thu, 18 Aug 2022 12:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=x6C9oaqjzTmMIXnSanHNNBqmdNheWpmGgKycJO3HRsM=; b=gfAiGgfU47zX+cjYD7NiEzDLnPng/4RgoLNcE7yXZwuQsCkYh6DuL+H6yoGVCTHa2Q V/6mVSPdZCfxjUjJTx9DrLZ9Ys2L5yZ79mAjNMm9n8J0PQJHpQvlAGvAyj4Q2SBZxWFZ t26GDzke1tpBmCY4TdoEIVXiwp+jlSi/xdhFk20mwHR07fciMFVVM+R7NXLKKCF6U3aU OQJyWplK3dXf4JkkWtiG8+Ydaz8pAO/XpBfnXMcL4zPd8S1umrVwdIk6OhAeGDLEMkXx 7Mg8oWg34Wf/FoY4/Opw7G8NmNG7CRPzYkas+2YD4f+ssZouEsGVRqif0gZc/7BAOzvK FRag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=x6C9oaqjzTmMIXnSanHNNBqmdNheWpmGgKycJO3HRsM=; b=ihypMS3NUwG6ovCGK23uUojKdgUo4LlttLSwfHb7kxvurn2Dgkqg+PHfpAID8hc1Ga 31Vq0v6xQDHS2j5InC8VEz4mILlPtngGx8/vWolD4blsphcz6yhY7domUzGhpA6DhsxX y7boSKvEkG6C/13s/BUKVZE0Y0yEtlzVLC9kWNbZJq7iqP1LZEO0PWzbYH1F1+qlEw18 zOIJWOU0m4rYaIDTMa1qBflRimYzG4HaJnyVf+OJAIt4e9ZZekCfx0UPQg2/Tma0J0xo 39GCeloh3moAFQIheOQ3hVCRYttLZtiMklcUivFwGxLcjcJgm9qY3o7T9PtCMpb2zL/D uBxw== X-Gm-Message-State: ACgBeo3pKyY9rIJCgw0Pv1dNqPfL+dWtsNpWkdWUsm7qb7Whrc/7RoPN X8uyhuXL3VwAWrt3H6oKqV8I5Ax+EMOmzPuwNAb/jthROno6sg== X-Received: by 2002:ad4:5baf:0:b0:476:6a9e:b5e1 with SMTP id 15-20020ad45baf000000b004766a9eb5e1mr3792263qvq.64.1660852611084; Thu, 18 Aug 2022 12:56:51 -0700 (PDT) MIME-Version: 1.0 References: <20220817200335.911-1-kabel@kernel.org> <20220817200335.911-2-kabel@kernel.org> <20220818214828.22023dc7@thinkpad> In-Reply-To: <20220818214828.22023dc7@thinkpad> From: Andy Shevchenko Date: Thu, 18 Aug 2022 22:56:14 +0300 Message-ID: Subject: Re: [PATCH linux-phy v2 1/4] string.h: Add str_has_proper_prefix() To: =?UTF-8?B?TWFyZWsgQmVow7pu?= 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 , =?UTF-8?Q?Pali_Roh=C3=A1r?= , josef.schlehofer@nic.cz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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, Aug 18, 2022 at 10:48 PM Marek Beh=C3=BAn wrote: > On Thu, 18 Aug 2022 22:10:58 +0300 > Andy Shevchenko wrote: > > On Wed, Aug 17, 2022 at 11:06 PM Marek Beh=C3=BAn wr= ote: ... > > Besides not the good naming (what 'proper' means), > > 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" It's nice to learn something, but I still think that name has too broad meaning(s) that may easily confuse the developers. > > > the entire function is not needed. You may simply call > > > > str_has_prefix() && p[len] !=3D '\0'; > > > > Correct? > > 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? The latter since this seems do not have users, except a single newcomer, --=20 With Best Regards, Andy Shevchenko