[PATCH 32/45] C++: __to_fd() needs to reduce the size of v for struct fd::flags

David Howells
2018-04-01T20:43:32Z

__to_fd() needs to reduce the size of v before it assigns the computed
value to fd::flags or suffer a warning about reduction of size of integer.

Signed-off-by: David Howells <dhowells@redhat.com>
---

include/linux/file.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/file.h b/include/linux/file.h
index 279720db984a..9807271c850a 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -49,7 +49,7 @@ extern void __f_unlock_pos(struct file *);

static inline struct fd __to_fd(unsigned long v)
{
- return (struct fd){(struct file *)(v & ~3),v & 3};
+ return (struct fd){(struct file *)(v & ~3), (unsigned int)v & 3};
}

static inline struct fd fdget(unsigned int fd)