On Thu, Sep 25, 2025 at 09:12:48PM -0500, Dan Jurgens wrote:
> On 9/25/25 4:01 PM, Michael S. Tsirkin wrote:
> > On Tue, Sep 23, 2025 at 09:19:13AM -0500, Daniel Jurgens wrote:
> >> When probing a virtnet device, attempt to read the flow filter
> >> capabilities. In order to use the feature the caps must also
> >> be set. For now setting what was read is sufficient.
> >>
> >> Signed-off-by: Daniel Jurgens <[email protected]>
> >> Reviewed-by: Parav Pandit <[email protected]>
> >> Reviewed-by: Shahar Shitrit <[email protected]>
> 
> >> +  ff_mask_size = sizeof(struct virtio_net_ff_cap_mask_data);
> >> +  sel = &ff->ff_mask->selectors[0];
> >> +
> >> +  for (int i = 0; i < ff->ff_mask->count; i++) {
> > 
> > 
> > I do not think kernel style allows this int inside loop.
> > I think you need to declare it at the beginning of the block.
> > 
> 
> checkpatch didn't mind and there are many other instances where it's done.

That's because checkpatch is kernel-wide. But netdev has some special rules:

https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#using-device-managed-and-cleanup-h-constructs

says:

"... is discouraged. Similar guidance applies to declaring variables 
mid-function."




Reply via email to