Re: [PATCH 1/1 net-next] libceph: remove unused variable in handle_reply()

From: Fabian Frederick
Date: Sat Oct 25 2014 - 14:41:33 EST




> On 23 October 2014 at 18:25 Ilya Dryomov <ilya.dryomov@xxxxxxxxxxx> wrote:
>
>
> On Thu, Oct 23, 2014 at 8:15 PM, Fabian Frederick <fabf@xxxxxxxxx> wrote:
> > osdmap_epoch is redundant with reassert_epoch and unused.
> >
> > Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
> > ---
> >Â net/ceph/osd_client.c | 2 --
> >Â 1 file changed, 2 deletions(-)
> >
> > diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> > index f3fc54e..432bd75 100644
> > --- a/net/ceph/osd_client.c
> > +++ b/net/ceph/osd_client.c
> > @@ -1700,7 +1700,6 @@ static void handle_reply(struct ceph_osd_client *osdc,
> > struct ceph_msg *msg,
> >Â Â Â Â Âint err;
> >Â Â Â Â Âu32 reassert_epoch;
> >Â Â Â Â Âu64 reassert_version;
> > -Â Â Â Âu32 osdmap_epoch;
> >Â Â Â Â Âint already_completed;
> >Â Â Â Â Âu32 bytes;
> >Â Â Â Â Âunsigned int i;
> > @@ -1725,7 +1724,6 @@ static void handle_reply(struct ceph_osd_client *osdc,
> > struct ceph_msg *msg,
> >Â Â Â Â Âresult = ceph_decode_32(&p);
> >Â Â Â Â Âreassert_epoch = ceph_decode_32(&p);
> >Â Â Â Â Âreassert_version = ceph_decode_64(&p);
> > -Â Â Â Âosdmap_epoch = ceph_decode_32(&p);
> >
> >Â Â Â Â Â/* lookup */
> >Â Â Â Â Âdown_read(&osdc->map_sem);
>
> Hi Fabian,
>
> osdmap_epoch is useful for debugging, but this is wrong anyway -
> ceph_decode_32() has side effects. Removing it and not adjusting *p
> would make the whole thing blow up pretty fast..
>
> Thanks,
>
>Â Â Â Â Â Â Â Â ÂIlya

Hi Ilya,

    osdmap_epoch generates a warning with -Wunused-but-set-variable.
Maybe we could just do ceph_decode_32(&p) and remove it
(it doesn't seem to add a warning) and/or add some comment ?

Regards,
Fabian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/