From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gnuweeb.org (Postfix) with ESMTPS id 5F71E7E4AA for ; Fri, 20 May 2022 17:32:50 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=DeCcmBVx; dkim-atps=neutral Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B7E4BB82D48; Fri, 20 May 2022 17:32:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CB75C385A9; Fri, 20 May 2022 17:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653067967; bh=AkqrkBrEvsXjOSRm5RxhZxVwEH22/E3TuME0JO+lf5A=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=DeCcmBVx10a0BzGN8pYtdoUTcPsw1MOyHqbOtblfbKbZL4YuU1dFGduDqnu012MSH G2/C1vj7v4SJJ6qVcid1PkK0W3qS6j7uKzn4YAXm9iSLq8pYe7aaZPVIjUweK9ynif 1y4R84ve4KplyZBI7jIkSZlykxhcyFKx9gkwJPusMgQp/iaBwa5w3Zbwkp+tRD4qAa nIfwf59KWE8zd73RYEft3E7P9FZx0QpheYUfZchtD8ejMIzqOQqNGPLs2rhrT5Stjf 5knHSsZQqZGWfv22TeTL14uJJ0KhchMDi8CwhOOZyK6rmz2wYazQSu/ggQO2SXEqfq Km80eiUJ/gWiQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 05BAA5C05F8; Fri, 20 May 2022 10:32:47 -0700 (PDT) Date: Fri, 20 May 2022 10:32:47 -0700 From: "Paul E. McKenney" To: Alviro Iskandar Setiawan Cc: Ammar Faizi , Willy Tarreau , Linux Kernel Mailing List , GNU/Weeb Mailing List , Facebook Kernel Team Subject: Re: [PATCH v1 1/2] tools/nolibc/stdlib: Support overflow checking for older compiler versions Message-ID: <20220520173247.GJ1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220519172116.283687-1-ammarfaizi2@gnuweeb.org> <20220519172116.283687-2-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: On Fri, May 20, 2022 at 06:29:56PM +0700, Alviro Iskandar Setiawan wrote: > On Fri, May 20, 2022 at 12:21 AM Ammar Faizi wrote: > > Previously, we used __builtin_mul_overflow() to check for overflow in > > the multiplication operation in the calloc() function. However, older > > compiler versions don't support this built-in. This patch changes the > > overflow checking mechanism to make it work on any compiler version > > by using a division method to check for overflow. No functional change > > intended. While in there, remove the unused variable `void *orig`. > > > > Link: https://lore.kernel.org/lkml/20220330024114.GA18892@1wt.eu > > Suggested-by: Willy Tarreau > > Cc: Alviro Iskandar Setiawan > > Signed-off-by: Ammar Faizi > > Reviewed-by: Alviro Iskandar Setiawan > > tq > > -- Viro I have queued both patches with yours and Willy Tarreau's reviews and acks. Thank you all! Thanx, Paul