[lkml]   [2017]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Y2038] [PATCH 3/7] scsi: bfa: improve bfa_ioc_send_enable/disable data
On Mon, Nov 13, 2017 at 3:08 PM, Ben Hutchings
<> wrote:
> On Fri, 2017-11-10 at 16:37 +0100, Arnd Bergmann wrote:

>> bfi_h2i_set(, 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.


 \ /
  Last update: 2017-11-13 15:56    [W:0.068 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site