[PATCH] include/linux/mfd/davinci_voicecodec.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
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

[PATCH] drivers: memstick: host: r592.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/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

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

2014-08-22 Thread Rasmus Villemoes
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

[PATCH v2] ray_cs: Add include guards

2014-08-25 Thread Rasmus Villemoes
: 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

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

2014-08-25 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 #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

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

2014-08-25 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"). Fixes: 0fe6f1d1 ("usb: udc: add Faraday fusb300 driver") Cc: Signed-off-by: Rasmus V

[PATCH/RFC] hash: Let gcc decide how to multiply

2014-08-25 Thread Rasmus Villemoes
\ 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)

Re: [PATCH/RFC] hash: Let gcc decide how to multiply

2014-08-26 Thread Rasmus Villemoes
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,

[PATCH/RFC 2/2] lib: string: Make all calls to strnicmp into calls to strncasecmp

2014-08-27 Thread Rasmus Villemoes
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

[PATCH/RFC 0/2] lib: string: Remove duplicated function

2014-08-27 Thread Rasmus Villemoes
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

[PATCH/RFC 1/2] lib: string: Remove duplicated function

2014-08-27 Thread Rasmus Villemoes
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 ---

Re: [PATCH/RFC 2/2] lib: string: Make all calls to strnicmp into calls to strncasecmp

2014-08-27 Thread Rasmus Villemoes
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

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

2014-08-28 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 0/4] Remove various orphaned header files

2014-08-28 Thread Rasmus Villemoes
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

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

2014-08-28 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 --

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

2014-08-28 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 4/4] include/rxrpc/types.h: Remove unused header

2014-08-28 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] include/linux/mfd/ti_ssp.h: Remove unused header

2014-08-28 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] include/linux/platform_data/tegra_emc.h: Remove unused header

2014-08-28 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 resend] Kbuild: x86: Eliminate duplicate command line options

2014-09-10 Thread Rasmus Villemoes
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&#

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

2014-08-20 Thread Rasmus Villemoes
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

[PATCH] kcmp: Fix standard comparison bug

2014-09-04 Thread Rasmus Villemoes
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

Re: [PATCH] kcmp: Fix standard comparison bug

2014-09-04 Thread Rasmus Villemoes
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

Re: [PATCH/RFC 2/2] lib: string: Make all calls to strnicmp into calls to strncasecmp

2014-08-30 Thread Rasmus Villemoes
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

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

2014-08-05 Thread Rasmus Villemoes
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

Re: [PATCH] drivers: message: fusion: Simplify rounding

2014-08-06 Thread Rasmus Villemoes
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

[PATCH] net: typhoon: Remove redundant casts

2014-10-21 Thread Rasmus Villemoes
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/

[PATCH] ARM: davinci: Remove redundant casts

2014-10-21 Thread Rasmus Villemoes
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

[PATCH] [media] s5p_mfc: Remove redundant casts

2014-10-21 Thread Rasmus Villemoes
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

[PATCH] staging: rtl8712: Remove redundant cast

2014-10-21 Thread Rasmus Villemoes
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

[PATCH] staging: vt6655: Remove redundant cast

2014-10-21 Thread Rasmus Villemoes
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

[PATCH] ASoC: dapm: Remove redundant cast

2014-10-21 Thread Rasmus Villemoes
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

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-22 Thread Rasmus Villemoes
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

[PATCH v2] staging: rtl8712: Remove redundant cast

2014-10-22 Thread Rasmus Villemoes
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

Re: [PATCH v3] bitops: Fix shift overflow in GENMASK macros

2014-11-05 Thread Rasmus Villemoes
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))

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

2014-11-05 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 ec538fc..bb9b836 100644 --- a/include/linux/socket.h +++ b/include

Re: [PATCH 4/6] trace: Replace seq_printf by simpler equivalents

2014-11-05 Thread Rasmus Villemoes
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

krealloc in kernel/params.c

2014-10-14 Thread Rasmus Villemoes
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

[PATCH v2 0/3] trace: Use simpler seq_file functions

2014-11-08 Thread Rasmus Villemoes
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

[PATCH v2 2/3] trace: Merge consecutive seq_puts calls

2014-11-08 Thread Rasmus Villemoes
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

[PATCH v2 1/3] trace: Replace seq_printf by simpler equivalents

2014-11-08 Thread 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 ++

[PATCH v2 3/3] trace: Replace single-character seq_puts with seq_putc

2014-11-08 Thread Rasmus Villemoes
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

Re: [PATCH 3/3 v6] mm/vmalloc: Cache the vmalloc memory info

2015-08-25 Thread Rasmus Villemoes
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 ;-) ] >

Re: [PATCH] lib/string_helpers: clarify esc arg in string_escape_mem

2015-07-30 Thread Rasmus Villemoes
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

Re: [PATCH v2] devpts: allow mounting with uid/gid of uint32_t

2015-08-19 Thread Rasmus Villemoes
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); > } > >

[PATCH v3 4/4] scripts: add stackdelta script

2015-08-20 Thread Rasmus Villemoes
,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

[PATCH v3 0/4] scripts: add stack{usage,delta} scripts

2015-08-20 Thread Rasmus Villemoes
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

[PATCH v3 1/4] scripts: add stackusage script

2015-08-20 Thread Rasmus Villemoes
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

[PATCH v3 2/4] .gitignore: add *.su pattern

2015-08-20 Thread Rasmus Villemoes
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

[PATCH v3 3/4] kbuild: remove *.su files generated by -fstack-usage

2015-08-20 Thread Rasmus Villemoes
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

Re: get_vmalloc_info() and /proc/meminfo insanely expensive

2015-08-13 Thread Rasmus Villemoes
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

[PATCH] x86, mtrr: mark range_new in mtrr_calc_range_state() as __initdata

2015-11-13 Thread Rasmus Villemoes
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

[PATCH] x86, fpu: put a few variables in .init.data

2015-11-13 Thread Rasmus Villemoes
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

Re: [PATCH] scsi: hpsa: fix multiple issues in path_info_show

2015-11-14 Thread Rasmus Villemoes
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

[PATCH] mei: bus: use scnprintf in *_show

2015-11-14 Thread Rasmus Villemoes
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

[PATCH] HID: core: use scnprintf in modalias_show()

2015-11-14 Thread Rasmus Villemoes
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

Re: [PATCH v3 14/14] lib/test_printf.c: test dentry printing

2015-12-04 Thread Rasmus Villemoes
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

Re: [PATCH v3 04/14] lib/vsprintf.c: expand field_width to 24 bits

2015-12-04 Thread Rasmus Villemoes
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

Re: [PATCH v3 04/14] lib/vsprintf.c: expand field_width to 24 bits

2015-12-04 Thread Rasmus Villemoes
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

[PATCH] printk-formats.txt: remove unimplemented %pT

2015-12-05 Thread Rasmus Villemoes
%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

Re: [PATCH v2 1/3] mm, printk: introduce new format string for flags

2015-12-05 Thread Rasmus Villemoes
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

snprintf, overlapping destination and source

2015-12-05 Thread Rasmus Villemoes
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

[PATCH] qeth: don't rely on signedness of char

2015-12-05 Thread Rasmus Villemoes
. 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 ---

[PATCH] mfd: wm831x: fix broken wm831x_unique_id_show

2015-12-05 Thread 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

[PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Rasmus Villemoes
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

Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Rasmus Villemoes
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

[PATCH] staging: lustre: fix %.2X versus signed char issue

2015-12-05 Thread Rasmus Villemoes
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/

[PATCH] tracing: don't macro-expand arguments before stringification in TP_printk

2015-12-15 Thread Rasmus Villemoes
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

Re: [PATCH] tracing: don't macro-expand arguments before stringification in TP_printk

2015-12-15 Thread Rasmus Villemoes
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

Re: snprintf, overlapping destination and source

2015-12-16 Thread Rasmus Villemoes
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

Re: [PATCH v2 0/3] Improve bitmap_empty and bitmap_full

2015-11-19 Thread Rasmus Villemoes
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.

Re: [PATCH v1 1/7] test_hexdump: rename to test_hexdump

2015-11-19 Thread Rasmus Villemoes
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

Re: [PATCH v1 2/7] test_hexdump: introduce test_hexdump_prepare_test() helper

2015-11-19 Thread Rasmus Villemoes
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/

Re: [PATCH v1 3/7] test_hexdump: go through all possible lengths of buffer

2015-11-19 Thread Rasmus Villemoes
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

Re: [PATCH v1 4/7] test_hexdump: replace magic numbers by their meaning

2015-11-19 Thread Rasmus Villemoes
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

Re: [PATCH v1 5/7] test_hexdump: check all bytes in real buffer

2015-11-19 Thread Rasmus Villemoes
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

Re: [PATCH v1 6/7] test_hexdump: test all possible group sizes for overflow

2015-11-19 Thread Rasmus Villemoes
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

Re: [PATCH v1 7/7] test_hexdump: print statistics at the end

2015-11-19 Thread Rasmus Villemoes
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:

[PATCH] misc: mic: ERR_PTR expects -Exxx

2015-11-20 Thread Rasmus Villemoes
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

[PATCH] mtip32xx: use formatting capability of kthread_create_on_node

2015-11-20 Thread Rasmus Villemoes
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

[PATCH] efi/esrt: don't preformat name

2015-11-20 Thread Rasmus Villemoes
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

Re: [PATCH 1/3] usb: musb: convert printk to pr_*

2015-11-30 Thread Rasmus Villemoes
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

Re: no-op delay loops

2015-11-30 Thread Rasmus Villemoes
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; >>

Re: [PATCH] x86, mtrr: mark range_new in mtrr_calc_range_state() as __initdata

2015-12-01 Thread Rasmus Villemoes
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

[PATCH] floppy: make local variable non-static

2015-12-01 Thread Rasmus Villemoes
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

[PATCH] kernel/resource.c: mark static variable __initdata

2015-12-01 Thread Rasmus Villemoes
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

[PATCH] fs: ramfs: mark once as __initdata

2015-12-01 Thread Rasmus Villemoes
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

[PATCH v2] x86, mtrr: mark range_new in mtrr_calc_range_state() as __initdata

2015-12-01 Thread Rasmus Villemoes
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

Re: [PATCH 1/2] mm, printk: introduce new format string for flags

2015-12-02 Thread Rasmus Villemoes
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

Re: [PATCH 1/2] mm, printk: introduce new format string for flags

2015-12-03 Thread Rasmus Villemoes
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

Re: [PATCH 3/3] usb: musb: remove redundant stack buffer

2015-12-03 Thread Rasmus Villemoes
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

Re: [PATCH 1/2] mm, printk: introduce new format string for flags

2015-12-03 Thread Rasmus Villemoes
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

[PATCH v3 07/14] lib/kasprintf.c: add sanity check to kvasprintf

2015-12-03 Thread Rasmus Villemoes
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

[PATCH v3 10/14] lib/test_printf.c: test precision quirks

2015-12-03 Thread Rasmus Villemoes
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

[PATCH v3 13/14] lib/test_printf.c: add test for large bitmaps

2015-12-03 Thread Rasmus Villemoes
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

[PATCH v3 12/14] lib/test_printf.c: account for kvasprintf tests

2015-12-03 Thread Rasmus Villemoes
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

[PATCH v3 14/14] lib/test_printf.c: test dentry printing

2015-12-03 Thread Rasmus Villemoes
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

[PATCH v3 11/14] lib/test_printf.c: add a few number() tests

2015-12-03 Thread Rasmus Villemoes
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

[PATCH v3 09/14] lib/test_printf.c: check for out-of-bound writes

2015-12-03 Thread Rasmus Villemoes
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

[PATCH v3 08/14] lib/test_printf.c: don't BUG

2015-12-03 Thread Rasmus Villemoes
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(-)

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