summaryrefslogtreecommitdiff
path: root/drivers/media/pci/saa7146/mxb.c
diff options
context:
space:
mode:
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>2017-10-01 15:30:41 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-08 10:11:00 -0500
commite40d14a89760632238f67c1f96c852652a137f2d (patch)
tree3c9a1c7729242a9725254a1ffe3e6a5de40da63d /drivers/media/pci/saa7146/mxb.c
parent37d5efb01910752d8d3846a2c4db0528c1dfa137 (diff)
media: use ARRAY_SIZE
Using the ARRAY_SIZE macro improves the readability of the code. Also, it is not always useful to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/saa7146/mxb.c')
-rw-r--r--drivers/media/pci/saa7146/mxb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c
index 930218cc2de1..0144f305ea24 100644
--- a/drivers/media/pci/saa7146/mxb.c
+++ b/drivers/media/pci/saa7146/mxb.c
@@ -30,6 +30,7 @@
#include <media/v4l2-common.h>
#include <media/i2c/saa7115.h>
#include <linux/module.h>
+#include <linux/kernel.h>
#include "tea6415c.h"
#include "tea6420.h"
@@ -837,7 +838,7 @@ static struct saa7146_ext_vv vv_data = {
.inputs = MXB_INPUTS,
.capabilities = V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_AUDIO,
.stds = &standard[0],
- .num_stds = sizeof(standard)/sizeof(struct saa7146_standard),
+ .num_stds = ARRAY_SIZE(standard),
.std_callback = &std_callback,
};