aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhaoxiao <zhaoxiao@uniontech.com>2021-11-17 03:06:56 +0000
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-11-19 16:08:37 +0000
commite59a9e50ec8c421818c10df6e619cec9cc9ed4e8 (patch)
treed9203ad71347ab0a85067f6f8925e4a6dbdc8845
parentmedia: media dvb_frontend: add suspend and resume callbacks to dvb_frontend_ops (diff)
downloadlinux-dev-e59a9e50ec8c421818c10df6e619cec9cc9ed4e8.tar.xz
linux-dev-e59a9e50ec8c421818c10df6e619cec9cc9ed4e8.zip
media: dib9000: Use min() instead of doing it manually
Fix following coccicheck warning: drivers/media/dvb-frontends/dib9000.c:261:10-11: WARNING opportunity for min() drivers/media/dvb-frontends/dib9000.c:345:10-11: WARNING opportunity for min() Link: https://lore.kernel.org/linux-media/20211117030656.14984-1-zhaoxiao@uniontech.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, zhaoxiao <zhaoxiao@uniontech.com> Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/dvb-frontends/dib9000.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/dvb-frontends/dib9000.c b/drivers/media/dvb-frontends/dib9000.c
index 04d92d614279..914ca820c174 100644
--- a/drivers/media/dvb-frontends/dib9000.c
+++ b/drivers/media/dvb-frontends/dib9000.c
@@ -258,7 +258,7 @@ static int dib9000_read16_attr(struct dib9000_state *state, u16 reg, u8 *b, u32
state->i2c_write_buffer[0] |= (1 << 4);
do {
- l = len < chunk_size ? len : chunk_size;
+ l = min(len, chunk_size);
state->msg[1].len = l;
state->msg[1].buf = b;
ret = i2c_transfer(state->i2c.i2c_adap, state->msg, 2) != 2 ? -EREMOTEIO : 0;
@@ -342,7 +342,7 @@ static int dib9000_write16_attr(struct dib9000_state *state, u16 reg, const u8 *
state->i2c_write_buffer[0] |= (1 << 4);
do {
- l = len < chunk_size ? len : chunk_size;
+ l = min(len, chunk_size);
state->msg[0].len = l + 2;
memcpy(&state->i2c_write_buffer[2], buf, l);