Skip to content

Commit

Permalink
[SCSI] mpt2sas: Corrected time stamp
Browse files Browse the repository at this point in the history
incorrect timestamp on 32 bit platforms: The upper 32 bit of
the timestamp was getting truncated when converting seconds to
milliseconds, which was due to the variable being long. To fix the problem,
the variable needs to be u64. Also the microseconds conversion to
milliseconds was incorrect; it should be divide by 1000 instead of divide by
8.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Apr 11, 2010
1 parent 31cef6b commit 7921b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/mpt2sas/mpt2sas_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -3009,8 +3009,8 @@ _base_send_ioc_init(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
* since epoch ~ midnight January 1, 1970.
*/
do_gettimeofday(&current_time);
mpi_request.TimeStamp = (current_time.tv_sec * 1000) +
(current_time.tv_usec >> 3);
mpi_request.TimeStamp = cpu_to_le64((u64)current_time.tv_sec * 1000 +
(current_time.tv_usec / 1000));

if (ioc->logging_level & MPT_DEBUG_INIT) {
u32 *mfp;
Expand Down

0 comments on commit 7921b35

Please sign in to comment.