From: Tina Ruchandani <ruchandani.tina@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
"James E.J. Bottomley" <JBottomley@parallels.com>,
Anil Gurumurthy <anil.gurumurthy@qlogic.com>,
Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Subject: [PATCH] [SCSI] bfa: Remove use of struct timeval
Date: Wed, 4 Feb 2015 08:42:03 +0530 [thread overview]
Message-ID: <20150204031203.GA3762@tinar> (raw)
struct timeval will have its tv_sec field overflow on 32-bit systems
in year 2038 and beyond. This patch removes the usage of struct timeval
and instead uses ktime_get_real_seconds() which returns 64-bit wall-clock
seconds.
Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
---
drivers/scsi/bfa/bfa_svc.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 625225f..5554461 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -14,6 +14,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
+#include <linux/ktime.h>
#include "bfad_drv.h"
#include "bfad_im.h"
@@ -303,16 +304,9 @@ plkd_validate_logrec(struct bfa_plog_rec_s *pl_rec)
return 0;
}
-static u64
-bfa_get_log_time(void)
+static u64 bfa_get_log_time(void)
{
- u64 system_time = 0;
- struct timeval tv;
- do_gettimeofday(&tv);
-
- /* We are interested in seconds only. */
- system_time = tv.tv_sec;
- return system_time;
+ return ktime_get_real_seconds();
}
static void
--
2.2.0.rc0.207.ga3a616c
next reply other threads:[~2015-02-04 3:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 3:12 Tina Ruchandani [this message]
2015-02-04 15:07 ` [PATCH] [SCSI] bfa: Remove use of struct timeval Arnd Bergmann
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=20150204031203.GA3762@tinar \
--to=ruchandani.tina@gmail.com \
--cc=JBottomley@parallels.com \
--cc=anil.gurumurthy@qlogic.com \
--cc=arnd@arndb.de \
--cc=linux-scsi@vger.kernel.org \
--cc=sudarsana.kalluru@qlogic.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