Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942390AbcJFQkf (ORCPT ); Thu, 6 Oct 2016 12:40:35 -0400 Received: from prod-mail-xrelay05.akamai.com ([23.79.238.179]:54801 "EHLO prod-mail-xrelay05.akamai.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746AbcJFQke (ORCPT ); Thu, 6 Oct 2016 12:40:34 -0400 Subject: Re: [PATCH] netfilter: xt_hashlimit: Add missing ULL suffixes for 64-bit constants To: Geert Uytterhoeven , Pablo Neira Ayuso References: <1475761214-13387-1-git-send-email-geert@linux-m68k.org> Cc: Patrick McHardy , Jozsef Kadlecsik , "David S. Miller" , Joshua Hunt , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org From: Vishwanath Pai Message-ID: <57F67E80.7080303@akamai.com> Date: Thu, 6 Oct 2016 12:40:32 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1475761214-13387-1-git-send-email-geert@linux-m68k.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 28 On 10/06/2016 09:40 AM, Geert Uytterhoeven wrote: > diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c > index 2fab0c65aa94b666..b89b688e9d01a2d1 100644 > --- a/net/netfilter/xt_hashlimit.c > +++ b/net/netfilter/xt_hashlimit.c > @@ -431,7 +431,7 @@ static void htable_put(struct xt_hashlimit_htable *hinfo) > CREDITS_PER_JIFFY*HZ*60*60*24 < 2^32 ie. > */ > #define MAX_CPJ_v1 (0xFFFFFFFF / (HZ*60*60*24)) > -#define MAX_CPJ (0xFFFFFFFFFFFFFFFF / (HZ*60*60*24)) > +#define MAX_CPJ (0xFFFFFFFFFFFFFFFFULL / (HZ*60*60*24)) > > /* Repeated shift and or gives us all 1s, final shift and add 1 gives > * us the power of 2 below the theoretical max, so GCC simply does a > @@ -473,7 +473,7 @@ static u64 user2credits(u64 user, int revision) > return div64_u64(user * HZ * CREDITS_PER_JIFFY_v1, > XT_HASHLIMIT_SCALE); > } else { > - if (user > 0xFFFFFFFFFFFFFFFF / (HZ*CREDITS_PER_JIFFY)) > + if (user > 0xFFFFFFFFFFFFFFFFULL / (HZ*CREDITS_PER_JIFFY)) > return div64_u64(user, XT_HASHLIMIT_SCALE_v2) > * HZ * CREDITS_PER_JIFFY; > > -- 1.9.1 Thanks for fixing this. Acked-by: Vishwanath Pai