[5/5] pvrusb2: delete generic_standards_cnt

Message ID 20110326015434.GJ2008@bicker (mailing list archive)
State Superseded, archived
Headers

Commit Message

Dan Carpenter March 26, 2011, 1:54 a.m. UTC
  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>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Comments

Mike Isely March 26, 2011, 4:35 a.m. UTC | #1
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;
>  	}
>
  

Patch

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;
 	}