Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-11 Thread Louis Langholtz
Hi Tejun, On Jun 10, 2015, at 7:54 PM, Tejun Heo wrote: > Hey, Louis. > > On Wed, Jun 10, 2015 at 11:05:21AM -0600, Louis Langholtz wrote: >> The underlying code for sysfs_create_file does call WARN to warn about >> any errors. So it's not like the code is

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-11 Thread Louis Langholtz
Hi Tejun, On Jun 10, 2015, at 7:54 PM, Tejun Heo hte...@gmail.com wrote: Hey, Louis. On Wed, Jun 10, 2015 at 11:05:21AM -0600, Louis Langholtz wrote: The underlying code for sysfs_create_file does call WARN to warn about any errors. So it's not like the code is totally silent anyway

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-10 Thread Louis Langholtz
On Jun 7, 2015, at 6:58 PM, Tejun Heo wrote: > On Sun, Jun 07, 2015 at 05:17:20PM -0700, Linus Torvalds wrote: >> At most, it could be a "WARN_ON_ONCE()". Maybe even just silently >> ignore the error. But BUG_ON()? Hell no. > > Yeah, WARN_ON_ONCE() is the right one... > > -- > tejun On

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-10 Thread Louis Langholtz
On Jun 7, 2015, at 6:58 PM, Tejun Heo hte...@gmail.com wrote: On Sun, Jun 07, 2015 at 05:17:20PM -0700, Linus Torvalds wrote: At most, it could be a WARN_ON_ONCE(). Maybe even just silently ignore the error. But BUG_ON()? Hell no. Yeah, WARN_ON_ONCE() is the right one... -- tejun On

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Louis Langholtz
On Jun 7, 2015, at 6:17 PM, Linus Torvalds wrote: > On Sun, Jun 7, 2015 at 5:00 PM, Tejun Heo wrote: >> On Sun, Jun 07, 2015 at 05:54:30PM -0600, Louis Langholtz wrote: >>> @@ -853,6 +853,7 @@ static void __init version_sysfs_builtin(void) >>> mk =

[PATCH v2] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Louis Langholtz
the warning, satisfies the required check, and warns if sysfs_create_file actually ever fails (something that Rusty says should never happen when this code runs). Signed-off-by: Louis Langholtz --- diff --git a/kernel/params.c b/kernel/params.c index a22d6a7..49406f9 100644 --- a/kernel/params.c

[PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Louis Langholtz
the warning, satisfies the required check, and fails-fast with notice if sysfs_create_file actually ever fails (something that Rusty says should never happen when this code runs). Signed-off-by: Louis Langholtz --- diff --git a/kernel/params.c b/kernel/params.c index a22d6a7..b04a752 100644 --- a/kernel

[PATCH v2] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Louis Langholtz
the warning, satisfies the required check, and warns if sysfs_create_file actually ever fails (something that Rusty says should never happen when this code runs). Signed-off-by: Louis Langholtz lou_langho...@me.com --- diff --git a/kernel/params.c b/kernel/params.c index a22d6a7..49406f9 100644

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Louis Langholtz
On Jun 7, 2015, at 6:17 PM, Linus Torvalds torva...@linux-foundation.org wrote: On Sun, Jun 7, 2015 at 5:00 PM, Tejun Heo hte...@gmail.com wrote: On Sun, Jun 07, 2015 at 05:54:30PM -0600, Louis Langholtz wrote: @@ -853,6 +853,7 @@ static void __init version_sysfs_builtin(void

[PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Louis Langholtz
the warning, satisfies the required check, and fails-fast with notice if sysfs_create_file actually ever fails (something that Rusty says should never happen when this code runs). Signed-off-by: Louis Langholtz lou_langho...@me.com --- diff --git a/kernel/params.c b/kernel/params.c index a22d6a7..b04a752

Re: kernel/params.c: 'err' variable "set but not used" and perhaps should be?

2015-06-03 Thread Louis Langholtz
On Jun 1, 2015, at 7:32 PM, Rusty Russell wrote: > Louis Langholtz writes: >> I get a compiler warning (on compiling the linux kernel) about the 'err' >> variable being "set but not used" in the version_sysfs_builtin() function >> of kernel/params.c (

Re: kernel/params.c: 'err' variable set but not used and perhaps should be?

2015-06-03 Thread Louis Langholtz
On Jun 1, 2015, at 7:32 PM, Rusty Russell ru...@rustcorp.com.au wrote: Louis Langholtz lou_langho...@me.com writes: I get a compiler warning (on compiling the linux kernel) about the 'err' variable being set but not used in the version_sysfs_builtin() function of kernel/params.c (at line 848

Re: [PATCH] include/linux: avoid narrowing length parameter values

2015-05-18 Thread Louis Langholtz
On May 18, 2015, at 9:56 AM, Al Viro wrote: > On Mon, May 18, 2015 at 09:33:10AM -0600, Louis Langholtz wrote: >> memcpy_from_msg() and memcpy_to_msg() functions previously called >> memcpy_fromiovec() and memcpy_toiovec() functions respectively. The >> memcpy_fromiovec

[PATCH] include/linux: avoid narrowing length parameter values

2015-05-18 Thread Louis Langholtz
parameter of type size_t. This also avoids a potential for data narrowing. Signed-off-by: Louis Langholtz -- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 45e0aa6..ee590fb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2708,12 +2708,12 @@ int

[PATCH] include/linux: avoid narrowing length parameter values

2015-05-18 Thread Louis Langholtz
parameter of type size_t. This also avoids a potential for data narrowing. Signed-off-by: Louis Langholtz lou_langho...@me.com -- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 45e0aa6..ee590fb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2708,12 +2708,12

Re: [PATCH] include/linux: avoid narrowing length parameter values

2015-05-18 Thread Louis Langholtz
On May 18, 2015, at 9:56 AM, Al Viro v...@zeniv.linux.org.uk wrote: On Mon, May 18, 2015 at 09:33:10AM -0600, Louis Langholtz wrote: memcpy_from_msg() and memcpy_to_msg() functions previously called memcpy_fromiovec() and memcpy_toiovec() functions respectively. The memcpy_fromiovec

Re: [tip:x86/build] x86/build: Remove -Wno-sign-compare

2015-05-13 Thread Louis Langholtz
On May 13, 2015, at 4:22 AM, Ingo Molnar wrote: > * valdis.kletni...@vt.edu wrote: > >> On Tue, 12 May 2015 10:44:15 +0200, Ingo Molnar said: >> >>> ... >>> Before I pushed out this -Wno-sign-compare change I made sure there >>> are no extra warnings generated on the 8 key configs I monitor

Re: [tip:x86/build] x86/build: Remove -Wno-sign-compare

2015-05-13 Thread Louis Langholtz
On May 13, 2015, at 4:22 AM, Ingo Molnar mi...@kernel.org wrote: * valdis.kletni...@vt.edu valdis.kletni...@vt.edu wrote: On Tue, 12 May 2015 10:44:15 +0200, Ingo Molnar said: ... Before I pushed out this -Wno-sign-compare change I made sure there are no extra warnings generated on the 8

[PATCH] x86: eliminate comparison between signed and unsigned integer expressions

2015-05-10 Thread Louis Langholtz
Eliminates multiple compiler warnings when the -Wno-sign-compare option is removed from the x86 Makefile (an option that is documented as a "Workaround for a gcc prelease that unfortunately was shipped in a suse release"). Signed-off-by: Louis Langholtz --- arch/x86/include/asm/uac

[PATCH] x86: eliminate comparison between signed and unsigned integer expressions

2015-05-10 Thread Louis Langholtz
Eliminates multiple compiler warnings when the -Wno-sign-compare option is removed from the x86 Makefile (an option that is documented as a Workaround for a gcc prelease that unfortunately was shipped in a suse release). Signed-off-by: Louis Langholtz lou_langho...@me.com --- arch/x86/include

Re: [PATCH 0/4] int to bool conversion

2015-01-30 Thread Louis Langholtz
While it may not be productive to perturb seemingly working code (as Rafael argues), it may also not be productive to have decreased code readability (as Quentin suggests). Personally I prefer readability enhancements over worrying about possibly breaking working code. I don't want to start a

Re: [PATCH 0/4] int to bool conversion

2015-01-30 Thread Louis Langholtz
While it may not be productive to perturb seemingly working code (as Rafael argues), it may also not be productive to have decreased code readability (as Quentin suggests). Personally I prefer readability enhancements over worrying about possibly breaking working code. I don't want to start a

[PATCH] kernel: avoid overflow in cmp_range

2015-01-14 Thread Louis Langholtz
Avoid overflow possibility. Signed-off-by: Louis Langholtz --- diff --git a/kernel/range.c b/kernel/range.c index 322ea8e..06d9ee7 100644 --- a/kernel/range.c +++ b/kernel/range.c @@ -113,12 +113,16 @@ static int cmp_range(const void *x1, const void *x2) { const struct range *r1 = x1

[PATCH] kernel: avoid overflow in cmp_range

2015-01-14 Thread Louis Langholtz
Avoid overflow possibility. Signed-off-by: Louis Langholtz lou_langho...@me.com --- diff --git a/kernel/range.c b/kernel/range.c index 322ea8e..06d9ee7 100644 --- a/kernel/range.c +++ b/kernel/range.c @@ -113,12 +113,16 @@ static int cmp_range(const void *x1, const void *x2) { const struct

[PATCH 3.18] kernel: avoid overflow in cmp_range()

2014-12-02 Thread Louis Langholtz
Avoid overflow possibility. Signed-off-by: Louis Langholtz --- diff --git a/kernel/range.c b/kernel/range.c index 322ea8e..06d9ee7 100644 --- a/kernel/range.c +++ b/kernel/range.c @@ -113,12 +113,16 @@ static int cmp_range(const void *x1, const void *x2) { const struct range *r1 = x1

[PATCH 3.18] kernel: avoid overflow in cmp_range()

2014-12-02 Thread Louis Langholtz
Avoid overflow possibility. Signed-off-by: Louis Langholtz lou_langho...@me.com --- diff --git a/kernel/range.c b/kernel/range.c index 322ea8e..06d9ee7 100644 --- a/kernel/range.c +++ b/kernel/range.c @@ -113,12 +113,16 @@ static int cmp_range(const void *x1, const void *x2) { const struct

[PATCH 3.18 v2] kernel: avoid possible overflow in range's cmp_range()

2014-11-25 Thread Louis Langholtz
Avoid overflow possibility. Signed-off-by: Louis Langholtz --- diff --git a/kernel/range.c b/kernel/range.c index 322ea8e..06d9ee7 100644 --- a/kernel/range.c +++ b/kernel/range.c @@ -113,12 +113,16 @@ static int cmp_range(const void *x1, const void *x2) { const struct range *r1 = x1

PATCH: avoid possible integer overflow with cmp_range() in kernel/range.c

2014-11-25 Thread Louis Langholtz
The cmp_range function (in kernel/range.c) is returning the difference between two s64 values (actually coming from u64 typed variables) in an int which can overflow (depending on the size of int). This function is used as a compare function for linux's sort function (in lib/sort.c). Linux's

PATCH: avoid possible integer overflow with cmp_range() in kernel/range.c

2014-11-25 Thread Louis Langholtz
The cmp_range function (in kernel/range.c) is returning the difference between two s64 values (actually coming from u64 typed variables) in an int which can overflow (depending on the size of int). This function is used as a compare function for linux's sort function (in lib/sort.c). Linux's

[PATCH 3.18 v2] kernel: avoid possible overflow in range's cmp_range()

2014-11-25 Thread Louis Langholtz
Avoid overflow possibility. Signed-off-by: Louis Langholtz lou_langho...@me.com --- diff --git a/kernel/range.c b/kernel/range.c index 322ea8e..06d9ee7 100644 --- a/kernel/range.c +++ b/kernel/range.c @@ -113,12 +113,16 @@ static int cmp_range(const void *x1, const void *x2) { const