Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753894AbXFDMgc (ORCPT ); Mon, 4 Jun 2007 08:36:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751883AbXFDMgY (ORCPT ); Mon, 4 Jun 2007 08:36:24 -0400 Received: from twin.jikos.cz ([213.151.79.26]:59875 "EHLO twin.jikos.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbXFDMgX (ORCPT ); Mon, 4 Jun 2007 08:36:23 -0400 Date: Mon, 4 Jun 2007 14:33:05 +0200 (CEST) From: Jiri Kosina To: Adrian Bunk cc: Rolf Eike Beer , linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , stable@kernel.org Subject: Re: [PATCH] Fix roundup_pow_of_two(1) In-Reply-To: <20070604114900.GS5500@stusta.de> Message-ID: References: <200705172356.57620.eike-kernel@sf-tec.de> <20070604114900.GS5500@stusta.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 765 Lines: 22 On Mon, 4 Jun 2007, Adrian Bunk wrote: > > 1 is a power of two, therefore roundup_pow_of_two(1) should return 1. It does > > in case the argument is a variable but in case it's a constant it behaves > > wrong and returns 0. Probably nobody ever did it so this was never noticed. > I'm not getting the problem. > 2^0 = 1 Adrian, that's of course true, but unrelated to the patch in question :) You simply want roundup_pow_of_two(1) to be 1, and not 0. That's what the patch does, and that's correct. -- Jiri Kosina - 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/