]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnx2x: use ktime_get_seconds() for timestamp
authorArnd Bergmann <arnd@arndb.de>
Fri, 11 Sep 2015 09:33:01 +0000 (11:33 +0200)
committerDan Duval <dan.duval@oracle.com>
Mon, 19 Oct 2015 22:14:42 +0000 (18:14 -0400)
commit41bde0fab0ddb81a6ba52515d041ba52cfaaa96e
tree6552c28f92419ef870279b260c7e33068511ac01
parentb7117dfd31af580903d11acf3c5a8184ff6722f5
bnx2x: use ktime_get_seconds() for timestamp

Orabug: 22066196

commit c48f350ff5e7 "bnx2x: Add MFW dump support" added the
bnx2x_update_mfw_dump() function that reads the current time and stores
it in a 32-bit field that gets passed into a buffer in a fixed format.

This is potentially broken when the epoch overflows in 2038, and
otherwise overflows in 2106. As we're trying to avoid uses of
struct timeval for this reason, I noticed the addition of this
function, and tried to rewrite it in a way that is more explicit
about the overflow and that will keep working once we deprecate
struct timeval.

I assume that it is not possible to change the ABI any more, otherwise
we should try to use a 64-bit field for the seconds right away.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Yuval Mintz <Yuval.Mintz@qlogic.com>
Cc: Ariel Elior <Ariel.Elior@qlogic.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a19a19de8310fb8ca2ca0621a9db1aab082943c5)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c