소스 검색

V4L/DVB (5831): stradis: use ARRAY_SIZE

sizeof(palette2fmt) / sizeof(u32) => ARRAY_SIZE(palette2fmt)

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Trent Piepho 18 년 전
부모
커밋
ba2cf98249
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      drivers/media/video/stradis.c

+ 1 - 1
drivers/media/video/stradis.c

@@ -1321,7 +1321,7 @@ static int saa_ioctl(struct inode *inode, struct file *file,
 			u32 format;
 			if (copy_from_user(&p, arg, sizeof(p)))
 				return -EFAULT;
-			if (p.palette < sizeof(palette2fmt) / sizeof(u32)) {
+			if (p.palette < ARRAY_SIZE(palette2fmt)) {
 				format = palette2fmt[p.palette];
 				saa->win.color_fmt = format;
 				saawrite(format | 0x60,