Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S270349AbUJTKGz (ORCPT ); Wed, 20 Oct 2004 06:06:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S270348AbUJTKBx (ORCPT ); Wed, 20 Oct 2004 06:01:53 -0400 Received: from aun.it.uu.se ([130.238.12.36]:1665 "EHLO aun.it.uu.se") by vger.kernel.org with ESMTP id S270326AbUJTJ45 (ORCPT ); Wed, 20 Oct 2004 05:56:57 -0400 Date: Wed, 20 Oct 2004 11:56:45 +0200 (MEST) Message-Id: <200410200956.i9K9ujOu026178@harpo.it.uu.se> From: Mikael Pettersson To: cw@f00f.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Avoid a build warning on 32-bit platforms Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 764 Lines: 26 On Tue, 19 Oct 2004 19:37:16 -0700, cw@f00f.org (Chris Wedgwood) wrote: >@@ -818,11 +818,12 @@ > * jiffies. > */ > time = get_cycles(); >- if (time != 0) { >- if (sizeof(time) > 4) >- num ^= (u32)(time >> 32); >- } else { >+ if (!time) > time = jiffies; >+ else { >+#if (BITS_PER_LONG > 32) >+ num ^= (u32)(time >> 32); >+#endif /* (BITS_PER_LONG > 32) */ There's a coding idiom for doing this: just break up the ">> 32" in two steps, like: ((time >> 31) >> 1). Definitely preferable over #ifdef:s. /Mikael - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/