[PATCH] staging/greybus: eliminate use of NAME_SIZE for strings

2021-02-21 Thread Kumar Kartikeya Dwivedi
Instead, depend on the size of the destination buffer for easier refactoring. Signed-off-by: Kumar Kartikeya Dwivedi --- Hopefully, this is more thorough. The only cases left now are where the destination string is represented by a pointer, otherwise all call sites with a fixed sized buffer have

Re: [PATCH 02/13] staging: greybus: Switch from strlcpy to strscpy

2021-02-16 Thread Kumar Kartikeya Dwivedi
On Tue, Feb 16, 2021 at 08:24:59PM IST, Alex Elder wrote: > This is a good change. But while you're at it, I would > appreciate if you would convert a few spots to use > sizeof(dest) rather than a fixed constant. I will > point them out below. > > If this is the *only* request for a change on yo

[PATCH v3] staging: emxx_udc: Make incorrectly defined global static

2021-02-07 Thread Kumar Kartikeya Dwivedi
d it be static? Signed-off-by: Kumar Kartikeya Dwivedi --- Changes in v1: Switch to variable with static linkage instead of extern Changes in v2: Resend a versioned patch Changes in v3: Include version changelog below the marker --- drivers/staging/emxx_udc/emxx_udc.c | 3 +++ drivers/staging/emxx_

[PATCH v2] staging: emxx_udc: Make incorrectly defined global static

2021-02-07 Thread Kumar Kartikeya Dwivedi
d it be static? Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/emxx_udc/emxx_udc.c | 3 +++ drivers/staging/emxx_udc/emxx_udc.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index a30

Re: [PATCH] staging: emxx_udc: Fix incorrectly defined global

2021-02-06 Thread Kumar Kartikeya Dwivedi
2f52ecd69f21f8dab Mon Sep 17 00:00:00 2001 From: Kumar Kartikeya Dwivedi Date: Sun, 7 Feb 2021 12:53:39 +0530 Subject: [PATCH] staging: emxx_udc: Make incorrectly defined global static The global gpio_desc pointer and int vbus_irq were defined in the header, instead put the definitions in the tr

[PATCH] staging: emxx_udc: Fix incorrectly defined global

2021-02-06 Thread Kumar Kartikeya Dwivedi
t declared. Should it be static? Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/emxx_udc/emxx_udc.c | 3 +++ drivers/staging/emxx_udc/emxx_udc.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/e

[PATCH 13/13] staging: wimax: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/wimax/i2400m/netdev.c | 6 +++--- drivers/staging/wimax/i2400m/usb.c| 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drive

[PATCH 12/13] staging: sm750fb: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/sm750fb/sm750.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm7

[PATCH 11/13] staging: rtl8712: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drive

[PATCH 10/13] staging: rtl8192u: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u

[PATCH 09/13] staging: rtl8192e: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_et

[PATCH 08/13] staging: rtl8188eu: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c

[PATCH 07/13] staging: olpc_dcon: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/olpc_dcon/olpc_dcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging

[PATCH 06/13] staging: octeon: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/octeon/ethernet-mdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/stag

[PATCH 05/13] staging: nvec: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/nvec/nvec_ps2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_p

[PATCH 04/13] staging: most: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/most/sound/sound.c | 2 +- drivers/staging/most/video/video.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/

[PATCH 03/13] staging: fsl-dpaa2: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw-et

[PATCH 02/13] staging: greybus: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/greybus/audio_helper.c | 2 +- drivers/staging/greybus/audio_module.c | 2 +- drivers/staging/greybus/audio_topology.c | 6 +++--- drivers/stagi

[PATCH 00/13] Convert all users of strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
sites that expect truncation. $ spatch --sp-file strscpy.cocci --include-headers --dir --in-place drivers/staging @strscpy@ expression dest, src, size; @@ -strlcpy(dest, src, size); +strscpy(dest, src, size); 2. Each individual automated conversion was rechecked manually for correctness. Kumar

[PATCH 01/13] staging: comedi: Switch from strlcpy to strscpy

2021-01-31 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/stag

[PATCH v2] staging: qlge/qlge_ethtool.c: Switch from strlcpy to strscpy

2021-01-29 Thread Kumar Kartikeya Dwivedi
checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/qlge/qlge_ethtool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/qlge/qlge_ethtool.c b/drivers/st

Re: [PATCH] staging: qlge/qlge_ethtool.c: strlcpy -> strscpy

2021-01-29 Thread Kumar Kartikeya Dwivedi
On 0129, Greg Kroah-Hartman wrote: > [SNIP] > > Yes, because it's copying the source strings to fixed size buffers in > > ethtool_drvinfo, so truncation would be fine here (as it's the driver name > > and > > other identity related stuff). > > So there is no need to make this change, or it is re

Re: [PATCH] staging: qlge/qlge_ethtool.c: strlcpy -> strscpy

2021-01-29 Thread Kumar Kartikeya Dwivedi
On 0129, Greg Kroah-Hartman wrote: > On Fri, Jan 29, 2021 at 01:51:55PM +0530, Kumar Kartikeya Dwivedi wrote: > > [Forgot to reply-all] > > > > On 0129, Greg Kroah-Hartman wrote: > > > On Fri, Jan 29, 2021 at 12:15:23PM +0530, Kumar Kartikeya Dwivedi wrote: > &g

Re: [PATCH] staging: qlge/qlge_ethtool.c: strlcpy -> strscpy

2021-01-29 Thread Kumar Kartikeya Dwivedi
[Forgot to reply-all] On 0129, Greg Kroah-Hartman wrote: > On Fri, Jan 29, 2021 at 12:15:23PM +0530, Kumar Kartikeya Dwivedi wrote: > > Fixes checkpatch warnings for usage of strlcpy. > > What warning would that be? > 5dbdb2d87c294401a22e6a6002f08ebc9fbea38b https://git.

[PATCH] staging: qlge/qlge_ethtool.c: strlcpy -> strscpy

2021-01-28 Thread Kumar Kartikeya Dwivedi
Fixes checkpatch warnings for usage of strlcpy. Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/qlge/qlge_ethtool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/qlge/qlge_ethtool.c b/drivers/staging/qlge/qlge_ethtool.c index a28f0254c