Message ID | 1421175905-17035-33-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/lib/src/fwts_gpe.c:35]: > (style) The scope of the variable 'i' can be reduced. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_gpe.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/lib/src/fwts_gpe.c b/src/lib/src/fwts_gpe.c > index a78c0d8..6ef759f 100644 > --- a/src/lib/src/fwts_gpe.c > +++ b/src/lib/src/fwts_gpe.c > @@ -32,10 +32,10 @@ > */ > void fwts_gpe_free(fwts_gpe *gpe, const int count) > { > - int i; > - > if (gpe) { > - for (i=0;i<count;i++) { > + int i; > + > + for (i = 0; i < count; i++) { > if (gpe[i].name) > free(gpe[i].name); > } > Acked-by: Ivan Hu <ivan.hu@canonical.com>
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/lib/src/fwts_gpe.c:35]: > (style) The scope of the variable 'i' can be reduced. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_gpe.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/lib/src/fwts_gpe.c b/src/lib/src/fwts_gpe.c > index a78c0d8..6ef759f 100644 > --- a/src/lib/src/fwts_gpe.c > +++ b/src/lib/src/fwts_gpe.c > @@ -32,10 +32,10 @@ > */ > void fwts_gpe_free(fwts_gpe *gpe, const int count) > { > - int i; > - > if (gpe) { > - for (i=0;i<count;i++) { > + int i; > + > + for (i = 0; i < count; i++) { > if (gpe[i].name) > free(gpe[i].name); > } > Acked-by: Alex Hung <alex.hung@canonical.com>
diff --git a/src/lib/src/fwts_gpe.c b/src/lib/src/fwts_gpe.c index a78c0d8..6ef759f 100644 --- a/src/lib/src/fwts_gpe.c +++ b/src/lib/src/fwts_gpe.c @@ -32,10 +32,10 @@ */ void fwts_gpe_free(fwts_gpe *gpe, const int count) { - int i; - if (gpe) { - for (i=0;i<count;i++) { + int i; + + for (i = 0; i < count; i++) { if (gpe[i].name) free(gpe[i].name); }