Bluetooth: Cleanup dtl1_config
PATCH 1/1 Bluetooth: Cleanup dtl1_config
the functions always return 0 on sucess and -ve error on failure.
This also removes variable i.
--- drivers/bluetooth/dtl1_cs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/bluetooth/dtl1_cs.c +3 -6
@@ -586,22 +586,19 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)static int dtl1_config (struct pcmcia_device *link) {dtl1_info_t *info = link->priv; -int i;/* Look for a generic full-sized window */ link->resource[0 ]->end =8 ;if (pcmcia_loop_config (link, dtl1_confcheck,NULL ) <0 ) goto failed; - i =pcmcia_request_irq (link, dtl1_interrupt); -if (i !=0 ) +if (pcmcia_request_irq (link, dtl1_interrupt)) goto failed; - i =pcmcia_enable_device (link); -if (i !=0 ) +if (pcmcia_enable_device (link)) goto failed; -if (dtl1_open (info) !=0 ) +if (dtl1_open (info)) goto failed;return 0 ;
Signature · 1 line
1.7.9.5
Hi Devendra,
Quoted 18 lines · Devendra Naga
the functions always return 0 on sucess and -ve error on failure.
This also removes variable i.
Signed-off-by Devendra Naga <[email protected]>--- drivers/bluetooth/dtl1_cs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)drivers/bluetooth/dtl1_cs.c +0
-1@@ -586,22 +586,19 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)static int dtl1_config (struct pcmcia_device *link) {dtl1_info_t *info = link->priv; -int i;
drivers/bluetooth/dtl1_cs.c static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) · line 596
Quoted 10 lines
drivers/bluetooth/dtl1_cs.c +1
-2/* Look for a generic full-sized window */ link->resource[0 ]->end =8 ;if (pcmcia_loop_config (link, dtl1_confcheck,NULL ) <0 ) goto failed; - i =pcmcia_request_irq (link, dtl1_interrupt); -if (i !=0 ) +if (pcmcia_request_irq (link, dtl1_interrupt)) goto failed;
I think this change is wrong, instead you might return i (that should be renamed to 'err') when the failed label is accessed. This way you improve the error report of this function.
Gustavo
Hi Gustavo,
Thanks for reviewing the patch.
On Tue, Jun 19, 2012 at 8:39 AM, Gustavo Padovan <[email protected]> wrot= e:
Quoted 13 lines
Hi Devendra,
Quoted 9 lines · Devendra Naga
the functions always return 0 on sucess and -ve error on failure.
This also removes variable i.
Signed-off-by Devendra Naga <[email protected]>---
=A0drivers/bluetooth/dtl1_cs.c | =A0 =A09 +++------ =A01 file changed, 3 insertions(+), 6 deletions(-)
Quoted 5 lines
drivers/bluetooth/dtl1_cs.c static int dtl1_confcheck(struct pcmcia_device *p_=
Quoted 5 lines
drivers/bluetooth/dtl1_cs.c +0
-0@@ -586,22 +586,19 @@ static int dtl1_confcheck(struct pcmcia_device *p_=
dev, void *priv_data)
Quoted 10 lines
Quoted 10 lines
drivers/bluetooth/dtl1_cs.c +0
-1=A0static int dtl1_config(struct pcmcia_device *link) =A0{ =A0 =A0 =A0 dtl1_info_t *info =3D link->priv; - =A0 =A0 int i;=A0 =A0 =A0 /* Look for a generic full-sized window */ =A0 =A0 =A0 link->resource[0]->end =3D 8;
=A0 =A0 =A0 if (pcmcia_loop_config(link, dtl1_confcheck, NULL)< 0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto failed;
Quoted 7 lines
Quoted 4 lines
- =A0 =A0 i =3D
pcmcia_request_irq(link, dtl1_interrupt);
- =A0 =A0 if (i !=3D 0)
+ =A0 =A0 if (pcmcia_request_irq(link, dtl1_interrupt)) =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto failed;I think this change is wrong, instead you might return i (that should be renamed to 'err') when the failed label is accessed. This way you improve=
the
Quoted 2 lines
error report of this function.
You are correct.
You can expect a V2 of this with your comments mentioned.
Quoted 1 line
=A0 =A0 =A0 =A0Gustavo
Thanks,
Devendra.