lkml.org 
[lkml]   [2018]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V1 2/3] scsi: ufs: Add ufs provisioning support
Date
-----Original Message-----
From: Bart Van Assche [mailto:Bart.VanAssche@wdc.com]
Sent: Monday, June 04, 2018 2:48 PM
To: vinholikatti@gmail.com; asutoshd@codeaurora.org; sayalil@codeaurora.org; evgreen@chromium.org; cang@codeaurora.org; martin.petersen@oracle.com; subhashj@codeaurora.org; vivek.gautam@codeaurora.org; rnayak@codeaurora.org; jejb@linux.vnet.ibm.com
Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH V1 2/3] scsi: ufs: Add ufs provisioning support

On Fri, 2018-06-01 at 16:12 +0530, Sayali Lokhande wrote:
> + qTotalRawDeviceCapacity =
> + (uint64_t)geo_buf[0x0b] | ((uint64_t)geo_buf[0x0a] << 8) |
> + ((uint64_t)geo_buf[0x09] << 16) |
> + ((uint64_t)geo_buf[0x08] << 24) |
> + ((uint64_t)geo_buf[0x07] << 32) |
> + ((uint64_t)geo_buf[0x06] << 40) |
> + ((uint64_t)geo_buf[0x05] << 48) |
> + ((uint64_t)geo_buf[0x04] << 56);
> + wEnhanced1CapAdjFac =
> + (uint16_t)geo_buf[0x31] | ((uint16_t)geo_buf[0x30] << 8);

Please use get_unaligned_be*() instead of open-coding these functions.
[Sayali]Agreed. Will update.

> + *pt++ = (cfg->unit[i].dNumAllocUnits >> 24) & 0xff;
> + *pt++ = (cfg->unit[i].dNumAllocUnits >> 16) & 0xff;
> + *pt++ = (cfg->unit[i].dNumAllocUnits >> 8) & 0xff;
> + *pt++ = (cfg->unit[i].dNumAllocUnits) & 0xff;

Please use put_unaligned_be() instead of open-coding this function.
[Sayali]Agreed. Will update.

Thanks,

Bart.




\
 
 \ /
  Last update: 2018-06-06 12:47    [W:0.090 / U:4.272 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site