Re: [PATCH 1/2] scsi: move Additional Sense Codes to separate file

2015-10-17 Thread Rasmus Villemoes
On Tue, Oct 06 2015, Rasmus Villemoes wrote: > On Mon, Oct 05 2015, Bart Van Assche wrote: > >> On 10/05/15 02:26, Rasmus Villemoes wrote: >>> - {0x041A, "Logical unit not ready, start stop unit command in " >>> -"progress"}, >>>

[PATCH 12/13] lib/test_printf.c: test dentry printing

2015-10-20 Thread Rasmus Villemoes
Cc: Al Viro Signed-off-by: Rasmus Villemoes --- Al, I'd appreciate it if you'd take a look and see that the printed strings are actually as expected. lib/test_printf.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/lib/test_printf.c b/lib/test_prin

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

2015-10-20 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: Kees Cook Cc: Tejun Heo Signed-off-by: Rasmus Villemoes --- lib/test_printf.c | 17 + 1 f

[PATCH 13/13] lib/kasprintf.c: add sanity check to kvasprintf

2015-10-20 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 32f12150fc4f..a30bf3042020 100644 --- a/lib/kasprintf.c +++ b/lib/kaspri

[PATCH 10/13] lib/test_printf.c: account for kvasprintf tests

2015-10-20 Thread Rasmus Villemoes
These should also count as performed tests. Cc: 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 80ddafb2675d..8fca007d9bcd 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c

[PATCH 06/13] lib/vsprintf.c: warn about too large precisions and field widths

2015-10-20 Thread Rasmus Villemoes
-(1<<23), but a negative field width means 'set the LEFT flag and use the absolute value', so we want the absolute value to fit. Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/vs

[PATCH 05/13] lib/vsprintf.c: help gcc make number() smaller

2015-10-20 Thread Rasmus Villemoes
. Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 373da7a84382..6d75a3364683 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -399,6 +399,8 @@ char *number

[PATCH 02/13] lib/vsprintf.c: move string() below widen_string()

2015-10-20 Thread Rasmus Villemoes
This is pure code movement, making sure the widen_string() helper is defined before the string() function. Cc: Ingo Molnar Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 62 +- 1 file changed, 31 insertions(+), 31 deletions(-) diff

[PATCH 03/13] lib/vsprintf.c: eliminate potential race in string()

2015-10-20 Thread Rasmus Villemoes
r has been checked for). We can avoid this by only passing over the source string once, stopping the first time we meet a nul byte (or when we reach the given precision), and then letting widen_string() handle left/right space padding. Cc: Ingo Molnar Signed-off-by: Rasmus Villemoes ---

[PATCH 04/13] lib/vsprintf.c: expand field_width to 24 bits

2015-10-20 Thread Rasmus Villemoes
.kernel/2034835 Reported-by: Maurizio Lombardi Cc: Tejun Heo Cc: Joe Perches Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 39 --- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index ba00eab1e703..373da7a843

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

2015-10-21 Thread Rasmus Villemoes
On Wed, Oct 21 2015, kbuild test robot wrote: > Hi Rasmus, > > [auto build test ERROR on next-20151020 -- if it's inappropriate base, please > suggest rules for selecting the more suitable base] > > url: > https://github.com/0day-ci/linux/commits/Rasmus-Villemo

[PATCH v2 04/13] lib/vsprintf.c: expand field_width to 24 bits

2015-10-21 Thread Rasmus Villemoes
.kernel/2034835 Reported-by: Maurizio Lombardi Cc: Tejun Heo Cc: Joe Perches Signed-off-by: Rasmus Villemoes --- v2: The static assertion actually fired on frv, as reported by the build bot. Add __packed to fix that. lib/vsprintf.c | 41 + 1 file changed

Re: [PATCH v5 2/2] lib/test-string_helpers.c: add string_get_size() tests

2015-10-21 Thread Rasmus Villemoes
On Thu, Sep 17 2015, Vitaly Kuznetsov wrote: > + > +static __init void test_string_get_size(void) > +{ > + test_string_get_size_one(16384, 512, STRING_UNITS_2, "8.00 MiB"); > + test_string_get_size_one(8192, 4096, STRING_UNITS_10, "32.7 MB"); This is a little late, but I just noticed tha

Re: [PATCH] string: Improve the generic strlcpy() implementation

2015-10-19 Thread Rasmus Villemoes
On Mon, Oct 05 2015, Ingo Molnar wrote: > * Linus Torvalds wrote: > >> On Thu, Sep 10, 2015 at 8:43 PM, Chris Metcalf wrote: >> > >> > Please pull the following changes for 4.3 from: >> > >> > git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile.git >> > strscpy >> >> So I fina

Re: [PATCH] intel: i40e: fix confused code

2015-10-20 Thread Rasmus Villemoes
On Mon, Oct 19 2015, "Nelson, Shannon" wrote: >> From: Rasmus Villemoes [mailto:li...@rasmusvillemoes.dk] >> Sent: Saturday, October 17, 2015 1:58 PM >> Subject: [PATCH] intel: i40e: fix confused code >> >> This code is pretty confused. The variable name

[PATCH 01/13] lib/vsprintf.c: pull out padding code from dentry_name()

2015-10-20 Thread Rasmus Villemoes
Pull out the logic in dentry_name() which handles field width space padding, in preparation for reusing it from string(). Rename the widen() helper to move_right(), since it is used for handling the !(flags & LEFT) case. Cc: Al Viro Cc: Ingo Molnar Signed-off-by: Rasmus Villemoes ---

[PATCH 07/13] lib/test_printf.c: don't BUG

2015-10-20 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. Cc: Kees Cook Signed-off-by: Rasmus Villemoes --- lib/test_printf.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[PATCH 08/13] lib/test_printf.c: check for out-of-bound writes

2015-10-20 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. Cc: Kees Cook Signed-off-by: Rasmus Villemoes --- lib/test_printf.c | 24 +++- 1 file changed, 19 insertions(+), 5 deletions

[PATCH 09/13] lib/test_printf.c: add a few string tests

2015-10-20 Thread Rasmus Villemoes
Cc: Kees Cook Signed-off-by: Rasmus Villemoes --- lib/test_printf.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/test_printf.c b/lib/test_printf.c index 1ce1a1dd8faf..80ddafb2675d 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -166,6 +166,10 @@ test_string(void

Re: [PATCH 2/3] lib/string_helpers.c: don't lose precision in string_get_size()

2015-10-26 Thread Rasmus Villemoes
So I also played with this over the weekend, and also threw together a stupid script to check the output. I see you have more or less the same idea I used, namely to combine size and blk_size earlier. I put some code on github, https://github.com/Villemoes/get_size. All versions still fail a very

Re: [PATCH 3/3] lib/test-string_helpers.c: add string_get_size() tests

2015-10-26 Thread Rasmus Villemoes
On Mon, Oct 26 2015, Vitaly Kuznetsov wrote: > Add a couple of simple tests for string_get_size(). > > Signed-off-by: Vitaly Kuznetsov > --- > lib/test-string_helpers.c | 44 > 1 file changed, 44 insertions(+) > > diff --git a/lib/test-string_helpers

[PATCH] kernel/params.c: remove confusing cast

2015-10-01 Thread Rasmus Villemoes
Both sides of the assignment are const char*, so this cast is unnecessary and confusing. Signed-off-by: Rasmus Villemoes --- kernel/params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/params.c b/kernel/params.c index b6554aa71094..0b433fdb45eb 100644 --- a/kernel

[PATCH] [SCSI] fnic: use kzalloc in fnic_fcoe_process_vlan_resp

2015-10-01 Thread Rasmus Villemoes
This saves a little .text and avoids the sizeof(...) style inconsistency. Signed-off-by: Rasmus Villemoes --- drivers/scsi/fnic/fnic_fcs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c index bf0bbd42efb5

[PATCH] [media] drxd: use kzalloc in drxd_attach()

2015-10-01 Thread Rasmus Villemoes
This saves a little .text and removes the sizeof(...) style inconsistency. Use sizeof(*state) in accordance with CodingStyle. Signed-off-by: Rasmus Villemoes --- drivers/media/dvb-frontends/drxd_hard.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/dvb

[PATCH] linux/thermal.h: rename KELVIN_TO_CELSIUS to DECI_KELVIN_TO_CELSIUS

2015-10-01 Thread Rasmus Villemoes
The macros KELVIN_TO_CELSIUS and CELSIUS_TO_KELVIN actually convert between deciKelvins and Celsius, so rename them to reflect that. While at it, use a statement expression in DECI_KELVIN_TO_CELSIUS to prevent expanding the argument multiple times and get rid of a few casts. Signed-off-by: Rasmus

[PATCH] kernel: time: timer.c: use __fls in apply_slack()

2015-10-02 Thread Rasmus Villemoes
1192106, but that is a false positive: Coverity is not aware that mask != 0 implies that find_last_bit will not return BITS_PER_LONG. Signed-off-by: Rasmus Villemoes --- kernel/time/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/timer.c b/kernel/time

[PATCH 2/2] slab.h: sprinkle __assume_aligned attributes

2015-10-02 Thread Rasmus Villemoes
ith a little overlap. Maybe arches which do not allow unaligned stores gain even more. I don't know if gcc can actually make use of alignments greater than 8 for anything, so one could probably drop the __assume_xyz_alignment macros and just use __assume_aligned(8). Signed-off-by: Rasmus

[PATCH 1/2] compiler.h: add support for function attribute assume_aligned

2015-10-02 Thread Rasmus Villemoes
gcc 4.9 added the function attribute assume_aligned, indicating to the caller that the returned pointer may be assumed to have a certain minimal alignment. This is useful if, for example, the return value is passed to memset(). Add a shorthand macro for that. Signed-off-by: Rasmus Villemoes

[PATCH] lib/vsprintf.c: update documentation

2015-10-02 Thread Rasmus Villemoes
%n is no longer just ignored; it results in early return from vsnprintf. Also add a request to add test cases for future %p extensions. Signed-off-by: Rasmus Villemoes --- applies on top of lib-documentation-synchronize-%p-formatting-documentation.patch and its -fix. Documentation/printk

Re: RFC: reduce CONFIG_SCSI_CONSTANTS impact by 4k

2015-10-03 Thread Rasmus Villemoes
136 160 +24 additional 11312 2824 -8488 Signed-off-by: Rasmus Villemoes --- drivers/scsi/constants.c | 25 + drivers/scsi/sense_codes.h | 2 -- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/s

[PATCH 0/2] scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k

2015-10-05 Thread Rasmus Villemoes
8K delta, however). Tested with a trivial module calling scsi_extd_sense_format with a few random known codes and comparing the result to the expected value. Rasmus Villemoes (2): scsi: move Additional Sense Codes to separate file scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k

[PATCH 1/2] scsi: move Additional Sense Codes to separate file

2015-10-05 Thread Rasmus Villemoes
This is a purely mechanical move of the list of additional sense codes to a separate file, in preparation for reducing the impact of choosing CONFIG_SCSI_CONSTANTS=y by about 8k.. Signed-off-by: Rasmus Villemoes --- drivers/scsi/constants.c | 839

[PATCH 2/2] scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k

2015-10-05 Thread Rasmus Villemoes
: 0/0 grow/shrink: 1/1 up/down: 24/-8488 (-8464) function old new delta scsi_extd_sense_format 136 160 +24 additional 113122824 -8488 Signed-off-by: Rasmus Villemoes --- drivers/scsi/c

Re: [PATCH rdma-next v4 2/3] test_overflow: Add shift overflow tests

2018-08-06 Thread Rasmus Villemoes
upstream during next merge window. > Co-developed-by: Rasmus Villemoes > Signed-off-by: Kees Cook > --- > +static int __init test_overflow_shift(void) > +{ > + int err = 0; > + > +/* Args are: value, shift, type, expected result, overflow expected */ > +#defin

Re: [PATCH] linux/bitmap.h: fix BITMAP_LAST_WORD_MASK

2018-08-06 Thread Rasmus Villemoes
On 2018-07-26 12:15, Wei Wang wrote: > On 07/26/2018 05:37 PM, Yury Norov wrote: >> On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote: >>> The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is >>> 0. This patch changes the macro to return 0 when there is no bit >>> needs to

reboot on wandboard fails with v4.14.67 (bisected to 2059e527a6)

2018-08-29 Thread Rasmus Villemoes
We're using imx_v6_v7_defconfig on our Wandboards. After upgrading to v4.14.67, reboot no longer works (or, well, takes a very long time when the watchdog is configured). v4.14.66 works fine, the breakage bisects to 2059e527a659cf16d6bb709f1c8509f7a7623fc4 (ARM: imx_v6_v7_defconfig: Select ULPI su

Re: reboot on wandboard fails with v4.14.67 (bisected to 2059e527a6)

2018-08-29 Thread Rasmus Villemoes
On 2018-08-29 11:55, Rasmus Villemoes wrote: > We're using imx_v6_v7_defconfig on our Wandboards. After upgrading to > v4.14.67, reboot no longer works (or, well, takes a very long time when > the watchdog is configured). > > v4.14.66 works fine, the

Re: reboot on wandboard fails with v4.14.67 (bisected to 2059e527a6)

2018-08-29 Thread Rasmus Villemoes
On 2018-08-29 12:55, Rasmus Villemoes wrote: > On 2018-08-29 11:55, Rasmus Villemoes wrote: >> We're using imx_v6_v7_defconfig on our Wandboards. After upgrading to >> v4.14.67, reboot no longer works (or, well, takes a very long time when >> the watchdog is configured).

Re: [RFC][PATCH] lib/string: introduce sysfs_strncpy() and sysfs_strlcpy()

2018-08-21 Thread Rasmus Villemoes
On 2018-08-21 08:24, Sergey Senozhatsky wrote: > +/** > + * sysfs_strncpy - Trim a length-limited C-string (wgutesoaces and a trailing > + * newline symbol) and copy into a buffer > + * @dest: Where to copy the string to > + * @src: Where to copy the string from > + * @count: The ma

Re: [RFC][PATCH] lib/string: introduce sysfs_strncpy() and sysfs_strlcpy()

2018-08-21 Thread Rasmus Villemoes
On 2018-08-21 11:50, Sergey Senozhatsky wrote: > Hi Rasmus, > > On (08/21/18 09:59), Rasmus Villemoes wrote: >>> +char *sysfs_strncpy(char *dest, const char *src, size_t count) >>> +{ >>> + char *c; >>> + >>> + strncpy(dest, skip_spaces(s

[PATCH 3/4] lib/, include/: avoid const-laundering warnings

2018-08-22 Thread Rasmus Villemoes
Even though str*() launders the const away for us, we should and do not modify the buffer through the returned pointer, so might as well declare it const. Signed-off-by: Rasmus Villemoes --- include/linux/cpumask.h | 2 +- lib/bitmap.c| 2 +- lib/parser.c| 2 +- 3 files

[PATCH 4/4] kernel/, init/: avoid const-laundering warnings

2018-08-22 Thread Rasmus Villemoes
Even though str*() launders the const away for us, we should and do not modify the buffer through the returned pointer, so might as well declare it const. Signed-off-by: Rasmus Villemoes --- init/do_mounts.c | 2 +- kernel/module.c | 2 +- kernel/params.c | 2 +- 3 files changed, 3 insertions

[PATCH 2/4] drivers/base/devtmpfs.c: don't pretend path is const in delete_path

2018-08-22 Thread Rasmus Villemoes
path is the result of kstrdup, and we repeatedly call strrchr on it, modifying it through the returned pointer. So there's no reason to pretend path is const. Signed-off-by: Rasmus Villemoes --- drivers/base/devtmpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[PATCH 1/4] string: try to find const-laundering bugs

2018-08-22 Thread Rasmus Villemoes
heir definitions similarly. Signed-off-by: Rasmus Villemoes --- Patches 2,3,4 can be applied independently of each other and this one, and just serve as examples of the kind of churn enabling these unconditionally would give. While playing with this, I haven't found any obvious bugs, bu

Re: [PATCH 1/4] string: try to find const-laundering bugs

2018-08-22 Thread Rasmus Villemoes
On 2018-08-22 13:07, Joe Perches wrote: > On Wed, 2018-08-22 at 13:00 +0200, Rasmus Villemoes wrote: >> This wraps strchr and friends in macros that ensure the return value has >> type const char* if the passed-in string (which the return value points >> into) also has type c

Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.

2018-01-24 Thread Rasmus Villemoes
on modern hardware. And we don't use strscpy() > in a performance critical paths to copy large amounts of data, > so it shouldn't matter anyway. > > Fixes: 30035e45753b7 ("string: provide strscpy()") > Signed-off-by: Andrey Ryabinin > Cc: > Acked-by: Rasmus Vi

Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.

2018-01-24 Thread Rasmus Villemoes
On 2018-01-09 17:47, Andrey Ryabinin wrote: > Attached user space program I used to see the difference. > Usage: > gcc -02 -o strscpy strscpy_test.c > ./strscpy {b|w} src_str_len count > > src_str_len - length of source string in between 1-4096 > count - how many strscpy() to execute.

[PATCH v4 1/2] irqchip: add support for Layerscape external interrupt lines

2018-01-25 Thread Rasmus Villemoes
The LS1021A allows inverting the polarity of six interrupt lines IRQ[0:5] via the scfg_intpcr register, effectively allowing IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. We just need to check the type, set the relevant bit in INTPCR accordingly, and fixup the type argument before calling

[PATCH v4 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-01-25 Thread Rasmus Villemoes
This adds Device Tree binding documentation for the external interrupt lines with configurable polarity present on some Layerscape SOCs. Signed-off-by: Rasmus Villemoes --- Changes since v3: Add non-empty commit log. .../interrupt-controller/fsl,ls-extirq.txt | 44

Re: [PATCH v2] ARM: dts: ls1021a: add nodes for on-chip ram

2018-01-19 Thread Rasmus Villemoes
On 2018-01-03 16:45, Rasmus Villemoes wrote: > Although the two nodes constitute one contiguous 128K region, still > describe them separately: > > - That's how they are described in the reference manual: "Each OCRAM > occupies a 64 KB of address region...", and t

Re: [PATCH] NFSD: hide unused svcxdr_dupstr()

2018-01-19 Thread Rasmus Villemoes
On 2018-01-19 15:54, Arnd Bergmann wrote: > There is now only one caller left for svcxdr_dupstr() and this is inside > of an #ifdef, so we can get a warning when the option is disabled: > > fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used > [-Werror=unused-function] > > This

[PATCH v3 1/2] irqchip: add support for Layerscape external interrupt lines

2018-01-22 Thread Rasmus Villemoes
The LS1021A allows inverting the polarity of six interrupt lines IRQ[0:5] via the scfg_intpcr register, effectively allowing IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. We just need to check the type, set the relevant bit in INTPCR accordingly, and fixup the type argument before calling

[PATCH v3 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-01-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- .../interrupt-controller/fsl,ls-extirq.txt | 44 ++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.txt diff --git a/Documentation/devicetree/bindings

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-22 Thread Rasmus Villemoes
On 2018-01-19 19:42, Linus Torvalds wrote: > > I actually asked (long long ago) for an optinal compiler warning for > "pointer subtraction with non-power-of-2 sizes". Not because of it > being undefined, but simply because it's expensive. The > divide->multiply thing doesn't always work, Huh? If

Re: [RFC PATCH] vsprintf: add flag ZEROPAD handling before crng is ready

2018-01-26 Thread Rasmus Villemoes
On 26 January 2018 at 10:17, Andy Shevchenko wrote: > +Rasmus Thanks. > On Fri, 2018-01-26 at 15:39 +0800, Yang Shunyong wrote: >> Before crng is ready, output of "%p" composes of "(ptrval)" and >> left padding spaces for alignment as no random address can be >> generated. This seems a little st

Re: [PATCH v2] of: use hash based search in of_find_node_by_phandle

2018-01-26 Thread Rasmus Villemoes
On 2018-01-26 09:31, Chintan Pandya wrote: > Implement, device-phandle relation in hash-table so > that look up can be faster, irrespective of where my > device is defined in the DT. > > There are ~6.7k calls to of_find_node_by_phandle() and > total improvement observed during boot is 400ms. I'm

[PATCH] ARM: dts: ls1021a: add quadspi node

2018-01-26 Thread Rasmus Villemoes
Add a node to device tree repesenting the QuadSPI controller present on LS1021a. Driver support has been present since e8c034b2fbe5 (mtd: spi-nor: fsl-quadspi: add support for ls1021a). Signed-off-by: Rasmus Villemoes --- arch/arm/boot/dts/ls1021a.dtsi | 14 ++ 1 file changed, 14

Re: [PATCH v5 1/2] printk: Add console owner and waiter logic to load balance console writes

2018-01-17 Thread Rasmus Villemoes
On 2018-01-12 18:11, Steven Rostedt wrote: > On Fri, 12 Jan 2018 11:54:54 -0500 > Steven Rostedt wrote: > >> #include >> #include >> #include >> #include >> #include >> #include >> >> > > >> >> Hmm, how does one have git commit not remove the C preprocessor at the >> start of the module?

[PATCH] wireless: broadcom: radio_2056: delete duplicated macro definitions

2018-01-08 Thread Rasmus Villemoes
b1 - Signed-off-by: Rasmus Villemoes --- drivers/net/wireless/broadcom/b43/radio_2056.h | 519 - 1 file changed, 519 deletions(-) diff --git a/drivers/net/wireless/broadcom/b43/radio_2056.h b/drivers/net/wireless/broadcom/b43/radio_2056.h index 59297fdce5e3..779b80ea072f

[PATCH] Input: cyapa - remove duplicated macro definitions

2018-01-08 Thread Rasmus Villemoes
Apart from whitespace differences, this block of macros is repeated twice: $ x=./drivers/input/mouse/cyapa_gen3.c; diff -w -u <(sed -n '139,181p' $x) <(sed -n '182,224p' $x) $ Signed-off-by: Rasmus Villemoes --- drivers/input/mouse/cyapa_gen3.c | 43 -

[PATCH] ida: do zeroing in ida_pre_get

2018-01-08 Thread Rasmus Villemoes
115 119 +4 vermagic 27 28 +1 ida_get_new_above715 627 -88 Signed-off-by: Rasmus Villemoes --- lib/idr.c| 2 -- lib/radix-tree.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions

[PATCH] scsi: fnic: use kzalloc in fnic_fcoe_process_vlan_resp

2018-01-08 Thread Rasmus Villemoes
This saves a little .text and gets rid of the unmotivated line break and the sizeof(...) style inconsistency. Signed-off-by: Rasmus Villemoes --- drivers/scsi/fnic/fnic_fcs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic

Re: [PATCH 1/2] bitmap: new bitmap_copy_safe and bitmap_{from,to}_arr32

2018-01-08 Thread Rasmus Villemoes
On 28 December 2017 at 16:00, Yury Norov wrote: > > In this patch, bitmap_copy_safe and bitmap_{from,to}_arr32 are introduced. > > 'Safe' in bitmap_copy_safe() stands for clearing unused bits in bitmap > beyond last bit till the end of last word. It is useful for hardening > API when bitmap is ass

Re: a Heisenbug tale

2018-03-10 Thread Rasmus Villemoes
On 2018-03-09 10:45, Ard Biesheuvel wrote: > On 8 March 2018 at 23:19, Rasmus Villemoes wrote: >> On 2018-03-07 20:25, Leonard Crestez wrote: >>> Hello, >>> >> >> What we ended up doing was to explicitly set the mtime of every file in >> the repo to t

Re: [PATCH 1/4] gpio: Remove VLA from gpiolib

2018-03-12 Thread Rasmus Villemoes
On 2018-03-10 01:10, Laura Abbott wrote: > /* collect all inputs belonging to the same chip */ > first = i; > - memset(mask, 0, sizeof(mask)); > + memset(mask, 0, sizeof(*mask)); see below > @@ -2887,14 +2909,30 @@ void gpiod_set_array_value_com

Re: [PATCH 1/4] gpio: Remove VLA from gpiolib

2018-03-13 Thread Rasmus Villemoes
On 2018-03-13 00:40, Laura Abbott wrote: > On 03/12/2018 08:00 AM, Rasmus Villemoes wrote: >> >> Hm, it seems you're now only clearing the first word of mask, not the >> entire allocation. Why not just use kcalloc() instead of kmalloc_array >> to have it automatica

Re: [PATCH] vsprintf: Make "null" pointer dereference more robust

2018-03-05 Thread Rasmus Villemoes
On 2 March 2018 at 13:53, Petr Mladek wrote: > %p has many modifiers where the pointer is dereferenced. An invalid > pointer might cause kernel to crash silently. > > Note that printk() formats the string under logbuf_lock. Any recursive > printks are redirected to the printk_safe implementation a

Re: [PATCH] staging: lustre: Remove VLA usage

2018-03-07 Thread Rasmus Villemoes
On 2018-03-07 06:46, Kees Cook wrote: > The kernel would like to remove all VLA usage. This switches to a > simple kasprintf() instead. > > Signed-off-by: Kees Cook > --- > drivers/staging/lustre/lustre/llite/xattr.c | 19 +-- > 1 file changed, 13 insertions(+), 6 deletions(-) >

Re: [PATCH] staging: lustre: Remove VLA usage

2018-03-07 Thread Rasmus Villemoes
On Wed, Mar 07 2018, Kees Cook wrote: > On Wed, Mar 7, 2018 at 5:10 AM, Rasmus Villemoes > wrote: >> On 2018-03-07 06:46, Kees Cook wrote: >>> The kernel would like to remove all VLA usage. This switches to a >>> simple kasprintf() instead. >>> >>

[PATCH] objtool: fix build with future Make

2018-03-25 Thread Rasmus Villemoes
To detect this change search for 'nocomment' in the .FEATURES variable. There are likely other places in the tree that will need fixing, so cc-ing Kbuild, but with this at least a x86-64 defconfig builds. Signed-off-by: Rasmus Villemoes --- tools/objtool/Makefile | 2 +- tools/scri

[PATCH 2/1] Kbuild: fix # escaping in .cmd files for future Make

2018-03-25 Thread Rasmus Villemoes
r future Make release contains that change by fixing up the .cmd file escaping - without this, make always thinks the command string has changed and hence rebuilds everything. Signed-off-by: Rasmus Villemoes --- So the previous patch made everything build, but building again revealed that thi

Re: [PATCH 2/1] Kbuild: fix # escaping in .cmd files for future Make

2018-04-05 Thread Rasmus Villemoes
On 2018-03-26 13:48, Masahiro Yamada wrote: > 2018-03-26 8:09 GMT+09:00 Rasmus Villemoes : >> The latest official Make release is 4.2.1 from mid-2016, but the current >> git release has this relevant note in the NEWS file: >> >> * WARNING: Backward-incompati

Re: [PATCH v4 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2018-04-06 Thread Rasmus Villemoes
On 2018-04-04 10:58, Petr Mladek wrote: > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > index 3551b7957d9e..1a080a75a825 100644 > --- a/lib/vsprintf.c > +++ b/lib/vsprintf.c > @@ -599,12 +599,46 @@ char *__string(char *buf, char *end, const char *s, > struct printf_spec spec) > return wide

Re: [PATCH v4 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2018-04-06 Thread Rasmus Villemoes
On 2018-04-06 14:26, Petr Mladek wrote: > On Thu 2018-04-05 16:46:23, Rasmus Villemoes wrote: >> On 2018-04-04 10:58, Petr Mladek wrote: >> >>> diff --git a/lib/vsprintf.c b/lib/vsprintf.c >>> index 3551b7957d9e..1a080a75a825 100644 >>> --- a/lib/vsprintf

Re: [PATCH v4 4/9] vsprintf: Consolidate handling of unknown pointer specifiers

2018-04-06 Thread Rasmus Villemoes
On 2018-04-06 13:43, Petr Mladek wrote: > On Thu 2018-04-05 16:55:35, Joe Perches wrote: >> On Thu, 2018-04-05 at 16:45 -0700, Joe Perches wrote: >>> On Thu, 2018-04-05 at 16:25 +0200, Rasmus Villemoes wrote: >>>> Even just git grep -1 -E '%p"$' finds %

Re: [PATCH?] reiserfs: prevent panic: don't allow %-char in journal dev. name

2018-04-06 Thread Rasmus Villemoes
On 2018-04-05 11:04, Rasmus Villemoes wrote: > On 2018-04-05 03:45, Andrew Morton wrote: >> >> Isn't the bug in journal_init_dev()? > > Urgh. At first I was about to reply that the real bug was in reiserfs.h > for failing to annotate __reiserfs_warning with __printf

[PATCH v2] Kbuild: fix # escaping in .cmd files for future Make

2018-04-08 Thread Rasmus Villemoes
s the above change, but at least this builds an x86_64 defconfig with the new make. Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=197847 Cc: Randy Dunlap Signed-off-by: Rasmus Villemoes --- v2: - squash the original objtool-only patch with the patch fixing up make-cmd, to avoid repeating

Re: detecting integer constant expressions in macros

2018-03-21 Thread Rasmus Villemoes
On 2018-03-21 00:08, Linus Torvalds wrote: > On Tue, Mar 20, 2018 at 3:13 PM, Uecker, Martin > wrote: >> >> here is an idea: > > That's not "an idea". > > That is either genius, or a seriously diseased mind. > > I can't quite tell which. > >> a test for integer constant expressions which retur

[RFC PATCH 1/2] modpost: delete stale comment

2018-03-22 Thread Rasmus Villemoes
Commit (7840fea200cd "kbuild: Fix computing srcversion for modules") fixed the comment above parse_source_files to refer to the new source_ line, but left this one behind that could still give the impression that drivers/net/dummy.c appears in the deps_ variable. Signed-off-by: Rasmus

[RFC PATCH 2/2] modpost: sumversions: try to fix "same dir" logic

2018-03-22 Thread Rasmus Villemoes
e included file using . as starting point, we include it - otherwise it was found via some -I path, so do not include it". In any case, this is mostly just something I stumbled on because I'm about to change the .o.cmd layout slightly, so I'd like to know what the rules are really supp

[PATCH] MAINTAINERS: Update Kbuild entry with a few paths

2018-03-22 Thread Rasmus Villemoes
/Makefile itself, and add one matching the Kbuild.include file as well. Signed-off-by: Rasmus Villemoes --- Hi Kbuild maintainers. Hope you don't mind me extending this entry a bit. MAINTAINERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS

[RFC resend 1/2] modpost: delete stale comment

2018-03-22 Thread Rasmus Villemoes
Commit (7840fea200cd "kbuild: Fix computing srcversion for modules") fixed the comment above parse_source_files to refer to the new source_ line, but left this one behind that could still give the impression that drivers/net/dummy.c appears in the deps_ variable. Signed-off-by: Rasmus

[RFC resend 2/2] modpost: sumversions: try to fix "same dir" logic

2018-03-22 Thread Rasmus Villemoes
e included file using . as starting point, we include it - otherwise it was found via some -I path, so do not include it". In any case, this is mostly just something I stumbled on because I'm about to change the .o.cmd layout slightly, so I'd like to know what the rules are really

Re: [PATCH 3/4] mm: Add free()

2018-03-23 Thread Rasmus Villemoes
On 2018-03-22 20:58, Matthew Wilcox wrote: > From: Matthew Wilcox > > free() can free many different kinds of memory. I'd be a bit worried about using that name. gcc very much knows about the C standard's definition of that function, as can be seen on godbolt.org by compiling void free(const vo

Re: [PATCH v2 1/3] vsprintf: Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 2018-03-08 04:30, Kees Cook wrote: > In the quest to remove all stack VLAs from the kernel[1], this introduces > a new "simple max" macro, and changes the "sym" array size calculation to > use it. The value is actually a fixed size, but since the max() macro uses > some extensive tricks for safe

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 2018-03-08 16:02, Josh Poimboeuf wrote: > On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: >> This series adds SIMPLE_MAX() to be used in places where a stack array >> is actually fixed, but the compiler still warns about VLA usage due to >> confusion caused by the safety checks in the

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 8 March 2018 at 21:39, Kees Cook wrote: > On Thu, Mar 8, 2018 at 11:57 AM, Rasmus Villemoes > wrote: >> On 2018-03-08 16:02, Josh Poimboeuf wrote: >>> On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: >>> +extern long __error_incompatible_types_

a Heisenbug tale (was: Re: arm crypto .S_shipped files sometimes get rebuilt randomly)

2018-03-08 Thread Rasmus Villemoes
On 2018-03-07 20:25, Leonard Crestez wrote: > Hello, > > I am using a toolchain with a broken/old version of perl which doesn't > include integer.pm and I noticed it triggers occasional build failures > on arch/arm64/crypto/sha512-core.S_shipped. Workarounds are easy, but > if the purpose of the .

Re: [PATCH] test_rhashtable: avoid gcc-8 -Wformat-overflow warning

2018-03-13 Thread Rasmus Villemoes
On 2018-03-13 14:21, Arnd Bergmann wrote: > gcc-8 warns about a code pattern that is used in the newly added > test_rhashtable code: > > lib/test_rhashtable.c: In function 'print_ht': > lib/test_rhashtable.c:511:21: error: ' > bucket[' directive writing 8 bytes into a region of size between 1 and

Re: [PATCH 0/3] Kbuild: Some fixdep tweaks

2018-09-26 Thread Rasmus Villemoes
On 15 August 2018 at 16:27, Rasmus Villemoes wrote: > These patches eliminate two (albeit tiny and shortlived) processes > from the cmd_and_fixdep rule, i.e. from every TU being > compiled. Whether the diffstat below is worth it I'll leave to Kbuild > maintainers to decide. Ping.

Re: [PATCH v8 02/10] Makefile: Prepare for using macros for inline asm

2018-09-27 Thread Rasmus Villemoes
On 2018-09-26 19:56, Nadav Amit wrote: > at 1:58 AM, Rasmus Villemoes wrote: > >>> +ASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s >>> +export ASM_MACRO_FLAGS >>> +KBUILD_CFLAGS += $(ASM_MACRO_FLAGS) >> How does this affect what gets rebuilt when one of the

Re: [PATCH 06/22] linux/printk.h: use unique identifier for each struct _ddebug

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 10:22, Petr Mladek wrote: > On Thu 2018-09-20 00:04:28, Rasmus Villemoes wrote: >> Changes on x86-64 later in this series require that all struct _ddebug >> descriptors in a translation unit uses distinct identifiers. Realize >> that for pr_debug_ratelimited

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 01:13, Kees Cook wrote: > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: >> Provide a resource managed version of kstrdup_const(). This variant >> internally calls devm_kstrdup() on pointers that are outside of >> .rodata section and returns the string as is otherwise. >

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 13:01, Geert Uytterhoeven wrote: > Hi Rasmus, > > On Thu, Sep 27, 2018 at 12:55 PM Rasmus Villemoes > wrote: >> On 2018-09-27 01:13, Kees Cook wrote: >> >> Just drop devm_kfree_const and teach devm_kfree to ignore >> is_kernel_rodata(). That avo

Re: [PATCH v5 2/4] mm: move is_kernel_rodata() to asm-generic/sections.h

2018-09-28 Thread Rasmus Villemoes
On 2018-09-28 09:14, Bartosz Golaszewski wrote: > Export this routine so that we can use it later in devm_kstrdup_const() > and devm_kfree_const(). s/devm_kfree_const/devm_kfree/. Apart from that nit, feel free to add my ack to 1,2,3. Thanks, Rasmus

Re: [PATCH 5/8] kbuild: change if_changed_rule to accept multi-line recipe

2018-11-15 Thread Rasmus Villemoes
On 15/11/2018 09.27, Masahiro Yamada wrote: > GNU Make supports 'define' ... 'endef' directive, which can describe > a recipe that consists of multiple lines. > > endef > > This does not actually exploit the benefits of 'define' ... 'endef' > form. All shell commands must be concatenated with '

Re: [PATCH] fork: Fix two -Wmissing-prototypes warnings

2018-11-13 Thread Rasmus Villemoes
On 13/11/2018 08.26, Yi Wang wrote: > We get two warning when building kernel with W=1: > kernel/fork.c:167:13: warning: no previous prototype for > ‘arch_release_thread_stack’ [-Wmissing-prototypes] > kernel/fork.c:779:13: warning: no previous prototype for ‘fork_init’ > [-Wmissing-prototypes]

Re: [PATCH v2 4/4] x86/static_call: Add inline static call implementation for x86-64

2018-11-30 Thread Rasmus Villemoes
On 29/11/2018 20.22, Josh Poimboeuf wrote: > On Thu, Nov 29, 2018 at 02:16:48PM -0500, Steven Rostedt wrote: >>> and honestly, the way "static_call()" works now, can you guarantee >>> that the call-site doesn't end up doing that, and calling the >>> trampoline function for two different static call

Re: [PATCH RFC 0/3] Static calls

2018-11-09 Thread Rasmus Villemoes
On 09/11/2018 16.16, Andy Lutomirski wrote: > On Thu, Nov 8, 2018 at 11:28 PM Ingo Molnar wrote: >> >> >> All other usecases are bonus, but it would certainly be interesting to >> investigate the impact of using these APIs for tracing: that too is a >> feature enabled everywhere but utilized only

[PATCH v3 10/23] dynamic_debug: remove unused EXPORT_SYMBOLs

2018-11-09 Thread Rasmus Villemoes
Baron Signed-off-by: Rasmus Villemoes --- lib/dynamic_debug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index ab81155f928d..f1de45a100fa 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -868,7 +868,6 @@ int ddebug_add_module(struct

<    1   2   3   4   5   6   7   8   9   10   >