[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <IA3PR11MB8986F184BB79B7DA439DC057E503A@IA3PR11MB8986.namprd11.prod.outlook.com>
Date: Fri, 5 Sep 2025 20:05:51 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: "liuqiangneo@....com" <liuqiangneo@....com>, "Nguyen, Anthony L"
<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
<przemyslaw.kitszel@...el.com>
CC: "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Qiang Liu
<liuqiang@...inos.cn>
Subject: RE: [Intel-wired-lan] [PATCH] ixgbe: Remove self-assignment code
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf
> Of liuqiangneo@....com
> Sent: Friday, September 5, 2025 4:55 AM
> To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@...el.com>
> Cc: intel-wired-lan@...ts.osuosl.org; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org; Qiang Liu <liuqiang@...inos.cn>
> Subject: [Intel-wired-lan] [PATCH] ixgbe: Remove self-assignment
> code
>
> From: Qiang Liu <liuqiang@...inos.cn>
>
> After obtaining the register value via raw_desc,
> redundant self-assignment operations can be removed.
>
> Signed-off-by: Qiang Liu <liuqiang@...inos.cn>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> index bfeef5b0b99d..6efedf04a963 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> @@ -143,18 +143,14 @@ static int ixgbe_aci_send_cmd_execute(struct
> ixgbe_hw *hw,
>
> /* Read sync Admin Command response */
> if ((hicr & IXGBE_PF_HICR_SV)) {
> - for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++) {
> + for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++)
> raw_desc[i] = IXGBE_READ_REG(hw,
> IXGBE_PF_HIDA(i));
> - raw_desc[i] = raw_desc[i];
> - }
> }
>
> /* Read async Admin Command response */
> if ((hicr & IXGBE_PF_HICR_EV) && !(hicr & IXGBE_PF_HICR_C)) {
> - for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++) {
> + for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++)
> raw_desc[i] = IXGBE_READ_REG(hw,
> IXGBE_PF_HIDA_2(i));
> - raw_desc[i] = raw_desc[i];
> - }
Can you refactor it to use IXGBE_READ_REG_ARRAY(hw, REG, i)?
this can greatly improve readability!
> }
>
> /* Handle timeout and invalid state of HICR register */
> --
> 2.43.0
Powered by blists - more mailing lists