netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: min.li.xe@renesas.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ptp: Add a ptp clock driver for IDT 82P33 SMU.
Date: Thu, 30 Jan 2020 07:01:53 -0800	[thread overview]
Message-ID: <20200130150153.GB1477@localhost> (raw)
In-Reply-To: <1580326638-5455-1-git-send-email-min.li.xe@renesas.com>


The net-next tree is closed for new submissions until after the
mainline merge window closes.  So you will have to re-submit this
patch then.

This patch and the first one should have [net-next] in the subject
line.  Please address both messages (1/2 and 2/2) to the netdev list,
with the others on CC.

But for, here are a few coding style issues...

On Wed, Jan 29, 2020 at 02:37:18PM -0500, min.li.xe@renesas.com wrote:
> @@ -12,4 +12,5 @@ obj-$(CONFIG_PTP_1588_CLOCK_KVM)	+= ptp_kvm.o
>  obj-$(CONFIG_PTP_1588_CLOCK_QORIQ)	+= ptp-qoriq.o
>  ptp-qoriq-y				+= ptp_qoriq.o
>  ptp-qoriq-$(CONFIG_DEBUG_FS)		+= ptp_qoriq_debugfs.o
> -obj-$(CONFIG_PTP_1588_CLOCK_IDTCM)	+= ptp_clockmatrix.o
> \ No newline at end of file

Please fix white space here

> +obj-$(CONFIG_PTP_1588_CLOCK_IDTCM)	+= ptp_clockmatrix.o
> +obj-$(CONFIG_PTP_1588_CLOCK_IDT82P33)	+= ptp_idt82p33.o
> \ No newline at end of file

and here.

> +static void _idt82p33_caps_init(struct ptp_clock_info	*caps)
> +{

No need for leading _ on private methods.

> +	(caps)->owner = THIS_MODULE;
> +	(caps)->max_adj = 92000;
> +	(caps)->adjfreq = idt82p33_adjfreq;
> +	(caps)->adjtime = idt82p33_adjtime;
> +	(caps)->gettime64 = idt82p33_gettime;
> +	(caps)->settime64 = idt82p33_settime;
> +	(caps)->enable = idt82p33_enable;
> +}
> +
> +static int _mask_bit_count(int mask)
> +{

There is a GCC built in for this.

> +	int ret = 0;
> +
> +	while (mask != 0) {
> +		mask &= (mask-1);
> +		ret++;
> +	}
> +
> +	return ret;
> +}
> +
> +static void _byte_array_to_timespec(struct timespec64 *ts,
> +				u8 buf[TOD_BYTE_COUNT])
> +{

Prefix all your functions with idt82p33_ please.

> +	u8 i;
> +	s32 nsec;
> +	time64_t sec;
> +
> +	nsec = buf[3];
> +	for (i = 0; i < 3; i++) {
> +		nsec <<= 8;
> +		nsec |= buf[2 - i];
> +	}
> +
> +	sec = buf[9];
> +	for (i = 0; i < 5; i++) {
> +		sec <<= 8;
> +		sec |= buf[8 - i];
> +	}
> +
> +	ts->tv_sec = sec;
> +	ts->tv_nsec = nsec;
> +}

Thanks,
Richard

      reply	other threads:[~2020-01-30 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 19:37 [PATCH 2/2] ptp: Add a ptp clock driver for IDT 82P33 SMU min.li.xe
2020-01-30 15:01 ` Richard Cochran [this message]

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=20200130150153.GB1477@localhost \
    --to=richardcochran@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=min.li.xe@renesas.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).