lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 10 Jun 2013 10:47:02 -0700
From:	James Bottomley <James.Bottomley@...senPartnership.com>
To:	Gu Zheng <guz.fnst@...fujitsu.com>
Cc:	Linux-Scsi <linux-scsi@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] scsi: Introduce a help function
 local_time_seconds() to simplify the getting time stamp operation

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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ