Subject: Re: [PATCH iproute2-next v2 1/2] dpll: add ps unit to phase-related pin attributes

From: Stephen Hemminger <[email-masked]>
Date: Sun, 3 May 2026 15:34:59 -0700

On Sun,  3 May 2026 17:13:51 +0200
Ivan Vecera <[email-masked]> wrote:

> +/* Phase offset - JSON prints raw sub-ps value, FP prints fractional ps */
> +#define DPLL_PR_PHASE_OFFSET(tb, attr_id)                                      \
> +	do {                                                                   \
> +		if (tb[attr_id]) {                                             \
> +			__s64 val = mnl_attr_get_sint(tb[attr_id]);            \
> +			lldiv_t d = lldiv(llabs(val),                          \
> +					  DPLL_PHASE_OFFSET_DIVIDER);	       \
> +			print_s64(PRINT_JSON, "phase-offset", NULL, val);      \
> +			print_string(PRINT_FP, NULL, " phase-offset %s",       \
> +				     val < 0 ? "-" : "");                      \
> +			print_s64(PRINT_FP, NULL, "%lld.", d.quot);            \
> +			print_s64(PRINT_FP, NULL, "%03lld ps", d.rem);         \
> +		}                                                              \
> +	} while (0)
> +
>  /* Gene

Any macro this big should be a function