[1/1] Bugfix 334: Remove unneeded assignments

Submitted by Mitul Karnik on March 8, 2019, 10:03 a.m.

Details

Message ID 20190308100329.29093-1-mitulkarnik.92@gmail.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Mitul Karnik March 8, 2019, 10:03 a.m.
From: Mitul Karnik <mitulkarnik.92@gmail.com>

Signed-off-by: Mitul Karnik <mitulkarnik.92@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(-)

Patch hide | download patch | download mbox

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;
 		}
diff --git a/criu/path.c b/criu/path.c
index 70b0c472..22a89a4a 100644
--- a/criu/path.c
+++ b/criu/path.c
@@ -99,7 +99,7 @@  char *mnt_get_sibling_path(struct mount_info *m,
 		rpath++;
 
 	if (rpath[0] != '\0')
-		off = snprintf(path, len, "/%s", rpath);
+		snprintf(path, len, "/%s", rpath);
 
 	return buf;
 }
diff --git a/test/zdtm/static/dumpable02.c b/test/zdtm/static/dumpable02.c
index bd632e13..024371bd 100644
--- a/test/zdtm/static/dumpable02.c
+++ b/test/zdtm/static/dumpable02.c
@@ -143,8 +143,8 @@  int main(int argc, char **argv)
 			return 1;
 		}
 
-		ret = execl(argv[0], "dumpable_server", NULL);
-		pr_perror("could not execv %s as a dumpable_server", argv[0]);
+		execl(argv[0], "dumpable_server", NULL);
+		pr_perror("could not execv %s as a dumpable_server\nError No: %d", argv[0], errno);
 		return 1;
 	}
 

Comments

Mike Rapoport March 10, 2019, 6:36 a.m.
Hi,

> Subject: Bugfix 334: Remove unneeded assignments

On Fri, Mar 08, 2019 at 10:03:29AM +0000, mitulkarnik.92@gmail.com wrote:
> From: Mitul Karnik <mitulkarnik.92@gmail.com>
> 
> Signed-off-by: Mitul Karnik <mitulkarnik.92@gmail.com>

In CRIU we add "Fixes: #<issue>" to the changelog body rather than to the
subject. Other than that:

Reviewed-by: Mike Rapoport <rppt@linux.ibm.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;
>  		}
> diff --git a/criu/path.c b/criu/path.c
> index 70b0c472..22a89a4a 100644
> --- a/criu/path.c
> +++ b/criu/path.c
> @@ -99,7 +99,7 @@ char *mnt_get_sibling_path(struct mount_info *m,
>  		rpath++;
>  
>  	if (rpath[0] != '\0')
> -		off = snprintf(path, len, "/%s", rpath);
> +		snprintf(path, len, "/%s", rpath);
>  
>  	return buf;
>  }
> diff --git a/test/zdtm/static/dumpable02.c b/test/zdtm/static/dumpable02.c
> index bd632e13..024371bd 100644
> --- a/test/zdtm/static/dumpable02.c
> +++ b/test/zdtm/static/dumpable02.c
> @@ -143,8 +143,8 @@ int main(int argc, char **argv)
>  			return 1;
>  		}
>  
> -		ret = execl(argv[0], "dumpable_server", NULL);
> -		pr_perror("could not execv %s as a dumpable_server", argv[0]);
> +		execl(argv[0], "dumpable_server", NULL);
> +		pr_perror("could not execv %s as a dumpable_server\nError No: %d", argv[0], errno);
>  		return 1;
>  	}
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
>
Radostin Stoyanov March 10, 2019, 9:54 a.m.
On 10/03/2019 06:36, Mike Rapoport wrote:
> Hi,
>
>> Subject: Bugfix 334: Remove unneeded assignments
> On Fri, Mar 08, 2019 at 10:03:29AM +0000, mitulkarnik.92@gmail.com wrote:
>> From: Mitul Karnik <mitulkarnik.92@gmail.com>
>>
>> Signed-off-by: Mitul Karnik <mitulkarnik.92@gmail.com>
> In CRIU we add "Fixes: #<issue>" to the changelog body rather than to the
> subject. Other than that:
>
> Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
"Fixes" is also a keyword that is used by GitHub to close the issue, and
there are a few more of them.

https://help.github.com/en/articles/closing-issues-using-keywords

>> ---
>>  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;
>>  		}
>> diff --git a/criu/path.c b/criu/path.c
>> index 70b0c472..22a89a4a 100644
>> --- a/criu/path.c
>> +++ b/criu/path.c
>> @@ -99,7 +99,7 @@ char *mnt_get_sibling_path(struct mount_info *m,
>>  		rpath++;
>>  
>>  	if (rpath[0] != '\0')
>> -		off = snprintf(path, len, "/%s", rpath);
>> +		snprintf(path, len, "/%s", rpath);
>>  
>>  	return buf;
>>  }
>> diff --git a/test/zdtm/static/dumpable02.c b/test/zdtm/static/dumpable02.c
>> index bd632e13..024371bd 100644
>> --- a/test/zdtm/static/dumpable02.c
>> +++ b/test/zdtm/static/dumpable02.c
>> @@ -143,8 +143,8 @@ int main(int argc, char **argv)
>>  			return 1;
>>  		}
>>  
>> -		ret = execl(argv[0], "dumpable_server", NULL);
>> -		pr_perror("could not execv %s as a dumpable_server", argv[0]);
>> +		execl(argv[0], "dumpable_server", NULL);
>> +		pr_perror("could not execv %s as a dumpable_server\nError No: %d", argv[0], errno);
>>  		return 1;
>>  	}
>>  
>> -- 
>> 2.17.1
>>
>> _______________________________________________
>> CRIU mailing list
>> CRIU@openvz.org
>> https://lists.openvz.org/mailman/listinfo/criu
>>
Mitul Karnik March 10, 2019, 12:22 p.m.
Hi Team,

Thanks alot for reviewing the patch and apologies for minor issues. Since I
am beginning to contribute to CRIU I was unaware of this process. Should I
resend the patch with suggested changes ?
Again apologies for being naive.

Regards,
Mitul


On Sun 10 Mar, 2019, 15:24 Radostin Stoyanov, <rstoyanov1@gmail.com> wrote:

>
> On 10/03/2019 06:36, Mike Rapoport wrote:
> > Hi,
> >
> >> Subject: Bugfix 334: Remove unneeded assignments
> > On Fri, Mar 08, 2019 at 10:03:29AM +0000, mitulkarnik.92@gmail.com
> wrote:
> >> From: Mitul Karnik <mitulkarnik.92@gmail.com>
> >>
> >> Signed-off-by: Mitul Karnik <mitulkarnik.92@gmail.com>
> > In CRIU we add "Fixes: #<issue>" to the changelog body rather than to the
> > subject. Other than that:
> >
> > Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
> "Fixes" is also a keyword that is used by GitHub to close the issue, and
> there are a few more of them.
>
> https://help.github.com/en/articles/closing-issues-using-keywords
>
> >> ---
> >>  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;
> >>              }
> >> diff --git a/criu/path.c b/criu/path.c
> >> index 70b0c472..22a89a4a 100644
> >> --- a/criu/path.c
> >> +++ b/criu/path.c
> >> @@ -99,7 +99,7 @@ char *mnt_get_sibling_path(struct mount_info *m,
> >>              rpath++;
> >>
> >>      if (rpath[0] != '\0')
> >> -            off = snprintf(path, len, "/%s", rpath);
> >> +            snprintf(path, len, "/%s", rpath);
> >>
> >>      return buf;
> >>  }
> >> diff --git a/test/zdtm/static/dumpable02.c
> b/test/zdtm/static/dumpable02.c
> >> index bd632e13..024371bd 100644
> >> --- a/test/zdtm/static/dumpable02.c
> >> +++ b/test/zdtm/static/dumpable02.c
> >> @@ -143,8 +143,8 @@ int main(int argc, char **argv)
> >>                      return 1;
> >>              }
> >>
> >> -            ret = execl(argv[0], "dumpable_server", NULL);
> >> -            pr_perror("could not execv %s as a dumpable_server",
> argv[0]);
> >> +            execl(argv[0], "dumpable_server", NULL);
> >> +            pr_perror("could not execv %s as a dumpable_server\nError
> No: %d", argv[0], errno);
> >>              return 1;
> >>      }
> >>
> >> --
> >> 2.17.1
> >>
> >> _______________________________________________
> >> CRIU mailing list
> >> CRIU@openvz.org
> >> https://lists.openvz.org/mailman/listinfo/criu
> >>
>
>
Radostin Stoyanov March 10, 2019, 2:14 p.m.
Hi Mitul,

There is no need to apologise. The idea of code reviews is to assure
software quality and we appreciate your contributions to the project.

The commit message can be changed either before it is pushed (by Andrei)
to the criu-dev branch, for example, to insert the "Reviewed-by" tag, or
you can do that using "git rebase" (or "git commit --amend") and then
send the new version of the patch with "--subject-prefix=PATCHv2".

Thanks
Radostin

On 10/03/2019 12:22, Mitul Karnik wrote:
> Hi Team,
>
> Thanks alot for reviewing the patch and apologies for minor issues.
> Since I am beginning to contribute to CRIU I was unaware of this
> process. Should I resend the patch with suggested changes ? 
> Again apologies for being naive. 
>
> Regards,
> Mitul
>
>
> On Sun 10 Mar, 2019, 15:24 Radostin Stoyanov, <rstoyanov1@gmail.com
> <mailto:rstoyanov1@gmail.com>> wrote:
>
>
>     On 10/03/2019 06:36, Mike Rapoport wrote:
>     > Hi,
>     >
>     >> Subject: Bugfix 334: Remove unneeded assignments
>     > On Fri, Mar 08, 2019 at 10:03:29AM +0000,
>     mitulkarnik.92@gmail.com <mailto:mitulkarnik.92@gmail.com> wrote:
>     >> From: Mitul Karnik <mitulkarnik.92@gmail.com
>     <mailto:mitulkarnik.92@gmail.com>>
>     >>
>     >> Signed-off-by: Mitul Karnik <mitulkarnik.92@gmail.com
>     <mailto:mitulkarnik.92@gmail.com>>
>     > In CRIU we add "Fixes: #<issue>" to the changelog body rather
>     than to the
>     > subject. Other than that:
>     >
>     > Reviewed-by: Mike Rapoport <rppt@linux.ibm.com
>     <mailto:rppt@linux.ibm.com>>
>     "Fixes" is also a keyword that is used by GitHub to close the
>     issue, and
>     there are a few more of them.
>
>     https://help.github.com/en/articles/closing-issues-using-keywords
>
>     >> ---
>     >>  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;
>     >>              }
>     >> diff --git a/criu/path.c b/criu/path.c
>     >> index 70b0c472..22a89a4a 100644
>     >> --- a/criu/path.c
>     >> +++ b/criu/path.c
>     >> @@ -99,7 +99,7 @@ char *mnt_get_sibling_path(struct mount_info *m,
>     >>              rpath++;
>     >> 
>     >>      if (rpath[0] != '\0')
>     >> -            off = snprintf(path, len, "/%s", rpath);
>     >> +            snprintf(path, len, "/%s", rpath);
>     >> 
>     >>      return buf;
>     >>  }
>     >> diff --git a/test/zdtm/static/dumpable02.c
>     b/test/zdtm/static/dumpable02.c
>     >> index bd632e13..024371bd 100644
>     >> --- a/test/zdtm/static/dumpable02.c
>     >> +++ b/test/zdtm/static/dumpable02.c
>     >> @@ -143,8 +143,8 @@ int main(int argc, char **argv)
>     >>                      return 1;
>     >>              }
>     >> 
>     >> -            ret = execl(argv[0], "dumpable_server", NULL);
>     >> -            pr_perror("could not execv %s as a
>     dumpable_server", argv[0]);
>     >> +            execl(argv[0], "dumpable_server", NULL);
>     >> +            pr_perror("could not execv %s as a
>     dumpable_server\nError No: %d", argv[0], errno);
>     >>              return 1;
>     >>      }
>     >> 
>     >> --
>     >> 2.17.1
>     >>
>     >> _______________________________________________
>     >> CRIU mailing list
>     >> CRIU@openvz.org <mailto:CRIU@openvz.org>
>     >> https://lists.openvz.org/mailman/listinfo/criu
>     >>
>