public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/5] [media] pvrusb2: delete generic_standards_cnt
@ 2011-03-26  1:54 Dan Carpenter
  2011-03-26  4:35 ` Mike Isely
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-26  1:54 UTC (permalink / raw)
  To: Mike Isely; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors

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

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/media/video/pvrusb2/pvrusb2-std.c b/drivers/media/video/pvrusb2/pvrusb2-std.c
index d5a679f..9bebc08 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-std.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-std.c
@@ -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;
 	}

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

* Re: [PATCH 5/5] [media] pvrusb2: delete generic_standards_cnt
  2011-03-26  1:54 [PATCH 5/5] [media] pvrusb2: delete generic_standards_cnt Dan Carpenter
@ 2011-03-26  4:35 ` Mike Isely
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Isely @ 2011-03-26  4:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors, Mike Isely


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

Acked-By: Mike Isely <isely@pobox.com>


On Sat, 26 Mar 2011, Dan Carpenter wrote:

> The generic_standards_cnt define is only used in one place and it's
> more readable to just call ARRAY_SIZE(generic_standards) directly.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/media/video/pvrusb2/pvrusb2-std.c b/drivers/media/video/pvrusb2/pvrusb2-std.c
> index d5a679f..9bebc08 100644
> --- a/drivers/media/video/pvrusb2/pvrusb2-std.c
> +++ b/drivers/media/video/pvrusb2/pvrusb2-std.c
> @@ -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;
>  	}
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8

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

end of thread, other threads:[~2011-03-26  4:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-26  1:54 [PATCH 5/5] [media] pvrusb2: delete generic_standards_cnt Dan Carpenter
2011-03-26  4:35 ` Mike Isely

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