ata: propagate return value of scc_wait_after_reset
PATCH 1/1 ata: propagate return value of scc_wait_after_reset
scc_bus_softreset not necessarily should return zero. Propagate the error code.
--- drivers/ata/pata_scc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/ata/pata_scc.c +4 -5
@@ -585,7 +585,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,* Note: Original code is ata_bus_softreset(). */ -static unsigned int scc_bus_softreset (struct ata_port *ap,unsigned int devmask, +static int scc_bus_softreset (struct ata_port *ap,unsigned int devmask,unsigned long deadline) {struct ata_ioports *ioaddr = &ap->ioaddr;
@@ -599,9 +599,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,udelay (20 );out_be32 (ioaddr->ctl_addr, ap->ctl); -scc_wait_after_reset (&ap->link, devmask, deadline); - -return 0 ; +return scc_wait_after_reset (&ap->link, devmask, deadline); }/**
@@ -618,7 +616,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes, {struct ata_port *ap = link->ap;unsigned int slave_possible = ap->flags &ATA_FLAG_SLAVE_POSS ; -unsigned int devmask =0 , err_mask; +unsigned int devmask =0 ; +int err_mask;u8 err;DPRINTK ("ENTER\n" );
Signature · 1 line
1.7.11.7
Hello,
drivers/ata/pata_scc.c static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
Quoted 21 lines · Arjun Sreedharan
scc_bus_softresetnot necessarily should return zero. Propagate the error code.Signed-off-by Arjun Sreedharan <[email protected]>--- drivers/ata/pata_scc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/ata/pata_scc.c +1
-1@@ -585,7 +585,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,* Note: Original code is ata_bus_softreset(). */ -static unsigned int scc_bus_softreset (struct ata_port *ap,unsigned int devmask, +static int scc_bus_softreset (struct ata_port *ap,unsigned int devmask,unsigned long deadline) {struct ata_ioports *ioaddr = &ap->ioaddr;@@ -599,9 +599,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
scc_bus_softreset() should return int too, right?
Quoted 11 lines
drivers/ata/pata_scc.c +1
-3udelay (20 );out_be32 (ioaddr->ctl_addr, ap->ctl); -scc_wait_after_reset (&ap->link, devmask, deadline); - -return 0 ; +return scc_wait_after_reset (&ap->link, devmask, deadline); }/**
drivers/ata/pata_scc.c static int scc_softreset(struct ata_link *link, unsigned int *classes, · line 620
Quoted 6 lines
drivers/ata/pata_scc.c +2
-1@@ -618,7 +616,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes, {struct ata_port *ap = link->ap;unsigned int slave_possible = ap->flags &ATA_FLAG_SLAVE_POSS ; -unsigned int devmask =0 , err_mask; +unsigned int devmask =0 ; +int err_mask;
@rc or @ret would be a better name for it.
Thanks.
Signature · 1 line
tejun
Quoted 18 lines · Tejun Heo
Hello,
Quoted 15 lines · Arjun Sreedharan
scc_bus_softresetnot necessarily should return zero. Propagate the error code.Signed-off-by Arjun Sreedharan <[email protected]>--- drivers/ata/pata_scc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/ata/pata_scc.c +0
-0@@ -585,7 +585,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,* Note: Original code is ata_bus_softreset(). */
Quoted 8 lines
drivers/ata/pata_scc.c static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
Quoted 6 lines
drivers/ata/pata_scc.c +1
-1-static unsigned int scc_bus_softreset (struct ata_port *ap,unsigned int devmask, +static int scc_bus_softreset (struct ata_port *ap,unsigned int devmask,unsigned long deadline) {struct ata_ioports *ioaddr = &ap->ioaddr;@@ -599,9 +599,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
scc_bus_softreset()should return int too, right?
I have changed it from unsigned int to int for better clarity since scc_wait_after_reset() could
return negative errnos. Any issues ??
Quoted 10 lines
Quoted 10 lines
drivers/ata/pata_scc.c +1
-3udelay (20 );out_be32 (ioaddr->ctl_addr, ap->ctl); -scc_wait_after_reset (&ap->link, devmask, deadline); - -return 0 ; +return scc_wait_after_reset (&ap->link, devmask, deadline); }
Quoted 10 lines
drivers/ata/pata_scc.c static int scc_softreset(struct ata_link *link, unsigned int *classes, · line 620
Quoted 8 lines
drivers/ata/pata_scc.c +2
-1/** @@ -618,7 +616,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes, {struct ata_port *ap = link->ap;unsigned int slave_possible = ap->flags &ATA_FLAG_SLAVE_POSS ; -unsigned int devmask =0 , err_mask; +unsigned int devmask =0 ; +int err_mask;@rc or @ret would be a better name for it.
rc would be better. yes. will do.
Quoted 5 lines
Thanks.
--
tejun
Quoted 28 lines · Arjun Sreedharan
Quoted 18 lines · Tejun Heo
Hello,
Quoted 15 lines · Arjun Sreedharan
scc_bus_softresetnot necessarily should return zero. Propagate the error code.Signed-off-by Arjun Sreedharan <[email protected]>--- drivers/ata/pata_scc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/ata/pata_scc.c +0
-0@@ -585,7 +585,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,* Note: Original code is ata_bus_softreset(). */ Quoted 8 lines
drivers/ata/pata_scc.c static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
Quoted 6 lines
drivers/ata/pata_scc.c +1
-1-static unsigned int scc_bus_softreset (struct ata_port *ap,unsigned int devmask, +static int scc_bus_softreset (struct ata_port *ap,unsigned int devmask,unsigned long deadline) {struct ata_ioports *ioaddr = &ap->ioaddr;@@ -599,9 +599,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
scc_bus_softreset()should return int too, right?
Quoted 3 lines
I have changed it from unsigned int to int for better clarity since
scc_wait_after_reset()could
return negative errnos. Any issues ??
Oh, I missed the previous chunk which changes it from uint to int. Sorry about that.
Thanks.
Signature · 1 line
tejun
Quoted 29 lines · Tejun Heo
Quoted 28 lines · Arjun Sreedharan
Quoted 26 lines · Tejun Heo
Hello,
drivers/ata/pata_scc.c static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
Quoted 21 lines · Arjun Sreedharan
scc_bus_softresetnot necessarily should return zero. Propagate the error code.Signed-off-by Arjun Sreedharan <[email protected]>--- drivers/ata/pata_scc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/ata/pata_scc.c +1
-1@@ -585,7 +585,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,* Note: Original code is ata_bus_softreset(). */ -static unsigned int scc_bus_softreset (struct ata_port *ap,unsigned int devmask, +static int scc_bus_softreset (struct ata_port *ap,unsigned int devmask,unsigned long deadline) {struct ata_ioports *ioaddr = &ap->ioaddr;@@ -599,9 +599,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
scc_bus_softreset()should return int too, right?
Quoted 6 lines
Quoted 3 lines
I have changed it from unsigned int to int for better clarity since
scc_wait_after_reset()could
return negative errnos. Any issues ??Oh, I missed the previous chunk which changes it from uint to int. Sorry about that.
OK. i will resend the patch.
Quoted 5 lines
Thanks.
--
tejun
PATCH 1/1 ata: propagate return value of scc_wait_after_reset
scc_bus_softreset not necessarily should return zero. Propagate the error code.
--- drivers/ata/pata_scc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/ata/pata_scc.c +6 -7
@@ -585,7 +585,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,* Note: Original code is ata_bus_softreset(). */ -static unsigned int scc_bus_softreset (struct ata_port *ap,unsigned int devmask, +static int scc_bus_softreset (struct ata_port *ap,unsigned int devmask,unsigned long deadline) {struct ata_ioports *ioaddr = &ap->ioaddr;
@@ -599,9 +599,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,udelay (20 );out_be32 (ioaddr->ctl_addr, ap->ctl); -scc_wait_after_reset (&ap->link, devmask, deadline); - -return 0 ; +return scc_wait_after_reset (&ap->link, devmask, deadline); }/**
@@ -618,7 +616,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes, {struct ata_port *ap = link->ap;unsigned int slave_possible = ap->flags &ATA_FLAG_SLAVE_POSS ; -unsigned int devmask =0 , err_mask; +unsigned int devmask =0 ; +int rc;u8 err;DPRINTK ("ENTER\n" );
@@ -634,8 +633,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,/* issue bus reset */ DPRINTK ("about to softreset, devmask=%x\n" , devmask); - err_mask =scc_bus_softreset (ap, devmask, deadline); -if (err_mask) { + rc =scc_bus_softreset (ap, devmask, deadline); +if (rc) {ata_port_err (ap,"SRST failed (err_mask=0x%x)\n" , err_mask);return -EIO ; }
Signature · 1 line
1.7.11.7
Tejun Heo
AppliedQuoted 4 lines · Arjun Sreedharan
scc_bus_softresetnot necessarily should return zero. Propagate the error code.Signed-off-by Arjun Sreedharan <[email protected]>
Applied to libata/for-3.17-fixes.
Thanks.
Signature · 1 line
tejun