Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp203168rdh; Tue, 13 Feb 2024 14:15:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWeJqxQEBZWzW2gvyPW3A3mcKGR5nCdaecLDsOCE4iOeeRqsj0bSGVC0vVfKdlATlxUk9FPSRq4VbdBw4mnyKOsIua6VyphO2jEqifhQQ== X-Google-Smtp-Source: AGHT+IHzAYrBJs7O8ZnLkOsyYUkl2r+sZHWW8SrGqVshkEDPGMmpICyecIH5R2E3aDuJTxowBh59 X-Received: by 2002:a05:6a20:93a5:b0:19e:947c:20cc with SMTP id x37-20020a056a2093a500b0019e947c20ccmr249036pzh.9.1707862546688; Tue, 13 Feb 2024 14:15:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707862546; cv=pass; d=google.com; s=arc-20160816; b=08bTXplo3wUfGJNBGR9ArtnPXm79uKN9QCqBCQnTPPCrbd4IZk7VTHVU5PigfCvtDi VwtnM5dGBYrM25v0tabkh4MFmG741k8FfZbR9l9ycY8lQSnkep8GLin/WtBzlNhwQ2Kk GUIMwp1PtI8eRDGQBm3za7YiD1aKfy5q3+hsi0cO3kwmQnIOkGDed20tlfUs+IY2BiBK dkVtt8RV2/JghX6HD57hXdnzNdugOtFcOkZtSnP7L7hukAcXbEzZfyPbcOYd4MzeKcV0 LDSLRhEWncPA7h5KaY9GgRgFIiPr6aP0SDwQlFCA4uRw+SAnG8Se6y6djjCABVX/MQzh otBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:dkim-signature:date; bh=zK5QLIW85nz1zVFqkUnOGvmwzlA1XAn7Um1knwojFcg=; fh=OJB4nMGKYUfiShvz7dVxilP+h2PsrixkM010yubyKYk=; b=ZS7oU24GG5ITlgQbeXJCfFEuOuRcz8M1iVd1Z/CyVGxJCOKe3JcAA/Aao33D45l/HH CsY3nScpZq30klvaf9qU4ppvhXZ+hMr9kFf4GqoFikPDWP458uYBzAX9KLHbURQ9YKzv ExHwcrj1oMAkmHDi+Psir/fbyiK/QlP3v+NaoZNoM59BebJaKVvQGDHmBQJmckV5J8lD KrIoKEXhZ8Q/PBQeC+qKhEZpEBk/7uJN6wxWCJ+TZhQnOqfWMlVuXGcg3IbX7Jfi3zBZ QvXpsia+T3x4s73f4rNBnvWEzHYL6zXYYGFr+ApAuwoLJaDxqJvBTMj1pMfCmMDfa/76 rI/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rGEbbs21; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-64438-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64438-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=2; AJvYcCU8S9XJ+rz3iGQrPHpgQTqnL2CDkMx8d3g5jBWphPO9pEeUofbQN1Yna+otSCkCjWL/Y+i/HUURkDz+gNAD2m1og0WrVhCbYyUmmGSJPw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j191-20020a6380c8000000b005cdf88fbc11si2484946pgd.48.2024.02.13.14.15.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 14:15:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64438-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rGEbbs21; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-64438-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64438-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3B75228E766 for ; Tue, 13 Feb 2024 22:14:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 907D17868E; Tue, 13 Feb 2024 22:06:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="rGEbbs21" Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 97C2F64CD5; Tue, 13 Feb 2024 22:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707862001; cv=none; b=WInlM3hsNITJrlr5YSsy/c/WWMUvucvetr9NbJm8o5uj/Zu6AAYnQ4ZuDcHNjFSQirW4rw8J1kbLdnKWQWf88/XuIGkGOqdhHzFNysFC767m1wjjslk1IcRMsmntELeAGjSvaRNbaYz52LTfjnlnAxf0hIp8W4R5fgWd+4LQv5c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707862001; c=relaxed/simple; bh=X9gIfYmrq4orF2JlReeyNwz+f8JQg90BSRXVh01Gv98=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nBUkUIo4mlB4cfs1G0s7WPmK6q/fczxOoX1JfUNsi3n8C0GBKkYVPK6s4tdNmbtx92Qb2GL2EQblewfVIj4r486juPFgORgDzv6eEvqT/bq63n0EfwXYHUKPWws28UNUllUzqUazEJ60QIPrU0qkwtt6Nm+GB6Y/dqurE8wZWqc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=rGEbbs21; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Tue, 13 Feb 2024 17:06:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707861997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zK5QLIW85nz1zVFqkUnOGvmwzlA1XAn7Um1knwojFcg=; b=rGEbbs21+nZYs0/9vmfeL0lWowbNK/eT6L0AAMRyacfOwuZ1UFFsPh7Fyvq2Xojp6JQO3z I7a9ZOt20XcGXtOfMwojqqXm3BemtyWhDrnkPQ04hJB4GRJnSJWu7AdXBizsePAbXyPZtC CS546SLxy1lnuwZShsLcF5/EaSRxDxg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Andy Shevchenko Cc: Suren Baghdasaryan , akpm@linux-foundation.org, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org, Andy Shevchenko , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , "Michael S. Tsirkin" , Jason Wang , Noralf =?utf-8?Q?Tr=C3=B8nnes?= Subject: Re: [PATCH v3 01/35] lib/string_helpers: Add flags param to string_get_size() Message-ID: References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-2-surenb@google.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT On Tue, Feb 13, 2024 at 10:26:48AM +0200, Andy Shevchenko wrote: > On Mon, Feb 12, 2024 at 11:39 PM Suren Baghdasaryan wrote: > > > > From: Kent Overstreet > > > > The new flags parameter allows controlling > > - Whether or not the units suffix is separated by a space, for > > compatibility with sort -h > > - Whether or not to append a B suffix - we're not always printing > > bytes. > > > > Signed-off-by: Kent Overstreet > > Signed-off-by: Suren Baghdasaryan > > ... > > You can move the below under --- cutter, so it won't pollute the git history. > > > Cc: Andy Shevchenko > > Cc: Michael Ellerman > > Cc: Benjamin Herrenschmidt > > Cc: Paul Mackerras > > Cc: "Michael S. Tsirkin" > > Cc: Jason Wang > > Cc: "Noralf Trønnes" > > Cc: Jens Axboe > > --- > > ... > > > --- a/include/linux/string_helpers.h > > +++ b/include/linux/string_helpers.h > > @@ -17,14 +17,13 @@ static inline bool string_is_terminated(const char *s, int len) > > ... > > > -/* Descriptions of the types of units to > > - * print in */ > > -enum string_size_units { > > - STRING_UNITS_10, /* use powers of 10^3 (standard SI) */ > > - STRING_UNITS_2, /* use binary powers of 2^10 */ > > +enum string_size_flags { > > + STRING_SIZE_BASE2 = (1 << 0), > > + STRING_SIZE_NOSPACE = (1 << 1), > > + STRING_SIZE_NOBYTES = (1 << 2), > > }; > > Do not kill documentation, I already said that. Or i.o.w. document this. > Also the _SIZE is ambigous (if you don't want UNITS, use SIZE_FORMAT. > > Also why did you kill BASE10 here? (see below as well) As you should be able to tell from the name, it's a set of flags. > > --- a/lib/string_helpers.c > > +++ b/lib/string_helpers.c > > @@ -19,11 +19,17 @@ > > #include > > #include > > > > +enum string_size_units { > > + STRING_UNITS_10, /* use powers of 10^3 (standard SI) */ > > + STRING_UNITS_2, /* use binary powers of 2^10 */ > > +}; > > Why do we need this duplication? Because otherwise a lot more code would have to change. > > It seems most of my points from the previous review were refused... Look, Andy, this is a pretty tiny part of the patchset, yet it's been eating up a pretty disproprortionate amount of time and your review feedback has been pretty unhelpful - asking for things to be broken up in ways that would not be bisectable, or (as here) re-asking the same things that I've already answered and that should've been obvious. The code works. If you wish to complain about anything being broken, or if you can come up with anything more actionable than what you've got here, I will absolutely respond to that, but otherwise I'm just going to leave things where they sit.