Re: d0b5e4a30ac9 - main - mana(4): Make the code cross-platform

From: Ravi Pokala <rpokala_at_freebsd.org>
Date: Fri, 04 Nov 2022 04:59:47 UTC
Hi Li-Wen,

Shouldn't these new "%ju"s and "%jx"s have (uintmax_t) casts?

Thanks,

Ravi (rpokala@)

-----Original Message-----
From: <owner-src-committers@freebsd.org> on behalf of Li-Wen Hsu <lwhsu@FreeBSD.org>
Date: 2022-11-03, Thursday at 21:16
To: <src-committers@FreeBSD.org>, <dev-commits-src-all@FreeBSD.org>, <dev-commits-src-main@FreeBSD.org>
Subject: git: d0b5e4a30ac9 - main - mana(4): Make the code cross-platform

    The branch main has been updated by lwhsu:

    URL: https://cgit.FreeBSD.org/src/commit/?id=d0b5e4a30ac985051c14b0f5e3cb3e6cdd271929

    commit d0b5e4a30ac985051c14b0f5e3cb3e6cdd271929
    Author:     Li-Wen Hsu <lwhsu@FreeBSD.org>
    AuthorDate: 2022-11-04 03:45:35 +0000
    Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
    CommitDate: 2022-11-04 03:45:35 +0000

        mana(4): Make the code cross-platform

        Discussed with: whu
        Sponsored by:   The FreeBSD Foundation
        Differential Revision:  https://reviews.freebsd.org/D36388
    ---
     sys/dev/mana/mana_en.c | 15 +++------------
     1 file changed, 3 insertions(+), 12 deletions(-)

    diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c
    index 5e5e3939753f..5a95eff66ab6 100644
    --- a/sys/dev/mana/mana_en.c
    +++ b/sys/dev/mana/mana_en.c
    @@ -1054,10 +1054,8 @@ mana_cfg_vport(struct mana_port_context *apc, uint32_t protection_dom_id,
     	apc->tx_shortform_allowed = resp.short_form_allowed;
     	apc->tx_vp_offset = resp.tx_vport_offset;

    -#if defined(__amd64__)
    -	if_printf(apc->ndev, "Configured vPort %lu PD %u DB %u\n",
    +	if_printf(apc->ndev, "Configured vPort %ju PD %u DB %u\n",
     	    apc->port_handle, protection_dom_id, doorbell_pg_id);
    -#endif

     out:
     	if (err)
    @@ -1127,10 +1125,8 @@ mana_cfg_vport_steering(struct mana_port_context *apc,
     		err = EPROTO;
     	}

    -#if defined(__amd64__)
    -	if_printf(ndev, "Configured steering vPort %lu entries %u\n",
    +	if_printf(ndev, "Configured steering vPort %ju entries %u\n",
     	    apc->port_handle, num_entries);
    -#endif

     out:
     	free(req, M_DEVBUF);
    @@ -1694,13 +1690,8 @@ mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq,

     	if (pktlen == 0) {
     		/* data packets should never have packetlength of zero */
    -#if defined(__amd64__)
    -		if_printf(ndev, "RX pkt len=0, rq=%u, cq=%u, rxobj=0x%lx\n",
    +		if_printf(ndev, "RX pkt len=0, rq=%u, cq=%u, rxobj=0x%jx\n",
     		    rxq->gdma_id, cq->gdma_id, rxq->rxobj);
    -#else
    -		if_printf(ndev, "RX pkt len=0, rq=%u, cq=%u, rxobj=0x%llx\n",
    -		    rxq->gdma_id, cq->gdma_id, rxq->rxobj);
    -#endif
     		return;
     	}