public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/ufs: Force type conversion from __fs16 to u16
@ 2019-04-23  9:01 Bharath Vedartham
  2019-04-24  4:12 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Bharath Vedartham @ 2019-04-23  9:01 UTC (permalink / raw)
  To: dushistov; +Cc: linux.bhar, linux-kernel

This patch fixes the sparse warning:
warning: restricted __fs16 degrades to integer

inode->ui_u1.oldids.ui_suid is of type __fs16, a restricted integer.
0XFFFF is a 16 bit unsigned integer. Use __force to fix the sparse
warning.

Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
---
 fs/ufs/util.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 1fd3011..b03143f 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -195,7 +195,7 @@ ufs_get_inode_uid(struct super_block *sb, struct ufs_inode *inode)
 	case UFS_UID_44BSD:
 		return fs32_to_cpu(sb, inode->ui_u3.ui_44.ui_uid);
 	case UFS_UID_EFT:
-		if (inode->ui_u1.oldids.ui_suid == 0xFFFF)
+		if ((__force u16)inode->ui_u1.oldids.ui_suid == 0xFFFF)
 			return fs32_to_cpu(sb, inode->ui_u3.ui_sun.ui_uid);
 		/* Fall through */
 	default:
@@ -229,7 +229,7 @@ ufs_get_inode_gid(struct super_block *sb, struct ufs_inode *inode)
 	case UFS_UID_44BSD:
 		return fs32_to_cpu(sb, inode->ui_u3.ui_44.ui_gid);
 	case UFS_UID_EFT:
-		if (inode->ui_u1.oldids.ui_suid == 0xFFFF)
+		if ((__force u16)inode->ui_u1.oldids.ui_suid == 0xFFFF)
 			return fs32_to_cpu(sb, inode->ui_u3.ui_sun.ui_gid);
 		/* Fall through */
 	default:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-24  4:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-23  9:01 [PATCH] fs/ufs: Force type conversion from __fs16 to u16 Bharath Vedartham
2019-04-24  4:12 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox