Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759065AbXFGKeh (ORCPT ); Thu, 7 Jun 2007 06:34:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753555AbXFGKeT (ORCPT ); Thu, 7 Jun 2007 06:34:19 -0400 Received: from wip-cdc-wd.wipro.com ([203.91.201.26]:42477 "EHLO wip-cdc-wd.wipro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbXFGKeR (ORCPT ); Thu, 7 Jun 2007 06:34:17 -0400 Subject: [KJ][PATCH]is_power_of_2-sparc/mm/srmmu.c From: vignesh babu Reply-To: vignesh.babu@wipro.com To: wli@holomorphy.com, davem@caip.rutgers.edu, zaitcev@yahoo.com, ecd@skynet.be, jj@sunsite.ms.mff.cuni.cz, anton@samba.org Cc: sparclinux@vger.kernel.org, linux-mm@kvack.org, linux-kernel , Kernel Janitors List Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: WIPRO Technologies Date: Thu, 07 Jun 2007 15:27:43 +0530 Message-Id: <1181210263.11218.2.camel@merlin.linuxcoe.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 (2.10.1-4.fc7) X-OriginalArrivalTime: 07 Jun 2007 09:58:07.0855 (UTC) FILETIME=[595ED7F0:01C7A8EA] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1075 Lines: 39 Replacing (n & (n-1)) in the context of power of 2 checks with is_power_of_2 Signed-off-by: vignesh babu --- diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index e5eaa80..741d303 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -354,7 +355,7 @@ void srmmu_free_nocache(unsigned long vaddr, int size) vaddr, srmmu_nocache_end); BUG(); } - if (size & (size-1)) { + if (!is_power_of_2(size)) { printk("Size 0x%x is not a power of 2\n", size); BUG(); } -- Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?" - 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/