Re: [PATCH net-next v4 09/17] net: pktgen: align some variable declarations to the most common pattern
From: Simon Horman
Date: Tue Feb 11 2025 - 05:15:49 EST
On Tue, Feb 11, 2025 at 10:29:59AM +0100, Peter Seiderer wrote:
> Hello Simon,
>
> On Thu, 6 Feb 2025 13:25:38 +0000, Simon Horman <horms@xxxxxxxxxx> wrote:
>
> > On Wed, Feb 05, 2025 at 02:11:45PM +0100, Peter Seiderer wrote:
> > > Align some variable declarations (in get_imix_entries and get_labels) to
> > > the most common pattern (int instead of ssize_t/long) and adjust function
> > > return value accordingly.
> > >
> > > Signed-off-by: Peter Seiderer <ps.report@xxxxxxx>
> >
> > Hi Peter,
> >
> > These comments are is true in general of this patchset, but particularly so
> > in the case of this patch:
> >
> > * I think a more succinct subject would be nice.
> > * I think the patch description should provide some reason
> > _why_ the change is being made.
>
> Yep, will improve...
>
> >
> > Also, specifically relating to this patch, I wonder if it's scope ought to
> > be extended. For example, the two callers of num_arg(), get_imix_entries() and
> > pktgen_if_write() assign the return value of num_arg() to len, which is now
> > an int in both functions. But num_args() returns a long.
>
> Aim was to get rid of the int/long mixture in the code (which works flawless
> because no one writes to proc with more than a few bytes AND count is limited
> to INT_MAX - PAGE_SIZE in vfs_write (see [1], [2])...
>
> I believe the clean way is to use
>
> size_t i, max;
> ssize_t len;
>
> consequently through out the code and adjust the function signatures
> accordingly...., will re-spin...
Thanks Peter,
I for one am all for things being consistent.
...