Skip to contentSkip to conversation

pvrusb2: delete generic_standards_cnt

PATCH In review Dan Carpenter 2 participants 2 messages Mar 26, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/5 pvrusb2: delete generic_standards_cnt

The generic_standards_cnt define is only used in one place and it's more readable to just call ARRAY_SIZE(generic_standards) directly.

drivers/media/video/pvrusb2/pvrusb2-std.c +1 -3
index d5a679f..9bebc08 100644
@@ -287,13 +287,11 @@ static struct v4l2_standard generic_standards[] = {
 	}
 };
 
-#define generic_standards_cnt ARRAY_SIZE(generic_standards)
-
 static struct v4l2_standard *match_std(v4l2_std_id id)
 {
 	unsigned int idx;
 
-	for (idx = 0; idx < generic_standards_cnt; idx++) {
+	for (idx = 0; idx < ARRAY_SIZE(generic_standards); idx++) {
 		if (generic_standards[idx].id & id)
 			return generic_standards + idx;
 	}
Acked-by on v1 5/5
#1 lore raw

Are you actually serious about this? Well it's a small change...

Quoted 25 lines · Dan Carpenter

The generic_standards_cnt define is only used in one place and it's more readable to just call ARRAY_SIZE(generic_standards) directly.

drivers/media/video/pvrusb2/pvrusb2-std.c +1 -3
index d5a679f..9bebc08 100644
@@ -287,13 +287,11 @@ static struct v4l2_standard generic_standards[] = {
 	}
 };
 
-#define generic_standards_cnt ARRAY_SIZE(generic_standards)
-
 static struct v4l2_standard *match_std(v4l2_std_id id)
 {
 	unsigned int idx;
 
-	for (idx = 0; idx < generic_standards_cnt; idx++) {
+	for (idx = 0; idx < ARRAY_SIZE(generic_standards); idx++) {
 		if (generic_standards[idx].id & id)
 			return generic_standards + idx;
 	}
Signature · 3 lines
Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8