Re: [PATCH] reiserfs: fix a few 'empty body in an if-statement' warnings.
On Thu, 14 Apr 2005, Randy.Dunlap wrote: > On Fri, 15 Apr 2005 02:58:54 +0200 (CEST) Jesper Juhl wrote: > > | When building with gcc -W fs/reiserfs/namei.c:602 has a few warnings > | about 'empty body in an if-statement'. This patch silences those warnings. > > So fix include/linux/reiserfs_xattr.h: > change > #define reiserfs_mark_inode_private(inode) > to > #define reiserfs_mark_inode_private(inode)do { } while (0) > > Right, that's better... Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> --- linux-2.6.12-rc2-mm3-orig/include/linux/reiserfs_xattr.h2005-04-05 21:21:50.0 +0200 +++ linux-2.6.12-rc2-mm3/include/linux/reiserfs_xattr.h 2005-04-15 11:41:25.0 +0200 @@ -112,20 +112,20 @@ #else #define is_reiserfs_priv_object(inode) 0 -#define reiserfs_mark_inode_private(inode) +#define reiserfs_mark_inode_private(inode) do { } while (0) #define reiserfs_getxattr NULL #define reiserfs_setxattr NULL #define reiserfs_listxattr NULL #define reiserfs_removexattr NULL -#define reiserfs_write_lock_xattrs(sb) -#define reiserfs_write_unlock_xattrs(sb) -#define reiserfs_read_lock_xattrs(sb) -#define reiserfs_read_unlock_xattrs(sb) +#define reiserfs_write_lock_xattrs(sb) do { } while (0) +#define reiserfs_write_unlock_xattrs(sb) do { } while (0) +#define reiserfs_read_lock_xattrs(sb) do { } while (0) +#define reiserfs_read_unlock_xattrs(sb) do { } while (0) #define reiserfs_permission NULL #define reiserfs_xattr_register_handlers() 0 -#define reiserfs_xattr_unregister_handlers() +#define reiserfs_xattr_unregister_handlers() do { } while (0) static inline int reiserfs_delete_xattrs (struct inode *inode) { return 0; }; static inline int reiserfs_chown_xattrs (struct inode *inode, struct iattr *attrs) { return 0; }; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] reiserfs: fix a few 'empty body in an if-statement' warnings.
On Thu, 14 Apr 2005, Randy.Dunlap wrote: On Fri, 15 Apr 2005 02:58:54 +0200 (CEST) Jesper Juhl wrote: | When building with gcc -W fs/reiserfs/namei.c:602 has a few warnings | about 'empty body in an if-statement'. This patch silences those warnings. So fix include/linux/reiserfs_xattr.h: change #define reiserfs_mark_inode_private(inode) to #define reiserfs_mark_inode_private(inode)do { } while (0) Right, that's better... Signed-off-by: Jesper Juhl [EMAIL PROTECTED] --- linux-2.6.12-rc2-mm3-orig/include/linux/reiserfs_xattr.h2005-04-05 21:21:50.0 +0200 +++ linux-2.6.12-rc2-mm3/include/linux/reiserfs_xattr.h 2005-04-15 11:41:25.0 +0200 @@ -112,20 +112,20 @@ #else #define is_reiserfs_priv_object(inode) 0 -#define reiserfs_mark_inode_private(inode) +#define reiserfs_mark_inode_private(inode) do { } while (0) #define reiserfs_getxattr NULL #define reiserfs_setxattr NULL #define reiserfs_listxattr NULL #define reiserfs_removexattr NULL -#define reiserfs_write_lock_xattrs(sb) -#define reiserfs_write_unlock_xattrs(sb) -#define reiserfs_read_lock_xattrs(sb) -#define reiserfs_read_unlock_xattrs(sb) +#define reiserfs_write_lock_xattrs(sb) do { } while (0) +#define reiserfs_write_unlock_xattrs(sb) do { } while (0) +#define reiserfs_read_lock_xattrs(sb) do { } while (0) +#define reiserfs_read_unlock_xattrs(sb) do { } while (0) #define reiserfs_permission NULL #define reiserfs_xattr_register_handlers() 0 -#define reiserfs_xattr_unregister_handlers() +#define reiserfs_xattr_unregister_handlers() do { } while (0) static inline int reiserfs_delete_xattrs (struct inode *inode) { return 0; }; static inline int reiserfs_chown_xattrs (struct inode *inode, struct iattr *attrs) { return 0; }; - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] reiserfs: fix a few 'empty body in an if-statement' warnings.
On Fri, 15 Apr 2005 02:58:54 +0200 (CEST) Jesper Juhl wrote: | When building with gcc -W fs/reiserfs/namei.c:602 has a few warnings | about 'empty body in an if-statement'. This patch silences those warnings. So fix include/linux/reiserfs_xattr.h: change #define reiserfs_mark_inode_private(inode) to #define reiserfs_mark_inode_private(inode) do { } while (0) and not as below. | Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> | | --- linux-2.6.12-rc2-mm3-orig/fs/reiserfs/namei.c 2005-04-11 21:20:55.0 +0200 | +++ linux-2.6.12-rc2-mm3/fs/reiserfs/namei.c 2005-04-15 02:54:53.0 +0200 | @@ -352,8 +352,9 @@ static struct dentry * reiserfs_lookup ( | } | | /* Propogate the priv_object flag so we know we're in the priv tree */ | - if (is_reiserfs_priv_object (dir)) | + if (is_reiserfs_priv_object (dir)) { | reiserfs_mark_inode_private (inode); | + } | } | reiserfs_write_unlock(dir->i_sb); | if ( retval == IO_ERROR ) { | @@ -599,8 +600,9 @@ static int reiserfs_create (struct inode | | reiserfs_write_lock(dir->i_sb); | | -if (locked) | +if (locked) { | reiserfs_write_lock_xattrs (dir->i_sb); | +} | | retval = journal_begin(, dir->i_sb, jbegin_count); | if (retval) { | @@ -640,8 +642,9 @@ static int reiserfs_create (struct inode | retval = journal_end(, dir->i_sb, jbegin_count) ; | | out_failed: | -if (locked) | +if (locked) { | reiserfs_write_unlock_xattrs (dir->i_sb); | +} | reiserfs_write_unlock(dir->i_sb); | return retval; | } | @@ -668,8 +671,9 @@ static int reiserfs_mknod (struct inode | | reiserfs_write_lock(dir->i_sb); | | -if (locked) | +if (locked) { | reiserfs_write_lock_xattrs (dir->i_sb); | +} | | retval = journal_begin(, dir->i_sb, jbegin_count) ; | if (retval) { | @@ -714,8 +718,9 @@ static int reiserfs_mknod (struct inode | retval = journal_end(, dir->i_sb, jbegin_count) ; | | out_failed: | -if (locked) | +if (locked) { | reiserfs_write_unlock_xattrs (dir->i_sb); | +} | reiserfs_write_unlock(dir->i_sb); | return retval; | } | @@ -743,8 +748,9 @@ static int reiserfs_mkdir (struct inode | locked = reiserfs_cache_default_acl (dir); | | reiserfs_write_lock(dir->i_sb); | -if (locked) | +if (locked) { | reiserfs_write_lock_xattrs (dir->i_sb); | +} | | retval = journal_begin(, dir->i_sb, jbegin_count) ; | if (retval) { | @@ -799,8 +805,9 @@ static int reiserfs_mkdir (struct inode | d_instantiate(dentry, inode); | retval = journal_end(, dir->i_sb, jbegin_count) ; | out_failed: | -if (locked) | +if (locked) { | reiserfs_write_unlock_xattrs (dir->i_sb); | +} | reiserfs_write_unlock(dir->i_sb); | return retval; | } --- ~Randy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] reiserfs: fix a few 'empty body in an if-statement' warnings.
On Fri, 15 Apr 2005 02:58:54 +0200 (CEST) Jesper Juhl wrote: | When building with gcc -W fs/reiserfs/namei.c:602 has a few warnings | about 'empty body in an if-statement'. This patch silences those warnings. So fix include/linux/reiserfs_xattr.h: change #define reiserfs_mark_inode_private(inode) to #define reiserfs_mark_inode_private(inode) do { } while (0) and not as below. | Signed-off-by: Jesper Juhl [EMAIL PROTECTED] | | --- linux-2.6.12-rc2-mm3-orig/fs/reiserfs/namei.c 2005-04-11 21:20:55.0 +0200 | +++ linux-2.6.12-rc2-mm3/fs/reiserfs/namei.c 2005-04-15 02:54:53.0 +0200 | @@ -352,8 +352,9 @@ static struct dentry * reiserfs_lookup ( | } | | /* Propogate the priv_object flag so we know we're in the priv tree */ | - if (is_reiserfs_priv_object (dir)) | + if (is_reiserfs_priv_object (dir)) { | reiserfs_mark_inode_private (inode); | + } | } | reiserfs_write_unlock(dir-i_sb); | if ( retval == IO_ERROR ) { | @@ -599,8 +600,9 @@ static int reiserfs_create (struct inode | | reiserfs_write_lock(dir-i_sb); | | -if (locked) | +if (locked) { | reiserfs_write_lock_xattrs (dir-i_sb); | +} | | retval = journal_begin(th, dir-i_sb, jbegin_count); | if (retval) { | @@ -640,8 +642,9 @@ static int reiserfs_create (struct inode | retval = journal_end(th, dir-i_sb, jbegin_count) ; | | out_failed: | -if (locked) | +if (locked) { | reiserfs_write_unlock_xattrs (dir-i_sb); | +} | reiserfs_write_unlock(dir-i_sb); | return retval; | } | @@ -668,8 +671,9 @@ static int reiserfs_mknod (struct inode | | reiserfs_write_lock(dir-i_sb); | | -if (locked) | +if (locked) { | reiserfs_write_lock_xattrs (dir-i_sb); | +} | | retval = journal_begin(th, dir-i_sb, jbegin_count) ; | if (retval) { | @@ -714,8 +718,9 @@ static int reiserfs_mknod (struct inode | retval = journal_end(th, dir-i_sb, jbegin_count) ; | | out_failed: | -if (locked) | +if (locked) { | reiserfs_write_unlock_xattrs (dir-i_sb); | +} | reiserfs_write_unlock(dir-i_sb); | return retval; | } | @@ -743,8 +748,9 @@ static int reiserfs_mkdir (struct inode | locked = reiserfs_cache_default_acl (dir); | | reiserfs_write_lock(dir-i_sb); | -if (locked) | +if (locked) { | reiserfs_write_lock_xattrs (dir-i_sb); | +} | | retval = journal_begin(th, dir-i_sb, jbegin_count) ; | if (retval) { | @@ -799,8 +805,9 @@ static int reiserfs_mkdir (struct inode | d_instantiate(dentry, inode); | retval = journal_end(th, dir-i_sb, jbegin_count) ; | out_failed: | -if (locked) | +if (locked) { | reiserfs_write_unlock_xattrs (dir-i_sb); | +} | reiserfs_write_unlock(dir-i_sb); | return retval; | } --- ~Randy - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/