public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Jakub Raczynski <j.raczynski@samsung.com>, <error27@gmail.com>
Cc: <netdev@vger.kernel.org>, <kuba@kernel.org>,
	<anthony.l.nguyen@intel.com>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH v2] net/intel: Replace manual array size calculation with ARRAY_SIZE
Date: Thu, 23 Apr 2026 09:41:55 +0200	[thread overview]
Message-ID: <1fa00801-b35d-4dd1-a229-c3a3b551e6f0@intel.com> (raw)
In-Reply-To: <20260422105710.268003-1-j.raczynski@samsung.com>

On 4/22/26 12:57, Jakub Raczynski wrote:
> There are still places in the code where manual calculation of array size
> exist, but it is good to enforce usage of single macro through the whole
> code as it makes code bit more readable.
> While at it, beautify condition surrounding it by reversing check and remove
> unnecessary casting.
> 

thank you for the submission, please find some process-related feedback
from me

for future submissions for intel networking please target IWL (Intel 
Wired Lan mailing list)

patches should be split into per-driver changes most of the time

please don't set "In-reply-to: v1" to v2 - just send as a standalone new
series (but link to v1 in changelog)

this is also a smallest bit above "too trivial to merge" IMO

finally this is not -net material, but -next, and -next is closed now
for PRs, and this is the only reason that warrants "v3" from you
(to:iwl, cc:netdev, after submission window reopens, ~Apr 27th)

(please collect Dan's Reviewed-by tag)


> Signed-off-by: Jakub Raczynski <j.raczynski@samsung.com>
> ---
>   drivers/net/ethernet/intel/i40e/i40e_adminq.h | 2 +-
>   drivers/net/ethernet/intel/iavf/iavf_adminq.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.h b/drivers/net/ethernet/intel/i40e/i40e_adminq.h
> index 1be97a3a86ce..dcf3baec7b73 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.h
> @@ -109,7 +109,7 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc)
>   		-EFBIG,      /* I40E_AQ_RC_EFBIG */
>   	};
>   
> -	if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0]))))
> +	if (aq_rc >= ARRAY_SIZE(aq_to_posix))
>   		return -ERANGE;
>   
>   	return aq_to_posix[aq_rc];
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_adminq.h b/drivers/net/ethernet/intel/iavf/iavf_adminq.h
> index bbf5c4b3a2ae..dd2f61172157 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_adminq.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.h
> @@ -113,7 +113,7 @@ static inline int iavf_aq_rc_to_posix(int aq_ret, int aq_rc)
>   	if (aq_ret == IAVF_ERR_ADMIN_QUEUE_TIMEOUT)
>   		return -EAGAIN;
>   
> -	if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0]))))
> +	if (aq_rc >= ARRAY_SIZE(aq_to_posix))
>   		return -ERANGE;
>   
>   	return aq_to_posix[aq_rc];


      parent reply	other threads:[~2026-04-23  7:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260421114034eucas1p1d746ffe32b49aeb57f10e729d1331124@eucas1p1.samsung.com>
2026-04-21 11:40 ` [PATCH] net/intel: Replace manual array size calculation with ARRAY_SIZE Jakub Raczynski
2026-04-21 14:11   ` Dan Carpenter
2026-04-22  8:32     ` Jakub Raczynski
2026-04-22 13:22       ` Dan Carpenter
2026-04-22 10:57     ` [PATCH v2] " Jakub Raczynski
2026-04-22 13:24       ` Dan Carpenter
2026-04-23  7:41       ` Przemek Kitszel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1fa00801-b35d-4dd1-a229-c3a3b551e6f0@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=error27@gmail.com \
    --cc=j.raczynski@samsung.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox