From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kever Yang Date: Tue, 13 Jun 2017 10:11:17 +0800 Subject: [U-Boot] [PATCH 2/2] mmc: rpmb: update size format for write_counter In-Reply-To: References: <1496884804-5731-1-git-send-email-kever.yang@rock-chips.com> <1496884804-5731-2-git-send-email-kever.yang@rock-chips.com> Message-ID: <4dd588cc-481e-7573-23f0-bbe45306ab0d@rock-chips.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, 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? Yes, we can use uint32_t, I use 'unsigned int' just for the same format with other members in the structure which using unsigned char/short. Is there a doc for which kind of data format prefer to use first in U-Boot? unsigned int, uint32_t, u32; Thanks, - Kever >> diff --git a/drivers/mmc/rpmb.c b/drivers/mmc/rpmb.c >> index 1c6888f..0b6b622 100644 >> --- a/drivers/mmc/rpmb.c >> +++ b/drivers/mmc/rpmb.c >> @@ -67,7 +67,7 @@ struct s_rpmb { >> unsigned char mac[RPMB_SZ_MAC]; >> unsigned char data[RPMB_SZ_DATA]; >> unsigned char nonce[RPMB_SZ_NONCE]; >> - unsigned long write_counter; >> + unsigned int write_counter; >> unsigned short address; >> unsigned short block_count; >> unsigned short result; >> -- >> 1.9.1 >>