Messages in this thread | | | Date | Sun, 26 Sep 2004 00:31:45 +0100 (BST) | From | Anton Altaparmakov <> | Subject | Re: [PATCH 7/10] Re: [2.6-BK-URL] NTFS: 2.1.19 sparse annotation, cleanups and a bugfix |
| |
On Sat, 25 Sep 2004 viro@parcelfarce.linux.theplanet.co.uk wrote: > 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?
*eeeeeek*
It is badly wrong. Removed. Thanks!
IIRC I had put them in to silence some sparse warnings I was getting until I solved the underlying problems and then completely forgot about them and so they didn't get removed again afterwards. Sorry. Just me being stupid. )-:
Best regards,
Anton -- Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/ - 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/
| |