All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Followup corrections for kexec_status()
@ 2017-01-19 17:10 Eric DeVolder
  2017-01-19 17:10 ` [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1 Eric DeVolder
  0 siblings, 1 reply; 5+ messages in thread
From: Eric DeVolder @ 2017-01-19 17:10 UTC (permalink / raw)
  To: xen-devel, ian.jackson, wei.liu2
  Cc: elena.ufimtseva, andrew.cooper3, daniel.kiper, konrad.wilk

Jan,
This corrects the use of test_bit() in kexec_status().

Wei,
This patch is against the kexec_status() recently applied to staging.

Regards,
Eric


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1
  2017-01-19 17:10 [PATCH 0/1] Followup corrections for kexec_status() Eric DeVolder
@ 2017-01-19 17:10 ` Eric DeVolder
  2017-01-19 18:05   ` Daniel Kiper
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Eric DeVolder @ 2017-01-19 17:10 UTC (permalink / raw)
  To: xen-devel, ian.jackson, wei.liu2
  Cc: elena.ufimtseva, andrew.cooper3, daniel.kiper, konrad.wilk

When checking kexec_flags bit corresponding to the
requested image, ensure that 0 or 1 is returned.

Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
---
 xen/common/kexec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index aa808cb..3da27bf 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1182,7 +1182,8 @@ static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)
     if ( kexec_load_get_bits(status.type, &base, &bit) )
         return -EINVAL;
 
-    return test_bit(bit, &kexec_flags);
+    /* Ensure return bit value of 0 or 1 */
+    return !!test_bit(bit, &kexec_flags);
 }
 
 static int do_kexec_op_internal(unsigned long op,
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1
  2017-01-19 17:10 ` [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1 Eric DeVolder
@ 2017-01-19 18:05   ` Daniel Kiper
  2017-01-20  8:32   ` Jan Beulich
  2017-01-20 15:01   ` Andrew Cooper
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel Kiper @ 2017-01-19 18:05 UTC (permalink / raw)
  To: Eric DeVolder
  Cc: elena.ufimtseva, wei.liu2, konrad.wilk, andrew.cooper3,
	ian.jackson, xen-devel

On Thu, Jan 19, 2017 at 11:10:53AM -0600, Eric DeVolder wrote:
> When checking kexec_flags bit corresponding to the
> requested image, ensure that 0 or 1 is returned.
>
> Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>

In general Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> but...

> ---
>  xen/common/kexec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/common/kexec.c b/xen/common/kexec.c
> index aa808cb..3da27bf 100644
> --- a/xen/common/kexec.c
> +++ b/xen/common/kexec.c
> @@ -1182,7 +1182,8 @@ static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)
>      if ( kexec_load_get_bits(status.type, &base, &bit) )
>          return -EINVAL;
>
> -    return test_bit(bit, &kexec_flags);
> +    /* Ensure return bit value of 0 or 1 */

This is not needed here. "!!" is used very often and it is not an unusual stuff.
So, it does not need any comment. However, I can agree that at first sight
it looks strange.

> +    return !!test_bit(bit, &kexec_flags);

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1
  2017-01-19 17:10 ` [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1 Eric DeVolder
  2017-01-19 18:05   ` Daniel Kiper
@ 2017-01-20  8:32   ` Jan Beulich
  2017-01-20 15:01   ` Andrew Cooper
  2 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2017-01-20  8:32 UTC (permalink / raw)
  To: Eric DeVolder
  Cc: elena.ufimtseva, wei.liu2, konrad.wilk, andrew.cooper3,
	daniel.kiper, ian.jackson, xen-devel

>>> On 19.01.17 at 18:10, <eric.devolder@oracle.com> wrote:
> --- a/xen/common/kexec.c
> +++ b/xen/common/kexec.c
> @@ -1182,7 +1182,8 @@ static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)
>      if ( kexec_load_get_bits(status.type, &base, &bit) )
>          return -EINVAL;
>  
> -    return test_bit(bit, &kexec_flags);
> +    /* Ensure return bit value of 0 or 1 */
> +    return !!test_bit(bit, &kexec_flags);
>  }

I don't see the point of adding a comment here, but I'll let Andrew as
the maintainer judge. In any event
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1
  2017-01-19 17:10 ` [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1 Eric DeVolder
  2017-01-19 18:05   ` Daniel Kiper
  2017-01-20  8:32   ` Jan Beulich
@ 2017-01-20 15:01   ` Andrew Cooper
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Cooper @ 2017-01-20 15:01 UTC (permalink / raw)
  To: Eric DeVolder, xen-devel, ian.jackson, wei.liu2
  Cc: elena.ufimtseva, daniel.kiper, konrad.wilk

On 19/01/17 17:10, Eric DeVolder wrote:
> When checking kexec_flags bit corresponding to the
> requested image, ensure that 0 or 1 is returned.
>
> Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> and committed.  I
dropped the commit while doing so

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-20 15:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-19 17:10 [PATCH 0/1] Followup corrections for kexec_status() Eric DeVolder
2017-01-19 17:10 ` [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1 Eric DeVolder
2017-01-19 18:05   ` Daniel Kiper
2017-01-20  8:32   ` Jan Beulich
2017-01-20 15:01   ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.