[CRIU] [PATCH v3] Removing Unneeded Return Value Assignments

Mitul Karnik mitulkarnik.92 at gmail.com
Thu Mar 21 15:39:31 MSK 2019


Hi Cyrill,

Sure will do the required changes, my bad I was unaware of
compell_syscall() implementation, I will be more careful  next time.
I will send the patch ASAP.
Thanks for pointing it out.



On Thu, Mar 21, 2019 at 4:48 PM Cyrill Gorcunov <gorcunov at gmail.com> wrote:

> On Sat, Mar 16, 2019 at 02:52:04PM +0000, mitulkarnik.92 at gmail.com wrote:
> > From: Mitul Karnik <mitulkarnik.92 at gmail.com>
> >
> > Fixes #334: Removing Unneeded Assignments
> >
> > Patch Description:
> > Removed return value assignment statements as they are not referenced or
> used
> > anywhere after the assignment is done.
> >
> > Signed-off-by: Mitul Karnik <mitulkarnik.92 at gmail.com>
> > ---
> >  compel/arch/s390/src/lib/infect.c | 2 +-
> >  criu/path.c                       | 2 +-
> >  test/zdtm/static/dumpable02.c     | 4 ++--
> >  3 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/compel/arch/s390/src/lib/infect.c
> b/compel/arch/s390/src/lib/infect.c
> > index 940d0441..b690b812 100644
> > --- a/compel/arch/s390/src/lib/infect.c
> > +++ b/compel/arch/s390/src/lib/infect.c
> > @@ -455,7 +455,7 @@ void *remote_mmap(struct parasite_ctl *ctl,
> >       if (ptrace_poke_area(pid, &arg_struct, where, sizeof(arg_struct)))
> {
> >               pr_err("Can't restore mmap args (pid: %d)\n", pid);
> >               if (map != 0) {
> > -                     err = compel_syscall(ctl, __NR_munmap, NULL, map,
> > +                     compel_syscall(ctl, __NR_munmap, NULL, map,
> >                                            length, 0, 0, 0, 0);
> >                       map = 0;
> >               }
>
> This is wrong. You should rather check err and print error message
> if __NR_munmap failed.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20190321/20ed2a06/attachment.html>


More information about the CRIU mailing list