lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 4 Jun 2018 09:17:37 +0000
From:   Bart Van Assche <Bart.VanAssche@....com>
To:     "vinholikatti@...il.com" <vinholikatti@...il.com>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        "sayalil@...eaurora.org" <sayalil@...eaurora.org>,
        "evgreen@...omium.org" <evgreen@...omium.org>,
        "cang@...eaurora.org" <cang@...eaurora.org>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "subhashj@...eaurora.org" <subhashj@...eaurora.org>,
        "vivek.gautam@...eaurora.org" <vivek.gautam@...eaurora.org>,
        "rnayak@...eaurora.org" <rnayak@...eaurora.org>,
        "jejb@...ux.vnet.ibm.com" <jejb@...ux.vnet.ibm.com>
CC:     "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.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.

> +		*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.

Thanks,

Bart.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ