lkml.org 
[lkml]   [2015]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 14/44] kdbus: Simplify expression in kdbus_get_memfd()
Date
'(s & m) != m' means that mask 'm' contains some bits which are not set
in 's', and this is literally equal to '~s & m'.

Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
---
ipc/kdbus/message.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
index ae565cd343f8..c7ef23d40471 100644
--- a/ipc/kdbus/message.c
+++ b/ipc/kdbus/message.c
@@ -273,7 +273,7 @@ static struct file *kdbus_get_memfd(const struct kdbus_memfd *memfd)
s = shmem_get_seals(f);
if (s < 0)
ret = ERR_PTR(-EMEDIUMTYPE);
- else if ((s & m) != m)
+ else if (~s & m)
ret = ERR_PTR(-ETXTBSY);
else if (memfd->start + memfd->size > (u64)i_size_read(file_inode(f)))
ret = ERR_PTR(-EFAULT);
--
1.8.3.1


\
 
 \ /
  Last update: 2015-10-08 13:41    [W:0.314 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site