All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ivan Vecera <ivecera@redhat.com>
Cc: netdev@vger.kernel.org, Petr Oros <poros@redhat.com>,
	David Ahern <dsahern@kernel.org>
Subject: Re: [PATCH iproute2-next v2 1/2] dpll: add ps unit to phase-related pin attributes
Date: Sun, 3 May 2026 15:34:59 -0700	[thread overview]
Message-ID: <20260503153459.388de695@phoenix.local> (raw)
In-Reply-To: <20260503151352.136509-2-ivecera@redhat.com>

On Sun,  3 May 2026 17:13:51 +0200
Ivan Vecera <ivecera@redhat.com> 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

  reply	other threads:[~2026-05-03 22:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-03 15:13 [PATCH iproute2-next v2 0/2] dpll: phase unit display and frequency monitoring Ivan Vecera
2026-05-03 15:13 ` [PATCH iproute2-next v2 1/2] dpll: add ps unit to phase-related pin attributes Ivan Vecera
2026-05-03 22:34   ` Stephen Hemminger [this message]
2026-05-04  6:48     ` Ivan Vecera
2026-05-03 15:13 ` [PATCH iproute2-next v2 2/2] dpll: add frequency monitoring support Ivan Vecera

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=20260503153459.388de695@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dsahern@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=poros@redhat.com \
    /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.