Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422773AbXBAKoJ (ORCPT ); Thu, 1 Feb 2007 05:44:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1422780AbXBAKoJ (ORCPT ); Thu, 1 Feb 2007 05:44:09 -0500 Received: from mx1.redhat.com ([66.187.233.31]:44028 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422773AbXBAKoH (ORCPT ); Thu, 1 Feb 2007 05:44:07 -0500 From: David Howells In-Reply-To: References: To: "Robert P. J. Day" Cc: Linux kernel mailing list , Andrew Morton , Paul Mackerras , dhowells@redhat.com, galak@kernel.crashing.org Subject: Re: [PATCH] Add "is_power_of_2" checking to log2.h. X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.0.50 Date: Thu, 01 Feb 2007 10:43:59 +0000 Message-ID: <3565.1170326639@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 561 Lines: 17 Robert P. J. Day wrote: > +#define is_power_of_4(x) is_power_of_2(x) && (ffs(x) & 1)) If this is such a commonly implemented op, it should probably be implemented globally too. I also wonder if there's some better way of implementing it than this, but I can't think of one offhand. David - 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/