All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Selvin Xavier <selvin.xavier@broadcom.com>,
	Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/bnxt_re: Replace cpu_to_be64 + le64_to_cpu with swab64
Date: Thu, 18 Dec 2025 17:18:51 +0200	[thread overview]
Message-ID: <20251218151851.GA400630@unreal> (raw)
In-Reply-To: <20251210131528.569382-2-thorsten.blum@linux.dev>

On Wed, Dec 10, 2025 at 02:15:29PM +0100, Thorsten Blum wrote:
> Replace cpu_to_be64(le64_to_cpu()) with swab64() to simplify
> bnxt_re_assign_pma_port_ext_counters().  No functional changes.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/infiniband/hw/bnxt_re/hw_counters.c | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/hw_counters.c b/drivers/infiniband/hw/bnxt_re/hw_counters.c
> index 651cf9d0e0c7..bb1137ad84c0 100644
> --- a/drivers/infiniband/hw/bnxt_re/hw_counters.c
> +++ b/drivers/infiniband/hw/bnxt_re/hw_counters.c
> @@ -290,19 +290,12 @@ int bnxt_re_assign_pma_port_ext_counters(struct bnxt_re_dev *rdev, struct ib_mad
>  	pma_cnt_ext = (struct ib_pma_portcounters_ext *)(out_mad->data + 40);
>  	if ((bnxt_qplib_is_chip_gen_p5(rdev->chip_ctx) && rdev->is_virtfn) ||
>  	    !bnxt_qplib_is_chip_gen_p5(rdev->chip_ctx)) {
> -		pma_cnt_ext->port_xmit_data =
> -			cpu_to_be64(le64_to_cpu(hw_stats->tx_ucast_bytes) / 4);

> +		pma_cnt_ext->port_xmit_data = swab64(hw_stats->tx_ucast_bytes / 4);

Why do you think that the above two lines are equal?
hw_stats->tx_ucast_bytes is __le64 value and le64_to_cpu(hw_stats->tx_ucast_bytes) / 4) is not equal to
hw_stats->tx_ucast_bytes / 4.

Thanks

      reply	other threads:[~2025-12-18 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10 13:15 [PATCH] RDMA/bnxt_re: Replace cpu_to_be64 + le64_to_cpu with swab64 Thorsten Blum
2025-12-18 15:18 ` Leon Romanovsky [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=20251218151851.GA400630@unreal \
    --to=leon@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=selvin.xavier@broadcom.com \
    --cc=thorsten.blum@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.