Message ID | 1421175905-17035-17-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 01/14/2015 03:04 AM, Colin King wrote: > From: Colin Ian King <colin.king@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@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@canonical.com>
On Wed, Jan 14, 2015 at 3:04 AM, Colin King <colin.king@canonical.com> wrote: > From: Colin Ian King <colin.king@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@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@canonical.com>
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