netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 net-next] libceph: remove unused variable in handle_reply()
@ 2014-10-23 16:15 Fabian Frederick
  2014-10-23 16:25 ` Ilya Dryomov
  0 siblings, 1 reply; 4+ messages in thread
From: Fabian Frederick @ 2014-10-23 16:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Fabian Frederick, Sage Weil, David S. Miller, ceph-devel, netdev

osdmap_epoch is redundant with reassert_epoch and unused.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 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);
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1 net-next] libceph: remove unused variable in handle_reply()
  2014-10-23 16:15 [PATCH 1/1 net-next] libceph: remove unused variable in handle_reply() Fabian Frederick
@ 2014-10-23 16:25 ` Ilya Dryomov
  2014-10-25  9:12   ` Fabian Frederick
  0 siblings, 1 reply; 4+ messages in thread
From: Ilya Dryomov @ 2014-10-23 16:25 UTC (permalink / raw)
  To: Fabian Frederick
  Cc: Linux Kernel Mailing List, Sage Weil, David S. Miller,
	Ceph Development, netdev

On Thu, Oct 23, 2014 at 8:15 PM, Fabian Frederick <fabf@skynet.be> wrote:
> osdmap_epoch is redundant with reassert_epoch and unused.
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1 net-next] libceph: remove unused variable in handle_reply()
  2014-10-23 16:25 ` Ilya Dryomov
@ 2014-10-25  9:12   ` Fabian Frederick
  2014-10-25 15:05     ` Ilya Dryomov
  0 siblings, 1 reply; 4+ messages in thread
From: Fabian Frederick @ 2014-10-25  9:12 UTC (permalink / raw)
  To: Ilya Dryomov
  Cc: netdev, Linux Kernel Mailing List, Ceph Development, Sage Weil,
	David S. Miller



> On 23 October 2014 at 18:25 Ilya Dryomov <ilya.dryomov@inktank.com> wrote:
>
>
> On Thu, Oct 23, 2014 at 8:15 PM, Fabian Frederick <fabf@skynet.be> wrote:
> > osdmap_epoch is redundant with reassert_epoch and unused.
> >
> > Signed-off-by: Fabian Frederick <fabf@skynet.be>
> > ---
> >  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1 net-next] libceph: remove unused variable in handle_reply()
  2014-10-25  9:12   ` Fabian Frederick
@ 2014-10-25 15:05     ` Ilya Dryomov
  0 siblings, 0 replies; 4+ messages in thread
From: Ilya Dryomov @ 2014-10-25 15:05 UTC (permalink / raw)
  To: Fabian Frederick
  Cc: netdev, Linux Kernel Mailing List, Ceph Development, Sage Weil,
	David S. Miller

On Sat, Oct 25, 2014 at 1:12 PM, Fabian Frederick <fabf@skynet.be> wrote:
>
>
>> On 23 October 2014 at 18:25 Ilya Dryomov <ilya.dryomov@inktank.com> wrote:
>>
>>
>> On Thu, Oct 23, 2014 at 8:15 PM, Fabian Frederick <fabf@skynet.be> wrote:
>> > osdmap_epoch is redundant with reassert_epoch and unused.
>> >
>> > Signed-off-by: Fabian Frederick <fabf@skynet.be>
>> > ---
>> >  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 ?

I see, I'll fix it up.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-25 18:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-23 16:15 [PATCH 1/1 net-next] libceph: remove unused variable in handle_reply() Fabian Frederick
2014-10-23 16:25 ` Ilya Dryomov
2014-10-25  9:12   ` Fabian Frederick
2014-10-25 15:05     ` Ilya Dryomov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).