* [PATCH] ipc/shm.c: removed 'int err' from shm_get_policy()
@ 2018-11-18 23:49 danielijrobson
2018-11-22 5:07 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: danielijrobson @ 2018-11-18 23:49 UTC (permalink / raw)
To: danielijrobson
Cc: akpm, dbueso, manfred, ebiederm, mike.kravetz, linux, viro,
ebiggers, arnd, linux-kernel
From: Daniel Robson <danielijrobson@gmail.com>
removed unneeded variable in shm_get_policy()
Signed-off-by: Daniel Robson <danielijrobson@gmail.com>
---
ipc/shm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ipc/shm.c b/ipc/shm.c
index 0842411cb0e9..2cb493214108 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -461,11 +461,10 @@ static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
{
struct file *file = vma->vm_file;
struct shm_file_data *sfd = shm_file_data(file);
- int err = 0;
if (sfd->vm_ops->set_policy)
- err = sfd->vm_ops->set_policy(vma, new);
- return err;
+ return sfd->vm_ops->set_policy(vma, new);
+ return 0;
}
static struct mempolicy *shm_get_policy(struct vm_area_struct *vma,
--
2.18.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipc/shm.c: removed 'int err' from shm_get_policy()
2018-11-18 23:49 [PATCH] ipc/shm.c: removed 'int err' from shm_get_policy() danielijrobson
@ 2018-11-22 5:07 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2018-11-22 5:07 UTC (permalink / raw)
To: danielijrobson
Cc: dbueso, manfred, ebiederm, mike.kravetz, linux, viro, ebiggers,
arnd, linux-kernel
On Sun, 18 Nov 2018 23:49:11 +0000 danielijrobson@gmail.com wrote:
> removed unneeded variable in shm_get_policy()
>
> ...
>
> --- a/ipc/shm.c
> +++ b/ipc/shm.c
> @@ -461,11 +461,10 @@ static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
> {
> struct file *file = vma->vm_file;
> struct shm_file_data *sfd = shm_file_data(file);
> - int err = 0;
>
> if (sfd->vm_ops->set_policy)
> - err = sfd->vm_ops->set_policy(vma, new);
> - return err;
> + return sfd->vm_ops->set_policy(vma, new);
> + return 0;
> }
Sorry, I don't think this is enough of an improvement to justify adding
the patch.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-22 5:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-18 23:49 [PATCH] ipc/shm.c: removed 'int err' from shm_get_policy() danielijrobson
2018-11-22 5:07 ` Andrew Morton
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).