lkml.org 
[lkml]   [2015]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hid-core: fix s32 to n function when n=32
On Thu, 21 May 2015, Samet, Yael wrote:

> In hid-core.c, s32ton function, when n in 32 the result will always be 0.
> In the last line of the function:
> 1 << 32 is not defined,
> I get 1 in my environment, Then ((1 << n) - 1) is 0, and the function returns 0 for each value.
>
> Signed-off-by: Yael Samet <yael.samet@intel.com>
>
> --- hid-core.c 2015-05-21 10:49:39.000000000 +0300
> +++ hid-core.c.pathced 2015-05-21 11:02:29.692431045 +0300

This is not a proper format to submit patches, please see
Documentation/SubmittingPatches.

> @@ -1044,6 +1044,8 @@
> static u32 s32ton(__s32 value, unsigned n)
> {
> s32 a = value >> (n - 1);
> + if (n == 32)
> + return value;
> if (a && a != -1)
> return value < 0 ? 1 << (n - 1) : (1 << (n - 1)) - 1;
> return value & ((1 << n) - 1);

The patch is whitespace-damaged. Could you please fix your mail setup and
resend?

> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited.

Seems like I wouldn't be allowed to apply it anyway though :p

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2015-05-29 17:21    [W:0.049 / U:8.336 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site