soc/intel: Replace open-coded buffer length calculation
Use `sizeof(value)` instead of manually calculating the buffer size. Change-Id: Ibe49e40b1c4f2c0b661d94e59059a95bdb204197 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52107 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
This commit is contained in:
parent
73a22edcc8
commit
0c0d49229d
6 changed files with 12 additions and 24 deletions
|
@ -116,11 +116,9 @@ static void soc_fill_gpio_pm_configuration(void)
|
|||
const config_t *config = config_of_soc();
|
||||
|
||||
if (config->gpio_override_pm)
|
||||
memcpy(value, config->gpio_pm, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memcpy(value, config->gpio_pm, sizeof(value));
|
||||
else
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value));
|
||||
|
||||
gpio_pm_configure(value, TOTAL_GPIO_COMM);
|
||||
}
|
||||
|
|
|
@ -14,11 +14,9 @@ void soc_gpio_pm_configuration(void)
|
|||
const config_t *config = config_of_soc();
|
||||
|
||||
if (config->gpio_override_pm)
|
||||
memcpy(value, config->gpio_pm, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memcpy(value, config->gpio_pm, sizeof(value));
|
||||
else
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value));
|
||||
|
||||
gpio_pm_configure(value, TOTAL_GPIO_COMM);
|
||||
}
|
||||
|
|
|
@ -105,11 +105,9 @@ static void soc_fill_gpio_pm_configuration(void)
|
|||
const config_t *config = config_of_soc();
|
||||
|
||||
if (config->gpio_override_pm)
|
||||
memcpy(value, config->gpio_pm, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memcpy(value, config->gpio_pm, sizeof(value));
|
||||
else
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value));
|
||||
|
||||
gpio_pm_configure(value, TOTAL_GPIO_COMM);
|
||||
}
|
||||
|
|
|
@ -95,11 +95,9 @@ static void soc_fill_gpio_pm_configuration(void)
|
|||
const config_t *config = config_of_soc();
|
||||
|
||||
if (config->gpio_override_pm)
|
||||
memcpy(value, config->gpio_pm, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memcpy(value, config->gpio_pm, sizeof(value));
|
||||
else
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value));
|
||||
|
||||
gpio_pm_configure(value, TOTAL_GPIO_COMM);
|
||||
}
|
||||
|
|
|
@ -111,11 +111,9 @@ static void soc_fill_gpio_pm_configuration(void)
|
|||
const config_t *config = config_of_soc();
|
||||
|
||||
if (config->gpio_override_pm)
|
||||
memcpy(value, config->gpio_pm, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memcpy(value, config->gpio_pm, sizeof(value));
|
||||
else
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value));
|
||||
|
||||
gpio_pm_configure(value, TOTAL_GPIO_COMM);
|
||||
}
|
||||
|
|
|
@ -116,11 +116,9 @@ static void soc_fill_gpio_pm_configuration(void)
|
|||
const config_t *config = config_of_soc();
|
||||
|
||||
if (config->gpio_override_pm)
|
||||
memcpy(value, config->gpio_pm, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memcpy(value, config->gpio_pm, sizeof(value));
|
||||
else
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(uint8_t) *
|
||||
TOTAL_GPIO_COMM);
|
||||
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value));
|
||||
|
||||
gpio_pm_configure(value, TOTAL_GPIO_COMM);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue