Skip to content

Commit

Permalink
ubifs: Force prandom result to __le32
Browse files Browse the repository at this point in the history
In set_dent_cookie() the result of prandom_u32() is
assinged to an __le32 type. Make this a forced conversion
to remove the following sparse warning:

fs/ubifs/journal.c:506:30: warning: incorrect type in assignment (different base types)
fs/ubifs/journal.c:506:30:    expected restricted __le32 [usertype] cookie
fs/ubifs/journal.c:506:30:    got unsigned int

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Ben Dooks (Codethink) authored and Richard Weinberger committed Nov 17, 2019
1 parent b27b281 commit 3cfa441
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ubifs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ static void mark_inode_clean(struct ubifs_info *c, struct ubifs_inode *ui)
static void set_dent_cookie(struct ubifs_info *c, struct ubifs_dent_node *dent)
{
if (c->double_hash)
dent->cookie = prandom_u32();
dent->cookie = (__force __le32) prandom_u32();
else
dent->cookie = 0;
}
Expand Down

0 comments on commit 3cfa441

Please sign in to comment.