media: cx88: use ARRAY_SIZE
authorXu Wang <vulab@iscas.ac.cn>
Fri, 13 Nov 2020 07:21:11 +0000 (08:21 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 3 Dec 2020 06:37:07 +0000 (07:37 +0100)
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/pci/cx88/cx88-mpeg.c

index a57c991b165b1ab84ddcd4edf79cd68dd62c8ac0..a3edb548afde4bf8f14433375f79e3b14f0ffd0c 100644 (file)
@@ -524,8 +524,7 @@ static int cx8802_request_acquire(struct cx8802_driver *drv)
                core->last_analog_input = core->input;
                core->input = 0;
                for (i = 0;
-                    i < (sizeof(core->board.input) /
-                         sizeof(struct cx88_input));
+                    i < ARRAY_SIZE(core->board.input);
                     i++) {
                        if (core->board.input[i].type == CX88_VMUX_DVB) {
                                core->input = i;