From: Bharath Vedartham <linux.bhar@gmail.com>
To: dushistov@mail.ru
Cc: linux.bhar@gmail.com, linux-kernel@vger.kernel.org
Subject: [PATCH] fs/ufs: Force type conversion from __fs16 to u16
Date: Tue, 23 Apr 2019 14:31:18 +0530 [thread overview]
Message-ID: <20190423090118.GA465@bharath12345-Inspiron-5559> (raw)
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
next reply other threads:[~2019-04-23 9:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 9:01 Bharath Vedartham [this message]
2019-04-24 4:12 ` [PATCH] fs/ufs: Force type conversion from __fs16 to u16 Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190423090118.GA465@bharath12345-Inspiron-5559 \
--to=linux.bhar@gmail.com \
--cc=dushistov@mail.ru \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).