public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: Linux-Scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND] scsi: Introduce a help function local_time_seconds() to simplify the getting time stamp operation
Date: Mon, 10 Jun 2013 10:47:02 -0700	[thread overview]
Message-ID: <1370886422.1936.27.camel@dabdike> (raw)
In-Reply-To: <51B53293.7090100@cn.fujitsu.com>

On Mon, 2013-06-10 at 09:57 +0800, Gu Zheng wrote:
> diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
> index 66216c1..f3377ca 100644
> --- a/include/scsi/scsi.h
> +++ b/include/scsi/scsi.h
> @@ -574,4 +574,13 @@ static inline __u32 scsi_to_u32(__u8 *ptr)
>         return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3];
>  }
>  
> +/*
> + * Convert system time in UTC to local time seconds.
> + */
> +static inline u32 local_time_seconds(void)
> +{
> +       struct timeval utc;
> +       do_gettimeofday(&utc);
> +       return (u32)(utc.tv_sec - (sys_tz.tz_minuteswest * 60));
> +}
>  #endif /* _SCSI_SCSI_H */

This doesn't belong in SCSI.

It's not a common pattern, so just leave it open coded in the 3ware
drivers.  If there's a need for it to be a common pattern, John Stultz
will add it to the timer code, but at the moment, he doesn't seem to see
the need.

James



  reply	other threads:[~2013-06-10 17:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10  1:57 [PATCH RESEND] scsi: Introduce a help function local_time_seconds() to simplify the getting time stamp operation Gu Zheng
2013-06-10 17:47 ` James Bottomley [this message]
2013-06-11  1:39   ` Gu Zheng

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=1370886422.1936.27.camel@dabdike \
    --to=james.bottomley@hansenpartnership.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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