> 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 against next? As Vladimir pointed
out, all the patches are to driver
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/checkpatch.pl
[]
> @@ -7011,6 +7011,25 @@ sub process {
>"Prefer strscp
On Thu, Oct 26, 2023 at 03:24:54PM -0700, Justin Stitt wrote:
> There was some discussion here [1] but AFAICT I need to use EMACS
> or configure my vim in a very particular way to get the same formatting
>
> But yeah, look around line 7000 -- lots of this pattern matching code is
> pretty hard to
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() to be
> directly below ethtool_sprintf() in the source code. What to do?
(removing everyone excep
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:
> >
> > 1) Use ethtool_sprintf() with just two argu
On Thu, Oct 26, 2023 at 03:11:28PM -0700, Justin Stitt wrote:
> On Thu, Oct 26, 2023 at 3:09 PM Justin Stitt wrote:
> > On Thu, Oct 26, 2023 at 3:02 PM Vladimir Oltean wrote:
> > > Maybe this is due to an incorrect rebase conflict resolution, but you
> > > shouldn't have touched any of the ethtoo
On Thu, Oct 26, 2023 at 09:56:09PM +, Justin Stitt wrote:
> This patch converts some basic cases of ethtool_sprintf() to
> ethtool_puts().
>
> The conversions are used in cases where ethtool_sprintf() was being used
> with just two arguments:
> | ethtool_sprintf(&data, buffer[i].name);
>
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:
>
> 1) Use ethtool_sprintf() with just two arguments:
> | ethtool_sprintf(&data, driver[i].name);
> or
> 2) Use
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().
> > >
> > > Functionally the same as ethtool_spr
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().
> >
> > Functionally the same as ethtool_sprintf() when it's used with two
> > arguments or with just "%s" format s
Hi Justin,
On Thu, Oct 26, 2023 at 09:56:07PM +, Justin Stitt wrote:
> 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/eth
This patch converts some basic cases of ethtool_sprintf() to
ethtool_puts().
The conversions are used in cases where ethtool_sprintf() was being used
with just two arguments:
| ethtool_sprintf(&data, buffer[i].name);
or when it's used with format string: "%s"
| ethtool_sprintf(&data, "
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 | 7 +++
2 fi
Add some warnings for using ethtool_sprintf() where a simple
ethtool_puts() would suffice.
The two cases are:
1) Use ethtool_sprintf() with just two arguments:
| ethtool_sprintf(&data, driver[i].name);
or
2) Use ethtool_sprintf() with a standalone "%s" fmt string:
| ethtool_sprintf(&d
Hi,
This series aims to implement ethtool_puts() and send out a wave 1 of
conversions from ethtool_sprintf(). There's also a checkpatch patch
included to check for the cases listed below.
This was sparked from recent discussion here [1]
The conversions are used in cases where ethtool_sprintf() w
The rtnl lock also needs to be held before rndis_filter_device_add()
which advertises nvsp_2_vsc_capability / sriov bit, and triggers
VF NIC offering and registering. If VF NIC finished register_netdev()
earlier it may cause name based config failure.
To fix this issue, move the call to rtnl_lock(
> Subject: Re: [PATCH] hv_netvsc: Mark VF as slave before exposing it to
> user-mode
>
> On Wed, 25 Oct 2023 15:50:50 -0700
> lon...@linuxonhyperv.com wrote:
>
> > @@ -2347,6 +2342,12 @@ static int netvsc_register_vf(struct net_device
> *vf_netdev)
> > if (!ndev)
> > return NOTIF
> Subject: Re: [PATCH] hv_netvsc: Mark VF as slave before exposing it to
> user-mode
>
> On Wed, 25 Oct 2023 15:50:50 -0700
> lon...@linuxonhyperv.com wrote:
>
> > list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) {
> > ndev = hv_get_drvdata(ndev_ctx->device_ctx);
> > -
On Thu, 2023-10-26 at 10:49 -0700, Kees Cook wrote:
> On Thu, Oct 26, 2023 at 09:33:17AM -0700, Joe Perches wrote:
> > On Thu, 2023-10-26 at 08:47 -0700, Kees Cook wrote:
> > > On Wed, Oct 25, 2023 at 11:40:31PM +, Justin Stitt wrote:
> > > > @replace_2_args@
> > > > identifier BUF;
> > > > exp
On Thu, Oct 26, 2023 at 09:33:17AM -0700, Joe Perches wrote:
> On Thu, 2023-10-26 at 08:47 -0700, Kees Cook wrote:
> > On Wed, Oct 25, 2023 at 11:40:31PM +, Justin Stitt wrote:
> > > @replace_2_args@
> > > identifier BUF;
> > > expression VAR;
> > > @@
> > >
> > > - ethtool_sprintf
> > >
On Wed, 2023-10-25 at 23:40 +, Justin Stitt wrote:
> Add some warnings for using ethtool_sprintf() where a simple
> ethtool_puts() would suffice.
Hi again Justin.
After I read patch 1/3 I don't object at all.
spatch/cocci will always be a better option than checkpatch
for conversions like th
On Wed, 25 Oct 2023 15:50:50 -0700
lon...@linuxonhyperv.com wrote:
> @@ -2347,6 +2342,12 @@ static int netvsc_register_vf(struct net_device
> *vf_netdev)
> if (!ndev)
> return NOTIFY_DONE;
>
> + if (event == NETDEV_POST_INIT) {
> + /* set slave flag before op
On Wed, 25 Oct 2023 15:50:50 -0700
lon...@linuxonhyperv.com wrote:
> list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) {
> ndev = hv_get_drvdata(ndev_ctx->device_ctx);
> - if (ether_addr_equal(vf_netdev->perm_addr, ndev->perm_addr)) {
> - net
On Thu, 2023-10-26 at 08:47 -0700, Kees Cook wrote:
> On Wed, Oct 25, 2023 at 11:40:31PM +, Justin Stitt wrote:
> > @replace_2_args@
> > identifier BUF;
> > expression VAR;
> > @@
> >
> > - ethtool_sprintf
> > + ethtool_puts
> > (&BUF, VAR)
>
> I think cocci will do a bett
On 10/25/2023 4:40 PM, Justin Stitt wrote:
This patch converts some basic cases of ethtool_sprintf() to
ethtool_puts().
The conversions are used in cases where ethtool_sprintf() was being used
with just two arguments:
| ethtool_sprintf(&data, buffer[i].name);
or when it's used with format
On Wed, Oct 25, 2023 at 11:40:31PM +, Justin Stitt wrote:
> @replace_2_args@
> identifier BUF;
> expression VAR;
> @@
>
> - ethtool_sprintf
> + ethtool_puts
> (&BUF, VAR)
I think cocci will do a better job at line folding if we adjust this
rule like I had to adjust the nex
On Thu, 2023-10-26 at 16:48 +0200, Louis Peens wrote:
> On Wed, Oct 25, 2023 at 11:40:33PM +, Justin Stitt wrote:
> > This patch converts some basic cases of ethtool_sprintf() to
> > ethtool_puts().
[30k of quoted content]
> Thanks Justin. From my perspective the series looks good, though I'v
> -Original Message-
> From: Wojciech Drewek
> Sent: Thursday, October 26, 2023 6:48 AM
> To: Haiyang Zhang ; linux-hyperv@vger.kernel.org;
> net...@vger.kernel.org
> Cc: KY Srinivasan ; wei@kernel.org; Dexuan Cui
> ; eduma...@google.com; k...@kernel.org;
> pab...@redhat.com; da...@
On Wed, Oct 25, 2023 at 11:40:33PM +, Justin Stitt wrote:
> This patch converts some basic cases of ethtool_sprintf() to
> ethtool_puts().
>
> The conversions are used in cases where ethtool_sprintf() was being used
> with just two arguments:
> | ethtool_sprintf(&data, buffer[i].name);
>
On Thu, 26 Oct 2023 11:23:37 +0200 Przemek Kitszel wrote:
> this would now fit into one line
> (perhaps it's the same in other cases, I just checked this one manually)
I think cocci would fold lines automatically? Could be worth trying
spatch to do the conversion for that reason, if you aren't alr
On 25.10.2023 23:16, Haiyang Zhang wrote:
> The rtnl lock also needs to be held before rndis_filter_device_add()
> which advertises nvsp_2_vsc_capability / sriov bit, and triggers
> VF NIC offering and registering. If VF NIC finished register_netdev()
> earlier it may cause name based config fai
> -Original Message-
> From: Przemek Kitszel
> Sent: Thursday, October 26, 2023 12:24 PM
> To: Justin Stitt ; David S. Miller
> ; Eric Dumazet ; Jakub
> Kicinski ; Paolo Abeni ; Agroskin, Shay
> ; Kiyanovski, Arthur ; Arinzon,
> David ; Dagan, Noam ;
> Bshara, Saeed ; Rasesh Mody ;
> Sudar
On 10/26/23 01:40, Justin Stitt wrote:
Add some warnings for using ethtool_sprintf() where a simple
ethtool_puts() would suffice.
The two cases are:
1) Use ethtool_sprintf() with just two arguments:
| ethtool_sprintf(&data, driver[i].name);
or
2) Use ethtool_sprintf() with a standalone "%
On 10/26/23 01: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() was being used
with just two arguments:
| ethtool_sprintf(&data, buffer[i].name);
or when it's used with format stri
34 matches
Mail list logo