From: Greg KH <gregkh@linuxfoundation.org>
To: Eisha Chen-yen-su <chenyensu0@gmail.com>
Cc: outreachy-kernel@googlegroups.com, abbotti@mev.co.uk,
hsweeten@visionengravers.com
Subject: Re: [PATCH] staging: comedi: Use '"%s:", __func__' instead of function name
Date: Tue, 20 Feb 2018 09:02:40 +0100 [thread overview]
Message-ID: <20180220080240.GA830@kroah.com> (raw)
In-Reply-To: <20180219200048.10511-1-chenyensu0@gmail.com>
On Mon, Feb 19, 2018 at 09:00:48PM +0100, Eisha Chen-yen-su wrote:
> Replace all occurrences of functions' names in strings by a reference
> to __func__, to improve robustness. Problem found with checkpatch.
>
> Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com>
> ---
> drivers/staging/comedi/drivers/jr3_pci.c | 2 +-
> drivers/staging/comedi/drivers/ni_mio_common.c | 8 +++++---
> drivers/staging/comedi/drivers/quatech_daqp_cs.c | 2 +-
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
> index 201f4f96c182..2578ae4b102f 100644
> --- a/drivers/staging/comedi/drivers/jr3_pci.c
> +++ b/drivers/staging/comedi/drivers/jr3_pci.c
> @@ -295,7 +295,7 @@ static int jr3_pci_open(struct comedi_device *dev)
> struct comedi_subdevice *s;
> int i;
>
> - dev_dbg(dev->class_dev, "jr3_pci_open\n");
> + dev_dbg(dev->class_dev, "%s\n", __func__);
A call like this should just be deleted, as it is a "tracing" call, and
we have an in-kernel function for that now. So just delete this line in
a separate patch.
> for (i = 0; i < dev->n_subdevices; i++) {
> s = &dev->subdevices[i];
> spriv = s->private;
> diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
> index 5d610af6799f..d6eb55b41814 100644
> --- a/drivers/staging/comedi/drivers/ni_mio_common.c
> +++ b/drivers/staging/comedi/drivers/ni_mio_common.c
> @@ -1965,7 +1965,8 @@ static void ni_cmd_set_mite_transfer(struct mite_ring *ring,
> if (nbytes > sdev->async->prealloc_bufsz) {
> if (cmd->stop_arg > 0)
> dev_err(sdev->device->class_dev,
> - "ni_cmd_set_mite_transfer: tried exact data transfer limits greater than buffer size\n");
> + "%s: tried exact data transfer limits greater than buffer size\n",
> + __func__);
>
> /*
> * we can only transfer up to the size of the buffer. In this
> @@ -1978,7 +1979,8 @@ static void ni_cmd_set_mite_transfer(struct mite_ring *ring,
> mite_init_ring_descriptors(ring, sdev, nbytes);
> #else
> dev_err(sdev->device->class_dev,
> - "ni_cmd_set_mite_transfer: exact data transfer limits not implemented yet without DMA\n");
> + "%s: exact data transfer limits not implemented yet without DMA\n",
> + __func__);
> #endif
> }
>
> @@ -4687,7 +4689,7 @@ static int cs5529_do_conversion(struct comedi_device *dev,
> retval = cs5529_wait_for_idle(dev);
> if (retval) {
> dev_err(dev->class_dev,
> - "timeout or signal in cs5529_do_conversion()\n");
> + "timeout or signal in %s()\n", __func__);
> return -ETIME;
> }
> status = ni_ao_win_inw(dev, NI67XX_CAL_STATUS_REG);
> diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> index 802f51e46405..ea194aa01a64 100644
> --- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> +++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> @@ -248,7 +248,7 @@ static irqreturn_t daqp_interrupt(int irq, void *dev_id)
>
> if (loop_limit <= 0) {
> dev_warn(dev->class_dev,
> - "loop_limit reached in daqp_interrupt()\n");
> + "loop_limit reached in %s()\n", __func__);
> s->async->events |= COMEDI_CB_ERROR;
> }
>
The rest of these were fine, can you resend this patch as a 2-patch
series with the change I mention above being one patch, and the rest of
these changes being the other?
thanks,
greg k-h
next prev parent reply other threads:[~2018-02-20 8:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 20:00 [PATCH] staging: comedi: Use '"%s:", __func__' instead of function name Eisha Chen-yen-su
2018-02-20 8:02 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-02-18 11:10 Eisha Chen-yen-su
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=20180220080240.GA830@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=abbotti@mev.co.uk \
--cc=chenyensu0@gmail.com \
--cc=hsweeten@visionengravers.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.