From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Mon, 18 May 2015 08:46:50 -0400 (EDT) Subject: [Cluster-devel] [PATCH 1/1 linux-next] gfs2: fix shadow warning in gfs2_rbm_find() In-Reply-To: <1431724674-29419-1-git-send-email-fabf@skynet.be> References: <1431724674-29419-1-git-send-email-fabf@skynet.be> Message-ID: <1808944788.656337.1431953210671.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- > bi was already declared globally in gfs2_rbm_find() > Use bi_full for this variable in > "Mark bitmap as full and fall through" context. > Also add blank line after declaration. > > Signed-off-by: Fabian Frederick > --- > fs/gfs2/rgrp.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c > index 900e515..fa47af9 100644 > --- a/fs/gfs2/rgrp.c > +++ b/fs/gfs2/rgrp.c > @@ -1712,8 +1712,9 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 > state, u32 *minext, > > bitmap_full: /* Mark bitmap as full and fall through */ > if ((state == GFS2_BLKST_FREE) && initial_offset == 0) { > - struct gfs2_bitmap *bi = rbm_bi(rbm); > - set_bit(GBF_FULL, &bi->bi_flags); > + struct gfs2_bitmap *bi_full = rbm_bi(rbm); > + > + set_bit(GBF_FULL, &bi_full->bi_flags); > } > > next_bitmap: /* Find next bitmap in the rgrp */ > -- > 2.4.0 Hi, In this case, I think it makes more sense to just eliminate the extra declare of bi and just use the function-global bi to set GBF_FULL. Regards, Bob Peterson Red Hat File Systems From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250AbbERMrH (ORCPT ); Mon, 18 May 2015 08:47:07 -0400 Received: from mx4-phx2.redhat.com ([209.132.183.25]:48441 "EHLO mx4-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbbERMq4 (ORCPT ); Mon, 18 May 2015 08:46:56 -0400 Date: Mon, 18 May 2015 08:46:50 -0400 (EDT) From: Bob Peterson To: Fabian Frederick Cc: linux-kernel@vger.kernel.org, Steven Whitehouse , cluster-devel@redhat.com Message-ID: <1808944788.656337.1431953210671.JavaMail.zimbra@redhat.com> In-Reply-To: <1431724674-29419-1-git-send-email-fabf@skynet.be> References: <1431724674-29419-1-git-send-email-fabf@skynet.be> Subject: Re: [PATCH 1/1 linux-next] gfs2: fix shadow warning in gfs2_rbm_find() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.3.113.82] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF37 (Linux)/8.0.6_GA_5922) Thread-Topic: gfs2: fix shadow warning in gfs2_rbm_find() Thread-Index: qNenpqnGzDPmRiTnGeRvFds02XRMaQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Original Message ----- > bi was already declared globally in gfs2_rbm_find() > Use bi_full for this variable in > "Mark bitmap as full and fall through" context. > Also add blank line after declaration. > > Signed-off-by: Fabian Frederick > --- > fs/gfs2/rgrp.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c > index 900e515..fa47af9 100644 > --- a/fs/gfs2/rgrp.c > +++ b/fs/gfs2/rgrp.c > @@ -1712,8 +1712,9 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 > state, u32 *minext, > > bitmap_full: /* Mark bitmap as full and fall through */ > if ((state == GFS2_BLKST_FREE) && initial_offset == 0) { > - struct gfs2_bitmap *bi = rbm_bi(rbm); > - set_bit(GBF_FULL, &bi->bi_flags); > + struct gfs2_bitmap *bi_full = rbm_bi(rbm); > + > + set_bit(GBF_FULL, &bi_full->bi_flags); > } > > next_bitmap: /* Find next bitmap in the rgrp */ > -- > 2.4.0 Hi, In this case, I think it makes more sense to just eliminate the extra declare of bi and just use the function-global bi to set GBF_FULL. Regards, Bob Peterson Red Hat File Systems