diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-01-26 09:49:50 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2008-01-26 09:49:50 +0100 |
commit | 45e44a03fbd608969051610b04b67f23820c5a1e (patch) | |
tree | bebbb75be161b14a4776b4122cd6a9de00e75420 | |
parent | 2a68d97abaf9b2194c9060de6f877427c08e2ecf (diff) | |
download | mediapointer-dvb-s2-45e44a03fbd608969051610b04b67f23820c5a1e.tar.gz mediapointer-dvb-s2-45e44a03fbd608969051610b04b67f23820c5a1e.tar.bz2 |
cx25840: code cleanup
From: Tyler Trafford <ttrafford@gmail.com>
- Use min()
- Eliminate extraneous variables
Signed-off-by: Tyler Trafford <ttrafford@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r-- | linux/drivers/media/video/cx25840/cx25840-firmware.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/linux/drivers/media/video/cx25840/cx25840-firmware.c b/linux/drivers/media/video/cx25840/cx25840-firmware.c index 56f992087..d283ef2d1 100644 --- a/linux/drivers/media/video/cx25840/cx25840-firmware.c +++ b/linux/drivers/media/video/cx25840/cx25840-firmware.c @@ -88,11 +88,9 @@ static int check_fw_load(struct i2c_client *client, int size) return 0; } -static int fw_write(struct i2c_client *client, u8 * data, int size) +static int fw_write(struct i2c_client *client, u8 *data, int size) { - int sent; - - if ((sent = i2c_master_send(client, data, size)) < size) { + if (i2c_master_send(client, data, size) < size) { v4l_err(client, "firmware load i2c failure\n"); return -ENOSYS; } @@ -105,7 +103,7 @@ int cx25840_loadfw(struct i2c_client *client) struct cx25840_state *state = i2c_get_clientdata(client); const struct firmware *fw = NULL; u8 buffer[4], *ptr; - int size, send, retval; + int size, retval; if (state->is_cx23885) firmware = FWFILE_CX23885; @@ -133,8 +131,7 @@ int cx25840_loadfw(struct i2c_client *client) while (size > 0) { ptr[0] = 0x08; ptr[1] = 0x02; - send = size > (FWSEND - 2) ? FWSEND : size + 2; - retval = fw_write(client, ptr, send); + retval = fw_write(client, ptr, min(FWSEND, size + 2)); if (retval < 0) { release_firmware(fw); |