ACK: [PATCH 16/46] bios: mtrr: reduce scope of variables

IvanHu ivan.hu at canonical.com
Thu Jan 15 07:32:01 UTC 2015


On 01/14/2015 03:04 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> cppcheck is picking up some minor style issues which can
> be easily fixed:
>
> [src/bios/mtrr/mtrr.c:418]:
> 	(style) The scope of the variable 'entry' can be reduced.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/bios/mtrr/mtrr.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/bios/mtrr/mtrr.c b/src/bios/mtrr/mtrr.c
> index b6a977d..51fe616 100644
> --- a/src/bios/mtrr/mtrr.c
> +++ b/src/bios/mtrr/mtrr.c
> @@ -415,13 +415,13 @@ static int validate_iomem(fwts_framework *fw)
>   static void do_mtrr_resource(fwts_framework *fw)
>   {
>   	fwts_list_link *item;
> -	struct mtrr_entry *entry;
>
>   	fwts_log_info_verbatum(fw,"MTRR overview");
>   	fwts_log_info_verbatum(fw,"-------------");
>
>   	fwts_list_foreach(item, mtrr_list) {
> -		entry = fwts_list_data(struct mtrr_entry *, item);
> +		struct mtrr_entry *entry = fwts_list_data(struct mtrr_entry *, item);
> +
>   		if (entry->type & DISABLED)
>   			fwts_log_info_verbatum(fw, "Reg %hhu: disabled", entry->reg);
>   		else
>

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list