From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Kamal Heib <kamalheib1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Kamal Heib <kamalh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH rdma-next 4/5] IB/rxe: Use __func__ to print function's name
Date: Thu, 15 Jun 2017 11:51:17 +0300 [thread overview]
Message-ID: <20170615085117.GA3066@yuvallap> (raw)
In-Reply-To: <20170615082907.5658-5-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
On Thu, Jun 15, 2017 at 11:29:06AM +0300, Leon Romanovsky wrote:
> From: Kamal Heib <kamalheib1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> Its better to use __func__ to print functions name instead of writing
> the name in the print statement.
>
> Signed-off-by: Kamal Heib <kamalh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> drivers/infiniband/sw/rxe/rxe_task.c | 4 ++--
> drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_task.c b/drivers/infiniband/sw/rxe/rxe_task.c
> index d2a14a1bdc7f..ea3810b29273 100644
> --- a/drivers/infiniband/sw/rxe/rxe_task.c
> +++ b/drivers/infiniband/sw/rxe/rxe_task.c
> @@ -78,7 +78,7 @@ void rxe_do_task(unsigned long data)
>
> default:
> spin_unlock_irqrestore(&task->state_lock, flags);
> - pr_warn("bad state = %d in rxe_do_task\n", task->state);
> + pr_warn("%s failed with bad state %d\n", __func__, task->state);
> return;
> }
>
> @@ -105,7 +105,7 @@ void rxe_do_task(unsigned long data)
> break;
>
> default:
> - pr_warn("bad state = %d in rxe_do_task\n",
> + pr_warn("%s failed with bad state %d\n", __func__,
> task->state);
> }
> spin_unlock_irqrestore(&task->state_lock, flags);
> diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
> index 92156025db73..a65a330b15b6 100644
> --- a/drivers/infiniband/sw/rxe/rxe_verbs.c
> +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
> @@ -1336,15 +1336,15 @@ int rxe_register_device(struct rxe_dev *rxe)
>
> err = ib_register_device(dev, NULL);
> if (err) {
> - pr_warn("rxe_register_device failed, err = %d\n", err);
> + pr_warn("%s failed with error %d\n", __func__, err);
> goto err1;
> }
>
> for (i = 0; i < ARRAY_SIZE(rxe_dev_attributes); ++i) {
> err = device_create_file(&dev->dev, rxe_dev_attributes[i]);
> if (err) {
> - pr_warn("device_create_file failed, i = %d, err = %d\n",
> - i, err);
> + pr_warn("%s failed with error %d for attr number %d\n",
> + __func__, err, i);
Before this fix the warn shows the call which fails (device_create_file)
and now it will show the caller (rxe_register_device).
Hope it is still fine with you.
> goto err2;
> }
> }
> --
> 2.12.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-06-15 8:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 8:29 [PATCH rdma-next 0/5] RXE checkpatch cleanup Leon Romanovsky
[not found] ` <20170615082907.5658-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-06-15 8:29 ` [PATCH rdma-next 1/5] IB/rxe: Use "foo *bar" instead of "foo * bar" Leon Romanovsky
2017-06-15 8:29 ` [PATCH rdma-next 2/5] IB/rxe: Prefer 'unsigned int' to bare use of 'unsigned' Leon Romanovsky
2017-06-15 8:29 ` [PATCH rdma-next 3/5] IB/rxe: Use DEVICE_ATTR_RO macro to show parent field Leon Romanovsky
2017-06-15 8:29 ` [PATCH rdma-next 4/5] IB/rxe: Use __func__ to print function's name Leon Romanovsky
[not found] ` <20170615082907.5658-5-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-06-15 8:51 ` Yuval Shaia [this message]
2017-06-15 9:09 ` Leon Romanovsky
2017-06-15 8:29 ` [PATCH rdma-next 5/5] IB/rxe: Constify static rxe_vm_ops Leon Romanovsky
2017-06-15 8:53 ` [PATCH rdma-next 0/5] RXE checkpatch cleanup Yuval Shaia
2017-07-28 17:35 ` Doug Ledford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170615085117.GA3066@yuvallap \
--to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=kamalh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=kamalheib1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox