[PATCH v3 03/27] net/nfp: unify the type of integer variable

Chaoyong He chaoyong.he at corigine.com
Mon Sep 18 03:26:36 CEST 2023


> On 9/15/2023 10:15 AM, Chaoyong He wrote:
> > Unify the type of integer variable to the DPDK prefer style.
> > Also change the return type of 'nfp_eth_speed2rate()' to the
> > corresponding enum, which make it more readable.
> >
> > Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
> > Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
> 
> <...>
> 
> > @@ -269,7 +269,7 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex
> *mutex)
> >  		if (err < 0 && err != -EBUSY)
> >  			return err;
> >  		if (time(NULL) >= warn_at) {
> > -			PMD_DRV_LOG(ERR, "Warning: waiting for NFP
> mutex usage:%u depth:%hd] target:%d addr:%llx key:%08x]",
> > +			PMD_DRV_LOG(ERR, "Warning: waiting for NFP
> mutex usage:%u
> > +depth:%hd] target:%d addr:%lx key:%08x]",
> >
> 
> '%lx' is not portable between 32bits and 64bits architectures, when using fixed
> size variables, like 'uint64_t', better to use 'PRIx64'
> macro,
> although I know driver is only compiled for 64bits.
> 

Okay, I got it, thanks.

> <...>
> 
> > @@ -316,7 +316,7 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
> >
> >  	max_size = RTE_MAX(in_size, out_size);
> >  	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size)
> {
> > -		PMD_DRV_LOG(ERR, "NSP: default buffer too small for
> command 0x%04x (%llu < %u)",
> > +		PMD_DRV_LOG(ERR, "NSP: default buffer too small for
> command 0x%04x
> > +(%llu < %lu)",
> >
> 
> '%zu' is for size_t

I will revise in the next version, thanks.


More information about the dev mailing list