From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266096AbUIYGiz (ORCPT ); Sat, 25 Sep 2004 02:38:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S269251AbUIYGiy (ORCPT ); Sat, 25 Sep 2004 02:38:54 -0400 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:9441 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S266096AbUIYGix (ORCPT ); Sat, 25 Sep 2004 02:38:53 -0400 Date: Sat, 25 Sep 2004 07:38:52 +0100 From: viro@parcelfarce.linux.theplanet.co.uk To: Anton Altaparmakov Cc: Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net Subject: Re: [PATCH 7/10] Re: [2.6-BK-URL] NTFS: 2.1.19 sparse annotation, cleanups and a bugfix Message-ID: <20040925063852.GR23987@parcelfarce.linux.theplanet.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 24, 2004 at 05:14:12PM +0100, Anton Altaparmakov wrote: > * Generic magic comparison macros. Finally found a use for the ## preprocessor > * operator! (-8 > */ > -#define ntfs_is_magic(x, m) ( (u32)(x) == magic_##m ) > -#define ntfs_is_magicp(p, m) ( *(u32*)(p) == magic_##m ) > + > +static inline BOOL __ntfs_is_magic(le32 x, NTFS_RECORD_TYPES r) > +{ > + return (x == (__force le32)r); > +} > +#define ntfs_is_magic(x, m) __ntfs_is_magic(x, magic_##m) > + > +static inline BOOL __ntfs_is_magicp(le32 *p, NTFS_RECORD_TYPES r) > +{ > + return (*p == (__force le32)r); > +} > +#define ntfs_is_magicp(p, m) __ntfs_is_magicp(p, magic_##m) *eeeeeek* It looks badly wrong. Why do you need these casts?