Skip to content

Commit 53cbc94

Browse files
committed
fix(mmc): align part config type
This corrects MISRA C2012 10.3: The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category. Set part_config to be an unsigned char everywhere it is used. Signed-off-by: Yann Gautier <[email protected]> Change-Id: I9cf87848fb016a5630b3c8091290419e3bc62b91
1 parent bf78a65 commit 53cbc94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/mmc/mmc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static int mmc_device_state(void)
111111
return MMC_GET_STATE(resp_data[0]);
112112
}
113113

114-
static int mmc_send_part_switch_cmd(unsigned int part_config)
114+
static int mmc_send_part_switch_cmd(unsigned char part_config)
115115
{
116116
int ret;
117117
unsigned int part_time = 0;
@@ -759,9 +759,9 @@ size_t mmc_erase_blocks(int lba, size_t size)
759759
return size;
760760
}
761761

762-
static int mmc_part_switch(unsigned int part_type)
762+
static int mmc_part_switch(unsigned char part_type)
763763
{
764-
uint8_t part_config = mmc_ext_csd[CMD_EXTCSD_PARTITION_CONFIG];
764+
unsigned char part_config = mmc_ext_csd[CMD_EXTCSD_PARTITION_CONFIG];
765765

766766
part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK;
767767
part_config |= part_type;

0 commit comments

Comments
 (0)