From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= Date: Mon, 19 Jun 2017 08:42:21 +0200 Subject: [U-Boot] [PATCH 2/2] mmc: rpmb: update size format for write_counter In-Reply-To: <4dd588cc-481e-7573-23f0-bbe45306ab0d@rock-chips.com> References: <1496884804-5731-1-git-send-email-kever.yang@rock-chips.com> <1496884804-5731-2-git-send-email-kever.yang@rock-chips.com> <4dd588cc-481e-7573-23f0-bbe45306ab0d@rock-chips.com> Message-ID: <20170619084221.10d3b6e1@karo-electronics.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi, On Tue, 13 Jun 2017 10:11:17 +0800 Kever Yang wrote: > Hi Simon, >=20 >=20 > On 06/09/2017 08:28 PM, Simon Glass wrote: > > On 7 June 2017 at 19:20, Kever Yang wrote: > >> According to MMC spec, the write_counter is 4-byte length, > >> use 'int' instead of 'long' type for the 'long' is not 4-byte > >> in 64 bit CPU. > >> > >> Signed-off-by: Jason Zhu > >> Signed-off-by: Kever Yang > >> --- > >> > >> drivers/mmc/rpmb.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > So should we use uint32_t? >=20 > Yes, we can use uint32_t, I use 'unsigned int' just for the same format=20 > with other > members in the structure which using unsigned char/short. >=20 > Is there a doc for which kind of data format prefer to use first in U-Boo= t? > unsigned int, uint32_t, u32; >=20 uint32_t is guaranteed to be of size 32bit according to the C spec. '[unsigned] int' is only guaranteed to be at least 32bit but can be larger on some machine. A good overview of the C data types and their properties can be found at: https://en.wikipedia.org/wiki/C_data_types Lothar Wa=C3=9Fmann