linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Siddaraju DH <siddarajudh@gmail.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: john.stultz@linaro.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ptp/ptp_clock.c: Correct input parameter range check
Date: Fri, 5 Apr 2019 15:53:52 +0530	[thread overview]
Message-ID: <CAGtA63dqBVQNzUMphSKTy_jH98YYVaxVAKYpWDFu3eCXJ0-ykQ@mail.gmail.com> (raw)
In-Reply-To: <20190404031455.cn4cc5wxbn6izvwe@localhost>

Sorry if there are duplicate emails in your inbox. Trying to solve "We
accept plain text only response but the message has HTML subpart"
error from mail delivery subsystem.

Thank you for the response with example Richard.
Agree, it works. So I take back the statement in my commit message
"Since the tv_sec field will be ZERO in this range, the user will not
be able to specify the signedness of adjustment through the tv_sec
field".

Specifying a -1 ns adjustment like
    tv_sec = 0
    tv_nsec = -1
looks pretty straight forward than specifying it like
    tv_sec = -1
    tv_nsec = 999999999.

And the former way of specifying the adjustment is consistent with how
we specify the values for positive adjustments.

So, the question is "why are we blocking -ve number in tv_nsec"? As
you mentioned, end of the day it's sum of tv_sec & tv_nsec.
If there is really an advantage, just to keep things clear, we could
have made tv_nsec/usec as "unsigned long" instead of "long". Right?
For me, it doesn't look good to expect/restrict a signed input to be unsigned.

Thanks,
Siddaraju DH

      reply	other threads:[~2019-04-05 10:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  0:09 [PATCH] ptp/ptp_clock.c: Correct input parameter range check Siddaraju D H
2019-04-04  3:14 ` Richard Cochran
2019-04-05 10:23   ` Siddaraju DH [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=CAGtA63dqBVQNzUMphSKTy_jH98YYVaxVAKYpWDFu3eCXJ0-ykQ@mail.gmail.com \
    --to=siddarajudh@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.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 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).