All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format
@ 2017-02-10 12:59 Andy Shevchenko
  2017-02-10 18:38 ` Simon Glass
  2017-03-18  0:15 ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Shevchenko @ 2017-02-10 12:59 UTC (permalink / raw)
  To: u-boot

From: Sebastien Colleur <sebastienx.colleur@intel.com>

itest shell command doesn't work correctly in long format when
doing comparaison due to wrong mask value calculus that overflow
on 32 bits values.

Signed-off-by: Sebastien Colleur <sebastienx.colleur@intel.com>
---
 cmd/itest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/itest.c b/cmd/itest.c
index 60626c7fe9..e1896d9f97 100644
--- a/cmd/itest.c
+++ b/cmd/itest.c
@@ -80,7 +80,8 @@ static long evalexp(char *s, int w)
 		l = simple_strtoul(s, NULL, 16);
 	}
 
-	return l & ((1UL << (w * 8)) - 1);
+	/* avoid overflow on mask calculus */
+	return (w >= sizeof(long)) ? l : (l & ((1UL << (w * 8)) - 1));
 }
 
 static char * evalstr(char *s)
-- 
2.11.0

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

* [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format
  2017-02-10 12:59 [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format Andy Shevchenko
@ 2017-02-10 18:38 ` Simon Glass
  2017-02-17 12:57   ` Andy Shevchenko
  2017-03-18  0:15 ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 1 reply; 7+ messages in thread
From: Simon Glass @ 2017-02-10 18:38 UTC (permalink / raw)
  To: u-boot

On 10 February 2017 at 05:59, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> From: Sebastien Colleur <sebastienx.colleur@intel.com>
>
> itest shell command doesn't work correctly in long format when
> doing comparaison due to wrong mask value calculus that overflow
> on 32 bits values.
>
> Signed-off-by: Sebastien Colleur <sebastienx.colleur@intel.com>
> ---
>  cmd/itest.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Seems reasonable to me.

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format
  2017-02-10 18:38 ` Simon Glass
@ 2017-02-17 12:57   ` Andy Shevchenko
  2017-02-17 13:00     ` Stefan Roese
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2017-02-17 12:57 UTC (permalink / raw)
  To: u-boot

On Fri, Feb 10, 2017 at 8:38 PM, Simon Glass <sjg@chromium.org> wrote:
> On 10 February 2017 at 05:59, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>> From: Sebastien Colleur <sebastienx.colleur@intel.com>
>>
>> itest shell command doesn't work correctly in long format when
>> doing comparaison due to wrong mask value calculus that overflow
>> on 32 bits values.

> Reviewed-by: Simon Glass <sjg@chromium.org>

Thanks!

To whom should I send this to get it applied? Or just wait when
maintainers pick this up?

-- 
With Best Regards,
Andy Shevchenko

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

* [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format
  2017-02-17 12:57   ` Andy Shevchenko
@ 2017-02-17 13:00     ` Stefan Roese
  2017-02-17 13:04       ` Andy Shevchenko
  2017-02-28 10:55       ` Andy Shevchenko
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Roese @ 2017-02-17 13:00 UTC (permalink / raw)
  To: u-boot

On 17.02.2017 13:57, Andy Shevchenko wrote:
> On Fri, Feb 10, 2017 at 8:38 PM, Simon Glass <sjg@chromium.org> wrote:
>> On 10 February 2017 at 05:59, Andy Shevchenko
>> <andriy.shevchenko@linux.intel.com> wrote:
>>> From: Sebastien Colleur <sebastienx.colleur@intel.com>
>>>
>>> itest shell command doesn't work correctly in long format when
>>> doing comparaison due to wrong mask value calculus that overflow
>>> on 32 bits values.
>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> Thanks!
>
> To whom should I send this to get it applied? Or just wait when
> maintainers pick this up?

As this patch doesn't fall into a special custodian responsibility, Tom
usually keeps track of it and will apply it - most likely after the
next release. But it's always a good idea to check from time to time, if
such patches have been applied and "ping" again if not.

Thanks,
Stefan

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

* [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format
  2017-02-17 13:00     ` Stefan Roese
@ 2017-02-17 13:04       ` Andy Shevchenko
  2017-02-28 10:55       ` Andy Shevchenko
  1 sibling, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2017-02-17 13:04 UTC (permalink / raw)
  To: u-boot

On Fri, Feb 17, 2017 at 3:00 PM, Stefan Roese <sr@denx.de> wrote:
> On 17.02.2017 13:57, Andy Shevchenko wrote:

>> To whom should I send this to get it applied? Or just wait when
>> maintainers pick this up?

> As this patch doesn't fall into a special custodian responsibility, Tom
> usually keeps track of it and will apply it - most likely after the
> next release. But it's always a good idea to check from time to time, if
> such patches have been applied and "ping" again if not.

Okay, thanks for clarification.

-- 
With Best Regards,
Andy Shevchenko

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

* [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format
  2017-02-17 13:00     ` Stefan Roese
  2017-02-17 13:04       ` Andy Shevchenko
@ 2017-02-28 10:55       ` Andy Shevchenko
  1 sibling, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2017-02-28 10:55 UTC (permalink / raw)
  To: u-boot

On Fri, Feb 17, 2017 at 3:00 PM, Stefan Roese <sr@denx.de> wrote:
> On 17.02.2017 13:57, Andy Shevchenko wrote:
>> On Fri, Feb 10, 2017 at 8:38 PM, Simon Glass <sjg@chromium.org> wrote:
>>> On 10 February 2017 at 05:59, Andy Shevchenko
>>> <andriy.shevchenko@linux.intel.com> wrote:

>>>> itest shell command doesn't work correctly in long format when
>>>> doing comparaison due to wrong mask value calculus that overflow
>>>> on 32 bits values.

>>> Reviewed-by: Simon Glass <sjg@chromium.org>

>> Thanks!
>>
>> To whom should I send this to get it applied? Or just wait when
>> maintainers pick this up?

> As this patch doesn't fall into a special custodian responsibility, Tom
> usually keeps track of it and will apply it - most likely after the
> next release. But it's always a good idea to check from time to time, if
> such patches have been applied and "ping" again if not.

Tom, there is no such in -rc3, please apply if no objections.

-- 
With Best Regards,
Andy Shevchenko

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

* [U-Boot] [U-Boot, v1] cmd: itest: correct calculus for long format
  2017-02-10 12:59 [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format Andy Shevchenko
  2017-02-10 18:38 ` Simon Glass
@ 2017-03-18  0:15 ` Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2017-03-18  0:15 UTC (permalink / raw)
  To: u-boot

On Fri, Feb 10, 2017 at 03:59:15PM +0300, Andy Shevchenko wrote:

> From: Sebastien Colleur <sebastienx.colleur@intel.com>
> 
> itest shell command doesn't work correctly in long format when
> doing comparaison due to wrong mask value calculus that overflow
> on 32 bits values.
> 
> Signed-off-by: Sebastien Colleur <sebastienx.colleur@intel.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170317/2f2da1c3/attachment.sig>

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

end of thread, other threads:[~2017-03-18  0:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 12:59 [U-Boot] [PATCH v1] cmd: itest: correct calculus for long format Andy Shevchenko
2017-02-10 18:38 ` Simon Glass
2017-02-17 12:57   ` Andy Shevchenko
2017-02-17 13:00     ` Stefan Roese
2017-02-17 13:04       ` Andy Shevchenko
2017-02-28 10:55       ` Andy Shevchenko
2017-03-18  0:15 ` [U-Boot] [U-Boot, " Tom Rini

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.