* [PATCH] staging: comedi: replace slash in name
@ 2021-03-14 3:57 Tong Zhang
2021-03-15 10:44 ` Ian Abbott
0 siblings, 1 reply; 15+ messages in thread
From: Tong Zhang @ 2021-03-14 3:57 UTC (permalink / raw)
To: Ian Abbott, H Hartley Sweeten, Greg Kroah-Hartman,
Alexander A. Klimov, Tong Zhang, devel, linux-kernel
request_irq() wont accept a name which contains slash so we need to
repalce it with something else -- otherwise it will trigger a warning
and the entry in /proc/irq/ will not be created
[ 1.565966] name 'pci-das6402/16'
[ 1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 __xlate_proc_name+0x93/0xb0
[ 1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
[ 1.574200] Call Trace:
[ 1.574722] proc_mkdir+0x18/0x20
[ 1.576629] request_threaded_irq+0xfe/0x160
[ 1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64]
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
---
drivers/staging/comedi/drivers/cb_pcidas64.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index fa987bb0e7cd..662d6ffb8f60 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -677,7 +677,7 @@ static const int bytes_in_sample = 2;
static const struct pcidas64_board pcidas64_boards[] = {
[BOARD_PCIDAS6402_16] = {
- .name = "pci-das6402/16",
+ .name = "pci-das6402-16",
.ai_se_chans = 64,
.ai_bits = 16,
.ai_speed = 5000,
@@ -693,7 +693,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255 = 1,
},
[BOARD_PCIDAS6402_12] = {
- .name = "pci-das6402/12", /* XXX check */
+ .name = "pci-das6402-12", /* XXX check */
.ai_se_chans = 64,
.ai_bits = 12,
.ai_speed = 5000,
@@ -709,7 +709,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255 = 1,
},
[BOARD_PCIDAS64_M1_16] = {
- .name = "pci-das64/m1/16",
+ .name = "pci-das64-m1-16",
.ai_se_chans = 64,
.ai_bits = 16,
.ai_speed = 1000,
@@ -725,7 +725,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255 = 1,
},
[BOARD_PCIDAS64_M2_16] = {
- .name = "pci-das64/m2/16",
+ .name = "pci-das64-m2-16",
.ai_se_chans = 64,
.ai_bits = 16,
.ai_speed = 500,
@@ -741,7 +741,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255 = 1,
},
[BOARD_PCIDAS64_M3_16] = {
- .name = "pci-das64/m3/16",
+ .name = "pci-das64-m3-16",
.ai_se_chans = 64,
.ai_bits = 16,
.ai_speed = 333,
@@ -984,7 +984,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255 = 0,
},
[BOARD_PCIDAS4020_12] = {
- .name = "pci-das4020/12",
+ .name = "pci-das4020-12",
.ai_se_chans = 4,
.ai_bits = 12,
.ai_speed = 50,
--
2.25.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: replace slash in name
2021-03-14 3:57 [PATCH] staging: comedi: replace slash in name Tong Zhang
@ 2021-03-15 10:44 ` Ian Abbott
2021-03-15 10:48 ` Ian Abbott
0 siblings, 1 reply; 15+ messages in thread
From: Ian Abbott @ 2021-03-15 10:44 UTC (permalink / raw)
To: Tong Zhang, H Hartley Sweeten, Greg Kroah-Hartman,
Alexander A. Klimov, devel, linux-kernel
On 14/03/2021 03:57, Tong Zhang wrote:
> request_irq() wont accept a name which contains slash so we need to
> repalce it with something else -- otherwise it will trigger a warning
> and the entry in /proc/irq/ will not be created
>
> [ 1.565966] name 'pci-das6402/16'
> [ 1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 __xlate_proc_name+0x93/0xb0
> [ 1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
> [ 1.574200] Call Trace:
> [ 1.574722] proc_mkdir+0x18/0x20
> [ 1.576629] request_threaded_irq+0xfe/0x160
> [ 1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64]
>
> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
> ---
> drivers/staging/comedi/drivers/cb_pcidas64.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
> index fa987bb0e7cd..662d6ffb8f60 100644
> --- a/drivers/staging/comedi/drivers/cb_pcidas64.c
> +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
> @@ -677,7 +677,7 @@ static const int bytes_in_sample = 2;
>
> static const struct pcidas64_board pcidas64_boards[] = {
> [BOARD_PCIDAS6402_16] = {
> - .name = "pci-das6402/16",
> + .name = "pci-das6402-16",
> .ai_se_chans = 64,
> .ai_bits = 16,
> .ai_speed = 5000,
> @@ -693,7 +693,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
> .has_8255 = 1,
> },
> [BOARD_PCIDAS6402_12] = {
> - .name = "pci-das6402/12", /* XXX check */
> + .name = "pci-das6402-12", /* XXX check */
> .ai_se_chans = 64,
> .ai_bits = 12,
> .ai_speed = 5000,
> @@ -709,7 +709,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
> .has_8255 = 1,
> },
> [BOARD_PCIDAS64_M1_16] = {
> - .name = "pci-das64/m1/16",
> + .name = "pci-das64-m1-16",
> .ai_se_chans = 64,
> .ai_bits = 16,
> .ai_speed = 1000,
> @@ -725,7 +725,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
> .has_8255 = 1,
> },
> [BOARD_PCIDAS64_M2_16] = {
> - .name = "pci-das64/m2/16",
> + .name = "pci-das64-m2-16",
> .ai_se_chans = 64,
> .ai_bits = 16,
> .ai_speed = 500,
> @@ -741,7 +741,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
> .has_8255 = 1,
> },
> [BOARD_PCIDAS64_M3_16] = {
> - .name = "pci-das64/m3/16",
> + .name = "pci-das64-m3-16",
> .ai_se_chans = 64,
> .ai_bits = 16,
> .ai_speed = 333,
> @@ -984,7 +984,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
> .has_8255 = 0,
> },
> [BOARD_PCIDAS4020_12] = {
> - .name = "pci-das4020/12",
> + .name = "pci-das4020-12",
> .ai_se_chans = 4,
> .ai_bits = 12,
> .ai_speed = 50,
>
Userspace applications can use these strings to determine the board
type, so changing the strings would break those applications.
I suggest passing the comedi driver name "cb_pcidas" to request_irq()
for now.
--
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: replace slash in name
2021-03-15 10:44 ` Ian Abbott
@ 2021-03-15 10:48 ` Ian Abbott
2021-03-15 19:58 ` [PATCH v2] staging: comedi: cb_pcidas64: fix request_irq() warn Tong Zhang
2021-03-15 20:00 ` [PATCH] staging: comedi: replace slash in name Tong Zhang
0 siblings, 2 replies; 15+ messages in thread
From: Ian Abbott @ 2021-03-15 10:48 UTC (permalink / raw)
To: Tong Zhang, H Hartley Sweeten, Greg Kroah-Hartman,
Alexander A. Klimov, devel, linux-kernel
On 15/03/2021 10:44, Ian Abbott wrote:
> On 14/03/2021 03:57, Tong Zhang wrote:
>> request_irq() wont accept a name which contains slash so we need to
>> repalce it with something else -- otherwise it will trigger a warning
>> and the entry in /proc/irq/ will not be created
>>
>> [ 1.565966] name 'pci-das6402/16'
>> [ 1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 __xlate_proc_name+0x93/0xb0
>> [ 1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
>> [ 1.574200] Call Trace:
>> [ 1.574722] proc_mkdir+0x18/0x20
>> [ 1.576629] request_threaded_irq+0xfe/0x160
>> [ 1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64]
>>
>> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
[snip]
> Userspace applications can use these strings to determine the board
> type, so changing the strings would break those applications.
>
> I suggest passing the comedi driver name "cb_pcidas" to request_irq()
> for now.
Oops, I meant "cb_pcidas64". But you could reach that via
dev->driver->driver_name if you want (where dev is the struct
comedi_device * parameter).
--
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2] staging: comedi: cb_pcidas64: fix request_irq() warn
2021-03-15 10:48 ` Ian Abbott
@ 2021-03-15 19:58 ` Tong Zhang
2021-03-16 10:31 ` Ian Abbott
2021-03-15 20:00 ` [PATCH] staging: comedi: replace slash in name Tong Zhang
1 sibling, 1 reply; 15+ messages in thread
From: Tong Zhang @ 2021-03-15 19:58 UTC (permalink / raw)
To: Ian Abbott, H Hartley Sweeten, Greg Kroah-Hartman,
Alexander A. Klimov, devel, linux-kernel
Cc: Tong Zhang
request_irq() wont accept a name which contains slash so we need to
repalce it with something else -- otherwise it will trigger a warning
and the entry in /proc/irq/ will not be created
since the .name might be used by userspace and we don't want to break
userspace, so we are changing the parameters passed to request_irq()
[ 1.565966] name 'pci-das6402/16'
[ 1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 __xlate_proc_name+0x93/0xb0
[ 1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
[ 1.574200] Call Trace:
[ 1.574722] proc_mkdir+0x18/0x20
[ 1.576629] request_threaded_irq+0xfe/0x160
[ 1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64]
Suggested-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
---
v2: revert changes to .name field so that we dont break userspace
drivers/staging/comedi/drivers/cb_pcidas64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index fa987bb0e7cd..6d3ba399a7f0 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -4035,7 +4035,7 @@ static int auto_attach(struct comedi_device *dev,
init_stc_registers(dev);
retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
- dev->board_name, dev);
+ "cb_pcidas64", dev);
if (retval) {
dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
pcidev->irq);
--
2.25.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: replace slash in name
2021-03-15 10:48 ` Ian Abbott
2021-03-15 19:58 ` [PATCH v2] staging: comedi: cb_pcidas64: fix request_irq() warn Tong Zhang
@ 2021-03-15 20:00 ` Tong Zhang
2021-03-16 10:37 ` Ian Abbott
1 sibling, 1 reply; 15+ messages in thread
From: Tong Zhang @ 2021-03-15 20:00 UTC (permalink / raw)
To: Ian Abbott
Cc: H Hartley Sweeten, Greg Kroah-Hartman, Alexander A. Klimov,
devel, open list
Thanks Ian,
I have submitted a v2 patch based on your suggestions.
Thanks,
- Tong
On Mon, Mar 15, 2021 at 6:48 AM Ian Abbott <abbotti@mev.co.uk> wrote:
>
> On 15/03/2021 10:44, Ian Abbott wrote:
> > On 14/03/2021 03:57, Tong Zhang wrote:
> >> request_irq() wont accept a name which contains slash so we need to
> >> repalce it with something else -- otherwise it will trigger a warning
> >> and the entry in /proc/irq/ will not be created
> >>
> >> [ 1.565966] name 'pci-das6402/16'
> >> [ 1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 __xlate_proc_name+0x93/0xb0
> >> [ 1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
> >> [ 1.574200] Call Trace:
> >> [ 1.574722] proc_mkdir+0x18/0x20
> >> [ 1.576629] request_threaded_irq+0xfe/0x160
> >> [ 1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64]
> >>
> >> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
> [snip]
> > Userspace applications can use these strings to determine the board
> > type, so changing the strings would break those applications.
> >
> > I suggest passing the comedi driver name "cb_pcidas" to request_irq()
> > for now.
>
> Oops, I meant "cb_pcidas64". But you could reach that via
> dev->driver->driver_name if you want (where dev is the struct
> comedi_device * parameter).
>
> --
> -=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
> -=( registered in England & Wales. Regd. number: 02862268. )=-
> -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
> -=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] staging: comedi: cb_pcidas64: fix request_irq() warn
2021-03-15 19:58 ` [PATCH v2] staging: comedi: cb_pcidas64: fix request_irq() warn Tong Zhang
@ 2021-03-16 10:31 ` Ian Abbott
0 siblings, 0 replies; 15+ messages in thread
From: Ian Abbott @ 2021-03-16 10:31 UTC (permalink / raw)
To: Tong Zhang, H Hartley Sweeten, Greg Kroah-Hartman,
Alexander A. Klimov, devel, linux-kernel
On 15/03/2021 19:58, Tong Zhang wrote:
> request_irq() wont accept a name which contains slash so we need to
> repalce it with something else -- otherwise it will trigger a warning
> and the entry in /proc/irq/ will not be created
> since the .name might be used by userspace and we don't want to break
> userspace, so we are changing the parameters passed to request_irq()
>
> [ 1.565966] name 'pci-das6402/16'
> [ 1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 __xlate_proc_name+0x93/0xb0
> [ 1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
> [ 1.574200] Call Trace:
> [ 1.574722] proc_mkdir+0x18/0x20
> [ 1.576629] request_threaded_irq+0xfe/0x160
> [ 1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64]
>
> Suggested-by: Ian Abbott <abbotti@mev.co.uk>
> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
> ---
> v2: revert changes to .name field so that we dont break userspace
>
> drivers/staging/comedi/drivers/cb_pcidas64.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
> index fa987bb0e7cd..6d3ba399a7f0 100644
> --- a/drivers/staging/comedi/drivers/cb_pcidas64.c
> +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
> @@ -4035,7 +4035,7 @@ static int auto_attach(struct comedi_device *dev,
> init_stc_registers(dev);
>
> retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
> - dev->board_name, dev);
> + "cb_pcidas64", dev);
> if (retval) {
> dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
> pcidev->irq);
>
Looks good.
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: replace slash in name
2021-03-15 20:00 ` [PATCH] staging: comedi: replace slash in name Tong Zhang
@ 2021-03-16 10:37 ` Ian Abbott
2021-03-16 22:42 ` [PATCH] staging: comedi: das800: fix request_irq() warn Tong Zhang
2021-03-16 22:42 ` [PATCH] staging: comedi: replace slash in name Tong Zhang
0 siblings, 2 replies; 15+ messages in thread
From: Ian Abbott @ 2021-03-16 10:37 UTC (permalink / raw)
To: Tong Zhang
Cc: H Hartley Sweeten, Greg Kroah-Hartman, Alexander A. Klimov,
devel, open list
On 15/03/2021 20:00, Tong Zhang wrote:
> Thanks Ian,
> I have submitted a v2 patch based on your suggestions.
> Thanks,
> - Tong
Thanks. I think the only other Comedi driver with the same problem is
"drivers/staging/comedi/drivers/das800.c". It passes dev->board_name as
the name argument of request_irq(), but that is "cio-das802/16" for one
of the boards supported by the driver.
> On Mon, Mar 15, 2021 at 6:48 AM Ian Abbott <abbotti@mev.co.uk> wrote:
>>
>> On 15/03/2021 10:44, Ian Abbott wrote:
>>> On 14/03/2021 03:57, Tong Zhang wrote:
>>>> request_irq() wont accept a name which contains slash so we need to
>>>> repalce it with something else -- otherwise it will trigger a warning
>>>> and the entry in /proc/irq/ will not be created
>>>>
>>>> [ 1.565966] name 'pci-das6402/16'
>>>> [ 1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 __xlate_proc_name+0x93/0xb0
>>>> [ 1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
>>>> [ 1.574200] Call Trace:
>>>> [ 1.574722] proc_mkdir+0x18/0x20
>>>> [ 1.576629] request_threaded_irq+0xfe/0x160
>>>> [ 1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64]
>>>>
>>>> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
>> [snip]
>>> Userspace applications can use these strings to determine the board
>>> type, so changing the strings would break those applications.
>>>
>>> I suggest passing the comedi driver name "cb_pcidas" to request_irq()
>>> for now.
>>
>> Oops, I meant "cb_pcidas64". But you could reach that via
>> dev->driver->driver_name if you want (where dev is the struct
>> comedi_device * parameter).
--
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] staging: comedi: das800: fix request_irq() warn
2021-03-16 10:37 ` Ian Abbott
@ 2021-03-16 22:42 ` Tong Zhang
2021-03-17 5:14 ` Dan Carpenter
2021-03-17 12:48 ` Ian Abbott
2021-03-16 22:42 ` [PATCH] staging: comedi: replace slash in name Tong Zhang
1 sibling, 2 replies; 15+ messages in thread
From: Tong Zhang @ 2021-03-16 22:42 UTC (permalink / raw)
To: Ian Abbott, H Hartley Sweeten, Greg Kroah-Hartman, Tong Zhang,
Alexander A. Klimov, devel, linux-kernel
request_irq() wont accept a name which contains slash so we need to
repalce it with something else -- otherwise it will trigger a warning
and the entry in /proc/irq/ will not be created
since the .name might be used by userspace and we don't want to break
userspace, so we are changing the parameters passed to request_irq()
Suggested-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
---
drivers/staging/comedi/drivers/das800.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c
index 2881808d6606..bc08324f422f 100644
--- a/drivers/staging/comedi/drivers/das800.c
+++ b/drivers/staging/comedi/drivers/das800.c
@@ -668,7 +668,7 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = board->name;
if (irq > 1 && irq <= 7) {
- ret = request_irq(irq, das800_interrupt, 0, dev->board_name,
+ ret = request_irq(irq, das800_interrupt, 0, "das800",
dev);
if (ret == 0)
dev->irq = irq;
--
2.25.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: replace slash in name
2021-03-16 10:37 ` Ian Abbott
2021-03-16 22:42 ` [PATCH] staging: comedi: das800: fix request_irq() warn Tong Zhang
@ 2021-03-16 22:42 ` Tong Zhang
1 sibling, 0 replies; 15+ messages in thread
From: Tong Zhang @ 2021-03-16 22:42 UTC (permalink / raw)
To: Ian Abbott
Cc: H Hartley Sweeten, Greg Kroah-Hartman, Alexander A. Klimov,
devel, open list
On Tue, Mar 16, 2021 at 6:37 AM Ian Abbott <abbotti@mev.co.uk> wrote:
>
> Thanks. I think the only other Comedi driver with the same problem is
> "drivers/staging/comedi/drivers/das800.c". It passes dev->board_name as
> the name argument of request_irq(), but that is "cio-das802/16" for one
> of the boards supported by the driver.
>
Thanks Ian, I think you are right, das800.c also shares the same issue.
I have sent a patch for das800.c as well according to your comments.
Best,
- Tong
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: das800: fix request_irq() warn
2021-03-16 22:42 ` [PATCH] staging: comedi: das800: fix request_irq() warn Tong Zhang
@ 2021-03-17 5:14 ` Dan Carpenter
[not found] ` <CAA5qM4BcQ6+aa1C3_28zLVojwLduK-WZwsEftuasJgo8z0t0ew@mail.gmail.com>
2021-03-17 12:48 ` Ian Abbott
1 sibling, 1 reply; 15+ messages in thread
From: Dan Carpenter @ 2021-03-17 5:14 UTC (permalink / raw)
To: Tong Zhang
Cc: Ian Abbott, H Hartley Sweeten, Greg Kroah-Hartman,
Alexander A. Klimov, devel, linux-kernel
On Tue, Mar 16, 2021 at 06:42:26PM -0400, Tong Zhang wrote:
> request_irq() wont accept a name which contains slash so we need to
> repalce it with something else -- otherwise it will trigger a warning
^^^^^^^
I don't normally comment on spelling mistakes in the commit message but
you're copy and pasting "repalce" over and over...
> and the entry in /proc/irq/ will not be created
> since the .name might be used by userspace and we don't want to break
> userspace, so we are changing the parameters passed to request_irq()
regards,
dan carpenter
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: das800: fix request_irq() warn
[not found] ` <CAA5qM4BcQ6+aa1C3_28zLVojwLduK-WZwsEftuasJgo8z0t0ew@mail.gmail.com>
@ 2021-03-17 6:52 ` Dan Carpenter
2021-03-17 22:43 ` Tong Zhang
0 siblings, 1 reply; 15+ messages in thread
From: Dan Carpenter @ 2021-03-17 6:52 UTC (permalink / raw)
To: Tong Zhang
Cc: Alexander A. Klimov, Greg Kroah-Hartman, H Hartley Sweeten,
Ian Abbott, devel, linux-kernel
On Wed, Mar 17, 2021 at 01:55:40AM -0400, Tong Zhang wrote:
> Thanks for pointing that out.
> Yes you are right there is a mistake.
> I am a human. Human make mistakes. Therefore I make mistakes.
>
Yep. We all make mistakes. One thing to do is if you make a mistake
then check to see if anyone else has made a similar mistake.
git grep repalce
If enough people make that specific mistake then consider adding it to
the list of commonly mispelled words: scripts/spelling.txt
I looked through the logs and it looks like someone mispells it once a
year so it's probably not common enough to worry about.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: das800: fix request_irq() warn
2021-03-16 22:42 ` [PATCH] staging: comedi: das800: fix request_irq() warn Tong Zhang
2021-03-17 5:14 ` Dan Carpenter
@ 2021-03-17 12:48 ` Ian Abbott
2021-03-19 3:47 ` [PATCH v2] " Tong Zhang
2021-03-19 3:48 ` [PATCH] " Tong Zhang
1 sibling, 2 replies; 15+ messages in thread
From: Ian Abbott @ 2021-03-17 12:48 UTC (permalink / raw)
To: Tong Zhang, H Hartley Sweeten, Greg Kroah-Hartman,
Alexander A. Klimov, devel, linux-kernel
On 16/03/2021 22:42, Tong Zhang wrote:
> request_irq() wont accept a name which contains slash so we need to
> repalce it with something else -- otherwise it will trigger a warning
> and the entry in /proc/irq/ will not be created
> since the .name might be used by userspace and we don't want to break
> userspace, so we are changing the parameters passed to request_irq()
>
> Suggested-by: Ian Abbott <abbotti@mev.co.uk>
> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
> ---
> drivers/staging/comedi/drivers/das800.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c
> index 2881808d6606..bc08324f422f 100644
> --- a/drivers/staging/comedi/drivers/das800.c
> +++ b/drivers/staging/comedi/drivers/das800.c
> @@ -668,7 +668,7 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
> dev->board_name = board->name;
>
> if (irq > 1 && irq <= 7) {
> - ret = request_irq(irq, das800_interrupt, 0, dev->board_name,
> + ret = request_irq(irq, das800_interrupt, 0, "das800",
> dev);
> if (ret == 0)
> dev->irq = irq;
>
Looks good (apart from the minor spelling niggle spotted by Dan
Carpenter), thanks!
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: das800: fix request_irq() warn
2021-03-17 6:52 ` Dan Carpenter
@ 2021-03-17 22:43 ` Tong Zhang
0 siblings, 0 replies; 15+ messages in thread
From: Tong Zhang @ 2021-03-17 22:43 UTC (permalink / raw)
To: Dan Carpenter
Cc: Alexander A. Klimov, Greg Kroah-Hartman, H Hartley Sweeten,
Ian Abbott, devel, open list
Thanks for sharing those best practices, Dan.
I was wondering if there is a spelling checker for git.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2] staging: comedi: das800: fix request_irq() warn
2021-03-17 12:48 ` Ian Abbott
@ 2021-03-19 3:47 ` Tong Zhang
2021-03-19 3:48 ` [PATCH] " Tong Zhang
1 sibling, 0 replies; 15+ messages in thread
From: Tong Zhang @ 2021-03-19 3:47 UTC (permalink / raw)
To: Ian Abbott, H Hartley Sweeten, Greg Kroah-Hartman,
Alexander A. Klimov, Tong Zhang, devel, linux-kernel
request_irq() won't accept a name which contains slash so we need to
replace it with something else -- otherwise it will throw a warning
and the entry in /proc/irq/ will not be created.
Since the .name might be used by userspace and we don't want to break
userspace, so we are changing the parameters passed to request_irq()
Suggested-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
---
v2: fix commit log
drivers/staging/comedi/drivers/das800.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c
index 2881808d6606..bc08324f422f 100644
--- a/drivers/staging/comedi/drivers/das800.c
+++ b/drivers/staging/comedi/drivers/das800.c
@@ -668,7 +668,7 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = board->name;
if (irq > 1 && irq <= 7) {
- ret = request_irq(irq, das800_interrupt, 0, dev->board_name,
+ ret = request_irq(irq, das800_interrupt, 0, "das800",
dev);
if (ret == 0)
dev->irq = irq;
--
2.25.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] staging: comedi: das800: fix request_irq() warn
2021-03-17 12:48 ` Ian Abbott
2021-03-19 3:47 ` [PATCH v2] " Tong Zhang
@ 2021-03-19 3:48 ` Tong Zhang
1 sibling, 0 replies; 15+ messages in thread
From: Tong Zhang @ 2021-03-19 3:48 UTC (permalink / raw)
To: Ian Abbott
Cc: H Hartley Sweeten, Greg Kroah-Hartman, Alexander A. Klimov,
devel, open list
Thank you all,
I fixed the commit log and resent as v2.
Thanks,
- Tong
On Wed, Mar 17, 2021 at 8:48 AM Ian Abbott <abbotti@mev.co.uk> wrote:
>
> On 16/03/2021 22:42, Tong Zhang wrote:
> > request_irq() wont accept a name which contains slash so we need to
> > repalce it with something else -- otherwise it will trigger a warning
> > and the entry in /proc/irq/ will not be created
> > since the .name might be used by userspace and we don't want to break
> > userspace, so we are changing the parameters passed to request_irq()
> >
> > Suggested-by: Ian Abbott <abbotti@mev.co.uk>
> > Signed-off-by: Tong Zhang <ztong0001@gmail.com>
> > ---
> > drivers/staging/comedi/drivers/das800.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c
> > index 2881808d6606..bc08324f422f 100644
> > --- a/drivers/staging/comedi/drivers/das800.c
> > +++ b/drivers/staging/comedi/drivers/das800.c
> > @@ -668,7 +668,7 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
> > dev->board_name = board->name;
> >
> > if (irq > 1 && irq <= 7) {
> > - ret = request_irq(irq, das800_interrupt, 0, dev->board_name,
> > + ret = request_irq(irq, das800_interrupt, 0, "das800",
> > dev);
> > if (ret == 0)
> > dev->irq = irq;
> >
>
> Looks good (apart from the minor spelling niggle spotted by Dan
> Carpenter), thanks!
>
> Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
>
> --
> -=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
> -=( registered in England & Wales. Regd. number: 02862268. )=-
> -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
> -=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2021-03-19 3:49 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 3:57 [PATCH] staging: comedi: replace slash in name Tong Zhang
2021-03-15 10:44 ` Ian Abbott
2021-03-15 10:48 ` Ian Abbott
2021-03-15 19:58 ` [PATCH v2] staging: comedi: cb_pcidas64: fix request_irq() warn Tong Zhang
2021-03-16 10:31 ` Ian Abbott
2021-03-15 20:00 ` [PATCH] staging: comedi: replace slash in name Tong Zhang
2021-03-16 10:37 ` Ian Abbott
2021-03-16 22:42 ` [PATCH] staging: comedi: das800: fix request_irq() warn Tong Zhang
2021-03-17 5:14 ` Dan Carpenter
[not found] ` <CAA5qM4BcQ6+aa1C3_28zLVojwLduK-WZwsEftuasJgo8z0t0ew@mail.gmail.com>
2021-03-17 6:52 ` Dan Carpenter
2021-03-17 22:43 ` Tong Zhang
2021-03-17 12:48 ` Ian Abbott
2021-03-19 3:47 ` [PATCH v2] " Tong Zhang
2021-03-19 3:48 ` [PATCH] " Tong Zhang
2021-03-16 22:42 ` [PATCH] staging: comedi: replace slash in name Tong Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).