From: Aishwarya Pant <aishpant@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: Re: [PATCH v4 6/8] staging: bcm2835-audio: Add function name to debug and error logs
Date: Thu, 9 Mar 2017 15:47:03 +0530 [thread overview]
Message-ID: <20170309101703.GA2298@aishwarya> (raw)
In-Reply-To: <e3541396d2f2171a9abcb932b1e02b118377159e.1488984315.git.aishpant@gmail.com>
On Wed, Mar 08, 2017 at 08:19:51PM +0530, Aishwarya Pant wrote:
> This patch adds current function names __func__ to debug and error logs
> in the work functions.
>
> Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
> ---
> .../staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
> index 026582e..77657a0 100644
> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
> @@ -138,7 +138,7 @@ int bcm2835_audio_start(struct bcm2835_alsa_stream *alsa_stream)
> work = kmalloc(sizeof(*work), GFP_ATOMIC);
> /*--- Queue some work (item 1) ---*/
> if (!work) {
> - LOG_ERR(" .. Error: NULL work kmalloc\n");
> + LOG_ERR("%s: Error: NULL work kmalloc\n", __func__);
> return -ENOMEM;
> }
> INIT_WORK(&work->my_work, my_wq_function);
> @@ -146,10 +146,11 @@ int bcm2835_audio_start(struct bcm2835_alsa_stream *alsa_stream)
> work->cmd = BCM2835_AUDIO_START;
> if (!queue_work(alsa_stream->my_wq, &work->my_work)) {
> kfree(work);
> + LOG_ERR("%s: Error: Unable to start audio\n", __func__);
> return -EBUSY;
> }
> }
> - LOG_DBG(" .. OUT\n");
> + LOG_DBG("%s: .. OUT\n", __func__);
> return 0;
> }
>
> @@ -162,7 +163,7 @@ int bcm2835_audio_stop(struct bcm2835_alsa_stream *alsa_stream)
> work = kmalloc(sizeof(*work), GFP_ATOMIC);
> /*--- Queue some work (item 1) ---*/
> if (!work) {
> - LOG_ERR(" .. Error: NULL work kmalloc\n");
> + LOG_ERR("%s: Error: NULL work kmalloc\n", __func__);
> return -ENOMEM;
> }
> INIT_WORK(&work->my_work, my_wq_function);
> @@ -170,10 +171,11 @@ int bcm2835_audio_stop(struct bcm2835_alsa_stream *alsa_stream)
> work->cmd = BCM2835_AUDIO_STOP;
> if (!queue_work(alsa_stream->my_wq, &work->my_work)) {
> kfree(work);
> + LOG_ERR("%s: Error: Unable to stop audio\n", __func__);
> return -EBUSY;
> }
> }
> - LOG_DBG(" .. OUT\n");
> + LOG_DBG("%s: .. OUT\n", __func__);
> return 0;
> }
>
> @@ -187,7 +189,7 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
> work = kmalloc(sizeof(*work), GFP_ATOMIC);
> /*--- Queue some work (item 1) ---*/
> if (!work) {
> - LOG_ERR(" .. Error: NULL work kmalloc\n");
> + LOG_ERR("%s: Error: NULL work kmalloc\n", __func__);
> return -ENOMEM;
> }
> INIT_WORK(&work->my_work, my_wq_function);
> @@ -197,10 +199,11 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
> work->count = count;
> if (!queue_work(alsa_stream->my_wq, &work->my_work)) {
> kfree(work);
> + LOG_ERR("%s: Error: Unable to write\n", __func__);
> return -EBUSY;
> }
> }
> - LOG_DBG(" .. OUT\n");
> + LOG_DBG("%s: .. OUT\n", __func__);
Please ignore this patch.
LOG_DBG/ERR/INFO(..) are wrappers around pr_*(..) family with line
number and function name appended. I'll send a new patchset with
these changes reverted.
> return 0;
> }
>
> --
> 2.7.4
>
next prev parent reply other threads:[~2017-03-09 10:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 14:48 [PATCH v4 0/8] staging: bcm2835-audio: fix coding style issues Aishwarya Pant
2017-03-08 14:48 ` [PATCH v4 1/8] staging: bcm2835-audio: Replace kmalloc with kzalloc Aishwarya Pant
2017-03-08 14:49 ` [PATCH v4 2/8] staging: bcm2835-audio: replace null with error pointer value Aishwarya Pant
2017-03-08 14:49 ` [PATCH v4 3/8] staging: bcm2835-audio: propagate PTR_ERR value instead of -EPERM Aishwarya Pant
2017-03-08 14:49 ` [PATCH v4 4/8] staging: bcm2835-audio: use conditional only for error case Aishwarya Pant
2017-03-08 14:49 ` [PATCH v4 5/8] staging: bcm2835-audio: deallocate work when queue_work(...) fails Aishwarya Pant
2017-03-08 14:49 ` [PATCH v4 6/8] staging: bcm2835-audio: Add function name to debug and error logs Aishwarya Pant
2017-03-09 10:17 ` Aishwarya Pant [this message]
2017-03-08 14:50 ` [PATCH v4 7/8] staging: bcm2835-audio: fix memory leak in bcm2835_audio_open_connection() Aishwarya Pant
2017-03-08 14:50 ` [PATCH v4 8/8] staging: bcm2835-audio: remove BUG_ON() " Aishwarya Pant
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=20170309101703.GA2298@aishwarya \
--to=aishpant@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.