Removing this include produces byte-identical output, and thus removes
a false dependency.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/genalloc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/genalloc.c b/lib/genalloc.c
index 2e65d206b01c..17d8f58f6716 100644
We don't need all the stuff kernel.h pulls in; just compiler.h since
export.h doesn't do necessary #includes. This removes more than 100
dependencies.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/lcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib
stmp_device.c only needs EXPORT_SYMBOL, so just include compiler.h and
export.h instead of the whole module.h machinery.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/stmp_device.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/stmp_device.c b/lib
strncpy_from_user.c only needs EXPORT_SYMBOL, so just include
compiler.h and export.h instead of the whole module.h machinery.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/strncpy_from_user.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib
The file doesn't seem to use anything from linux/user_namespace.h, and
removing it yields byte-identical object code and strictly fewer
dependencies in the .cmd file.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/kobject_uevent.c | 1 -
1 file changed, 1 deletion(-)
diff
.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/percpu_ida.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/percpu_ida.c b/lib/percpu_ida.c
index 93d145e5539c..f75715131f20 100644
--- a/lib/percpu_ida.c
+++ b/lib/percpu_ida.c
@@ -19,13 +19,10 @@
#include linux/bug.h
Removing the include of linux/spinlock.h produces byte-identical
output for {allno,def}config, and identical objdump -d output for
allyesconfig. In the former two cases, more than a 100 lines are
eliminated from the generated dependency file.
Signed-off-by: Rasmus Villemoes li
The comment helpfully explains why hardirq.h is included, but since
2d4b84739f0a (hardirq: Split preempt count mask definitions)
in_interrupt() has been provided by preempt_mask.h. Use that instead,
saving around 40 lines in the generated dependency file.
Signed-off-by: Rasmus Villemoes li
show_mem.c doesn't use anything from nmi.h. Removing it yields
identical objdump -d output for each of {allyes,allno,def}config and
eliminates more than 100 lines in the dependency file.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/show_mem.c | 1 -
1 file changed, 1 deletion
nlattr.c doesn't seem to rely on anything from netdevice.h. Removing
it yields identical objdump -d output for each of {allyes,allno,def}config,
and eliminates more than 200 lines from the generated dependency file.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/nlattr.c | 1
idr.c doesn't seem to use anything from hardirq.h (or anything
included from that). Removing it produces identical objdump -d output,
and gives 44 fewer lines in the .idr.o.cmd dependency file.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/idr.c | 1 -
1 file changed, 1
This file doesn't seem to use anything provided by linux/interrupt.h
or anything recursively included through that. Removing it produces
byte-identical output, while reducing .llist.o.cmd from 541 to 156
lines.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/llist.c | 1 -
1
md5.c doesn't use anything from kernel.h, except that that pulls in
compiler.h, which is needed for the export.h to work.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/md5.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/md5.c b/lib/md5.c
index
.sort.o.cmd.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/sort.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/sort.c b/lib/sort.c
index 926d00429ed2..14fc1dfadb3f 100644
--- a/lib/sort.c
+++ b/lib/sort.c
@@ -4,8 +4,8 @@
* Jan 23 2005 Matt Mackall m
, but only if
!CONFIG_DYNAMIC_DEBUG, so just include it explicitly (for memset).
objdump -d says the generated code is the same, and wc -l says that
lib/.list_sort.o.cmd went from 579 to 165 lines.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/list_sort.c | 7 +--
1 file
/types.h in order for gcc not to complain
about unknown types.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/cryptohash.h | 2 ++
lib/halfmd4.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/cryptohash.h b/include/linux
The file uses nothing from init.h, and also doesn't need the full
module.h machinery; export.h is sufficient. The latter requires the
user to ensure compiler.h is included, so do that explicitly instead
of relying on some other header pulling it in.
Signed-off-by: Rasmus Villemoes li
files, but that is of course at the same time a huge can of
worms, involving boatloads of tree-wide patches updating users to
include what they use directly. So before I start doing that, I'd like
to hear if people think it would be futile.
Rasmus Villemoes (19):
lib/interval_tree.c: Simplify
The file doesn't use anything from ctype.h. Instead of module.h, just
use export.h for EXPORT_SYMBOL. The latter requires the user to
include compiler.h, so do that explicitly instead of relying on some
other header pulling it in.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib
their u8
or __le32 buffers without a cast.
Furthermore, this allows us to simply let bitmap_copy_le be an alias
for bitmap_copy on little-endian; see next patch.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 2 +-
lib/bitmap.c | 9 -
2
On little-endian, there's no reason to have an extra, presumably less
efficient, way of copying a bitmap.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 4
lib/bitmap.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/include/linux
Now that all in-tree users of strnicmp have been converted to
strncasecmp, the wrapper can be removed.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Notes:
For 3.20.
The #undef __HAVE_ARCH_STRNICMP in arch/s390/include/asm/string.h is
a no-op, so removing
I found some patches in a long-forgotten branch - they still applied
cleanly, so I spiced them up with a few extra simplifications and
signed-unsigned conversions.
Rasmus Villemoes (8):
lib: bitmap: More signed-unsigned conversions
linux/nodemask.h: Update bitmap wrappers to take unsigned int
For consistency with the other bitmap_* functions, also make the nbits
parameter of bitmap_zero, bitmap_fill and bitmap_copy unsigned.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff
Make the nbits parameter unsigned for consistency with most other
bitmap_* functions, and pull the test of empty dst out of the loop.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 2 +-
lib/bitmap.c | 23 ++-
2 files changed
Change the sz and nbits parameters of bitmap_fold to unsigned int for
consistency with other bitmap_* functions, and to save another few
bytes in the generated code.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 2 +-
lib/bitmap.c | 8
2
of bitmap_pos_to_ord. Since
the static inline frontend bitmap_weight doesn't handle nbits==0
correctly (it would behave exactly as if nbits==BITS_PER_LONG), use
__bitmap_weight.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Notes:
Alternatively, the last line could be spelled bitmap_weight
Change the nbits parameter of bitmap_onto to unsigned int for
consistency with other bitmap_* functions.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 2 +-
lib/bitmap.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git
(unofficial) 0. No current users are affected by this change.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 2 +-
lib/bitmap.c | 28 +++-
2 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/include/linux
Since the various bitmap_* functions now take an unsigned int as nbits
parameter, it makes sense to also update the various wrappers, even
though they're marked as obsolete.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/cpumask.h | 22 +++---
1 file
Since the various bitmap_* functions now take an unsigned int as nbits
parameter, it makes sense to also update the various wrappers.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/nodemask.h | 26 +-
1 file changed, 13 insertions(+), 13
Commit 836bee9eee6d (Staging: unisys: remove references to __DATE__
and __TIME__) removed most; this seems to be an accidental
leftover. VERSIONDATE is not used anywhere.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/staging/unisys/common-spar/include/version.h | 1 -
1
Since fe7c36c7 (Makefile: Build with -Werror=date-time if the
compiler supports it), use of __DATE__, __TIME__, __TIMESTAMP__ has
been disallowed. This hasn't prevented a few new users from creeping
in. Make checkpatch complain.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
The macro __DATE__ and friends is not allowed in the kernel. Also,
including the build time in output doesn't seem to provide any value.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/acpi/acpica/acapps.h | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff
On Fri, Dec 12 2014, Mark Brown broo...@kernel.org wrote:
On Tue, Dec 09, 2014 at 10:53:41PM +0100, Rasmus Villemoes wrote:
if (a-reg != b-reg)
return a-reg - b-reg;
-if (a-dapm != b-dapm)
-return (unsigned long)a-dapm - (unsigned long)b-dapm
string_get_size was documented to return an error, but in fact always
returned 0. Since the output always fits in 9 bytes, just document
that and let callers do what they do now: Pass a small stack buffer
and ignore the return value.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
replace a do_div with an ordinary 32/32 bit
division.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/string_helpers.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/string_helpers.c b/lib/string_helpers.c
index 0d25f7aa732c..2b3757f84b3b 100644
sentinel; once
we reach E size is at most 18. [The test is also wrong; it should be
units_str[units][i+1]; if we've reached NULL we're already doomed.]
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/string_helpers.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff
lines.
Rasmus Villemoes (3):
trace: Replace seq_printf by simpler equivalents
trace: Merge consecutive seq_puts calls
trace: Replace single-character seq_puts with seq_putc
kernel/trace/ftrace.c| 30 +++---
kernel/trace/trace.c | 78
Consecutive seq_puts calls with literal strings can be merged to a
single call. This reduces the size of the generated code, and can also
lead to slight .rodata reduction (because of fewer nul and padding
bytes). It should also shave a off a few clock cycles.
Signed-off-by: Rasmus Villemoes li
will simplify further.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
kernel/trace/ftrace.c| 30
kernel/trace/trace.c | 44 ++--
kernel/trace/trace_branch.c | 26
Printing a single character to a seqfile might as well be done with
seq_putc instead of seq_puts; this avoids a strlen() call and a memory
access. It also shaves another few bytes off the generated code.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
kernel/trace/ftrace.c
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/BusLogic.c | 10 +-
drivers/scsi/NCR5380.c
Using seq_putc to print a single character saves at least a strlen()
call and a memory access, and may also give a small .text reduction.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/NCR5380.c | 2 +-
drivers/scsi/advansys.c | 34
The macro SPRINTF doesn't save a lot of typing or make the code more
readable, and depending on a specific identifier (m) in the
surrounding scope is generally frowned upon. Nuke it.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/NCR5380.c | 20 ++-
drivers/scsi
Consecutive seq_puts calls with literal strings may be replaced by a
single call, saving a little .text.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/advansys.c | 43 +++
drivers/scsi/atp870u.c | 5 ++---
drivers
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/advansys.c | 155
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/aha152x.c | 248
the semantics of the code (well, that's the
idea anyway), but should make it slightly smaller and faster.
v2: Redone on top of git://git.infradead.org/users/hch/scsi-queue.git
drivers-for-3.19
Rasmus Villemoes (6):
scsi: Remove SPRINTF macro
scsi/advansys: Replace seq_printf with seq_puts
scsi
On Fri, Dec 12 2014, Joe Perches j...@perches.com wrote:
On Fri, 2014-12-12 at 11:51 +0100, Rasmus Villemoes wrote:
Since fe7c36c7 (Makefile: Build with -Werror=date-time if the
compiler supports it), use of __DATE__, __TIME__, __TIMESTAMP__ has
been disallowed. This hasn't prevented a few
... and rename it to nbits, both for consistency with other bitmap_*
functions.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
This is meant to replace 8/8 (lib: bitmap: Minor changes of
bitmap_remap), if you haven't gotten to that yet. No big deal either
way.
v2: Only do
Also, rename bits to nbits. Both changes for consistency with other
bitmap_* functions.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Notes:
v3: Hopefully complete and unambiguous commit log.
v2: Only do the signed-unsigned conversion. bitmap_remap only has
It is likely that I'm just missing something trivial, but I have
a hard time understanding 63662139e (params: Fix potential
memory leak in add_sysfs_param()). [I take it for granted that
krealloc() does not free its first argument when it fails, as
reading mm/slab_common.c seems to confirm.] Some
On Tue, Nov 04 2014, Maxime COQUELIN maxime.coque...@st.com wrote:
-#define GENMASK(h, l)(((U32_C(1) ((h) - (l) + 1)) - 1)
(l))
-#define GENMASK_ULL(h, l)(((U64_C(1) ((h) - (l) + 1)) - 1) (l))
+#define GENMASK(h, l) \
+ ((~0UL (BITS_PER_LONG - ((h) - (l) + 1)))
File descriptors are always closed on exit :-)
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
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 ec538fc..bb9b836 100644
--- a/include/linux
On Wed, Nov 05 2014, Steven Rostedt rost...@goodmis.org wrote:
On Fri, 12 Sep 2014 11:25:52 +0200
Rasmus Villemoes li...@rasmusvillemoes.dk wrote:
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 5916a8e..7b9ce28 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace
change the other occurences of the !strncmp
idiom.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Strictly speaking this is a user-visible change since buf came from
userspace. I can't believe anybody cares, though.
drivers/usb/musb/musb_cppi41.c | 4 ++--
drivers/usb/musb
The string IOMEGA Clik! has length 12, not 11. Using strstarts
avoids the error-prone hardcoding of the prefix length. For
consistency, also change the occurence just above.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/ide/ide-floppy.c | 4 ++--
1 file changed, 2
We can shift the bits from lower and upper into place before
assembling dst[k]; moving the shift of upper into the branch where we
already know that rem is non-zero allows us to remove a
conditional.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/bitmap.c | 6 +++---
1 file
-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/bitmap.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 9250c3f..20bb314 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -134,8 +134,6 @@ void __bitmap_shift_right(unsigned long *dst, const
unsigned
is 0
the loop is never executed.
Also use shift and nbits consistently for the parameter names.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 12 ++--
lib/bitmap.c | 10 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff
from
being wrong before, though.
Rasmus Villemoes (7):
lib: bitmap: Change bitmap_shift_right to take unsigned parameters
lib: bitmap: Eliminate branch in __bitmap_shift_right
lib: bitmap: Remove redundant code from __bitmap_shift_right
lib: bitmap: Yet another simplification
and nbits consistently for the parameter names.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
include/linux/bitmap.h | 12 ++--
lib/bitmap.c | 11 ++-
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/include/linux/bitmap.h b/include/linux
-order don't care bits of dst,
about which no guarantee is made.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/bitmap.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 2362601..acea8ae 100644
--- a/lib/bitmap.c
+++ b
We can shift the bits from lower and upper into place before
assembling dst[k + off]; moving the shift of lower into the branch
where we already know that rem is non-zero allows us to remove a
conditional.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/bitmap.c | 7 +++
1
If left is 0, we can just let mask be ~0UL, so that anding with it is
a no-op. Conveniently, BITMAP_LAST_WORD_MASK provides precisely what
we need, and we can eliminate left.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/bitmap.c | 8
1 file changed, 4 insertions
These can be done as a single seq_puts call, reducing the code size slightly.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
arch/x86/platform/uv/tlb_uv.c | 18 +++---
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch
seq_puts is a lot cheaper than seq_printf, so use that to print
literal strings.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
arch/x86/kernel/cpu/proc.c| 10 +-
arch/x86/kernel/irq.c | 30 +++---
arch/x86/mm/pat.c | 2
obfuscating, macros.
The patches don't change the semantics of the code (well, that's the
idea anyway), but should make it slightly smaller and faster.
Rasmus Villemoes (7):
scsi: Remove SPRINTF macro
scsi/g_NCR5380: Remove obfuscating macros
scsi/advansys: Replace seq_printf with seq_puts
scsi
The macro SPRINTF doesn't save a lot of typing or make the code more
readable, and depending on a specific identifier (m) in the
surrounding scope is generally frowned upon. Nuke it.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/NCR5380.c | 42 +++---
drivers
Consecutive seq_puts calls with literal strings may be replaced by a
single call, saving a little .text.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/advansys.c | 40 ++--
drivers/scsi/atp870u.c | 5 ++---
drivers/scsi
Using seq_putc to print a single character saves at least a strlen()
call and a memory access, and may also give a small .text reduction.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/NCR5380.c | 2 +-
drivers/scsi/advansys.c | 34
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/advansys.c | 157
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/BusLogic.c | 10 +-
drivers/scsi/NCR5380.c
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/aha152x.c | 252
The macros PRINTP/ANDP make the code harder to read and depend on a
specific identifier name in the surrounding scope. Nuke them.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/g_NCR5380.c | 66 ++--
1 file changed, 30
a memcmp (except for the signature and
that bytes are not necessarily treated as unsigned char); since only
the boolean value of the result is used we can just replace
de4x5_strncmp with memcmp.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Notes:
I don't know if the comment
long)o2-len;
but I'd rather eliminate the usually broken 'return a - b;' idiom.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Notes:
How this could ever have worked is beyond me - compare_blob seems to
be used to maintain an rbtree, and I wouldn't expect rbtrees to behave
returning
hash - kn-hash in the first place is only ok because the hashes are
restricted to 31 bits, add a comment explaining that.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
fs/kernfs/dir.c | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/fs
long)o2-len;
but I'd rather eliminate the usually broken 'return a - b;' idiom.
Reviewed-by: Jeff Layton jlay...@primarydata.com
Cc: sta...@vger.kernel.org
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Notes:
How this could ever have worked is beyond me - compare_blob seems
reporting a match to the
caller.
Technically 'hash - kn-hash' is ok since the hashes are restricted to
31 bits, but it's better to avoid that subtlety.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Notes:
v2: Also use explicit comparisons of the hashes.
fs/kernfs/dir.c | 12
If u and v both represent negative integers and their limb counts
happen to differ, mpi_cmp will always return a positive value - this
is obviously bogus. u is smaller than v if and only if it is larger in
absolute value.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/mpi/mpi
mpihelp_cmp returns {-1,0,1};
-INT_MIN==INT_MIN won't bite us.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/mpi/mpi-cmp.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/mpi/mpi-cmp.c b/lib/mpi/mpi-cmp.c
index 3801694240d8..d25e9e96c310 100644
--- a/lib
On Sun, Dec 07 2014, Julia Lawall julia.law...@lip6.fr wrote:
Replace a misspelled function name by %s and then __func__.
The function name begins with pci, not cpci.
...
result = cpci_hotplug_init(debug);
if (result) {
- err(cpci_hotplug_init with error %d\n,
-stolen-start has type unsigned long; relying on the difference
(effectively cast to int) for sorting is wrong.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/gpu/drm/i915/i915_debugfs.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu
Ensure that lcm(a,b) returns the mathematically correct result,
provided it fits in an unsigned long. The current version returns
garbage if a*b overflows, even if the final result would fit.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/lcm.c | 2 +-
1 file changed, 1
Return the mathematically correct answer when an argument is 0.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
lib/lcm.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/lcm.c b/lib/lcm.c
index 01b3aa922dda..51cc6b13cd52 100644
--- a/lib/lcm.c
+++ b/lib
The idiom 'return a - b;' often used in comparison functions is wrong
unless one is certain the values being compared lie in a sufficiently
small range. In this case dapm_seq_compare would also return 0 if the
-dapm pointers happened to differ by a multiple of 2^32.
Signed-off-by: Rasmus
than a. One can also easily find three values
a,b,c such that a compares less than b, b compares less than c, but a
does not compare less than c.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
fs/hfs/catalog.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff
__FUNCTION__ hasn't been treated as a string literal since gcc 3.4, so
this only helps people who only test-compile using 3.3
(compiler-gcc3.h barks at anything older than that). Besides, there
are almost no occurrences of __FUNCTION__ left in the tree.
Signed-off-by: Rasmus Villemoes li
On Wed, Feb 04 2015, Joe Perches j...@perches.com wrote:
On Wed, 2015-02-04 at 10:48 +0100, Rasmus Villemoes wrote:
__FUNCTION__ hasn't been treated as a string literal since gcc 3.4, so
this only helps people who only test-compile using 3.3
(compiler-gcc3.h barks at anything older than
On Wed, Feb 04 2015, Joe Perches j...@perches.com wrote:
On Wed, 2015-02-04 at 21:55 +0100, Rasmus Villemoes wrote:
On Wed, Feb 04 2015, Joe Perches j...@perches.com wrote:
On Wed, 2015-02-04 at 10:48 +0100, Rasmus Villemoes wrote:
__FUNCTION__ hasn't been treated as a string literal
The only caller of cpuset_init_current_mems_allowed is the __init
annotated build_all_zonelists_init, so we can also make the former
__init.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
kernel/cpuset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel
The only caller of mminit_verify_zonelist is build_all_zonelists_init,
which is annotated with __init, so it should be safe to also mark the
former as __init, saving ~400 bytes of .text.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
mm/mm_init.c | 2 +-
1 file changed, 1 insertion
All users of mminit_dprintk pass a compile-time constant as level, so
this just makes gcc emit a single printk call instead of two.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Notes:
Not a huge deal, since the only users are __init or __meminit
functions, but even
Pulling the code protected by if (system_state == SYSTEM_BOOTING) into
its own helper allows us to shrink .text a little. This relies on
build_all_zonelists already having a __ref annotation. Add a comment
explaining why so one doesn't have to track it down through git log.
Signed-off-by: Rasmus
Only compile-tested, but I think these should be ok. Net saving aroung
450 bytes of .text.
Rasmus Villemoes (5):
mm/internal.h: Don't split printk call in two
mm/page_alloc.c: Pull out init code from build_all_zonelists
mm/mm_init.c: Mark mminit_verify_zonelist as __init
mm/mm_init.c
mminit_loglevel is only referenced from __init and __meminit
functions, so we can mark it __meminitdata.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
mm/mm_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mm_init.c b/mm/mm_init.c
index e17c758b27bf
On Sat, Jan 31 2015, yury.no...@gmail.com wrote:
From: Yury Norov y.no...@samsung.com
New implementations takes less space in source file (see diffstat)
and in object. For me it's 710 vs 453 bytes of text.
New version generally looks good. Please include a summary of the
changes between the
On Mon, Feb 02 2015, George Spelvin li...@horizon.com wrote:
Rasmus Villemoes li...@rasmusvillemoes.dk wrote:
... and this be part of _find_next_bit? Can find_next_bit not be simply
'return _find_next_bit(addr, size, offset, 1);', and similarly for
find_next_zero_bit? Btw., passing true
201 - 300 of 3339 matches
Mail list logo