The include guard doesn't work as intended due to the transposition
typo DAVINCI -> DAVINIC.
Signed-off-by: Rasmus Villemoes
---
include/linux/mfd/davinci_voicecodec.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/mfd/davinci_voicecodec.h
b/include/l
Clearly this was meant to be an include guard, but the
#define was missing.
Signed-off-by: Rasmus Villemoes
---
drivers/memstick/host/r592.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/memstick/host/r592.h b/drivers/memstick/host/r592.h
index c5726c1..3d80c21 100644
--- a
Josef Bacik writes:
> On 06/20/2014 12:51 PM, Rasmus Villemoes wrote:
>> 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: R
: Rasmus Villemoes
---
Notes:
v2: Change subject prefix and fix broken commit message.
drivers/net/wireless/ray_cs.h | 5 +++--
drivers/net/wireless/rayctl.h | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ray_cs.h b/drivers/net/wireless/ray_cs.h
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
#define the macro. Add those #defines. git grep says the macro names
are not defined elsewhere.
Signed-off-by: Rasmus Villemoes
---
For good measure, here's a ve
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").
Fixes: 0fe6f1d1 ("usb: udc: add Faraday fusb300 driver")
Cc:
Signed-off-by: Rasmus V
\
for (i = 0; i < N; ++i) \
sum += f(buf[i], NBITS);\
stop = rdtsc(); \
printf("%s\t%lu\t%lu\n", #f, sum, stop-start); \
} while (0)
David Miller writes:
> From: Daniel Borkmann
> Date: Mon, 25 Aug 2014 14:58:37 +0200
>
>> On 08/25/2014 02:13 PM, Rasmus Villemoes wrote:
>>> A 9+ years old comment in hash_64 says that gcc can't optimize
>>> multiplication by GOLDEN_RATIO_PRIME_64. Well,
been converted.
Signed-off-by: Rasmus Villemoes
---
include/linux/string.h | 2 +-
lib/string.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/string.h b/include/linux/string.h
index d36977e..e6edfe5 100644
--- a/include/linux/string.h
+++ b/include
have no idea how to do that (hence the RFC).
Rasmus Villemoes (2):
lib: string: Remove duplicated function
lib: string: Make all calls to strnicmp into calls to strncasecmp
include/linux/string.h | 2 +-
lib/string.c | 28 +++-
2 files changed, 12 inser
ernel (and since both are exported to modules), make
strnicmp a wrapper for strncasecmp.
Signed-off-by: Rasmus Villemoes
---
lib/string.c | 27 ++-
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/lib/string.c b/lib/string.c
index 992bf30..92c33e1 100644
---
On Wed, Aug 27 2014, Dan Carpenter wrote:
> On Wed, Aug 27, 2014 at 09:36:02AM +0200, Rasmus Villemoes wrote:
>> The previous patch made strnicmp into a wrapper for strncasecmp. This
>> patch makes all in-tree users of strnicmp call strncasecmp directly,
>> while still
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
These four files are not included anywhere, and seem to be accidental
leftovers from past cleanups (see the individual commit messages).
Rasmus Villemoes (4):
include/linux/cycx_x25.h: Remove unused header
include/linux/i82593.h: Remove unused header
include/linux/phonedev.h: Remove unused
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 --
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
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
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
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 --
the $(cc-option) [according
to http://www.gnu.org/software/gcc/gcc-3.1/changes.html], and since
the former were unconditionally used, one can deduce that only gcc
versions knowing about all four are supported. So also eliminate the
$(cc-option) wrap.
Signed-off-by: Rasmus Villemoes
---
I know it
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 Villemoes
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/net/ethernet
entable
in a long). As it stands, one can easily obtain three file descriptors
exhibiting the non-transitivity of kcmp().
Cc:
Signed-off-by: Rasmus Villemoes
---
Side note 1: I can't see that ensuring the MSB of the multiplier is
set serves any purpose other than obfuscating the obfu
On Thu, Sep 04 2014, Cyrill Gorcunov wrote:
> On Thu, Sep 04, 2014 at 12:40:06PM +0200, Rasmus Villemoes wrote:
>>
>> Note that it makes absolutely no difference that
On Wed, Aug 27 2014, Dan Carpenter wrote:
> On Wed, Aug 27, 2014 at 11:13:16AM +0200, Rasmus Villemoes wrote:
>> Anyway, I was also planning on sending tree-wide patches doing
>> s/strnicmp/strncasecmp/, and then removing the hack from string.h, but I
>> first wanted to get
the $(cc-option) [according
to http://www.gnu.org/software/gcc/gcc-3.1/changes.html], and since
the former were unconditionally used, one can deduce that only gcc
versions knowing about all four are supported. So also eliminate the
$(cc-option) wrap.
Signed-off-by: Rasmus Villemoes
---
arch/x86
Joe Lawrence writes:
> On Tue, 1 Jul 2014, Rasmus Villemoes wrote:
>
>> Rounding up to a multiple of 4 should be done using the ALIGN
>> macro. As a bonus, this also makes the generated code smaller.
>>
>> In GetIocFacts(), sz is assigned to a few lines belo
Both image_data and typhoon_fw->data are const u8*, so the cast to u8*
is unnecessary and confusing.
Signed-off-by: Rasmus Villemoes
---
drivers/net/ethernet/3com/typhoon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/3com/typhoon.c
b/drivers/
These casts to char* are unnecessary and slightly confusing, since
both operands actually have type const char*.
Signed-off-by: Rasmus Villemoes
---
arch/arm/mach-davinci/board-da850-evm.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-davinci/board
Both sides of these assignments actually have type "const struct
vb2_mem_ops *", so the casts are unnecessary and slightly confusing.
Signed-off-by: Rasmus Villemoes
---
drivers/media/platform/s5p-mfc/s5p_mfc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
struct firmware::data has type const u8*, as does *ppmappedfw, so the
cast to u8* is unnecessary and slightly confusing.
Signed-off-by: Rasmus Villemoes
---
drivers/staging/rtl8712/hal_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8712/hal_init.c
Both sides have type const struct iw_handler_def*, so the cast is
unnecessary and confusing.
Signed-off-by: Rasmus Villemoes
---
drivers/staging/vt6655/device_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vt6655/device_main.c
b/drivers/staging
Both path->name and e->texts[i] have type const char*, so the cast is
slightly confusing and certainly unnecessary.
Signed-off-by: Rasmus Villemoes
---
sound/soc/soc-dapm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
On Mon, Oct 20 2014, Andrey Ryabinin wrote:
> UBSan uses compile-time instrumentation to catch undefined behavior (UB).
> Compiler inserts code that perform certain kinds of
> checks before operations that could cause UB.
> If check fails (i.e. UB detected) __ubsan_handle_* function called.
> to
struct firmware::data has type const u8*, as does *ppmappedfw, so the
cast to u8* is unnecessary and slightly confusing.
Signed-off-by: Rasmus Villemoes
---
drivers/staging/rtl8712/hal_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8712/hal_init.c
On Tue, Nov 04 2014, Maxime COQUELIN 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))) << (l))
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 ec538fc..bb9b836 100644
--- a/include/linux/socket.h
+++ b/include
On Wed, Nov 05 2014, Steven Rostedt wrote:
> On Fri, 12 Sep 2014 11:25:52 +0200
> Rasmus Villemoes wrote:
>
>> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
>> index 5916a8e..7b9ce28 100644
>> --- a/kernel/trace/ftrace.c
>> +++ b/kernel/tra
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
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
t; seq_putc(m, c)
Subsequent patches will simplify further.
Signed-off-by: Rasmus Villemoes
---
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
---
kernel/trace/ftrace.c| 2 +-
kernel
On Tue, Aug 25 2015, Ingo Molnar wrote:
> * George Spelvin wrote:
>
>> (I hope I'm not annoying you by bikeshedding this too much, although I
>> think this is improving.)
>
> [ I don't mind, although I wish other, more critical parts of the kernel got
> this
> much attention as well ;-) ]
>
the parameter name suggest that the esc string contains additional
characters to escape, not the other way around.
Could we also rename the parameter 'only' or something like that? In any
case,
Acked-by: Rasmus Villemoes
--
To unsubscribe from this list: send the line "unsubscribe
On Wed, Aug 19 2015, Andrew Morton wrote:
>
> whoa, wait, I was looking at the -mm tree which changes kstrtouint():
>
> static inline int __must_check kstrtouint(const char *s, unsigned int base,
> unsigned int *res)
> {
> return parse_integer(s, base | PARSE_INTEGER_NEWLINE, res);
> }
>
>
,new}.su | sort -k5,5g
shows that gcc 5.0 generally produces less stack-hungry code than gcc
4.7. Obviously, the script can also be used for measuring the effect
of commits, .config tweaks or whatnot.
Signed-off-by: Rasmus Villemoes
---
scripts/stackdelta | 59
FLAGS instead of EXTRA_CFLAGS. A few more details in commit
messages. Simpler option handling in stackusage. Removed accidental
leftover debug prints.
v3: Fix a few typos.
Rasmus Villemoes (4):
scripts: add stackusage script
.gitignore: add *.su pattern
kbuild: remove *.su files generated
5.0 doesn't
have this problem; it uses the full name as seen in the object file.
[1] Since gcc encodes that by
48 83 c4 80 add$0xff80,%rsp
and not
48 81 ec 80 00 00 00 sub $0x80,%rsp
since -128 fits in an imm8.
Signed-off-by: Rasmus Villemoes
---
scri
Ignore the *.su files generated by using the gcc option -fstack-usage.
Signed-off-by: Rasmus Villemoes
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 4ad4a98b884b..9e51ead66a55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7
Make sure 'make clean' removes *.su files generated by the gcc option
-fstack-usage.
Signed-off-by: Rasmus Villemoes
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 6e88c371b32f..a3b3499f94e5 100644
--- a/Makefile
+++ b/Makefile
@@ -1433
On Thu, Aug 13 2015, Linus Torvalds wrote:
> On Wed, Aug 12, 2015 at 9:00 PM, Andrew Morton
> wrote:
>>
>> Do your /proc/meminfo vmalloc numbers actually change during that build?
>> Mine don't. Perhaps we can cache the most recent vmalloc_info and
>> invalidate that cache whenever someone does
nally assigned to before it is read, so
there's no point in having it static.
Signed-off-by: Rasmus Villemoes
---
arch/x86/kernel/cpu/mtrr/cleanup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c
b/arch/x86/kernel/cpu/mtrr/clean
These are clearly just used during init.
Signed-off-by: Rasmus Villemoes
---
arch/x86/kernel/fpu/init.c | 4 ++--
arch/x86/kernel/fpu/xstate.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c
index be39b5fde4b9
On Wed, Oct 28 2015, Don Brace wrote:
> On 10/27/2015 05:16 PM, Rasmus Villemoes wrote:
>> I'm not familiar with this code, but path_info_show() (added in
>> 8270b86243658 "hpsa: add sysfs entry path_info to show box and
>> bay information") seems to
There's no reason to duplicate the logic provided by scnprintf().
Signed-off-by: Rasmus Villemoes
---
drivers/misc/mei/bus.c | 19 ---
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 0b05aa938799..630bdf1
scnprintf() exists to provide these semantics, so we might as well use
it.
Signed-off-by: Rasmus Villemoes
---
drivers/hid/hid-core.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index c6f7a694f67a..efa3660e23a0
On Fri, Dec 04 2015, Andrew Morton wrote:
> On Thu, 3 Dec 2015 21:51:13 +0100 Rasmus Villemoes
> wrote:
>
>> +static struct dentry test_dentry[4] __initdata = {
>> +{ .d_parent = &test_dentry[0],
>> + .d_name = { .len = 3, .name = test_dentry[0].d_ina
On Fri, Dec 04 2015, Joe Perches wrote:
> On Thu, 2015-12-03 at 15:34 -0800, Andrew Morton wrote:
>> I've been fiddling with a BUILD_BUG_ON which works outside functions
>> using gcc's __COUNTER__ - something like
>>
>> #define BBO(expr) typedef char __bbo##__COUNTER__[1-2*(!!expr)]
>
> nit: yo
On Fri, Dec 04 2015, Andrew Morton wrote:
> On Thu, 03 Dec 2015 23:28:58 +0200 Andy Shevchenko
> wrote:
>
>> I like most of the stuff here, though, Joe, can we avoid open-coded
>> BUILD_BUG_ON()?
>
> Well we could just do
>
[snip]
>
> Which is better than open-coding it, IMO.
I'd really prefer
%pT for task->comm has been proposed (several times, I think), but is
not actually implemented. Remove it from printk-formats.txt and add it
back if/when it gets implemented.
Signed-off-by: Rasmus Villemoes
---
This slipped through in 5e4ee7b ("printk: synchronize %p formatting
docum
On Fri, Dec 04 2015, Vlastimil Babka wrote:
> In mm we use several kinds of flags bitfields that are sometimes printed for
> debugging purposes, or exported to userspace via sysfs. To make them easier to
> interpret independently on kernel version and config, we want to dump also the
> symbolic f
I did a search for code doing
s[n]printf(buf, "...", ..., buf, ...)
and found a few instances. They all do it with the format string
beginning with "%s" and buf being passed as the corresponding parameter
(obviously to append to the existing string). That works (AFAICT), both
with the current p
. To help future readers, simply do an explicit mask
so that the value passed to sprintf is in 0-255. If char is indeed
unsigned, gcc should be able to elide the masking.
In any case, the subsequent 0-termination is redundant, since sprintf
has done that.
Signed-off-by: Rasmus Villemoes
---
is much simpler to simply use %phN and do all the
formatting at once.
Signed-off-by: Rasmus Villemoes
---
drivers/mfd/wm831x-otp.c | 10 ++
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/mfd/wm831x-otp.c b/drivers/mfd/wm831x-otp.c
index b90f3e06b6c9..ebac0027f8e0 10
If char is signed and ch happens to be negative, printing ch with
"%02x" will not do as intended (when ch is -19, one will get
"ffed"). Fix that by masking with 0xff.
Signed-off-by: Rasmus Villemoes
---
drivers/staging/speakup/kobjects.c | 2 +-
1 file changed, 1 inse
On Sun, Dec 06 2015, Joe Perches wrote:
> On Sun, 2015-12-06 at 01:05 +0100, Rasmus Villemoes wrote:
>> If char is signed and ch happens to be negative, printing ch with
>> "%02x" will not do as intended (when ch is -19, one will get
>> "ffed"). Fix
by "bin2hex(buffer, lmm,
lmm_bytes);".
Signed-off-by: Rasmus Villemoes
---
drivers/staging/lustre/lustre/lov/lov_pack.c | 15 +--
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c
b/drivers/staging/lustre/lustre/
or example, in the i2c
case the same array is repeated four times in
include/trace/events/i2c.h).
Signed-off-by: Rasmus Villemoes
---
include/trace/trace_events.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
index de996c
Bah, just found 0462b5664b (ftrace: Output REC->var instead of
__entry->var for trace format). There's some magic here I don't
understand, but I'm wondering if '__entry' wouldn't do just as well as
'REC' for the tools that try to parse these strings.
Rasmus
--
To unsubscribe from this list: send t
On Mon, Dec 07 2015, Kees Cook wrote:
> On Sat, Dec 5, 2015 at 12:38 PM, Rasmus Villemoes
> wrote:
>> I did a search for code doing
>>
>> s[n]printf(buf, "...", ..., buf, ...)
>>
>> and found a few instances. They all do it with the format string
On Thu, Nov 19 2015, Jia He wrote:
> find_fisrt_{zero_}bit are too heavy for bitmap_{full,empty}. We don't
> need to calculate and compare the position of bitmap. This set of patch
> instroduces lightweight api and replaces the heavy one.
>
Please check the history of the code you're modifying.
On Wed, Nov 11 2015, Andy Shevchenko wrote:
> Just to follow the scheme that most of the test modules are using.
>
> There is no fuctional change.
Yeah, this has also been bugging me slightly.
Acked-by: Rasmus Villemoes
--
To unsubscribe from this list: send the line "unsubscrib
e. It does improve readability slightly.
Acked-by: Rasmus Villemoes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
On Wed, Nov 11 2015, Andy Shevchenko wrote:
> When test for overflow do iterate the buffer length in a range
> 0 .. BUF_SIZE.
>
> Signed-off-by: Andy Shevchenko
> ---
> lib/test_hexdump.c | 20 ++--
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/lib/test_he
On Wed, Nov 11 2015, Andy Shevchenko wrote:
> The magic numbers of the length are converted to their actual meaning, such as
> end of the buffer with and without ASCII part.
>
> We don't touch the rest magic constants that will be removed in the following
> commits.
>
> Signed-off-by: Andy Shevch
On Wed, Nov 11 2015, Andy Shevchenko wrote:
> After processing by hex_dump_to_buffer() check all the parts to be expected.
>
> Part 1. The actual expected hex dump with or without ASCII part.
> This is provided by plain strcmp() call including check for the
> terminating NUL.
>
> Part
On Wed, Nov 11 2015, Andy Shevchenko wrote:
> Currently only one combination is tested for overflow, i.e. rowsize = 16,
> groupsize = 1, len = 1. Do various test to go all possible branches.
>
> Signed-off-by: Andy Shevchenko
> ---
> lib/test_hexdump.c | 23 ++-
> 1 file ch
On Wed, Nov 11 2015, Andy Shevchenko wrote:
> Like others test are doing print the gathered statistics after test module is
> finished. Return from the module based on the result.
>
Homogeneity between test modules is good.
Acked-by: Rasmus Villemoes
--
To unsubscribe from this list:
These wouldn't be recognized by IS_ERR. There's no actual harm done,
since the only caller ignores the return value.
Signed-off-by: Rasmus Villemoes
---
drivers/misc/mic/scif/scif_dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/mic/scif/sc
kthread_create_on_node takes format+args, so there's no need to do the
pretty-printing in advance. Moreover, "mtip_svc_thd_99" (including its
'\0') only just fits in 16 bytes, so if index could ever go above 99
we'd have a stack buffer overflow.
Signed-off-by: Rasmus
kobject_init_and_add takes a format string+args, so there's no reason
to do this formatting in advance.
Signed-off-by: Rasmus Villemoes
---
drivers/firmware/efi/esrt.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmwar
On Sat, Nov 28 2015, Sergei Shtylyov wrote:
> On 11/28/2015 3:04 AM, Greg Kroah-Hartman wrote:
>
This file already uses pr_debug in a few places; this converts the
remaining printks.
>>>
>>> Are you aware that printk(KERN_DEBUG, ...) and pr_debug() are not
>>> equivalent?
>>
>> Yes
On Fri, Nov 27 2015, Arnd Bergmann wrote:
> On Friday 27 November 2015 09:53:50 Rasmus Villemoes wrote:
>>
>> It seems that gcc happily compiles
>>
>> for (i = 0; i < 10; ++i) ;
>>
>> into simply
>>
>> i = 10;
>>
On Fri, Nov 27 2015, Ingo Molnar wrote:
> * Rasmus Villemoes wrote:
>
>> range_new doesn't seem to be used after init. It is only passed to
>> memset, sum_ranges, memcmp and x86_get_mtrr_mem_range, the latter of
>> which also only passes it on to various *range* lib
There's no reason for temparea to be static, since it's only used for
temporary sprintf output. It's not immediately obvious that the output
will always fit (in the worst case, the output including '\0' is
exactly 32 bytes), so save a future reader from worrying about tha
The address of reserved doesn't escape this function, and I could sure
use those extra .001% of memory after boot.
Signed-off-by: Rasmus Villemoes
---
kernel/resource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/resource.c b/kernel/resource.c
There's no reason to keep this around after init.
Signed-off-by: Rasmus Villemoes
---
fs/ramfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 889d558b4e05..74afa43cced5 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/in
o doesn't carry state between calls (it is
unconditionally assigned to before it is read), we might as well make
it an ordinary automatic variable.
Signed-off-by: Rasmus Villemoes
---
Something like this, perhaps?
v2: Add comment on range_new, per Ingo.
arch/x86/kernel/cpu/mtrr/cleanup.c
it's a good fit, and the extra indirection in a non-critical
> path is negligible.
>
> Signed-off-by: Vlastimil Babka
> Cc: Rasmus Villemoes
> ---
> I'm sending it on top of the page_owner series, as it's already in mmotm.
> But to reduce churn (in cas
On Thu, Dec 03 2015, yalin wang wrote:
>> On Dec 2, 2015, at 13:04, Vlastimil Babka wrote:
>>
>> On 12/02/2015 06:40 PM, yalin wang wrote:
>>
>> (please trim your reply next time, no need to quote whole patch here)
>>
>>> i am thinking why not make %pg* to be more generic ?
>>> not restricted
On Tue, Dec 01 2015, Felipe Balbi wrote:
> Hi,
>
> Rasmus Villemoes writes:
>> aRevision is only used once, so we might as well do the formatting as
>> part of the pr_debug. This eliminates the stack buffer, and avoids
>> doing the formatting at all when pr_debug is
On Wed, Dec 02 2015, Vlastimil Babka wrote:
>> [where I've assumed that the trace_print_flags array is terminated with
>> an entry with 0 mask. Passing its length is also possible, but maybe a
>> little awkward if the arrays are defined in mm/ and contents depend on
>> .config.]
...
>
>> Rasmus
sanity check and let's see if it ever triggers.
Signed-off-by: Rasmus Villemoes
---
lib/kasprintf.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/kasprintf.c b/lib/kasprintf.c
index f194e6e593e1..7f6c506a4942 100644
--- a/lib/kasprintf.c
+++ b/lib/kaspri
The kernel's printf doesn't follow the standards in a few corner cases
(which are probably mostly irrelevant). Add tests that document the
current behaviour.
Cc: Kees Cook
Signed-off-by: Rasmus Villemoes
---
lib/test_printf.c | 21 +++--
1 file changed, 15 insert
Following "lib/vsprintf.c: expand field_width to 24 bits", let's add a
test to see that we now actually support bitmaps with 65536 bits.
Cc: Maurizio Lombardi
Cc: Tejun Heo
Acked-by: Kees Cook
Signed-off-by: Rasmus Villemoes
---
lib/test_printf.c | 17 +
1 f
These should also count as performed tests.
Acked-by: Kees Cook
Signed-off-by: Rasmus Villemoes
---
lib/test_printf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/test_printf.c b/lib/test_printf.c
index b23ce824766f..3e21170d327d 100644
--- a/lib/test_printf.c
+++ b/lib
Cc: Al Viro
Signed-off-by: Rasmus Villemoes
---
lib/test_printf.c | 27 +++
1 file changed, 27 insertions(+)
diff --git a/lib/test_printf.c b/lib/test_printf.c
index 60740c10c3e8..0234356c6698 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -13,6 +13,7
This adds a few tests to test_number, one of which serves to document
another deviation from POSIX/C99 (printing 0 with an explicit
precision of 0).
Signed-off-by: Rasmus Villemoes
---
lib/test_printf.c | 24
1 file changed, 24 insertions(+)
diff --git a/lib
Add a few padding bytes on either side of the test buffer, and check
that these (and the part of the buffer not used) are untouched by
vsnprintf.
Acked-by: Kees Cook
Signed-off-by: Rasmus Villemoes
---
lib/test_printf.c | 24 +++-
1 file changed, 19 insertions(+), 5
BUG is a completely unnecessarily big hammer, and we're more likely to
get the internal bug reported if we just pr_err() and ensure the test
suite fails.
Acked-by: Kees Cook
Signed-off-by: Rasmus Villemoes
---
lib/test_printf.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
901 - 1000 of 1998 matches
Mail list logo