linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Tetsuhiro Kohada <Kohada.Tetsuhiro@dc.mitsubishielectric.co.jp>
Cc: Mori.Takahiro@ab.mitsubishielectric.co.jp,
	motai.hirotaka@aj.mitsubishielectric.co.jp,
	Namjae Jeon <namjae.jeon@samsung.com>,
	Sungjong Seo <sj1557.seo@samsung.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] exfat: replace 'time_ms' with 'time_10ms'
Date: Wed, 8 Apr 2020 04:21:52 -0700	[thread overview]
Message-ID: <20200408112152.GP21484@bombadil.infradead.org> (raw)
In-Reply-To: <20200408074610.35591-1-Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp>

Please leave at least 24 hours between sending new versions so that
you can collect all feedback relating to your change, and we don't see
discussion fragment between different threads.

> @@ -84,10 +84,10 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
>  			      t >> 11, (t >> 5) & 0x003F, (t & 0x001F) << 1);
>  
>  
> -	/* time_ms field represent 0 ~ 199(1990 ms) */
> -	if (time_ms) {
> -		ts->tv_sec += time_ms / 100;
> -		ts->tv_nsec = (time_ms % 100) * 10 * NSEC_PER_MSEC;
> +	/* time_10ms field represent 0 ~ 199cs(1990 ms) */
> +	if (time_10ms) {
> +		ts->tv_sec += (time_10ms * 10) / 1000;
> +		ts->tv_nsec = (time_10ms * 10) % 1000 * NSEC_PER_MSEC;

I find this more confusing than the original.

		ts->tv_sec += time_10ms / 100;
		ts->tv_nsec = (time_10ms % 100) * 10 * NSEC_PER_MSEC;

is easier to understand for me, not least because I don't need to worry
about the operator precedence between % and *.


  reply	other threads:[~2020-04-08 11:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08  7:46 [PATCH v2] exfat: replace 'time_ms' with 'time_10ms' Tetsuhiro Kohada
2020-04-08 11:21 ` Matthew Wilcox [this message]
2020-04-13  9:41   ` Kohada.Tetsuhiro
2020-04-16  6:47     ` Namjae Jeon
2020-04-16  7:45       ` Kohada.Tetsuhiro

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=20200408112152.GP21484@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=Kohada.Tetsuhiro@dc.mitsubishielectric.co.jp \
    --cc=Mori.Takahiro@ab.mitsubishielectric.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=motai.hirotaka@aj.mitsubishielectric.co.jp \
    --cc=namjae.jeon@samsung.com \
    --cc=sj1557.seo@samsung.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).