Re: [PATCH v2 2/3] binder: do not initialize locals passed to copy_from_user()

2020-03-05 Thread Rasmus Villemoes
On 02/03/2020 19.31, Jann Horn wrote: > On Mon, Mar 2, 2020 at 7:17 PM Alexander Potapenko wrote: >> On Mon, Mar 2, 2020 at 3:00 PM Joe Perches wrote: >>> >>> So? CONFIG_INIT_STACK_ALL by design slows down code. >> Correct. >> >>> This marking would likely need to be done for nearly all >>>

Re: [PATCH] Staging: octeon: Avoid several usecases of strcpy

2019-09-11 Thread Rasmus Villemoes
On 11/09/2019 11.16, Dan Carpenter wrote: > On Wed, Sep 11, 2019 at 11:04:38AM +0200, Sandro Volery wrote: >> >> >>> On 11 Sep 2019, at 10:52, Dan Carpenter wrote: >>> >>> On Wed, Sep 11, 2019 at 08:23:59AM +0200, Sandro Volery wrote: strcpy was used multiple times in strcpy to write into

Re: [PATCH] Staging: exfat: Avoid use of strcpy

2019-09-11 Thread Rasmus Villemoes
On 11/09/2019 10.41, Dan Carpenter wrote: > On Wed, Sep 11, 2019 at 07:57:49AM +0200, Sandro Volery wrote: >> Replaced strcpy with strscpy in exfat_core.c. >> >> Signed-off-by: Sandro Volery >> --- >> drivers/staging/exfat/exfat_core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>

Re: [PATCH] media: meson: Add NULL check after the call to kmalloc()

2019-09-04 Thread Rasmus Villemoes
On 04/09/2019 10.22, Austin Kim wrote: > If the kmalloc() return NULL, the NULL pointer dereference will occur. > new_ts->ts = ts; > > Add exception check after the call to kmalloc() is made. > > Signed-off-by: Austin Kim > --- > drivers/staging/media/meson/vdec/vdec_helpers.c | 4 >

[PATCH v2] staging: greybus: loopback.c: remove unused lists

2018-10-24 Thread Rasmus Villemoes
. Reviewed-by: Bryan O'Donoghue Signed-off-by: Rasmus Villemoes --- Sending as a proper patch. Marked v2 since this replaces earlier 2/3 and 3/3 patches. Applies on top of b4fc4e8340784e30c5a59bf0791f9c3ce15e (staging: greybus: loopback.c: remove unused gb_loopback::lbid). drivers/staging

Re: [PATCH 2/3] staging: greybus: loopback.c: do insertion in O(n) instead of O(n lg n)

2018-10-23 Thread Rasmus Villemoes
On 2018-10-11 01:03, Bryan O'Donoghue wrote: > On 05/10/2018 15:28, Rasmus Villemoes wrote: >> Signed-off-by: Rasmus Villemoes >> --- >> I have no idea if the performance matters (it probably doesn't). Feel >> free to ignore this and the followup cleanup. > > What

Re: [PATCH 2/3] staging: greybus: loopback.c: do insertion in O(n) instead of O(n lg n)

2018-10-11 Thread Rasmus Villemoes
On 2018-10-11 01:03, Bryan O'Donoghue wrote: > On 05/10/2018 15:28, Rasmus Villemoes wrote: >> Signed-off-by: Rasmus Villemoes >> --- >> I have no idea if the performance matters (it probably doesn't). Feel >> free to ignore this and the followup cleanup. > > What

[PATCH 3/3] staging: greybus: loopback.c: simplify prototype of gb_loopback_bus_id_compare

2018-10-05 Thread Rasmus Villemoes
gb_loopback_bus_id_compare only has a single caller, and it no longer needs to have a prototype compatible with being a callback for list_sort. Signed-off-by: Rasmus Villemoes --- drivers/staging/greybus/loopback.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[PATCH 1/3] staging: greybus: loopback.c: remove unused gb_loopback::lbid

2018-10-05 Thread Rasmus Villemoes
the lbid field is entirely unused outside of this function, so it seems we can just drop it entirely. Signed-off-by: Rasmus Villemoes --- Since lbid isn't mentioned anywhere else in greybus/, it's hard to figure out how it was meant to be used. It does seem like entirely dead (write-only) code.

[PATCH 2/3] staging: greybus: loopback.c: do insertion in O(n) instead of O(n lg n)

2018-10-05 Thread Rasmus Villemoes
"Append to the list and do a merge sort" is not really an insertion sort. While a few more lines of code, we can keep the list sorted doing at most n comparisons by iterating until we find the first element strictly greater than gb. Signed-off-by: Rasmus Villemoes --- I ha

Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case

2018-09-19 Thread Rasmus Villemoes
On 2018-09-19 00:46, Thomas Gleixner wrote: > On Tue, 18 Sep 2018, Andy Lutomirski wrote: >>> >> >> Do we do better if we use signed arithmetic for the whole calculation? >> Then a small backwards movement would result in a small backwards result. >> Or we could offset everything so that we’d have

[PATCH] android: binder: use kstrdup instead of open-coding it

2018-09-07 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/android/binder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index d58763b6b009..2abcf4501d9a 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -5667,12

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

2018-03-07 Thread Rasmus Villemoes
On Wed, Mar 07 2018, Kees Cook <keesc...@chromium.org> wrote: > On Wed, Mar 7, 2018 at 5:10 AM, Rasmus Villemoes > <rasmus.villem...@prevas.dk> wrote: >> On 2018-03-07 06:46, Kees Cook wrote: >>> The kernel would like to remove all VLA usage. This switches to

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

Re: [PATCH 1/1] staging: rtl8723bs: make memcmp() calls consistent

2017-12-13 Thread Rasmus Villemoes
On 2017-12-13 15:49, Hans de Goede wrote: > Hi, > > On 13-12-17 12:47, Greg Kroah-Hartman wrote: >> On Sun, Dec 10, 2017 at 08:35:12PM +0100, Nicolas Iooss wrote: >>> rtw_pm_set() uses memcmp() with 5-chars strings and a length of 4 when >>> parsing extra, and then parses extra+4 as an int: >>>

[PATCH 3/5] staging: speakup: Apply format_template attribute

2017-11-12 Thread Rasmus Villemoes
This serves as human-readable documentation as well as allowing the format_template plugin to complain about any static initializers of this struct member that do not have the same set of printf specifiers. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- drivers/staging/s

Re: [PATCH v2 1/7] lib: string: add functions to case-convert strings

2016-07-07 Thread Rasmus Villemoes
On Tue, Jul 05 2016, Markus Mayer wrote: > Add a collection of generic functions to convert strings to lowercase > or uppercase. > > Changing the case of a string (with or without copying it first) seems > to be a recurring requirement in the kernel that is currently being >

Re: [PATCH 1/6] lib: string: add function strtolower()

2016-07-01 Thread Rasmus Villemoes
On Fri, Jul 01 2016, Markus Mayer wrote: > Add a function called strtolower() to convert strings to lower case > in-place, overwriting the original string. > > This seems to be a recurring requirement in the kernel that is > currently being solved by several duplicated

[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 <li...@rasmusvillemoes.dk> --- drivers/staging/speakup/kobjects.c

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

2015-12-05 Thread Rasmus Villemoes
On Sun, Dec 06 2015, Joe Perches <j...@perches.com> 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 >

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

2015-12-05 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- 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/lov/lov_pack.c in

[PATCH] staging: android: ion: fix some format strings

2015-02-20 Thread Rasmus Villemoes
. Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk --- drivers/staging/android/ion/ion.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index b8f1c491553e..65361ca33fc9 100644

Re: [PATCH] staging: rtl8188eu: core: switch with redundant cases

2015-02-04 Thread Rasmus Villemoes
On Wed, Feb 04 2015, Nicholas Mc Guire hof...@osadl.org wrote: A few redundant switch cases as well as a redundant if/else within one of the cases was consolidated to a single call. The cases are intentionally retained for documentation purposes. [...] diff --git

[PATCH] staging: iio: ad2s1200: Fix sign extension

2015-01-22 Thread Rasmus Villemoes
and 16 bits types, so use that. Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk --- drivers/staging/iio/resolver/ad2s1200.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index

[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 li...@rasmusvillemoes.dk --- drivers/staging/rtl8712/hal_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[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 li...@rasmusvillemoes.dk --- drivers/staging/rtl8712/hal_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[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 li...@rasmusvillemoes.dk --- drivers/staging/vt6655/device_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6655/device_main.c

[PATCH 20/22] staging: r8188eu: Replace strnicmp with strncasecmp

2014-09-16 Thread Rasmus Villemoes
...@driverdev.osuosl.org Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk --- drivers/staging/rtl8188eu/os_dep/rtw_android.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/rtw_android.c b/drivers/staging/rtl8188eu/os_dep/rtw_android.c index ca2736d..2b5ddc3

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

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

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

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

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

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

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

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

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

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