From patchwork Thu Sep 23 02:13:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 65482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E1BDDB70D5 for ; Thu, 23 Sep 2010 12:16:23 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OybKV-0001in-N3; Thu, 23 Sep 2010 02:14:35 +0000 Received: from smtp.gentoo.org ([140.211.166.183]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1OybKT-0001aC-Ma for linux-mtd@lists.infradead.org; Thu, 23 Sep 2010 02:14:34 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 9D3D11B4049 for ; Thu, 23 Sep 2010 02:14:28 +0000 (UTC) From: Mike Frysinger To: linux-mtd@lists.infradead.org Subject: [PATCH] rbtree: avoid redefining offsetof Date: Wed, 22 Sep 2010 22:13:40 -0400 Message-Id: <1285208020-24905-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.3 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100922_221433_831832_EB0CEE88 X-CRM114-Status: GOOD ( 10.32 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [140.211.166.183 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Newer versions of gcc will define & export offsetof, so we don't want to unconditionally define it. Otherwise we hit: In file included from mkfs.jffs2.c:76:0: rbtree.h:134:0: warning: "offsetof" redefined /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include/stddef.h:411:0: note: this is the location of the previous definition Signed-off-by: Mike Frysinger --- rbtree.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/rbtree.h b/rbtree.h index 9597b10..e64dc9a 100644 --- a/rbtree.h +++ b/rbtree.h @@ -131,7 +131,10 @@ static inline void rb_set_color(struct rb_node *rb, int color) #define RB_ROOT (struct rb_root) { NULL, } +/* Newer gcc versions take care of exporting this */ +#ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \