Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1633311 > unrolled thread
| Started by | Dhiru Kholia <dhiru.kholia@gmail.com> |
|---|---|
| First post | 2017-04-29 18:50 +0200 |
| Last post | 2017-04-30 12:20 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 1/1] staging: comedi: use __func__ instead of hardcoded function name Dhiru Kholia <dhiru.kholia@gmail.com> - 2017-04-29 18:50 +0200
Re: [PATCH 1/1] staging: comedi: use __func__ instead of hardcoded function name Joe Perches <joe@perches.com> - 2017-04-29 19:30 +0200
Re: [PATCH 1/1] staging: comedi: use __func__ instead of hardcoded function name Dhiru Kholia <dhiru.kholia@gmail.com> - 2017-04-30 12:20 +0200
| From | Dhiru Kholia <dhiru.kholia@gmail.com> |
|---|---|
| Date | 2017-04-29 18:50 +0200 |
| Subject | [PATCH 1/1] staging: comedi: use __func__ instead of hardcoded function name |
| Message-ID | <tBDJf-c0-9@gated-at.bofh.it> |
This coding style issue was found by checkpatch.pl script. Using
__func__ instead of hardcoded function name should help in future
refactoring of this code.
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
---
drivers/staging/comedi/drivers/quatech_daqp_cs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
index 802f51e..ea194aa 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;
}
--
2.7.4
[toc] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-04-29 19:30 +0200 |
| Subject | Re: [PATCH 1/1] staging: comedi: use __func__ instead of hardcoded function name |
| Message-ID | <tBElX-DO-3@gated-at.bofh.it> |
| In reply to | #1633311 |
On Sat, 2017-04-29 at 22:17 +0530, Dhiru Kholia wrote:
> This coding style issue was found by checkpatch.pl script. Using
> __func__ instead of hardcoded function name should help in future
> refactoring of this code.
>
> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
> ---
> drivers/staging/comedi/drivers/quatech_daqp_cs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> index 802f51e..ea194aa 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__);
More common would be:
dev_warn(dev->class_dev, "%s: loop limit reached\n", __func__);
It also seems that the loop_limit test, a loop count,
is sensitive on the cpu frequency and perhaps should
be some timer based limit instead.
[toc] | [prev] | [next] | [standalone]
| From | Dhiru Kholia <dhiru.kholia@gmail.com> |
|---|---|
| Date | 2017-04-30 12:20 +0200 |
| Subject | Re: [PATCH 1/1] staging: comedi: use __func__ instead of hardcoded function name |
| Message-ID | <tBU7o-1Wa-13@gated-at.bofh.it> |
| In reply to | #1633314 |
On Sat, Apr 29, 2017 at 10:21:33AM -0700, Joe Perches wrote:
> On Sat, 2017-04-29 at 22:17 +0530, Dhiru Kholia wrote:
> > This coding style issue was found by checkpatch.pl script. Using
> > __func__ instead of hardcoded function name should help in future
> > refactoring of this code.
> >
> > if (loop_limit <= 0) {
> > dev_warn(dev->class_dev,
> > - "loop_limit reached in daqp_interrupt()\n");
> > + "loop_limit reached in %s()\n", __func__);
>
> More common would be:
> dev_warn(dev->class_dev, "%s: loop limit reached\n", __func__);
Thanks for the feedback, Joe. I have sent out a v2 of this patch with
this suggestion applied.
> It also seems that the loop_limit test, a loop count,
> is sensitive on the cpu frequency and perhaps should
> be some timer based limit instead.
I am not familiar with this code at all. I am doing this patch as part
of "The Eudyptula Challenge" (http://eudyptula-challenge.org/).
Thanks,
Dhiru
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web