From patchwork Sun Feb 3 17:34:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 2087991 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 470513FCD5 for ; Sun, 3 Feb 2013 17:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753341Ab3BCRed (ORCPT ); Sun, 3 Feb 2013 12:34:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28903 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753282Ab3BCReb (ORCPT ); Sun, 3 Feb 2013 12:34:31 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r13HYSK5013323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 3 Feb 2013 12:34:29 -0500 Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r13HYRpf025182 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 3 Feb 2013 12:34:28 -0500 Message-ID: <510E9FA3.5060600@redhat.com> Date: Sun, 03 Feb 2013 11:34:27 -0600 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: kreijack@inwind.it, Chris Mason , linux-btrfs Subject: [PATCH] btrfs-progs: include kerncompat.h in raid6.c, define __attribute_const__ References: <510D7356.4030903@inwind.it> <510E8898.4050606@redhat.com> <20130203170138.GC16594@twin.jikos.cz> In-Reply-To: <20130203170138.GC16594@twin.jikos.cz> X-Enigmail-Version: 1.5 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org raid6.c was failing to build for Goffredo and me due to __attribute_const__ being undefined. Define it in kerncompat.h and include that; this also makes sure BITS_PER_LONG is defined for raid6.c, prior to this it was not defined, at least in my build. Finally, redefine BITS_PER_LONG in a way that it can be tested in the preprocessor macro. Signed-off-by: Eric Sandeen --- -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kerncompat.h b/kerncompat.h index d60f722..1e7b7d3 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -36,7 +36,7 @@ #define gfp_t int #define get_cpu_var(p) (p) #define __get_cpu_var(p) (p) -#define BITS_PER_LONG (sizeof(long) * 8) +#define BITS_PER_LONG (__SIZEOF_LONG__ * 8) #define __GFP_BITS_SHIFT 20 #define __GFP_BITS_MASK ((int)((1 << __GFP_BITS_SHIFT) - 1)) #define GFP_KERNEL 0 @@ -126,6 +126,8 @@ static inline int mutex_is_locked(struct mutex *m) #define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) +#define __attribute_const__ __attribute__((__const__)) + /** * __set_bit - Set a bit in memory * @nr: the bit to set diff --git a/raid6.c b/raid6.c index 3a42bdf..ce0f655 100644 --- a/raid6.c +++ b/raid6.c @@ -19,6 +19,8 @@ */ #include #include +#include "kerncompat.h" + /* * This is the C data type to use */