[PATCH 16/46] bios: mtrr: reduce scope of variables
Keng-Yu Lin
keng-yu.lin at canonical.com
Tue Jan 20 06:53:21 UTC 2015
On Wed, Jan 14, 2015 at 3:04 AM, Colin King <colin.king at canonical.com> 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
> --
> 2.1.4
>
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>
More information about the fwts-devel
mailing list