[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZFxQ4TNisTvc1sn0@hoboy.vegasvil.org>
Date: Wed, 10 May 2023 19:20:17 -0700
From: Richard Cochran <richardcochran@...il.com>
To: Rahul Rameshbabu <rrameshbabu@...dia.com>
Cc: netdev@...r.kernel.org, Saeed Mahameed <saeed@...nel.org>,
Gal Pressman <gal@...dia.com>, Tariq Toukan <tariqt@...dia.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jacob Keller <jacob.e.keller@...el.com>
Subject: Re: [PATCH net-next 5/9] ptp: Add .getmaxphase callback to
ptp_clock_info
On Wed, May 10, 2023 at 01:53:02PM -0700, Rahul Rameshbabu wrote:
> +#define PTP_SHOW_CB_INT(name, cb) \
> +static ssize_t cb##_show(struct device *dev, \
> + struct device_attribute *attr, char *page) \
> +{ \
> + struct ptp_clock *ptp = dev_get_drvdata(dev); \
> + return snprintf(page, PAGE_SIZE-1, "%d\n", \
> + ptp->info->cb(ptp->info)); \
> +} \
> +static DEVICE_ATTR(name, 0444, cb##_show, NULL);
> +
> PTP_SHOW_INT(max_adjustment, max_adj);
> +PTP_SHOW_CB_INT(max_phase_adjustment, getmaxphase);
Ugh, please no macro here. Just add it plainly like clock_name_show.
Rest of patch LGTM.
Thanks,
Richard
Powered by blists - more mailing lists