Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3193372rdb; Tue, 26 Dec 2023 21:55:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHL1OmNlR22Yx3p2pRysrtL9S8Xqt2LMkgy8y+pKVjlbNXgcTt1VnEzYodtEqMbeAxx7R+G X-Received: by 2002:a17:906:3f07:b0:a23:6249:ee99 with SMTP id c7-20020a1709063f0700b00a236249ee99mr7492896ejj.11.1703656533043; Tue, 26 Dec 2023 21:55:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703656533; cv=none; d=google.com; s=arc-20160816; b=Ne3nc1ueT54cPKzhd4LtHQXLT7Z16Oc1Ij2ZHdLdpOxn0KLaLtDcs7wA2j2TcrfT+/ 73KeGMEVh8nFJzkIbG312wjG9ARtOz6iWB0YEu/OwLmSHzAbXrPCo6jfCxXpeg4KmiTP aFWEpNlBQc3sL2YoRTpqUtHXjgrg4IZKIxxfRiqOXasuMe2cbuK3jpgvw+SL4KepGOKS IKwYAE2iFJRnTaBoHosR87wUStyPybrJ5sGO+8p0JVFMvJZpeN8HGtVPpLhULDpcIN2p 1D9HiQWdCHAzLM612nUIh02tCZn40/QzI0OQnGwDc+LYttIAlJT6kmPfZOXZybKLakPN +zDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=+XsM5hFWkLW09YUNHSAectqYCug7xGgUZWGLicrUKlY=; fh=CB0Hu6gt044CXZxCCRXcuz3tJObiyOXzcdcgG7x+gW4=; b=bvwtZE4RD0FrLFA8KKr1OHzqZMvffCe++Tft8NBkj3QYt4mYJOeB4HcwC38Mm4dX1n UK8bQS5CaVGehZdXb2BfLr8FUyPm2ZFHyDlcpeeamshiJfDc4n2h/+6rdfmAODL3X8NF qqa/QuVow1QdoT4T77JV4KwohNA8fXAL6U0wlj5J7VJwBz0jeGa7rX57cyw49po2/DCI KSJty3+n2oJ5BRJgcIq/bpnIqPh5RDN1mnJKVWQ+yul9GPl9jtI6MQxSSAMsHjsluC2I c7PyhST3QH/9zHGDp/h/PIrbOGvriCvRXULelNgxI+vQMmmlunjr+JJrZZVct/2lEuQM U4rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samba.org header.s=42 header.b="JM3GTG/0"; spf=pass (google.com: domain of linux-kernel+bounces-11838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11838-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gu15-20020a170906f28f00b00a26c77963a1si4473180ejb.571.2023.12.26.21.55.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 21:55:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@samba.org header.s=42 header.b="JM3GTG/0"; spf=pass (google.com: domain of linux-kernel+bounces-11838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11838-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id C5A2E1F21909 for ; Wed, 27 Dec 2023 05:55:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCBF3522F; Wed, 27 Dec 2023 05:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (3072-bit key) header.d=samba.org header.i=@samba.org header.b="JM3GTG/0" X-Original-To: linux-kernel@vger.kernel.org Received: from hr2.samba.org (hr2.samba.org [144.76.82.148]) (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 374903FFE; Wed, 27 Dec 2023 05:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=samba.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samba.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Message-ID:Cc:To:From:Date; bh=+XsM5hFWkLW09YUNHSAectqYCug7xGgUZWGLicrUKlY=; b=JM3GTG/0eQBIzPfhgWTwaXHfbN 2sx42F0Jm+PSFApMU+9Jozj+j3zGynmtiJCBqwpEDjBwb4f7tFN2+4OyFX83AJzuqPGbi5jPhLE7J VousxCHLbVYvaRACIAjnRSdaq7k90vm5tUgZNRjH3LexUmGs+NTg7Fk3BS0Tq1+N3YRr++Rqh6s2u a6diP7Eir7v+j97jXbgep5NGNa49e7BgQW+IZbH78eohdxeCVGJhSKUa3iOCxYbNwG9X29Gr0tEBO DwRdd2kEOIypASTamwwBYK8u/8PIGLPCSTJFndxs69V81RBjAtirUqT5sDQ78gIx8Wja/rgCwY2zJ VfcuFnHzSuyR3Bk+IFxRfVrylMzUNmh7dM/tk4YjPZK1O2qvEgYNzGkEDv1aeetzCO2k422QljucD 2LiPDFgF2lYvFO85gW3FP8uM6tqbBxKX7bJH1uZyDmYLRQL6UyFmCOUl3ZKuRDeuW+6aBH/5R1XtU 6uNN6lWx75MUiI69JzbPGhGG; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__ECDSA_SECP256R1_SHA256__CHACHA20_POLY1305:256) (Exim) id 1rIMcv-005MKc-2k; Wed, 27 Dec 2023 05:38:46 +0000 Date: Wed, 27 Dec 2023 16:38:32 +1100 From: David Disseldorp To: Qu Wenruo Cc: Qu Wenruo , linux-btrfs@vger.kernel.org, Andrew Morton , Christophe JAILLET , Andy Shevchenko , David Laight , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] lib/strtox: introduce kstrtoull_suffix() helper Message-ID: <20231227163832.51e305f7@echidna> In-Reply-To: <97b85612-16ab-4099-9a8e-426df510d7db@gmx.com> References: <20231220163856.274f84a3@echidna> <97b85612-16ab-4099-9a8e-426df510d7db@gmx.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 23 Dec 2023 20:27:30 +1030, Qu Wenruo wrote: > On 2023/12/20 16:08, David Disseldorp wrote: ... > >> +#define KSTRTOULL_SUFFIX_DEFAULT (SUFFIX_K | SUFFIX_M | SUFFIX_G | SUFFIX_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. I think it's a sane default, my concern is that _DEFAULT says nothing about supported units from the caller's perspective. Perhaps MEMPARSE_SUFFIX_KMGTP or MEMPARSE_UNITS_KMGTP would be clearer. ... > > 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. Sounds good. Will follow up there. Cheers, David