Commit 84d890fc authored by Ondrej Zary's avatar Ondrej Zary Committed by Damien Le Moal

ata: pata_parport-bpck6: remove useless range check from read/write_regr

bpck6_read_regr() and bpck6_write_regr() check values of cont and reg
but there's no point in doing that. They can only be called with
a fixed set of values. Remove the checks.
Signed-off-by: default avatarOndrej Zary <linux@zary.sk>
Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 7ec02c5e
...@@ -25,24 +25,12 @@ ...@@ -25,24 +25,12 @@
static int bpck6_read_regr(struct pi_adapter *pi, int cont, int reg) static int bpck6_read_regr(struct pi_adapter *pi, int cont, int reg)
{ {
unsigned int out; return ppc6_rd_port(PPCSTRUCT(pi), cont?reg|8:reg);
/* check for bad settings */
if (reg<0 || reg>7 || cont<0 || cont>2)
{
return(-1);
}
out=ppc6_rd_port(PPCSTRUCT(pi),cont?reg|8:reg);
return(out);
} }
static void bpck6_write_regr(struct pi_adapter *pi, int cont, int reg, int val) static void bpck6_write_regr(struct pi_adapter *pi, int cont, int reg, int val)
{ {
/* check for bad settings */ ppc6_wr_port(PPCSTRUCT(pi), cont?reg|8:reg, val);
if (reg>=0 && reg<=7 && cont>=0 && cont<=1)
{
ppc6_wr_port(PPCSTRUCT(pi),cont?reg|8:reg,(u8)val);
}
} }
static void bpck6_write_block(struct pi_adapter *pi, char *buf, int len) static void bpck6_write_block(struct pi_adapter *pi, char *buf, int len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment