mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-20 07:09:58 +00:00
media: netup_unidvb: Use min macro
Simplify the code. Found by cocci: drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:138:26-27: WARNING opportunity for min() Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-15-3c4865f5a4b0@chromium.org Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
529c657f5b
commit
f2ccb530c5
@ -135,7 +135,7 @@ static void netup_i2c_fifo_tx(struct netup_i2c *i2c)
|
||||
(readw(&i2c->regs->tx_fifo.stat_ctrl) & 0x3f);
|
||||
u32 msg_length = i2c->msg->len - i2c->xmit_size;
|
||||
|
||||
msg_length = (msg_length < fifo_space ? msg_length : fifo_space);
|
||||
msg_length = min(msg_length, fifo_space);
|
||||
while (msg_length--) {
|
||||
data = i2c->msg->buf[i2c->xmit_size++];
|
||||
writeb(data, &i2c->regs->tx_fifo.data8);
|
||||
|
Loading…
x
Reference in New Issue
Block a user