Commit 5c444d6c authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: a couple of inline fixes in drivers'/scsi

	Usual "inline used before definition" fixes in nsp32.c and sg.c
parent 05ddf410
......@@ -3342,6 +3342,48 @@ static int nsp32_prom_read(nsp32_hw_data *data, int romaddr)
return val;
}
static inline void nsp32_prom_set(nsp32_hw_data *data, int bit, int val)
{
int base = data->BaseAddress;
int tmp;
tmp = nsp32_index_read1(base, SERIAL_ROM_CTL);
if (val == 0) {
tmp &= ~bit;
} else {
tmp |= bit;
}
nsp32_index_write1(base, SERIAL_ROM_CTL, tmp);
udelay(10);
}
static inline int nsp32_prom_get(nsp32_hw_data *data, int bit)
{
int base = data->BaseAddress;
int tmp, ret;
if (bit != SDA) {
nsp32_msg(KERN_ERR, "return value is not appropriate");
return 0;
}
tmp = nsp32_index_read1(base, SERIAL_ROM_CTL) & bit;
if (tmp == 0) {
ret = 0;
} else {
ret = 1;
}
udelay(10);
return ret;
}
static void nsp32_prom_start (nsp32_hw_data *data)
{
/* start condition */
......@@ -3387,48 +3429,6 @@ static int nsp32_prom_read_bit(nsp32_hw_data *data)
return val;
}
static inline void nsp32_prom_set(nsp32_hw_data *data, int bit, int val)
{
int base = data->BaseAddress;
int tmp;
tmp = nsp32_index_read1(base, SERIAL_ROM_CTL);
if (val == 0) {
tmp &= ~bit;
} else {
tmp |= bit;
}
nsp32_index_write1(base, SERIAL_ROM_CTL, tmp);
udelay(10);
}
static inline int nsp32_prom_get(nsp32_hw_data *data, int bit)
{
int base = data->BaseAddress;
int tmp, ret;
if (bit != SDA) {
nsp32_msg(KERN_ERR, "return value is not appropriate");
return 0;
}
tmp = nsp32_index_read1(base, SERIAL_ROM_CTL) & bit;
if (tmp == 0) {
ret = 0;
} else {
ret = 1;
}
udelay(10);
return ret;
}
/**************************************************************************
* Power Management
......
......@@ -720,6 +720,19 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
return 0;
}
static inline unsigned
sg_jif_to_ms(int jifs)
{
if (jifs <= 0)
return 0U;
else {
unsigned int j = (unsigned int) jifs;
return (j <
(UINT_MAX / 1000)) ? ((j * 1000) / HZ) : ((j / HZ) *
1000);
}
}
static int
sg_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd_in, unsigned long arg)
......@@ -2586,19 +2599,6 @@ sg_ms_to_jif(unsigned int msecs)
: (((int) msecs / 1000) * HZ);
}
static inline unsigned
sg_jif_to_ms(int jifs)
{
if (jifs <= 0)
return 0U;
else {
unsigned int j = (unsigned int) jifs;
return (j <
(UINT_MAX / 1000)) ? ((j * 1000) / HZ) : ((j / HZ) *
1000);
}
}
static unsigned char allow_ops[] = { TEST_UNIT_READY, REQUEST_SENSE,
INQUIRY, READ_CAPACITY, READ_BUFFER, READ_6, READ_10, READ_12,
MODE_SENSE, MODE_SENSE_10, LOG_SENSE
......
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