Skip to content

Commit f2ccb53

Browse files
ribaldamchehab
authored andcommitted
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/[email protected] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 529c657 commit f2ccb53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void netup_i2c_fifo_tx(struct netup_i2c *i2c)
135135
(readw(&i2c->regs->tx_fifo.stat_ctrl) & 0x3f);
136136
u32 msg_length = i2c->msg->len - i2c->xmit_size;
137137

138-
msg_length = (msg_length < fifo_space ? msg_length : fifo_space);
138+
msg_length = min(msg_length, fifo_space);
139139
while (msg_length--) {
140140
data = i2c->msg->buf[i2c->xmit_size++];
141141
writeb(data, &i2c->regs->tx_fifo.data8);

0 commit comments

Comments
 (0)