ion VAR;
@@
- ethtool_sprintf
+ ethtool_puts
(&BUF, VAR)
@replace_3_args@
identifier BUF;
expression VAR;
@@
- ethtool_sprintf(&BUF, "%s", VAR)
+ ethtool_puts(&BUF, VAR)
[5]: $ rg "ethtool_sprintf\(\s*[^,)]+\s*,\s*[^,)]+\s*\)"
Use strscpy() to implement ethtool_puts().
Functionally the same as ethtool_sprintf() when it's used with two
arguments or with just "%s" format specifier.
Signed-off-by: Justin Stitt
---
include/linux/ethtool.h | 13 +
net/ethtool/ioctl.c | 7 +++
2 fi
-is but I will send new versions for the others.
[1]: https://lore.kernel.org/all/?q=dfb%3Aethtool_sprintf+AND+f%3Ajustinstitt
Signed-off-by: Justin Stitt
---
drivers/net/ethernet/amazon/ena/ena_ethtool.c | 4 +-
drivers/net/ethernet/brocade/bna/bnad_ethtool.c| 2 +-
.../net/ethernet
thtool_sprintf(&data, "%s", driver[i].name);
The former may cause -Wformat-security warnings while the latter is just
not preferred. Both are safely in the category of warnings, not errors.
Signed-off-by: Justin Stitt
---
scripts/checkpatch.pl | 13 +
1 file changed, 13
On Wed, Oct 25, 2023 at 4:51 PM Joe Perches wrote:
>
> On Wed, 2023-10-25 at 23:40 +, Justin Stitt wrote:
> > This patch converts some basic cases of ethtool_sprintf() to
> > ethtool_puts().
> >
> > The conversions are used in cases where ethtool_sprintf() wa
ethtool_sprintf(BUF, "%s", VAR)
+ ethtool_puts(BUF, VAR)
- ethtool_sprintf(&BUF, "%s", VAR)
+ ethtool_puts(&BUF, VAR)
[5]: $ rg "ethtool_sprintf\(\s*[^,)]+\s*,\s*[^,)]+\s*\)"
Signed-off-by: Justin Stitt
---
Changes in v2:
- wrap lines better in replaceme
thtool_sprintf(&data, "%s", driver[i].name);
The former may cause -Wformat-security warnings while the latter is just
not preferred. Both are safely in the category of warnings, not errors.
Signed-off-by: Justin Stitt
---
scripts/checkpatch.pl | 19 +++
1 file cha
Use strscpy() to implement ethtool_puts().
Functionally the same as ethtool_sprintf() when it's used with two
arguments or with just "%s" format specifier.
Signed-off-by: Justin Stitt
---
include/linux/ethtool.h | 34 +++---
net/ethtool/ioctl.c
htool_sprintf(&data, "%s", buffer[i].name);
which both now become:
| ethtool_puts(&data, buffer[i].name);
Signed-off-by: Justin Stitt
---
drivers/net/dsa/lantiq_gswip.c | 2 +-
drivers/net/dsa/mt7530.c | 2 +
On Thu, Oct 26, 2023 at 3:02 PM Vladimir Oltean wrote:
>
> Hi Justin,
>
> On Thu, Oct 26, 2023 at 09:56:07PM +0000, Justin Stitt wrote:
> > Use strscpy() to implement ethtool_puts().
> >
> > Functionally the same as ethtool_sprintf() when it's used with two
>
On Thu, Oct 26, 2023 at 3:09 PM Justin Stitt wrote:
>
> On Thu, Oct 26, 2023 at 3:02 PM Vladimir Oltean wrote:
> >
> > Hi Justin,
> >
> > On Thu, Oct 26, 2023 at 09:56:07PM +, Justin Stitt wrote:
> > > Use strscpy() to implement ethtool_puts(
On Thu, Oct 26, 2023 at 3:12 PM Vladimir Oltean wrote:
>
> On Thu, Oct 26, 2023 at 09:56:08PM +, Justin Stitt wrote:
> > Add some warnings for using ethtool_sprintf() where a simple
> > ethtool_puts() would suffice.
> >
> > The two cases are:
> >
> &
On Thu, Oct 26, 2023 at 5:25 PM Andrew Lunn wrote:
>
> > Changes in v2:
> > - wrap lines better in replacement (thanks Joe, Kees)
> > - add --fix to checkpatch (thanks Joe)
> > - clean up checkpatch formatting (thanks Joe, et al.)
> > - rebase against next
>
> Please could you explain the rebase a
On Thu, Oct 26, 2023 at 3:25 PM Vladimir Oltean wrote:
>
> On Thu, Oct 26, 2023 at 03:09:59PM -0700, Justin Stitt wrote:
> > Should I undo this? I want my patch against next since it's targeting
> > some stuff in-flight over there. BUT, I also want ethtool_puts() t
On Thu, Oct 26, 2023 at 3:39 PM Joe Perches wrote:
>
> On Thu, 2023-10-26 at 21:56 +, Justin Stitt wrote:
> > Add some warnings for using ethtool_sprintf() where a simple
> > ethtool_puts() would suffice.
> []
> > diff --git a/scripts/checkpatch.pl b/scripts/checkp
Use strscpy() to implement ethtool_puts().
Functionally the same as ethtool_sprintf() when it's used with two
arguments or with just "%s" format specifier.
Signed-off-by: Justin Stitt
---
include/linux/ethtool.h | 13 +
net/ethtool/ioctl.c | 7 +++
2 fi
ethtool_sprintf(BUF, "%s", VAR)
+ ethtool_puts(BUF, VAR)
- ethtool_sprintf(&BUF, "%s", VAR)
+ ethtool_puts(&BUF, VAR)
[5]: $ rg "ethtool_sprintf\(\s*[^,)]+\s*,\s*[^,)]+\s*\)"
Signed-off-by: Justin Stitt
---
Changes in v3:
- fix force_speed_maps merge
thtool_sprintf(&data, "%s", driver[i].name);
The former may cause -Wformat-security warnings while the latter is just
not preferred. Both are safely in the category of warnings, not errors.
Signed-off-by: Justin Stitt
---
scripts/checkpatch.pl | 19 +++
1 file cha
htool_sprintf(&data, "%s", buffer[i].name);
which both now become:
| ethtool_puts(&data, buffer[i].name);
Signed-off-by: Justin Stitt
---
drivers/net/dsa/lantiq_gswip.c | 2 +-
drivers/net/dsa/mt7530.c | 2 +
On Fri, Oct 27, 2023 at 4:43 PM Andrew Lunn wrote:
>
> > +/**
> > + * ethtool_puts - Write string to ethtool string data
> > + * @data: Pointer to start of string to update
>
> Isn't it actually a pointer to a pointer to the start of string to
> update?
I suppose.
FWIW, I just copy-pasted the sp
Use strscpy() to implement ethtool_puts().
Functionally the same as ethtool_sprintf() when it's used with two
arguments or with just "%s" format specifier.
Signed-off-by: Justin Stitt
---
include/linux/ethtool.h | 13 +
net/ethtool/ioctl.c | 7 +++
2 fi
htool_sprintf(&data, "%s", buffer[i].name);
which both now become:
| ethtool_puts(&data, buffer[i].name);
Signed-off-by: Justin Stitt
---
drivers/net/dsa/lantiq_gswip.c | 2 +-
drivers/net/dsa/mt7530.c | 2 +
thtool_sprintf(&data, "%s", driver[i].name);
The former may cause -Wformat-security warnings while the latter is just
not preferred. Both are safely in the category of warnings, not errors.
Signed-off-by: Justin Stitt
---
scripts/checkpatch.pl | 19 +++
1 file cha
BUF, VAR)
+ ethtool_puts(BUF, VAR)
@replace_3_args@
expression BUF;
expression VAR;
@@
- ethtool_sprintf(BUF, "%s", VAR)
+ ethtool_puts(BUF, VAR)
- ethtool_sprintf(&BUF, "%s", VAR)
+ ethtool_puts(&BUF, VAR)
[5]: $ rg "ethtool_sprin
24 matches
Mail list logo