From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Cox Subject: Re: [PATCH] tcp_lp: use 64-bit arithmetic instead of 32-bit Date: Thu, 1 Feb 2018 00:32:36 +0000 Message-ID: <20180201003236.06143fd0@alans-desktop> References: <20180201002407.GA1608@embeddedgus> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "Wong Hoi Sing, Edison" , "Hung Hing Lun, Mike" , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" To: "Gustavo A. R. Silva" Return-path: Received: from www.llwyncelyn.cymru ([82.70.14.225]:44714 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754068AbeBAAdb (ORCPT ); Wed, 31 Jan 2018 19:33:31 -0500 In-Reply-To: <20180201002407.GA1608@embeddedgus> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 31 Jan 2018 18:24:07 -0600 "Gustavo A. R. Silva" wrote: > Cast to s64 some variables and a macro in order to give the > compiler complete information about the proper arithmetic to > use. Notice that these elements are used in contexts that > expect expressions of type s64 (64 bits, signed). > > Currently such expression are being evaluated using 32-bit > arithmetic. The question you need to ask is 'can it overflow 32bit maths', otherwise you are potentially making the system do extra work for no reason. Alan