scsi: aacraid: stop using deprated get_seconds()
authorArnd Bergmann <arnd@arndb.de>
Mon, 18 Jun 2018 15:26:47 +0000 (17:26 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Jun 2018 15:57:01 +0000 (11:57 -0400)
get_seconds() can overflow on 32-bit architectures and is deprecated
because of that. The use in the aacraid driver has the same problem due to
a limited firmware interface, it also overflows in the year 2106.

This changes all calls to get_seconds() to the non-deprecated
ktime_get_real_seconds(), which unfortunately doesn't solve that problem
but gets rid of one user of the deprecated interface.

[mkp: checkpatch]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aacraid/rx.c
drivers/scsi/aacraid/sa.c
drivers/scsi/aacraid/src.c

index 6201666941717042e3c7a2a1cd5f459b41b3360c..576cdf9cc12069cf26591e3af42d5d758ddd266c 100644 (file)
@@ -319,7 +319,7 @@ static void aac_rx_start_adapter(struct aac_dev *dev)
        union aac_init *init;
 
        init = dev->init;
-       init->r7.host_elapsed_seconds = cpu_to_le32(get_seconds());
+       init->r7.host_elapsed_seconds = cpu_to_le32(ktime_get_real_seconds());
        // We can only use a 32 bit address here
        rx_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa,
          0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL);
index 882f40353b965809ec835c8b448bb96eca34c039..efa96c1c6aa3472b7ebfd460134503b049abc479 100644 (file)
@@ -251,7 +251,7 @@ static void aac_sa_start_adapter(struct aac_dev *dev)
         * Fill in the remaining pieces of the init.
         */
        init = dev->init;
-       init->r7.host_elapsed_seconds = cpu_to_le32(get_seconds());
+       init->r7.host_elapsed_seconds = cpu_to_le32(ktime_get_real_seconds());
        /* We can only use a 32 bit address here */
        sa_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, 
                        (u32)(ulong)dev->init_pa, 0, 0, 0, 0, 0,
index 4ebb35a29caadf0bd57b5295a78f0d0ed3eea4ee..7a51ccfa8662735c4a4c03dffaa03645cbb76374 100644 (file)
@@ -409,7 +409,8 @@ static void aac_src_start_adapter(struct aac_dev *dev)
 
        init = dev->init;
        if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE3) {
-               init->r8.host_elapsed_seconds = cpu_to_le32(get_seconds());
+               init->r8.host_elapsed_seconds =
+                       cpu_to_le32(ktime_get_real_seconds());
                src_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS,
                        lower_32_bits(dev->init_pa),
                        upper_32_bits(dev->init_pa),
@@ -417,7 +418,8 @@ static void aac_src_start_adapter(struct aac_dev *dev)
                        (AAC_MAX_HRRQ - 1) * sizeof(struct _rrq),
                        0, 0, 0, NULL, NULL, NULL, NULL, NULL);
        } else {
-               init->r7.host_elapsed_seconds = cpu_to_le32(get_seconds());
+               init->r7.host_elapsed_seconds =
+                       cpu_to_le32(ktime_get_real_seconds());
                // We can only use a 32 bit address here
                src_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS,
                        (u32)(ulong)dev->init_pa, 0, 0, 0, 0, 0,