[PATCH] trivial: net/irda/irlmp.c: Fix closing brace followed by if

2014-06-20 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- net/irda/irlmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index 98ad6ec..a5f28d4 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c @@ -1426,7 +1426,8 @@ __u8 *irlmp_hint_to_service(__u8 *hint

[PATCH] trivial: sound/core/seq/seq_memory.c: Fix closing brace followed by if

2014-06-20 Thread Rasmus Villemoes
Add a newline, and remove a space while at it. Signed-off-by: Rasmus Villemoes --- sound/core/seq/seq_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index 1e206de..4854c21 100644 --- a/sound/core/seq

[PATCH] trivial: fs/btrfs/tree-log.c: Fix closing brace followed by if

2014-06-20 Thread Rasmus Villemoes
Maybe "else if" was meant, but because of the goto out_unlock, it doesn't make a difference. Anyway, I chose the "only whitespace" fix. Signed-off-by: Rasmus Villemoes --- fs/btrfs/tree-log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/bt

[PATCH] trivial: drivers/staging/rtl8821ae/rtl8821ae: Fix closing brace followed by if

2014-06-20 Thread Rasmus Villemoes
sing -- is equivalent to flipping it). Signed-off-by: Rasmus Villemoes --- drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c ind

[PATCH] drivers/video/fbdev/sis: Add missing else

2014-06-20 Thread Rasmus Villemoes
The surrounding code and the fact that the previous two if's are rendered useless without this "else" (since SIS_340==55 and XGI_20==75 are greater than SIS_661==15) suggests that the "else" is indeed missing. Signed-off-by: Rasmus Villemoes --- drivers/video/fbdev/

[PATCH] checkpatch.pl: Also suggest 'else if' when if follows brace

2014-06-20 Thread Rasmus Villemoes
This might help a kernel hacker think twice before blindly adding a newline. Signed-off-by: Rasmus Villemoes --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 010b18e..e1924eb 100755 --- a/scripts

Re: [PATCH] trivial: drivers/staging/rtl8821ae/rtl8821ae: Fix closing brace followed by if

2014-06-20 Thread Rasmus Villemoes
Greg Kroah-Hartman writes: > On Fri, Jun 20, 2014 at 09:56:35PM +0200, Rasmus Villemoes wrote: >> All of the code is #if 0'd out, and the change just replaces a >> space with a newline, so this obviously doesn't change anything. > > How about just deleting all th

[PATCH] drivers/staging/rtl8821ae/rtl8821ae: Remove dead code

2014-06-20 Thread Rasmus Villemoes
This is all #if 0'ed out, and it contains some rather weird stuff (post-increment of a bool, for example). Nuke it. Signed-off-by: Rasmus Villemoes --- drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/staging/rtl8

[PATCH] net/wireless/brcm80211/brcmfmac: Make return type reflect actual semantics

2014-06-20 Thread Rasmus Villemoes
traversal and bit testing have no side effects, just return true immediately. Signed-off-by: Rasmus Villemoes --- Notes: Alternatively, if the function is supposed to return a count, the one-line fix would be - bool result = 0; + u32 result = 0; drivers/net/wireless/brcm80211

[PATCH 1/2] lib: list_sort_test(): Return -ENOMEM when allocation fails

2014-06-20 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- lib/list_sort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/list_sort.c b/lib/list_sort.c index 1183fa7..291412a 100644 --- a/lib/list_sort.c +++ b/lib/list_sort.c @@ -207,7 +207,7 @@ static int __init cmp(void *priv, struct

[PATCH 2/2] lib: list_sort_test(): Add extra corruption check

2014-06-20 Thread Rasmus Villemoes
Add a check to make sure that the prev pointer of the list head points to the last element on the list. Signed-off-by: Rasmus Villemoes --- lib/list_sort.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/list_sort.c b/lib/list_sort.c index 291412a..832f525 100644 --- a/lib

[PATCH v2] net/wireless/brcm80211/brcmfmac: Make return type and name reflect actual semantics

2014-06-21 Thread Rasmus Villemoes
traversal and bit testing have no side effects, just return true immediately. Its return value tells if any vif is up, so also rename it to brcmf_get_vif_state_any. Reviewed-by: Arend van Spriel Signed-off-by: Rasmus Villemoes --- Notes: v2: Rename wl_get_vif_state_all => brcmf_get_vif_state_

[PATCH v3] net/wireless/brcm80211/brcmfmac: Make return type and name reflect actual semantics

2014-06-22 Thread Rasmus Villemoes
traversal and bit testing have no side effects, just return true immediately. Its return value tells if any vif is in the specified state, so also rename it to brcmf_get_vif_state_any. Reviewed-by: Arend van Spriel Signed-off-by: Rasmus Villemoes --- Notes: v3: Fix thinko in commit message

[PATCH] kernel: timer.c: Small improvement in apply_slack()

2014-07-28 Thread Rasmus Villemoes
, but that is a false positive, since Coverity is not aware that mask != 0 implies that find_last_bit will not return BITS_PER_LONG. Signed-off-by: Rasmus Villemoes --- kernel/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/timer.c b/kernel/timer.c index 3bb01a3

[PATCH v2] drivers: tty: Merge alloc_tty_struct and initialize_tty_struct

2014-07-12 Thread Rasmus Villemoes
The two functions alloc_tty_struct and initialize_tty_struct are always called together. Merge them into alloc_tty_struct, updating its prototype and the only two callers of these functions. Signed-off-by: Rasmus Villemoes --- I hope this is sufficient. Thanks, Dan and Julia! v2: Don't

Re: [PATCH] pci: Add include guard to include/linux/pci_ids.h

2014-07-12 Thread Rasmus Villemoes
Bjorn Helgaas writes: > On Thu, Jul 10, 2014 at 02:05:11PM +0200, Rasmus Villemoes wrote: >> Adding an include guard frees the preprocessor from reparsing over >> 2600 #defines in the cases where pci_ids.h is somehow included more >> than once. This gives a tiny-but-m

[PATCH] drivers: tty: Fix use-after-free in pty_common_install

2014-07-12 Thread Rasmus Villemoes
ned-off-by: Rasmus Villemoes --- drivers/tty/pty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index ac723e3..9bbdb1d 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -388,7 +388,7 @@ err_deinit_tty: deinitialize_tty_st

[PATCH 1/2] staging: rtl8821ae: Pass large struct by const reference

2014-07-01 Thread Rasmus Villemoes
struct rtl_stats is rather huge (152 bytes), and since rtl8812ae_rx_command_packet_handler() does not modify it, it might as well be passed by const reference. Reported by Coverity: CID 1167285 Signed-off-by: Rasmus Villemoes --- drivers/staging/rtl8821ae/pci.c | 2 +- drivers/staging

[PATCH 2/2] staging: rtl8192ee: Pass large struct by const reference

2014-07-01 Thread Rasmus Villemoes
struct rtl_stats is rather huge (152 bytes), and since rtl92ee_rx_command_packet() does not modify it, it might as well be passed by const reference. Reported by Coverity: CID 1222131 Signed-off-by: Rasmus Villemoes --- drivers/staging/rtl8192ee/pci.c | 2 +- drivers/staging

[PATCH] drivers: message: fusion: Simplify rounding

2014-07-01 Thread Rasmus Villemoes
mageSize. Signed-off-by: Rasmus Villemoes --- drivers/message/fusion/mptbase.c | 7 +-- drivers/message/fusion/mptctl.c | 7 +-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index ebc0af7..10b16a1 1006

[PATCH] net: arcnet: Remove "#define bool int"

2014-07-02 Thread Rasmus Villemoes
appear before #include (the compiler wouldn't like "typedef _Bool int"). Since none of the files using arcdevice.h declare variables of type "bool", the patch is actually quite simple, unlike the commit message. Signed-off-by: Rasmus Villemoes --- include/linux/arcdevice.

[PATCH] staging: omap4iss: Fix type of struct iss_device::crashed

2014-07-02 Thread Rasmus Villemoes
blamed on index 0, which is unlikely to be what was intended. Signed-off-by: Rasmus Villemoes --- drivers/staging/media/omap4iss/iss.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/omap4iss/iss.h b/drivers/staging/media/omap4iss/iss.h index 05cd9bf.

Re: [PATCH] net: arcnet: Remove "#define bool int"

2014-07-02 Thread Rasmus Villemoes
Greg Kroah-Hartman writes: > On Wed, Jul 02, 2014 at 02:12:01PM +0200, Rasmus Villemoes wrote: > >> include/linux/arcdevice.h | 10 +++--- >> 1 file changed, 3 insertions(+), 7 deletions(-) > > Why are you sending this patch to me? I don't "ow

DNAME_INLINE_LEN versus CONFIG_GENERIC_LOCKBREAK

2014-07-03 Thread Rasmus Villemoes
Hi, In dcache.h, DNAME_INLINE_LEN is carefully chosen so that sizeof(struct dentry) is a (specific) multiple of 64 bytes. Obviously this breaks when certain debug options are chosen (DEBUG_LOCK_ALLOC and DEBUG_SPINLOCK), but also, AFAICT, on architectures with CONFIG_GENERIC_LOCKBREAK. I'm not su

[PATCH] scripts: modpost: Remove numeric suffix pattern matching

2014-07-09 Thread Rasmus Villemoes
For several years, the pattern "foo$" has effectively been treated as equivalent to "foo" due to a bug in the (misnamed) helper number_prefix(). This hasn't been observed to cause any problems, so remove the broken $ functionality and change all foo$ patterns to fo

[PATCH] pci: Add include guard to include/linux/pci_ids.h

2014-07-10 Thread Rasmus Villemoes
Adding an include guard frees the preprocessor from reparsing over 2600 #defines in the cases where pci_ids.h is somehow included more than once. This gives a tiny-but-measurable performance improvement when compiling such files. Signed-off-by: Rasmus Villemoes --- include/linux/pci_ids.h | 4

[PATCH] drivers: tty: Remove redundant memset() in initialize_tty_struct

2014-07-10 Thread Rasmus Villemoes
All callers (all two) of initialize_tty_struct() have just obtained the passed tty_struct from alloc_tty_struct(), which uses kzalloc(). So there is no reason to clear the memory again. Signed-off-by: Rasmus Villemoes --- drivers/tty/tty_io.c | 1 - 1 file changed, 1 deletion(-) diff --git a

[PATCH] drivers: tty: Merge alloc_tty_struct and initialize_tty_struct

2014-07-10 Thread Rasmus Villemoes
The two functions alloc_tty_struct and initialize_tty_struct are always called together. Merge them into alloc_tty_struct, updating its prototype and the only two callers of these functions. Signed-off-by: Rasmus Villemoes --- drivers/tty/pty.c| 19 +-- drivers/tty/tty_io.c

[PATCH 06/18] lib: bitmap: Make nbits parameter of bitmap_{and,or,xor,andnot} unsigned

2014-07-03 Thread Rasmus Villemoes
This change is only for consistency with the changes to the other bitmap_* functions; it doesn't change the size of the generated code: inside BITS_TO_LONGS there is a sizeof(long), which causes bits to be interpreted as unsigned anyway. Signed-off-by: Rasmus Villemoes --- include/

[PATCH 15/18] lib: bitmap: Micro-optimize bitmap_allocate_region

2014-07-03 Thread Rasmus Villemoes
__reg_op(..., REG_OP_ALLOC) always returns 0, so we might as well use that and save an instruction. Signed-off-by: Rasmus Villemoes --- lib/bitmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/bitmap.c b/lib/bitmap.c index c2f3807..faaf720 100644 --- a/lib/bitmap.c

[PATCH 17/18] lib: bitmap: Add missing mask in bitmap_and

2014-07-03 Thread Rasmus Villemoes
Apparently, bitmap_and is supposed to return whether the new bitmap is empty. But it didn't take potential garbage bits in the last word into account. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 2 +- lib/bitmap.c | 7 +-- 2 files changed, 6 insertions(

[PATCH 00/18] lib: bitmap: Various improvements

2014-07-03 Thread Rasmus Villemoes
mewhat annoying. Rasmus Villemoes (18): lib: bitmap: Make nbits parameter of bitmap_empty unsigned lib: bitmap: Make nbits parameter of bitmap_full unsigned lib: bitmap: Make nbits parameter of bitmap_equal unsigned lib: bitmap: Make nbits parameter of bitmap_complement unsigned lib:

[PATCH 16/18] lib: bitmap: Add missing mask in bitmap_shift_right

2014-07-03 Thread Rasmus Villemoes
There is no guarantee that *src does not contain garbage bits outside the lower nbits, so we need to mask it before the shift-and-assign. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bitmap.h b

[PATCH 18/18] lib: bitmap: Add missing mask in bitmap_andnot

2014-07-03 Thread Rasmus Villemoes
Apparently, bitmap_andnot is supposed to return whether the new bitmap is empty. But it didn't take potential garbage bits in the last word into account. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 2 +- lib/bitmap.c | 7 +-- 2 files changed, 6 insertions(

[PATCH 09/18] lib: bitmap: Make nbits parameter of bitmap_weight unsigned

2014-07-03 Thread Rasmus Villemoes
containing a call to bitmap_weight(). Certainly an int is capable of holding the result. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 4 ++-- lib/bitmap.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/bitmap.h b/include/linux/bi

[PATCH 08/18] lib: bitmap: Make nbits parameter of bitmap_subset unsigned

2014-07-03 Thread Rasmus Villemoes
The compiler can generate slightly smaller and simpler code when it knows that "nbits" is non-negative. Since no-one passes a negative bit-count, this shouldn't affect the semantics. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 4 ++-- lib/bitmap.c |

[PATCH 11/18] lib: bitmap: Make the start index of bitmap_clear unsigned

2014-07-03 Thread Rasmus Villemoes
The compiler can generate slightly smaller and simpler code when it knows that "start" is non-negative. Also, use the names "start" and "len" for the two parameters for consistency with bitmap_set. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 2 +

[PATCH 13/18] lib: bitmap: Fix typo in kerneldoc for bitmap_pos_to_ord

2014-07-03 Thread Rasmus Villemoes
A few lines above, it was stated that positions for non-set bits are mapped to -1, which is obviously also what the code does. Signed-off-by: Rasmus Villemoes --- lib/bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bitmap.c b/lib/bitmap.c index d4b3a6d..2714df9

[PATCH 14/18] lib: bitmap: Change parameter of bitmap_*_region to unsigned

2014-07-03 Thread Rasmus Villemoes
error code to be returned. An int is certainly capable of representing any realistic return value. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 6 +++--- lib/bitmap.c | 12 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/bitmap.h

[PATCH 12/18] lib: bitmap: Simplify bitmap_parselist

2014-07-03 Thread Rasmus Villemoes
We want len to be the index of the first '\n', or the length of the string if there is no newline. This is a good example of the usefulness of strchrnul(). Use that instead, thus eliminating a branch and a call to strlen(). Signed-off-by: Rasmus Villemoes --- lib/bitmap.c | 9 ++-

[PATCH 10/18] lib: bitmap: Make the start index of bitmap_set unsigned

2014-07-03 Thread Rasmus Villemoes
The compiler can generate slightly smaller and simpler code when it knows that "start" is non-negative. Also, use the names "start" and "len" for the two parameters in both header file and implementation, instead of the previous mix. Signed-off-by: Rasmus Villemoe

[PATCH 07/18] lib: bitmap: Make nbits parameter of bitmap_intersects unsigned

2014-07-03 Thread Rasmus Villemoes
The compiler can generate slightly smaller and simpler code when it knows that "nbits" is non-negative. Since no-one passes a negative bit-count, this shouldn't affect the semantics. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 4 ++-- lib/bitmap.c |

[PATCH 03/18] lib: bitmap: Make nbits parameter of bitmap_equal unsigned

2014-07-03 Thread Rasmus Villemoes
The compiler can generate slightly smaller and simpler code when it knows that "nbits" is non-negative. Since no-one passes a negative bit-count, this shouldn't affect the semantics. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 2 +- lib/bitmap.c |

[PATCH 04/18] lib: bitmap: Make nbits parameter of bitmap_complement unsigned

2014-07-03 Thread Rasmus Villemoes
The compiler can generate slightly smaller and simpler code when it knows that "nbits" is non-negative. Since no-one passes a negative bit-count, this shouldn't affect the semantics. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 6 +++--- lib/bitmap.c |

[PATCH 02/18] lib: bitmap: Make nbits parameter of bitmap_full unsigned

2014-07-03 Thread Rasmus Villemoes
The compiler can generate slightly smaller and simpler code when it knows that "nbits" is non-negative. Since no-one passes a negative bit-count, this shouldn't affect the semantics. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 4 ++-- lib/bitmap.c |

[PATCH 05/18] lib: bitmap: Remove unnecessary mask from bitmap_complement

2014-07-03 Thread Rasmus Villemoes
Since the extra bits are "don't care", there is no reason to mask the last word to the used bits when complementing. This shaves off yet a few bytes. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 2 +- lib/bitmap.c | 2 +- 2 files changed, 2 insertions(

[PATCH 01/18] lib: bitmap: Make nbits parameter of bitmap_empty unsigned

2014-07-03 Thread Rasmus Villemoes
The compiler can generate slightly smaller and simpler code when it knows that "nbits" is non-negative. Since no-one passes a negative bit-count, this shouldn't affect the semantics. Signed-off-by: Rasmus Villemoes --- include/linux/bitmap.h | 4 ++-- lib/bitmap.c |

[PATCH 0/2] Per-task wait_queue_t

2014-06-10 Thread Rasmus Villemoes
es, but not actually tested. [1] http://thread.gmane.org/gmane.linux.kernel/1720670 Rasmus Villemoes (2): wait: Introduce per-task wait_queue_t wait: Use the per-task wait_queue_t in ___wait_event macro include/linux/sched.h | 23 +++ include/linux/w

[PATCH 1/2] wait: Introduce per-task wait_queue_t

2014-06-10 Thread Rasmus Villemoes
eed "leaf waiters", make all access through two helper functions. Signed-off-by: Rasmus Villemoes --- include/linux/sched.h | 23 +++ include/linux/wait.h | 1 + kernel/fork.c | 1 + 3 files changed, 25 insertions(+) diff --git a/include/linux/sched.h b/

[PATCH 2/2] wait: Use the per-task wait_queue_t in ___wait_event macro

2014-06-10 Thread Rasmus Villemoes
The ___wait_event macro satisfies the requirements for making use of the per-task wait_queue_t, so use it. This should make the stack footprint of all users of the wait_event_* macros smaller. Signed-off-by: Rasmus Villemoes --- include/linux/wait.h | 17 + 1 file changed, 9

Re: [PATCH 0/2] Per-task wait_queue_t

2014-06-12 Thread Rasmus Villemoes
Peter Zijlstra writes: > On Tue, Jun 10, 2014 at 02:29:17PM +0200, Rasmus Villemoes wrote: >> This is an attempt to reduce the stack footprint of various functions >> (those using any of the wait_event_* macros), by removing the need to >> allocate a wait_queue_t on the st

Re: [RFC 2/2] x86_64: expand kernel stack to 16K

2014-06-03 Thread Rasmus Villemoes
Possibly stupid question: Is it true that any given task can only be using one wait_queue_t at a time? If so, would it be an idea to put a wait_queue_t into struct task_struct [maybe union'ed with a struct wait_bit_queue] and avoid allocating this 40 byte structure repeatedly on the stack. E.g., i

[PATCH trivial] include/linux/socket.h: Fix comment

2014-06-04 Thread Rasmus Villemoes
File descriptors are always closed on exit :-) Signed-off-by: Rasmus Villemoes --- include/linux/socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/socket.h b/include/linux/socket.h index 8e98297..99d2466 100644 --- a/include/linux/socket.h +++ b/include

[PATCH/RFC] scripts: Add stack-o-meter

2014-06-17 Thread Rasmus Villemoes
o-meter.pl --sort delta gcc4.6 gcc4.7 Signed-off-by: Rasmus Villemoes --- scripts/stack-o-meter.pl | 482 +++ 1 file changed, 482 insertions(+) create mode 100755 scripts/stack-o-meter.pl diff --git a/scripts/stack-o-meter.pl b/scripts/stack-o-meter

[PATCH v2] trivial: sound/core/seq/seq_memory.c: Fix closing brace followed by if

2014-06-23 Thread Rasmus Villemoes
Add a newline and, while at it, remove a space and redundant braces. Signed-off-by: Rasmus Villemoes --- sound/core/seq/seq_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index 1e206de..ba8e4a6 100644

Re: [PATCH 2/2] lib: list_sort_test(): Add extra corruption check

2014-06-23 Thread Rasmus Villemoes
Rasmus Villemoes writes: > Add a check to make sure that the prev pointer of the list head points > to the last element on the list. > > Signed-off-by: Rasmus Villemoes > --- > lib/list_sort.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/lib/li

[PATCH v2 0/4] lib: list_sort: Various minor improvements

2014-06-24 Thread Rasmus Villemoes
Reading the source of lib/list_sort.c, I came up with a few possible improvements. I think 4/4 may be a bit controversial, but 1/4, 2/4 and 3/4 should be straightforward. v2: Fix typo in 2/4, and add 3/4,4/4. Rasmus Villemoes (4): lib: list_sort_test(): Return -ENOMEM when allocation fails

[PATCH v2 2/4] lib: list_sort_test(): Add extra corruption check

2014-06-24 Thread Rasmus Villemoes
Add a check to make sure that the prev pointer of the list head points to the last element on the list. Signed-off-by: Rasmus Villemoes --- lib/list_sort.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/list_sort.c b/lib/list_sort.c index 291412a..fbdbc86 100644 --- a/lib

[PATCH v2 1/4] lib: list_sort_test(): Return -ENOMEM when allocation fails

2014-06-24 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- lib/list_sort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/list_sort.c b/lib/list_sort.c index 1183fa7..291412a 100644 --- a/lib/list_sort.c +++ b/lib/list_sort.c @@ -207,7 +207,7 @@ static int __init cmp(void *priv, struct

[PATCH v2 3/4] lib: list_sort_test(): Simplify and harden cleanup

2014-06-24 Thread Rasmus Villemoes
elements. Minor details: Use sizeof(*elts) instead of sizeof(void *), and return err immediately when allocation of elts fails, to avoid introducing another label just before the final return statement. Signed-off-by: Rasmus Villemoes --- lib/list_sort.c | 12 +--- 1 file changed, 5

[PATCH v2 4/4] lib: list_sort.c: Limit number of unused cmp callbacks

2014-06-24 Thread Rasmus Villemoes
at least two function calls for every two pointer assignments is a bit excessive. This patch limits the calls to once for every 256 iterations. Signed-off-by: Rasmus Villemoes --- lib/list_sort.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/list_sort.c b/lib/list_sort

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Rasmus Villemoes
Joe Perches writes: > On Mon, 2014-06-23 at 08:23 +0200, Mathias Krause wrote: >> On 23 June 2014 00:56, Joe Perches wrote: >> > On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote: >> >> [...] patch 2 adds some syntactical sugar for the most popular use >> >> case, by providing pr_ alike ma

[PATCH 6/6] include/rxrpc/types.h: Remove unused header

2014-06-24 Thread Rasmus Villemoes
The header file include/rxrpc/types.h does not seem to be used anywhere. It was orphaned by 63b6be55 "[AF_RXRPC]: Delete the old RxRPC code.". Remove it. Signed-off-by: Rasmus Villemoes --- include/rxrpc/types.h | 41 - 1 file changed, 41

[PATCH 3/6] include/linux/mfd/ti_ssp.h: Remove unused header

2014-06-24 Thread Rasmus Villemoes
The header file include/linux/mfd/ti_ssp.h does not seem to be used anywhere. It was orphaned by 3033ee62 "mfd: Remove obsolete ti-ssp driver". Remove it. Signed-off-by: Rasmus Villemoes --- include/linux/mfd/ti_ssp.h | 93 -- 1 file c

[PATCH 5/6] include/linux/platform_data/tegra_emc.h: Remove unused header

2014-06-24 Thread Rasmus Villemoes
The header file include/linux/platform_data/tegra_emc.h does not seem to be used anywhere. It was orphaned by a7cbe92c "ARM: tegra: remove tegra EMC scaling driver". Remove it. Signed-off-by: Rasmus Villemoes --- include/linux/platform_data/tegra_emc.h | 34 --

[PATCH 4/6] include/linux/phonedev.h: Remove unused header

2014-06-24 Thread Rasmus Villemoes
The header file include/linux/phonedev.h does not seem to be used anywhere. It was orphaned by 7326446c "Staging: remove telephony drivers". Remove it. Signed-off-by: Rasmus Villemoes --- include/linux/phonedev.h | 25 - 1 file changed, 25 deletions(-) d

[PATCH 0/6] Remove various orphaned header files

2014-06-24 Thread Rasmus Villemoes
AFAICT, these headers are not used anywhere, and are just accidental leftovers from past cleanups. Rasmus Villemoes (6): include/linux/cycx_x25.h: Remove unused header include/linux/i82593.h: Remove unused header include/linux/mfd/ti_ssp.h: Remove unused header include/linux/phonedev.h

[PATCH 1/6] include/linux/cycx_x25.h: Remove unused header

2014-06-24 Thread Rasmus Villemoes
The header file include/linux/cycx_x25.h does not seem to be used anywhere. It was orphaned by 6fcdf4facb "wanrouter: delete now orphaned header content, files/drivers". Remove it. Signed-off-by: Rasmus Villemoes --- include/linux/cycx_x

[PATCH 2/6] include/linux/i82593.h: Remove unused header

2014-06-24 Thread Rasmus Villemoes
The header file include/linux/i82593.h does not seem to be used anywhere. It was orphaned by 8a594170 "drivers/net: delete intel i825xx based znet notebook driver". Remove it. Signed-off-by: Rasmus Villemoes --- include/linux/i82593.h | 229 --

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-25 Thread Rasmus Villemoes
Mathias Krause writes: > On 24 June 2014 16:31, Rasmus Villemoes wrote: >> gcc already seems to contain infrastructure for this kind of thing, so >> maybe it doesn't even require a plugin, but simply a little coordination >> with the gcc folks. This snippet from gc

[PATCH] scripts/mod/modpost.c: Fix bug in number_prefix

2014-06-25 Thread Rasmus Villemoes
x27;, which obviously fails to be a digit. Signed-off-by: Rasmus Villemoes --- scripts/mod/modpost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 9d9c5b9..336f45f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/

Re: [PATCH v2 0/4] lib: list_sort: Various minor improvements

2014-06-25 Thread Rasmus Villemoes
Andrew Morton writes: > On Tue, 24 Jun 2014 12:06:27 +0200 Rasmus Villemoes > wrote: > >> Reading the source of lib/list_sort.c, I came up with a few possible >> improvements. I think 4/4 may be a bit controversial, but 1/4, 2/4 and >> 3/4 should be straightforward.

Re: [PATCH v2 0/4] lib: list_sort: Various minor improvements

2014-06-25 Thread Rasmus Villemoes
Andrew Morton writes: > On Thu, 26 Jun 2014 00:28:18 +0200 Rasmus Villemoes > wrote: > >> Minor comment: Won't this end up saying "list_sort_test: list passed to >> ...", despite the list coming from a 'real' user? Maybe change the first >>

Re: [PATCH] scripts/mod/modpost.c: Fix bug in number_prefix

2014-06-25 Thread Rasmus Villemoes
Paul Gortmaker writes: > On 14-06-25 04:46 AM, Rasmus Villemoes wrote: >> The function number_prefix() can currently only return 1 if its >> argument is the empty string: If line 3 is reached and *sym (now the >> second character in the argument) is not '.', 0 i

Re: [PATCH] net: ethernet: broadcom: bnx2x: Remove redundant #ifdef

2014-08-22 Thread Rasmus Villemoes
David Miller writes: > From: Rasmus Villemoes > Date: Wed, 20 Aug 2014 15:14:49 +0200 > >> Nothing defines _ASM_GENERIC_INT_L64_H, it is a weird way to check for >> 64 bit longs, and u64 should be printed using %llx anyway. >> >> Signed-off-by: Rasmus Villemo

[PATCH] sound: pci: ca0132_regs.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- sound/pci/hda/ca0132_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/ca0132_regs.h b/sound/pci/hda/ca0132_regs.h index 07e7609..8371274 100644 --- a/sound/pci/hda/ca0132_regs.h +++ b/sound/pci/hda/ca0132_regs.h @@ -20,7

[PATCH] sound: pci: ct20k1reg: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- sound/pci/ctxfi/ct20k1reg.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/pci/ctxfi/ct20k1reg.h b/sound/pci/ctxfi/ct20k1reg.h index f2e34e3..5851249 100644 --- a/sound/pci/ctxfi/ct20k1reg.h +++ b/sound/pci/ctxfi/ct20k1reg.h

[PATCH] sound: soc: da732x.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- sound/soc/codecs/da732x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/da732x.h b/sound/soc/codecs/da732x.h index 1dceafe..f586cbd 100644 --- a/sound/soc/codecs/da732x.h +++ b/sound/soc/codecs/da732x.h @@ -11,7 +11,7

[PATCH] sound: tegra: tegra_asoc_utils.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- sound/soc/tegra/tegra_asoc_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/tegra/tegra_asoc_utils.h b/sound/soc/tegra/tegra_asoc_utils.h index 9577121..ca80376 100644 --- a/sound/soc/tegra/tegra_asoc_utils.h +++ b/sound

[PATCH 3/3] x86: xen/smp.h: Add missing #define

2014-08-22 Thread Rasmus Villemoes
The #define is missing from the include guard idiom. Signed-off-by: Rasmus Villemoes --- arch/x86/xen/smp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/xen/smp.h b/arch/x86/xen/smp.h index c7c2d89..b4f1561 100644 --- a/arch/x86/xen/smp.h +++ b/arch/x86/xen/smp.h @@ -1,4 +1,5

[PATCH 1/3] x86: kernel/tls.h: Add missing #define

2014-08-22 Thread Rasmus Villemoes
The macro name suggests that the include guard idiom was meant, but the #define was missing. Signed-off-by: Rasmus Villemoes --- arch/x86/kernel/tls.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/tls.h b/arch/x86/kernel/tls.h index 2f083a2..a18e48b 100644 --- a/arch/x86

[PATCH 2/3] x86: xen/mmu.h: Add missing #define

2014-08-22 Thread Rasmus Villemoes
The #define is missing from the include guard idiom. Signed-off-by: Rasmus Villemoes --- arch/x86/xen/mmu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h index 73809bb..0675f8c 100644 --- a/arch/x86/xen/mmu.h +++ b/arch/x86/xen/mmu.h @@ -1,4 +1,5

[PATCH 2/2] drivers/gpu/drm/vmwgfx/vmwgfx_fence.h: Add missing #define

2014-08-22 Thread Rasmus Villemoes
The name of the macro suggests that the include guard idiom was meant, but the #define was missing. Signed-off-by: Rasmus Villemoes --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h b/drivers/gpu/drm/vmwgfx

[PATCH 1/2] drivers/gpu/drm/exynos/exynos_drm_fb.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/gpu/drm/exynos/exynos_drm_fb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.h b/drivers/gpu/drm/exynos/exynos_drm_fb.h index 517471b..09ce2bc 100644 --- a/drivers/gpu/drm/exynos

[PATCH] drivers/ipack/devices/ipoctal.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/ipack/devices/ipoctal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ipack/devices/ipoctal.h b/drivers/ipack/devices/ipoctal.h index 28f1c42..7fede0e 100644 --- a/drivers/ipack/devices/ipoctal.h +++ b/drivers/ipack

[PATCH] drivers: net: wireless: Add include guards

2014-08-22 Thread Rasmus Villemoes
The files ray_cs.h and rayctl.h both contain two thirds of what appears to be an include guard using the macro name RAYLINK_H (both lack the #define). Since RAYLINK_H is not defined anywhere, the guards using different macro names. Signed-off-by: Rasmus Villemoes --- drivers/net/wireless

[PATCH] drivers: scsi: #define missing include guards

2014-08-22 Thread Rasmus Villemoes
The four files aha1542.h, aha1740.h, gvp11.h and mvme147.h under drivers/scsi/ contain two-thirds of an include guard, but do not elsewhere. Signed-off-by: Rasmus Villemoes --- drivers/scsi/aha1542.h | 1 + drivers/scsi/aha1740.h | 1 + drivers/scsi/gvp11.h | 1 + drivers/scsi/mvme147.h | 1

[PATCH] drivers: target: target_core_ua_h: Add #define of include guard

2014-08-22 Thread Rasmus Villemoes
Clearly the file was meant to contain an include guard, but it was missing the #define part. Signed-off-by: Rasmus Villemoes --- drivers/target/target_core_ua.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/target/target_core_ua.h b/drivers/target/target_core_ua.h index be912b3

[PATCH] drivers: usb: gadget: fusb300_udc.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/usb/gadget/udc/fusb300_udc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fusb300_udc.h b/drivers/usb/gadget/udc/fusb300_udc.h index ae811d8..ad39f89 100644 --- a/drivers/usb/gadget/udc/fusb300_udc.h +++ b

[PATCH] dt-bindings/mfs/palmas.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- include/dt-bindings/mfd/palmas.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dt-bindings/mfd/palmas.h b/include/dt-bindings/mfd/palmas.h index 2c8ac48..f4db7df 100644 --- a/include/dt-bindings/mfd/palmas.h +++ b/include/dt

Re: [PATCH] drivers: scsi: #define missing include guards

2014-08-22 Thread Rasmus Villemoes
Rasmus Villemoes writes: > The four files aha1542.h, aha1740.h, gvp11.h and mvme147.h under > drivers/scsi/ contain two-thirds of an include guard, but do not > elsewhere. > Argh, git commit ate a line because it happened to start with #. This was supposed to be something like &q

Re: [PATCH] drivers: net: wireless: Add include guards

2014-08-22 Thread Rasmus Villemoes
Rasmus Villemoes writes: > The files ray_cs.h and rayctl.h both contain two thirds of what > appears to be an include guard using the macro name RAYLINK_H (both > lack the #define). Since RAYLINK_H is not defined anywhere, the > guards using different macro names. > I need to

[PATCH v2] drivers: usb: gadget: fusb300_udc.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Clearly this was meant to be an include guard, but a trailing underscore was missing. It has been this way since the file was introduced in 0fe6f1d1 ("usb: udc: add Faraday fusb300 driver"). Signed-off-by: Rasmus Villemoes --- drivers/usb/gadget/udc/fusb300_udc.h | 2 +- 1 file

Re: [PATCH v2] drivers: usb: gadget: fusb300_udc.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Felipe Balbi writes: > On Fri, Aug 22, 2014 at 04:44:33PM +0200, Rasmus Villemoes wrote: >> Clearly this was meant to be an include guard, but a trailing >> underscore was missing. It has been this way since the file was >> introduced in 0fe6f1d1 ("usb: udc:

Re: [PATCH 0/6] Remove various orphaned header files

2014-08-22 Thread Rasmus Villemoes
Joe Perches writes: > On Tue, 2014-06-24 at 19:27 +0200, Rasmus Villemoes wrote: >> AFAICT, these headers are not used anywhere, and are just accidental >> leftovers from past cleanups. > > Thanks. Did anyone pick these [1] up? All six files still seem to be present. Tha

Re: [PATCH] Kbuild: x86: Eliminate duplicate command line options

2014-08-22 Thread Rasmus Villemoes
Rasmus Villemoes writes: > The options -mno-mmx and -mno-sse are unconditionally added to > KBUILD_CFLAGS in both branches of an ifeq and through a $(cc-option) > further down. We can safely remove the first instances. > > In fact, since the -mno-mmx and -mno-sse options

[PATCH] drivers: crypto: mv_cesa.h: Add missing #define

2014-08-22 Thread Rasmus Villemoes
Clearly this was meant to be an include guard, but the #define was missing. Signed-off-by: Rasmus Villemoes --- drivers/crypto/mv_cesa.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/mv_cesa.h b/drivers/crypto/mv_cesa.h index 08fcb11..9249d3e 100644 --- a/drivers/crypto

[PATCH] drivers: isdn: eicon: xdi_msg.h: Fix typo in #ifndef

2014-08-22 Thread Rasmus Villemoes
Test for definedness of the macro which is actually defined (the change is hard to see: it is s/SSS/SSA/). Signed-off-by: Rasmus Villemoes --- drivers/isdn/hardware/eicon/xdi_msg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/isdn/hardware/eicon/xdi_msg.h b

[PATCH] drivers: media: b2c2: flexcop.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Three trailing underscores is one too many. Signed-off-by: Rasmus Villemoes --- drivers/media/common/b2c2/flexcop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/b2c2/flexcop.h b/drivers/media/common/b2c2/flexcop.h index 897b10c..8942bda 100644 --- a

[PATCH] drivers: media: i2c: adv7343_regs.h: Fix typo in #ifndef

2014-08-22 Thread Rasmus Villemoes
Test for definedness of the macro which is actually defined, and which matches the name of the file. Signed-off-by: Rasmus Villemoes --- drivers/media/i2c/adv7343_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv7343_regs.h b/drivers/media/i2c

<    4   5   6   7   8   9   10   11   12   13   >