Messages in this thread | | | Date | Sat, 25 Sep 2004 07:38:52 +0100 | From | viro@parcelfa ... | Subject | Re: [PATCH 7/10] Re: [2.6-BK-URL] NTFS: 2.1.19 sparse annotation, cleanups and a bugfix |
| |
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? - 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/
| |