[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a37rEZq0PdpmvNF2wsAWNO=R+pod4Mq+WF1p2bo1UGUGA@mail.gmail.com>
Date: Mon, 13 Nov 2017 15:55:13 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Ben Hutchings <ben.hutchings@...ethink.co.uk>
Cc: Anil Gurumurthy <anil.gurumurthy@...gic.com>,
Sudarsana Kalluru <sudarsana.kalluru@...gic.com>,
"James E . J . Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
Hannes Reinecke <hare@...e.com>,
linux-scsi <linux-scsi@...r.kernel.org>,
y2038 Mailman List <y2038@...ts.linaro.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Johannes Thumshirn <jthumshirn@...e.de>,
Christoph Hellwig <hch@....de>
Subject: Re: [Y2038] [PATCH 3/7] scsi: bfa: improve bfa_ioc_send_enable/disable
data
On Mon, Nov 13, 2017 at 3:08 PM, Ben Hutchings
<ben.hutchings@...ethink.co.uk> wrote:
> On Fri, 2017-11-10 at 16:37 +0100, Arnd Bergmann wrote:
>>
>> bfi_h2i_set(enable_req.mh, BFI_MC_IOC, BFI_IOC_H2I_ENABLE_REQ,
>> bfa_ioc_portid(ioc));
>> enable_req.clscode = cpu_to_be16(ioc->clscode);
>> - do_gettimeofday(&tv);
>> - enable_req.tv_sec = be32_to_cpu(tv.tv_sec);
>> + /* unsigned 32-bit time_t overflow in y2106 */
>> + enable_req.tv_sec = be32_to_cpu(ktime_get_real_seconds());
>
> The byte order conversion should also logically be cpu_to_be32(), not
> be32_to_cpu().
>
Right, I had not noticed that. I just tried fixing this, looking at what
sparse thinks of the file as a whole. I found it basically hopeless
to fix the endianess warnings in this driver, it seems completely
random here whether they are used correctly, in the opposite
direction as expected, or just flip data in place as in
attr->part[i].part_off = be32_to_cpu(f->part[i].part_off);
I'd rather not touch that part. IIRC I had at some point spent
a day trying to clean up the "warning: symbol
'bfa_flash_sem_get' was not declared. Should it be static?"
sparse warnings for some driver, before giving up for
similar reasons.
Arnd
Powered by blists - more mailing lists