Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1313658rdb; Sat, 23 Dec 2023 01:58:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWMP2Z3kJE6FAmMkrWJKYQNHXRkZBbSlBgaaWVkJJNpn7Vuzr7Uz/j3BdKHjaFQvrmpO9/ X-Received: by 2002:a05:620a:f82:b0:77f:e41:b30f with SMTP id b2-20020a05620a0f8200b0077f0e41b30fmr3252165qkn.115.1703325492662; Sat, 23 Dec 2023 01:58:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703325492; cv=none; d=google.com; s=arc-20160816; b=CaqGlI43pzYvnD1FdQsmoL1i5LIDbZUvxLA6bV7Xp28LKHudUwv5w/Nytd+tGzefB3 StsVvTNsbmKhPXm/gyMllAVGzt40pDofGlhxau60TVbXsq/c5/5xPKk7KIxdaMdzBxq5 yIAbbhlOHv6N9WaIyRgOrN1i6eV5QZTdcJl4VXi0/bWOwRFt6WjncLaQ6yX/2lFhSFtM X/Omw89/14TrElDoChFR2OF/C+CuMumj/zdjNjcKS4ancOD4zoBU4dyJlWQnohGfWuJC pGSHxST0xykV0SrlmJMx4euK4L7xD1fs1yY3P4Cb3MVHxm5HlV5AnYd06wj724ifs/a1 luMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:autocrypt :from:content-language:references:cc:to:subject:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=6tThKMgmf1VnMxBguqz/fkGTxJxueSdRTQLBazc4PeA=; fh=cc206KWHlZQQRxPMEO/KeUneZFTjLvT+g78fUjXYuA4=; b=lAG0RotLFC/1XVxStMuojUVAEwANEviBXsGX9oGiA5LsI4RY9zksjXVsGWYefu1Ln7 zxM7IC3CAZ3l6BPgyRUqBoHPON++b/yWO9ehCXJJn8URayjCQ8H1wSqBYOr2/7mVUHPz X4S6iw5F7zUAdbqZlwGoJYm/6XapZQCOjP8kzQUP99Dc7mm9XmYkL7ZGHE6LaL/unOW5 OyIhH23cI+O3ZxzGAWPxPUomCpalvH6kICgne439v9aFJKlcftGC/JOdUvm7vVpCMWZv j9Q1lrt9Es3jO1CXQTX22T1aaXcR2Dcf9AivEpsAZwbZds0mn6tTvX0Yy2OUEaOBoj9R W1sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.com header.s=s31663417 header.b=Vs6zVM+d; spf=pass (google.com: domain of linux-kernel+bounces-10368-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10368-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bk34-20020a05620a1a2200b0077d685d25b6si6802073qkb.252.2023.12.23.01.58.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Dec 2023 01:58:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10368-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.com header.s=s31663417 header.b=Vs6zVM+d; spf=pass (google.com: domain of linux-kernel+bounces-10368-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10368-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1FA1C1C21C99 for ; Sat, 23 Dec 2023 09:58:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A537D260; Sat, 23 Dec 2023 09:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.com header.i=quwenruo.btrfs@gmx.com header.b="Vs6zVM+d" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB455CA56; Sat, 23 Dec 2023 09:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.com; s=s31663417; t=1703325460; x=1703930260; i=quwenruo.btrfs@gmx.com; bh=rx3bOFolwdk/BQoY5XxMCc/2twq4gkgfH3/Z0+N7o8s=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=Vs6zVM+ddudSoUB8vuyQUYzhryOoO0/vOLxqW5HztUpc3U++FyXL7a2jGGfZBk+a So00WgWouqJInPZRllx8hMuojubMRI0+ws4WvIjzlf6fJz25c04mDwrLRr6ez095Z lDMS0sQ7Yyu7IVloBV94rFC0ggkHPVY3QFUVckFqNaw6tMX2v93Nlf12z7HEChuq3 Va9LJRF4oM6zjoos1W0bSt5y/M20/7qr2Hsk/6pEM5onQyGW8VJ9ICUlQBgSKRMbq 0YnOanInPGlAXcXBWvlDu6UVYuMDgH51FYY+64Q8SxHJLfFhXhzp7YSZE8nRNI/1H PInIcpQbae+HGOqSaQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [172.16.0.153] ([193.115.114.154]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mt79F-1r1mGI2KAT-00tTdC; Sat, 23 Dec 2023 10:57:40 +0100 Message-ID: <97b85612-16ab-4099-9a8e-426df510d7db@gmx.com> Date: Sat, 23 Dec 2023 20:27:30 +1030 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] lib/strtox: introduce kstrtoull_suffix() helper To: David Disseldorp , Qu Wenruo Cc: linux-btrfs@vger.kernel.org, Andrew Morton , Christophe JAILLET , Andy Shevchenko , David Laight , linux-kernel@vger.kernel.org References: <20231220163856.274f84a3@echidna> Content-Language: en-US From: Qu Wenruo Autocrypt: addr=quwenruo.btrfs@gmx.com; keydata= xsBNBFnVga8BCACyhFP3ExcTIuB73jDIBA/vSoYcTyysFQzPvez64TUSCv1SgXEByR7fju3o 8RfaWuHCnkkea5luuTZMqfgTXrun2dqNVYDNOV6RIVrc4YuG20yhC1epnV55fJCThqij0MRL 1NxPKXIlEdHvN0Kov3CtWA+R1iNN0RCeVun7rmOrrjBK573aWC5sgP7YsBOLK79H3tmUtz6b 9Imuj0ZyEsa76Xg9PX9Hn2myKj1hfWGS+5og9Va4hrwQC8ipjXik6NKR5GDV+hOZkktU81G5 gkQtGB9jOAYRs86QG/b7PtIlbd3+pppT0gaS+wvwMs8cuNG+Pu6KO1oC4jgdseFLu7NpABEB AAHNIlF1IFdlbnJ1byA8cXV3ZW5ydW8uYnRyZnNAZ214LmNvbT7CwJQEEwEIAD4CGwMFCwkI BwIGFQgJCgsCBBYCAwECHgECF4AWIQQt33LlpaVbqJ2qQuHCPZHzoSX+qAUCY00iVQUJDToH pgAKCRDCPZHzoSX+qNKACACkjDLzCvcFuDlgqCiS4ajHAo6twGra3uGgY2klo3S4J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20231220163856.274f84a3@echidna> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:qvyyVcHYE6sfPqlm7fALmfVwPDTVSuga0ioaCQ2l6QBYagPuvdK RkRt2AtdR0tzIpNjtc/hodf/0XRWKVsE5netbqaOG1MlY3rkM66+N423T69bMXTnVokPpMd rFFS6ik5yHO7SYBWv71GQbqPKfvM71hvFTNitxsqw7YxZXDDHBz0BCOHL9YYCaQzzWN8Yuz QzqVZiH1Ssru4Tu4pJYCQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:BopI6sNVzFk=;Vqn4/qloe4HMK/k6vhI6aSDRd1h u/hMLcLr7tv1sDss+wioX8DEFqlCQcROw8lYbtK9nplqEx3C8BVOu4LIKLAfEcsr6gB1gLetQ zV/aCb6daFwqYfO3DJMiOqhFIwWPKiFa74p6RlkfSx0syOlVD1xnLE2rPKKPS9VvTW+/LCbLo lzV9Gbz1J0qxbceaYvcqssrECLe1P1udlLoGa3791WiFtSuYEMEJ+s8rpataNyJAv1IL6i0qd HaIeWl4w4sVE1stx3JW4t67SW/Z8Z2x09Zg8Bowz47F3/xTowvWQi6VKE5JJ/chImeM+mVjci nSiiEGzN+Yaf9aZQfUyp5Eqn9FVQiSCwKvekG1q634KNbbWny2IrNXVSz1cb507roHqw3Ii1A ak9kj+QTX36SJPYoV4T70ObyV5gwH76Cn2V2qgTBcuCEH5wnbTJgpM5xDh3F+V138zBvbzXbu 0GS1ia1RzjQ/yKh68NTZka8183wluo1THxWnzK0ihyRDc2nedu5D7xDezGH3aoJ25lX7MJjEE EP9wRposgdSdjWRu2FiN2nEFBQZxYQhknWYuKaur3kZgNSE7ba2/KlybLTBBMmyfmFqSgxFiv mc/oSEx1WIDSe8PB+iBN9nK2J7iOVnWY7XCQwuOfzp8Jt0XctSYtYR3Mb81kTUOzTv1mfMab/ NVk8lJOYF4/bcFFiZ7lNVjTiVo83M//jDlpfVnhL6YoSDec9K1b2tz5sxWp2uSe/bg5W8ooAt Qp78wujkmgg8jCht0u3libEPSn0F/CUO9wjV/H+0LqF3mRLibrvS2yUPM/vpOxIRAyGIhvtg8 nhLfR8pXZwbDn3FqqagBNxbEywsPgcDlPcq9kF1NG3a++XSUtyJYuZ2LLh8O1f1+allOho/j4 Yzavl2lY0dgOZOYz5uKFLuCFGq8JPxXgEQeTRIlljJxRNcxQMharCidaB2FhqnQdRxbn0yT3b DVOqXmYBKYeOYEXDbU4UC8zLevk= On 2023/12/20 16:08, David Disseldorp wrote: > On Wed, 20 Dec 2023 10:40:00 +1030, Qu Wenruo wrote: > [...] >> >> ---- >> Changelog: >> v2: >> - Use enum bitmap to describe the suffixes >> This gets rid of the upper/lower case problem, and enum makes it >> a little more readable. >> >> - Fix the suffix overflow detection >> >> - Move the left shift out of the switch block >> >> - Remove the "done" tag >> Since no tailing character can already be handled properly. > > nit: git am puts this changelog in the commit message when applied. > Please use `git send-email --annotate` and put it next to the diffstat, > so that it gets discarded. Got it. [...] >> +}; >> + >> +/* >> + * The default suffix list would not include "E" since it's too easy t= o overflow >> + * and not much real world usage. >> + */ > > ^ this comment is a duplicate. > >> +#define KSTRTOULL_SUFFIX_DEFAULT (SUFFIX_K | SUFFIX_M | SUFFIX_G | SUF= FIX_T | SUFFIX_P) > > I think it'd be clearer if you dropped this default and had callers > explicitly provide the desired suffix mask. Well, that would be long, and would be even longer as the newer naming would be MEMPARSE_SUFFIX_*, to be more explicit on what the suffix is for.= .. And I really want callers to choose a saner default suffix, thus here comes the default one. In fact, in my next version, I also found that there are some memparse() call sites benefits from the newer suffixes (although won't for the "E" one). The example is the call site setup_elfcorehdr(). Where the comment only mentions KMG, but since memparse() silently added "PE" suffixes, maybe on some mainframes we saved some time for one or two lucky admins. [...] > > > With the above changes made, feel free to add > Reviewed-by: David Disseldorp Thanks for the review, but I'm afraid the newer version would be another beast. All the ommitted comments would be addressed a in new series. > > I'll leave the review of patch 2/2 up to others, as I'm still a little > worried about sysfs trailing whitespace regressions. That won't be a problem anymore, the new series would keep the old @retptr behavior, thus for btrfs part it won't be changed at all. Thanks, Qu >