From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD9C9C4332F for ; Thu, 6 Oct 2022 13:06:14 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1ogQZq-0001jo-B3; Thu, 06 Oct 2022 13:06:14 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ogQZe-0001jT-DA; Thu, 06 Oct 2022 13:06:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0ENsN90teNsuQpmekN7b+hdYLbg48hC1jdG1eR+cyBQ=; b=KcQYDmMwVEc4O6qGR2weV+w8Zx A5GhrtJbClpcTuDsdENxmLzNWWW50r1qHEoAIophu26tpsCfT7aFxzG6RF3idRbExRYYUDK8UvCe3 7PlY/oA4J4+MVDP4KweuFhTET9qWl7r5ZKL+J3hKIgIoXKaTkT7lyD1T9w+XI1SAY0YY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0ENsN90teNsuQpmekN7b+hdYLbg48hC1jdG1eR+cyBQ=; b=i2W1GFAXX5h/gBVwQFPAY2+wg4 rW+ZvWzdvdZwaHomboYshI5gxToT4K2xrj9v/YNHGcBEmAaJLzPm5Cpij5UuVfPOCd2TzoiAPfEM8 Vz76BVv+ad5UnCUZENttCQFsHymIK044gHaTa6x+ThJkmH3F0cLSmN4H/o11dvknl2Rs=; Received: from mga03.intel.com ([134.134.136.65]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1ogQZd-00EiVu-8A; Thu, 06 Oct 2022 13:06:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665061561; x=1696597561; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=FGTLdaiXSBCapn2JjYMa8Pm3byrwndmRCKrokbx26S8=; b=RJ4xz9xJXLhCVBiqAIf0QUhbMeuRW4kmqo0D2fUDgDiNO/551/oMPh4/ 7Gs9NHulGrbI/j97CJaxqPgJPcjC4qViSrKaGg6KKfwOvCnbceWby/bmf TX8i5mEUraEgTYrWx1ZuPGccqzMhlmccEPpdZdpIkwfp6I8cjkAMB82jh z828S2ZLUo1Gfjk7ZynLBuvff/tNleSBiNvn7rp6pvfDBW7fFLaezMP07 yl4OV+HqZjLLj8MYv0FdztpflBf7eM2PFT8Pv6DXGBrMkr98m9qNPyTWa Z9wDYH42I+Z96Hb8xPAc414gdD0K5CesH2usSF4YqX5HluC3MOUixVm8l Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="305015846" X-IronPort-AV: E=Sophos;i="5.95,163,1661842800"; d="scan'208";a="305015846" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 06:05:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="575816142" X-IronPort-AV: E=Sophos;i="5.95,163,1661842800"; d="scan'208";a="575816142" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 06 Oct 2022 06:05:33 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1ogQZ0-0039VB-0C; Thu, 06 Oct 2022 16:05:22 +0300 Date: Thu, 6 Oct 2022 16:05:21 +0300 From: Andy Shevchenko To: Jason Gunthorpe Message-ID: References: <20221005214844.2699-1-Jason@zx2c4.com> <20221005214844.2699-2-Jason@zx2c4.com> <202210052035.A1020E3@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Headers-End: 1ogQZd-00EiVu-8A Subject: Re: [f2fs-dev] [PATCH v1 1/5] treewide: use prandom_u32_max() when possible X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , "Darrick J . Wong" , Ulf Hansson , dri-devel@lists.freedesktop.org, Andrii Nakryiko , Hans Verkuil , linux-sctp@vger.kernel.org, "Md . Haris Iqbal" , Miquel Raynal , Christoph Hellwig , Andy Gospodarek , Sergey Matyukevich , Rohit Maheshwari , Michael Ellerman , ceph-devel@vger.kernel.org, Christophe Leroy , Jozsef Kadlecsik , Nilesh Javali , Jean-Paul Roubelat , Dick Kennedy , Jay Vosburgh , Potnuri Bharat Teja , Vinay Kumar Yadav , linux-nfs@vger.kernel.org, Nicholas Piggin , Igor Mitsyanko , Andy Lutomirski , linux-hams@vger.kernel.org, Thomas Gleixner , Trond Myklebust , linux-raid@vger.kernel.org, Neil Horman , Hante Meuleman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Michael Chan , linux-kernel@vger.kernel.org, Varun Prakash , Chuck Lever , netfilter-devel@vger.kernel.org, Masami Hiramatsu , Jiri Olsa , Jan Kara , linux-fsdevel@vger.kernel.org, Lars Ellenberg , linux-media@vger.kernel.org, Claudiu Beznea , Sharvari Harisangam , "Jason A. Donenfeld" , linux-doc@vger.kernel.org, linux-mmc@vger.kernel.org, Dave Hansen , Song Liu , Eric Dumazet , target-devel@vger.kernel.org, John Stultz , Stanislav Fomichev , Gregory Greenman , drbd-dev@lists.linbit.com, dev@openvswitch.org, Leon Romanovsky , Helge Deller , Hugh Dickins , James Smart , Anil S Keshavamurthy , Pravin B Shelar , Julian Anastasov , coreteam@netfilter.org, Veaceslav Falico , Yonghong Song , Namjae Jeon , linux-crypto@vger.kernel.org, Santosh Shilimkar , Ganapathi Bhat , linux-actions@lists.infradead.org, Simon Horman , Jaegeuk Kim , Mika Westerberg , Andrew Morton , OGAWA Hirofumi , Hao Luo , Theodore Ts'o , Stephen Boyd , Dennis Dalessandro , Florian Westphal , Andreas =?iso-8859-1?Q?F=E4rber?= , Jon Maloy , Vlad Yasevich , Anna Schumaker , Yehezkel Bernat , Haoyue Xu , Heiner Kallweit , linux-wireless@vger.kernel.org, Marcelo Ricardo Leitner , Rasmus Villemoes , linux-fbdev@vger.kernel.org, linux-nvme@lists.infradead.org, Michal Januszewski , linux-mtd@lists.infradead.org, kasan-dev@googlegroups.com, Cong Wang , Thomas Sailer , Ajay Singh , Sagi Grimberg , Daniel Borkmann , Jonathan Corbet , linux-rdma@vger.kernel.org, lvs-devel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Naveen N . Rao" , Ilya Dryomov , Paolo Abeni , Pablo Neira Ayuso , Marco Elver , Kees Cook , Yury Norov , "James E . J . Bottomley" , Jamal Hadi Salim , KP Singh , Borislav Petkov , Keith Busch , Dan Williams , Mauro Carvalho Chehab , Franky Lin , Arend van Spriel , linux-ext4@vger.kernel.org, Wenpeng Liang , "Martin K . Petersen" , Xinming Hu , linux-stm32@st-md-mailman.stormreply.com, Jeff Layton , linux-xfs@vger.kernel.org, netdev@vger.kernel.org, Ying Xue , Manish Rangankar , "David S . Miller" , Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= , Vignesh Raghavendra , Peter Zijlstra , "H . Peter Anvin" , Alexandre Torgue , Amitkumar Karwar , linux-mm@kvack.org, Andreas Dilger , Ayush Sawal , Andreas Noever , Jiri Pirko , linux-f2fs-devel@lists.sourceforge.net, Jack Wang , Steffen Klassert , rds-devel@oss.oracle.com, Herbert Xu , linux-scsi@vger.kernel.org, dccp@vger.kernel.org, Richard Weinberger , Russell King , SHA-cyfmac-dev-list@infineon.com, Ingo Molnar , Jakub Kicinski , John Fastabend , Maxime Coquelin , Manivannan Sadhasivam , Michael Jamet , Kalle Valo , Akinobu Mita , linux-block@vger.kernel.org, dmaengine@vger.kernel.org, Hannes Reinecke , Xiubo Li , Dmitry Vyukov , Jens Axboe , cake@lists.bufferbloat.net, brcm80211-dev-list.pdl@broadcom.com, Yishai Hadas , Hideaki YOSHIFUJI , linuxppc-dev@lists.ozlabs.org, David Ahern , Philipp Reisner , Stephen Hemminger , Christoph =?iso-8859-1?Q?B=F6hmwalder?= , Vinod Koul , tipc-discussion@lists.sourceforge.net, Thomas Graf , Johannes Berg , Sungjong Seo , Martin KaFai Lau Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Thu, Oct 06, 2022 at 09:55:19AM -0300, Jason Gunthorpe wrote: > On Thu, Oct 06, 2022 at 06:45:25AM -0600, Jason A. Donenfeld wrote: > > On Wed, Oct 05, 2022 at 09:16:50PM -0700, Kees Cook wrote: > > > On Wed, Oct 05, 2022 at 11:48:40PM +0200, Jason A. Donenfeld wrote: > > > > Rather than incurring a division or requesting too many random bytes for > > > > the given range, use the prandom_u32_max() function, which only takes > > > > the minimum required bytes from the RNG and avoids divisions. > > > > > > Yes please! > > > > > > Since this is a treewide patch, it's helpful for (me at least) doing > > > reviews to detail the mechanism of the transformation. > > > > This is hand done. There were also various wrong seds done. And then I'd > > edit the .diff manually, and then reapply it, as an iterative process. > > No internet on the airplane, and oddly no spatch already on my laptop (I > > think I had some Gentoo ocaml issues at some point and removed it?). > > > > > e.g. I imagine this could be done with something like Coccinelle and > > > > Feel free to check the work here by using Coccinelle if you're into > > that. > > Generally these series are a lot easier to review if it is structured > as a patches doing all the unusual stuff that had to be by hand > followed by an unmodified Coccinelle/sed/etc handling the simple > stuff. > > Especially stuff that is reworking the logic beyond simple > substitution should be one patch per subsystem not rolled into a giant > one patch conversion. > > This makes the whole workflow better because the hand-done stuff can > have a chance to flow through subsystem trees. +1 to all arguments for the splitting. I looked a bit into the code I have the interest to, but I won't spam people with not-so-important questions / comments / tags, etc. -- With Best Regards, Andy Shevchenko _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel