Skip to contentSkip to conversation

fs:xfs: cleanup __FUNCTION__ usage

PATCH In review Dwaipayan Ray 3 participants 3 messages Jul 11, 2021 – Jul 14, 2021 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs:xfs: cleanup __FUNCTION__ usage

__FUNCTION__ exists only for backwards compatibility reasons with old gcc versions. Replace it with __func__.

---
 fs/xfs/xfs_icreate_item.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_icreate_item.c +2 -2
index 9b3994b9c716..017904a34c02 100644
@@ -201,7 +201,7 @@ xlog_recover_icreate_commit_pass2(
 	if (length != igeo->ialloc_blks &&
 	    length != igeo->ialloc_min_blks) {
 		xfs_warn(log->l_mp,
-			 "%s: unsupported chunk length", __FUNCTION__);
+			 "%s: unsupported chunk length", __func__);
 		return -EINVAL;
 	}
 
@@ -209,7 +209,7 @@ xlog_recover_icreate_commit_pass2(
 	if ((count >> mp->m_sb.sb_inopblog) != length) {
 		xfs_warn(log->l_mp,
 			 "%s: inconsistent inode count and chunk length",
-			 __FUNCTION__);
+			 __func__);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Dwaipayan Ray

__FUNCTION__ exists only for backwards compatibility reasons with old gcc versions. Replace it with __func__.

---
 fs/xfs/xfs_icreate_item.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_icreate_item.c +1 -1
index 9b3994b9c716..017904a34c02 100644
@@ -201,7 +201,7 @@ xlog_recover_icreate_commit_pass2(
 	if (length != igeo->ialloc_blks &&
 	    length != igeo->ialloc_min_blks) {
 		xfs_warn(log->l_mp,
-			 "%s: unsupported chunk length", __FUNCTION__);
+			 "%s: unsupported chunk length", __func__);
 		return -EINVAL;
 	}
 

fs/xfs/xfs_icreate_item.c xlog_recover_icreate_commit_pass2( · line 214

Quoted 7 lines
fs/xfs/xfs_icreate_item.c +1 -1
@@ -209,7 +209,7 @@ xlog_recover_icreate_commit_pass2(
 	if ((count >> mp->m_sb.sb_inopblog) != length) {
 		xfs_warn(log->l_mp,
 			 "%s: inconsistent inode count and chunk length",
-			 __FUNCTION__);
+			 __func__);
 		return -EINVAL;
 	}

Looks good.

For future reference, the subject only needs "xfs:", you can drop the "fs:" prefix from it.

-Dave.

Signature · 2 lines
Dave Chinner
[email protected]
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dwaipayan Ray
Quoted 4 lines · Dwaipayan Ray

__FUNCTION__ exists only for backwards compatibility reasons with old gcc versions. Replace it with __func__.

LGTM

--D

Quoted 29 lines
---
 fs/xfs/xfs_icreate_item.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_icreate_item.c +2 -2
index 9b3994b9c716..017904a34c02 100644
@@ -201,7 +201,7 @@ xlog_recover_icreate_commit_pass2(
 	if (length != igeo->ialloc_blks &&
 	    length != igeo->ialloc_min_blks) {
 		xfs_warn(log->l_mp,
-			 "%s: unsupported chunk length", __FUNCTION__);
+			 "%s: unsupported chunk length", __func__);
 		return -EINVAL;
 	}
 
@@ -209,7 +209,7 @@ xlog_recover_icreate_commit_pass2(
 	if ((count >> mp->m_sb.sb_inopblog) != length) {
 		xfs_warn(log->l_mp,
 			 "%s: inconsistent inode count and chunk length",
-			 __FUNCTION__);
+			 __func__);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.28.0