mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] V4L: stk11xx, use ARRAY_SIZE in another 2 cases
@ 2007-08-28  8:17 Jiri Slaby
  2007-08-28  8:17 ` [PATCH 2/3] V4L: stk11xx, use retval from stk11xx_check_device Jiri Slaby
  2007-08-28  8:18 ` [PATCH 3/3] V4L: stk11xx, add static to tables Jiri Slaby
  0 siblings, 2 replies; 5+ messages in thread
From: Jiri Slaby @ 2007-08-28  8:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

stk11xx, use ARRAY_SIZE in another 2 cases

There were 2 places with constant in for loop. Use ARRARY_SIZE instead to
allow easy update of the tables.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit addcd116df57eaca525a1c827efdd5bf3e61b7b5
tree a4ee11673dfdbaabe1500cd9e4301bd535177bfa
parent 926af968884e1e153ad2f91892ff71ec33005d22
author Jiri Slaby <jirislaby@gmail.com> Tue, 28 Aug 2007 09:53:55 +0200
committer Jiri Slaby <jirislaby@gmail.com> Tue, 28 Aug 2007 09:53:55 +0200

 drivers/media/video/stk1125.c |    2 +-
 drivers/media/video/stk1135.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/stk1125.c b/drivers/media/video/stk1125.c
index ed3cc58..2429225 100644
--- a/drivers/media/video/stk1125.c
+++ b/drivers/media/video/stk1125.c
@@ -80,7 +80,7 @@ static int stk1125_load_microcode(struct stk11xx *dev)
 		break;
 	}
 
-	for (i = 0; i < 59; i++) {
+	for (i = 0; i < ARRAY_SIZE(values_1_204); i++) {
 		stk11xx_read_dummy(dev, 0x02ff);
 		stk11xx_write_reg(dev, 0x02ff, 0x00);
 
diff --git a/drivers/media/video/stk1135.c b/drivers/media/video/stk1135.c
index c6e0361..9acd951 100644
--- a/drivers/media/video/stk1135.c
+++ b/drivers/media/video/stk1135.c
@@ -53,7 +53,7 @@ static int stk1135_load_microcode(struct stk11xx *dev)
 		0xe4, 0x09, 0xc8, 0x08, 0x08, 0x10, 0x14
 	};
 
-	for (i = 0; i < 117; i++) {
+	for (i = 0; i < ARRAY_SIZE(values_204); i++) {
 		stk11xx_read_dummy(dev, 0x02ff);
 		stk11xx_write_reg(dev, 0x02ff, 0x00);
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-31 18:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-28  8:17 [PATCH 1/3] V4L: stk11xx, use ARRAY_SIZE in another 2 cases Jiri Slaby
2007-08-28  8:17 ` [PATCH 2/3] V4L: stk11xx, use retval from stk11xx_check_device Jiri Slaby
2007-08-28  8:18 ` [PATCH 3/3] V4L: stk11xx, add static to tables Jiri Slaby
2007-08-29 10:42   ` Satyam Sharma
2007-08-31 18:40   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®