2018-05-10 00:43:15

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning after merge of the nfsd tree

Hi all,

After merging the nfsd tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

net/sunrpc/xprtrdma/svc_rdma_transport.c: In function 'rdma_listen_handler':
net/sunrpc/xprtrdma/svc_rdma_transport.c:299:23: warning: unused variable 'rdma' [-Wunused-variable]
struct svcxprt_rdma *rdma = cma_id->context;
^~~~

Introduced by commit

d1ab72afe681 ("svcrdma: Trace key RDMA API events")

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2018-05-10 14:21:51

by Chuck Lever III

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the nfsd tree



> On May 9, 2018, at 8:42 PM, Stephen Rothwell <[email protected]> wrote:
>
> Hi all,
>
> After merging the nfsd tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> net/sunrpc/xprtrdma/svc_rdma_transport.c: In function 'rdma_listen_handler':
> net/sunrpc/xprtrdma/svc_rdma_transport.c:299:23: warning: unused variable 'rdma' [-Wunused-variable]
> struct svcxprt_rdma *rdma = cma_id->context;
> ^~~~

Needs to be wrapped with "#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)"
Would you like me to send a patch?


> Introduced by commit
>
> d1ab72afe681 ("svcrdma: Trace key RDMA API events")

--
Chuck Lever




2018-05-10 15:24:37

by J. Bruce Fields

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the nfsd tree

On Thu, May 10, 2018 at 10:21:05AM -0400, Chuck Lever wrote:
>
>
> > On May 9, 2018, at 8:42 PM, Stephen Rothwell <[email protected]> wrote:
> >
> > Hi all,
> >
> > After merging the nfsd tree, today's linux-next build (powerpc
> > ppc64_defconfig) produced this warning:
> >
> > net/sunrpc/xprtrdma/svc_rdma_transport.c: In function 'rdma_listen_handler':
> > net/sunrpc/xprtrdma/svc_rdma_transport.c:299:23: warning: unused variable 'rdma' [-Wunused-variable]
> > struct svcxprt_rdma *rdma = cma_id->context;
> > ^~~~
>
> Needs to be wrapped with "#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)"
> Would you like me to send a patch?

Any objection to saving the #if and just going back to writing out
cma_id->context there?

I've done that in my tree.

--b.

diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index ca9001d73456..05edb18f8ca3 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -544,7 +544,6 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
struct rdma_cm_event *event)
{
struct sockaddr *sap = (struct sockaddr *)&cma_id->route.addr.src_addr;
- struct svcxprt_rdma *rdma = cma_id->context;
int ret = 0;

trace_svcrdma_cm_event(event, sap);
@@ -552,7 +551,7 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
switch (event->event) {
case RDMA_CM_EVENT_CONNECT_REQUEST:
dprintk("svcrdma: Connect request on cma_id=%p, xprt = %p, "
- "event = %s (%d)\n", cma_id, rdma,
+ "event = %s (%d)\n", cma_id, cma_id->context,
rdma_event_msg(event->event), event->event);
handle_connect_req(cma_id, &event->param.conn);
break;

2018-05-10 16:11:00

by Chuck Lever III

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the nfsd tree



> On May 10, 2018, at 11:24 AM, Bruce Fields <[email protected]> wrote:
>
> On Thu, May 10, 2018 at 10:21:05AM -0400, Chuck Lever wrote:
>>
>>
>>> On May 9, 2018, at 8:42 PM, Stephen Rothwell <[email protected]> wrote:
>>>
>>> Hi all,
>>>
>>> After merging the nfsd tree, today's linux-next build (powerpc
>>> ppc64_defconfig) produced this warning:
>>>
>>> net/sunrpc/xprtrdma/svc_rdma_transport.c: In function 'rdma_listen_handler':
>>> net/sunrpc/xprtrdma/svc_rdma_transport.c:299:23: warning: unused variable 'rdma' [-Wunused-variable]
>>> struct svcxprt_rdma *rdma = cma_id->context;
>>> ^~~~
>>
>> Needs to be wrapped with "#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)"
>> Would you like me to send a patch?
>
> Any objection to saving the #if and just going back to writing out
> cma_id->context there?

LGTM

That's not really very useful information anyway, but I decided
to leave this stuff mostly as-is for now. I plan to do something
to fix races between disconnect and device removal at some point.


> I've done that in my tree.
>
> --b.
>
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> index ca9001d73456..05edb18f8ca3 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> @@ -544,7 +544,6 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
> struct rdma_cm_event *event)
> {
> struct sockaddr *sap = (struct sockaddr *)&cma_id->route.addr.src_addr;
> - struct svcxprt_rdma *rdma = cma_id->context;
> int ret = 0;
>
> trace_svcrdma_cm_event(event, sap);
> @@ -552,7 +551,7 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id,
> switch (event->event) {
> case RDMA_CM_EVENT_CONNECT_REQUEST:
> dprintk("svcrdma: Connect request on cma_id=%p, xprt = %p, "
> - "event = %s (%d)\n", cma_id, rdma,
> + "event = %s (%d)\n", cma_id, cma_id->context,
> rdma_event_msg(event->event), event->event);
> handle_connect_req(cma_id, &event->param.conn);
> break;

--
Chuck Lever