mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
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: Ondrej Zary <linux@zary.sk> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
This commit is contained in:
parent
7ec02c5e99
commit
84d890fc09
1 changed files with 2 additions and 14 deletions
|
@ -25,24 +25,12 @@
|
|||
|
||||
static int bpck6_read_regr(struct pi_adapter *pi, int cont, int reg)
|
||||
{
|
||||
unsigned int out;
|
||||
|
||||
/* 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);
|
||||
return ppc6_rd_port(PPCSTRUCT(pi), cont?reg|8:reg);
|
||||
}
|
||||
|
||||
static void bpck6_write_regr(struct pi_adapter *pi, int cont, int reg, int val)
|
||||
{
|
||||
/* check for bad settings */
|
||||
if (reg>=0 && reg<=7 && cont>=0 && cont<=1)
|
||||
{
|
||||
ppc6_wr_port(PPCSTRUCT(pi),cont?reg|8:reg,(u8)val);
|
||||
}
|
||||
ppc6_wr_port(PPCSTRUCT(pi), cont?reg|8:reg, val);
|
||||
}
|
||||
|
||||
static void bpck6_write_block(struct pi_adapter *pi, char *buf, int len)
|
||||
|
|
Loading…
Reference in a new issue