Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2713378rdb; Mon, 12 Feb 2024 14:09:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWiCOT7nR/DMszidExyHfEAeHeyqyAbF98A+yWcEZDvyFSp0UsgaX/kA27W1uyqBvlcd0UWmtyv0IkvV61rBvnKg7OQ1bUoBekP6XrTQg== X-Google-Smtp-Source: AGHT+IFYxv+Fzpmlh4z44k9Nr5gQ+6bAectSJPmNw6PFgtSWLM8LeDff6kYNPHE1lMPSObr1Df01 X-Received: by 2002:a9d:769a:0:b0:6e2:b689:c38f with SMTP id j26-20020a9d769a000000b006e2b689c38fmr7565682otl.27.1707775797914; Mon, 12 Feb 2024 14:09:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707775797; cv=pass; d=google.com; s=arc-20160816; b=Hnnfo/0hnRMgXNkJX48hCXHBOS7DU7zvOHrV2ackII2S6Viv6VNxWtuK8HLZTW86ir 3v3l3n9FmEzU0gFKehtQRBAFI8l0UvY0XggeAo2FXlMcvkVfhix3ELSC7JZujbt0fK+v g+sjohLXedFl4BvOhwWvcWBKGmMGunHE0lGpm+or+EQ0wYZ6iliEgsv0ruzppYLUfhGw 7s0XzifuhN4qFfX6dMLwP2lgEyh3t6bPEjhoYlRhHvC7H+MfTHDNvZvaloKli7Cc4Qn6 WRj5aGaLVmda6cKllm0wBY6RjH0BPpfc4t1049n8i9u2jFlMGm3ubObSiLNGyKne5bzH GBHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ijXS7mVIfD783iJTrvPPuV7zXdag7eKduahqAMiyRM0=; fh=nEKsjCog09XXfN+v3m8OjPqimdv0jiyamQqQO+gSpWo=; b=z6HopryRiTxkb7jKkwwdMDuyh8cPtzxAg3epFrlT3uElAlnpwVb5lTlfFGMH5bosC4 T9n04EziyZYDPmBsC6I1qgF+hruNzFJZ0X8am9RcxQKuzaIdr1lGIzslvM9ZYx5nKKrh VCoAVB1JSNpKaQALcc6+ZBR9A4UybzESx5wXOQoxgfTfJJNqRhn2p4LyPiELHgg8Ax66 gv/7bmCmoGHpEtheM4UYg+u7x5jF2oJSZYWXmvnQjzfmNQAAkizSkRBvQDZ0LGo+zw3n jknun5kRjSOMPTHAPWhE20cDmUUt+7HI+eeD1Fe7FUM0kPOHv6f1A3/08hawiuYT7Z2A zglA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=McKPaw6D; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-62457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCUOxjAFuyxTrMF5qva3I4lxFtv/j9MMIW7OEoKpQQ3pLoreUmQ7EeM2GHFk+KjO/ON1KXeUnizWfXM4Brg3O1nnOc8xtklB486X75EYsg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f17-20020ac84651000000b0042c23dbd2easi1356447qto.693.2024.02.12.14.09.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 14:09:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=McKPaw6D; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-62457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9A4B41C22764 for ; Mon, 12 Feb 2024 22:09:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C646E4D131; Mon, 12 Feb 2024 22:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="McKPaw6D" Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C93964D595 for ; Mon, 12 Feb 2024 22:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707775778; cv=none; b=nr8OYcSzuP1fMzaD7RtmOO5gTRyKw6f21mGfx1J0IBBtkKcTkCaSWFxJK2eiWoQZ/3boriaXOKMUKSRwY8QYct3N5bUpLsRO/lln3BJ1kP++XgUQXKnQYjQukTht8+1SpROiFYpYiRGrBIy9LQ31zLldBdXgcCBX/SSQRP4HLwE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707775778; c=relaxed/simple; bh=MLwsSr8MVdCOcLFBS21ndz8l0PLPcDhM3Y/oMOTG9R8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u4ucp8x4CZegGWKjgOlUYeivNSrLItPDDm3kg/sMJCdJXec2zh1dcbLIptcD8DyKepezFHJT0Lg2hhsOCxHSayKhX7mooJ9wjjlL53uaPBtwFDZ6O0sxP9tNnXuOWpDzIx9XkH7b+mq3aftPF9HLVfMBeexxK+T9Y+gqK/4aZlg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=McKPaw6D; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6e0507eb60cso2357289b3a.3 for ; Mon, 12 Feb 2024 14:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707775775; x=1708380575; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ijXS7mVIfD783iJTrvPPuV7zXdag7eKduahqAMiyRM0=; b=McKPaw6DXrLHk5gwQBi14gC36WdNjtcbjXr9Th2EFwu0ozmdj7lEErt39knzyI8Xab LnwmO2ExgK9SP7FJMmoMQ7RHPXTi/Ojr5ZV5bzkLM1etG1wyHznlqcwn17cJNooraMEr 4TUICGFhrt+cmBpJCKl5JPPp7Lwa35J06fFTY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707775775; x=1708380575; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ijXS7mVIfD783iJTrvPPuV7zXdag7eKduahqAMiyRM0=; b=KUG4sXvHvLOEM6OeL9kPPBLOSMe8JqQ2pyZ1X6QLgdFzu/buxmZEG3GqZVj2l38GHk hjJczGGLuRUEd/bCKoRFbgwUijQnlnheqm+usAH8cvdAom/sDYbBShApfsF0zmOvd+a+ KP+3xWSbK+gjCPl6YOrzqokWLIro9wu9UDMo+o3FxXM3CW9dwcwn2D9VCWrmlEsDDEV0 /TRKmWQ6swKLzNLO31xJP0GmjSUIql66ORQF7ygmQK0m0KMZje0nk6jTsx4I3/DhjZGn dCJHY2QZuZBhhVTVC6lOv787AQ28FHXciIohHuqdC6h70FzHQEdOOhUEOIcqlXr29xnY dRNQ== X-Forwarded-Encrypted: i=1; AJvYcCVbEAoG9u67kDwpBXzeNGgI5hg2Mw7okgItpmYu91oJy3WnW5DKYpzQPN7OKO3WDFgPPHr9qeaVND1W+aBF16XM1+t8BvgNOn9ibFw7 X-Gm-Message-State: AOJu0Yyd3yhzM/J5eXTPintZbYU4aUedWOxmjX27ylOugTP5S73h4K1g PUyBl42hgh/Dsdom+QHMYysGcY9E7xDdG3i8VvllTnGVcd9vheaPxmOPC+VtJQ== X-Received: by 2002:a05:6a00:4b4b:b0:6e0:38bf:28ea with SMTP id kr11-20020a056a004b4b00b006e038bf28eamr9682776pfb.19.1707775775255; Mon, 12 Feb 2024 14:09:35 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWl2GHEiI0AdIONJv9vhuo053+zvHgdgwx2XCGWS00mxsRzMcqr79bvNvUDgm4zurDDPMyzknMUHE2JzbpNpXpoosUywUuK8+h2bt63JzaaMKGW1JwFkeicTqkQnrh5yEsbUY0YSJ9KrvTBoJzdixbEQwXGnB+rBT4smOkRhcG3knPCxp5C5Jmu74qY0nq9EOrAW9CVttjK3LBzv7FXCoZ4NIj+hpsuYoReG76UiKrBEUUslqfsnPDWvWLiRaZARKurLT/uPwecyFHzGa6QZBFqZs39g9QQqpxCzlP8crYc3dvxjzW95a7CEQmZMA/pIwcZPD5PznKyfGa8Zhcgw0jBETK3W3wOxPJtobmxnoIUltdfffu2zdolE4WS8qneSd0RnuJLbI5CvSmPksggXAwQBpfSjRow/luRjT5t5fi3EKG34lljK3UsZFrf0AkYedTEG9gAWsrElOEfr7wZM5qD7lSBcnghPDc+He4vk1wG8a5maN3KWnNAGd+yJsjmlKHKiL+qgyACU3Fg05QbSZFvSZd6uhF47cH0mgzLEvbZkIOeKyDesE+6SMGVzhaye/ANoj1+hPzMhSl83im0D8wWkdtCJDUU2vzlrmLvKYfLJiddjBonHbV/5oYtsnKbHKN/bNLryZfRlo9iikMEMkFOG66/DD474EblIazqjnz+eJ2I+/Y0Ckt0lhGrr+wBx8jty7dK/PqWEs0w6x4fR57/eWmImaXyVs560HpVnn2GeDvdhGi+5z5+oWyrXLZk6iiM3POqqyDmPB1WSIt4UIf4AcFzh4CPCLUhblFuFGpuXoLl+L4J6dKCityjp3TPGWiqEsnhNWQc2mHIyvo0b0MnVXLerlFLm42viHQ9Z5HAM+GGR652A441koINmwJaGpt7XPVtNyqMHOqcfZXeHjNAEA7U5qEHKP4qfh1GXbEP2E96JLV6bsx8oqiMe2FTQg== Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id b18-20020aa78712000000b006db9604bf8csm5978722pfo.131.2024.02.12.14.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 14:09:34 -0800 (PST) Date: Mon, 12 Feb 2024 14:09:34 -0800 From: Kees Cook To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, kent.overstreet@linux.dev, 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, 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 =?iso-8859-1?Q?Tr=F8nnes?= Subject: Re: [PATCH v3 01/35] lib/string_helpers: Add flags param to string_get_size() Message-ID: <202402121408.5C98241E@keescook> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240212213922.783301-2-surenb@google.com> On Mon, Feb 12, 2024 at 01:38:47PM -0800, 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 If there is a v4, please include some short examples with the .h bit field documentation. It's pretty obvious right now but these kinds of things have a habit of growing, so let's set a good example for documenting the flags. Reviewed-by: Kees Cook -- Kees Cook