Skip to contentSkip to conversation

pvrusb2: Use ARRAY_SIZE macro

PATCH In review Ahmed S. Darwish 5 participants 8 messages Jan 16, 2007 – Jan 19, 2007 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 pvrusb2: Use ARRAY_SIZE macro

Use ARRAY_SIZE macro in pvrusb2-hdw.c file

---

drivers/media/video/pvrusb2/pvrusb2-hdw.c +8 -14
index d200496..f66f7c6 100644
@@ -71,12 +71,10 @@ static const char *pvr2_client_29xxx[] = {
 
 static struct pvr2_string_table pvr2_client_lists[] = {
 	[PVR2_HDW_TYPE_29XXX] = {
-		pvr2_client_29xxx,
-		sizeof(pvr2_client_29xxx)/sizeof(pvr2_client_29xxx[0]),
+		pvr2_client_29xxx, ARRAY_SIZE(pvr2_client_29xxx)
 	},
 	[PVR2_HDW_TYPE_24XXX] = {
-		pvr2_client_24xxx,
-		sizeof(pvr2_client_24xxx)/sizeof(pvr2_client_24xxx[0]),
+		pvr2_client_24xxx, ARRAY_SIZE(pvr2_client_24xxx)
 	},
 };
 
@@ -212,7 +210,7 @@ static const struct pvr2_mpeg_ids mpeg_ids[] = {
 		.id = V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM,
 	}
 };
-#define MPEGDEF_COUNT (sizeof(mpeg_ids)/sizeof(mpeg_ids[0]))
+#define MPEGDEF_COUNT ARRAY_SIZE(mpeg_ids)
 
 
 static const char *control_values_srate[] = {
@@ -846,7 +844,7 @@ static const struct pvr2_ctl_info control_defs[] = {
 	}
 };
 
-#define CTRLDEF_COUNT (sizeof(control_defs)/sizeof(control_defs[0]))
+#define CTRLDEF_COUNT ARRAY_SIZE(control_defs)
 
 
 const char *pvr2_config_get_name(enum pvr2_config cfg)
@@ -960,12 +958,10 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
 	};
 	static const struct pvr2_string_table fw_file_defs[] = {
 		[PVR2_HDW_TYPE_29XXX] = {
-			fw_files_29xxx,
-			sizeof(fw_files_29xxx)/sizeof(fw_files_29xxx[0]),
+			fw_files_29xxx, ARRAY_SIZE(fw_files_29xxx)
 		},
 		[PVR2_HDW_TYPE_24XXX] = {
-			fw_files_24xxx,
-			sizeof(fw_files_24xxx)/sizeof(fw_files_24xxx[0]),
+			fw_files_24xxx, ARRAY_SIZE(fw_files_24xxx)
 		},
 	};
 	hdw->fw1_state = FW1_STATE_FAILED; // default result
@@ -1052,8 +1048,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
 	trace_firmware("pvr2_upload_firmware2");
 
 	ret = pvr2_locate_firmware(hdw,&fw_entry,"encoder",
-				   sizeof(fw_files)/sizeof(fw_files[0]),
-				   fw_files);
+				   ARRAY_SIZE(fw_files), fw_files);
 	if (ret < 0) return ret;
 	fwidx = ret;
 	ret = 0;
@@ -1750,8 +1745,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
 	struct pvr2_ctl_info *ciptr;
 
 	hdw_type = devid - pvr2_device_table;
-	if (hdw_type >=
-	    sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) {
+	if (hdw_type >= ARRAY_SIZE(pvr2_device_names)) {
 		pvr2_trace(PVR2_TRACE_ERROR_LEGS,
 			   "Bogus device type of %u reported",hdw_type);
 		return NULL;
Signature · 2 lines
Ahmed S. Darwish
http://darwish-07.blogspot.com
#1 lore raw
Quoted 3 lines · Ahmed S. Darwish

Use ARRAY_SIZE macro in pvrusb2-hdw.c file

... snip ...

i'm not sure it's worth submitting multiple patches to convert code expressions to the ARRAY_SIZE() macro since i was going to wait for the next kernel release, and do that in one fell swoop with a single patch.

but if people higher up the food chain think it's a better idea to do it a little at a time, that's fine.

rday

#2 lore raw
Quoted 8 lines · On Tue, 16 Jan 2007 03:36:16 -0500 (EST) Robert P. J. Day wrote:
Quoted 3 lines · Ahmed S. Darwish

Use ARRAY_SIZE macro in pvrusb2-hdw.c file

... snip ...

Quoted 7 lines

i'm not sure it's worth submitting multiple patches to convert code expressions to the ARRAY_SIZE() macro since i was going to wait for the next kernel release, and do that in one fell swoop with a single patch.

but if people higher up the food chain think it's a better idea to do it a little at a time, that's fine.

I'm not strictly on the food chain, but these 4 patches to pvrusb2 should have been sent as one patch IMO.

---
~Randy

#3 lore raw
Quoted 15 lines · Randy Dunlap
Quoted 13 lines · On Tue, 16 Jan 2007 03:36:16 -0500 (EST) Robert P. J. Day wrote:
Quoted 3 lines · Ahmed S. Darwish

Use ARRAY_SIZE macro in pvrusb2-hdw.c file

... snip ...

i'm not sure it's worth submitting multiple patches to convert code expressions to the ARRAY_SIZE() macro since i was going to wait for the next kernel release, and do that in one fell swoop with a single patch.

Quoted 5 lines
Quoted 2 lines

but if people higher up the food chain think it's a better idea to do it a little at a time, that's fine.

I'm not strictly on the food chain, but these 4 patches to pvrusb2 should have been sent as one patch IMO.

it's not like i'm trying to be territorial or anything. if someone
wants to handle all these changes, go wild. it's just that this discussion of ARRAY_SIZE started back in december:

http://lkml.org/lkml/2006/12/17/85

i have a check for possibilities where this change can be done in my
"style" script:

  $ grep -Er "sizeof ?\(?([^\)]+)\)? ?/ ?sizeof ?\(?.*\1.*" .

and i also have a script that crawls the tree, making the more
obvious changes. (it will miss spots where the expression is broken over two lines, stuff like that, so there will probably be a few stragglers that will have to be done manually.)

i haven't done anything with this lately as i was waiting for the
new release, whereupon i'm assuming the floodgates will be opened and all the pending changes will finally start to wander upstream. then all these changes might make sense as a multi-part patch.

but, as i said, i'll leave this to people much smarter than me.

rday

#6 lore raw
In reply to Robert P. J. Day
Quoted 4 lines · Robert P. J. Day
Quoted 2 lines · Ahmed S. Darwish

Use ARRAY_SIZE macro in pvrusb2-hdw.c file

Quoted 8 lines
Quoted 1 line

... snip ...

i'm not sure it's worth submitting multiple patches to convert code expressions to the ARRAY_SIZE() macro since i was going to wait for the next kernel release, and do that in one fell swoop with a single patch.

No problem :). But will a single patch be accepted ?. Grepping the tree,I found many results that will make the patch very very big.
Should I stop sending them till 2.6.20 ?.
If so, I've made any way about 10 patches dealing with different subsytems. I can send them to you to avoid this little work duplication.

Regards

Signature · 2 lines
Ahmed S. Darwish
http://darwish-07.blogspot.com
#4 lore raw
In reply to Randy Dunlap
Quoted 15 lines · Randy Dunlap
Quoted 13 lines · On Tue, 16 Jan 2007 03:36:16 -0500 (EST) Robert P. J. Day wrote:
Quoted 3 lines · Ahmed S. Darwish

Use ARRAY_SIZE macro in pvrusb2-hdw.c file

... snip ...

i'm not sure it's worth submitting multiple patches to convert code expressions to the ARRAY_SIZE() macro since i was going to wait for the next kernel release, and do that in one fell swoop with a single patch.

Quoted 5 lines
Quoted 2 lines

but if people higher up the food chain think it's a better idea to do it a little at a time, that's fine.

I'm not strictly on the food chain, but these 4 patches to pvrusb2 should have been sent as one patch IMO.

Here's the same patch in one file as suggested.

A patch to use ARRAY_SIZE macro when appropriate.

---

pvrusb2-encoder.c   |   19 ++++++++-----------
pvrusb2-hdw.c       |   22 ++++++++--------------
pvrusb2-i2c-core.c  |    3 +--
pvrusb2-std.c       |   25 +++++++++----------------
pvrusb2-sysfs.c     |    2 +-
pvrusb2-video-v4l.c |    9 +++------
pvrusb2-wm8775.c    |    9 +++------
7 files changed, 33 insertions(+), 56 deletions(-)
drivers/media/video/pvrusb2/pvrusb2-encoder.c +8 -11
index c94f97b..4ec937a 100644
@@ -169,25 +169,23 @@ static int pvr2_encoder_cmd(void *ctxt,
 
 	*/
 
-	if (arg_cnt_send > (sizeof(wrData)/sizeof(wrData[0]))-4) {
+	if (arg_cnt_send > (ARRAY_SIZE(wrData) - 4)) {
 		pvr2_trace(
 			PVR2_TRACE_ERROR_LEGS,
 			"Failed to write cx23416 command"
 			" - too many input arguments"
 			" (was given %u limit %u)",
-			arg_cnt_send,
-			(unsigned int)(sizeof(wrData)/sizeof(wrData[0])) - 4);
+			arg_cnt_send, ARRAY_SIZE(wrData) - 4);
 		return -EINVAL;
 	}
 
-	if (arg_cnt_recv > (sizeof(rdData)/sizeof(rdData[0]))-4) {
+	if (arg_cnt_recv > (ARRAY_SIZE(rdData) - 4)) {
 		pvr2_trace(
 			PVR2_TRACE_ERROR_LEGS,
 			"Failed to write cx23416 command"
 			" - too many return arguments"
 			" (was given %u limit %u)",
-			arg_cnt_recv,
-			(unsigned int)(sizeof(rdData)/sizeof(rdData[0])) - 4);
+			arg_cnt_recv, ARRAY_SIZE(rdData) - 4);
 		return -EINVAL;
 	}
 
@@ -201,7 +199,7 @@ static int pvr2_encoder_cmd(void *ctxt,
 		for (idx = 0; idx < arg_cnt_send; idx++) {
 			wrData[idx+4] = argp[idx];
 		}
-		for (; idx < (sizeof(wrData)/sizeof(wrData[0]))-4; idx++) {
+		for (; idx < ARRAY_SIZE(wrData) - 4; idx++) {
 			wrData[idx+4] = 0;
 		}
 
@@ -245,8 +243,7 @@ static int pvr2_encoder_cmd(void *ctxt,
 		if (ret) break;
 		wrData[0] = 0x7;
 		ret = pvr2_encoder_read_words(
-			hdw,0,rdData,
-			sizeof(rdData)/sizeof(rdData[0]));
+			hdw,0,rdData, ARRAY_SIZE(rdData));
 		if (ret) break;
 		for (idx = 0; idx < arg_cnt_recv; idx++) {
 			argp[idx] = rdData[idx+4];
@@ -269,13 +266,13 @@ static int pvr2_encoder_vcmd(struct pvr2_hdw *hdw, int cmd,
 	unsigned int idx;
 	u32 data[12];
 
-	if (args > sizeof(data)/sizeof(data[0])) {
+	if (args > ARRAY_SIZE(data)) {
 		pvr2_trace(
 			PVR2_TRACE_ERROR_LEGS,
 			"Failed to write cx23416 command"
 			" - too many arguments"
 			" (was given %u limit %u)",
-			args,(unsigned int)(sizeof(data)/sizeof(data[0])));
+			args, ARRAY_SIZE(data));
 		return -EINVAL;
 	}
 
drivers/media/video/pvrusb2/pvrusb2-hdw.c +8 -14
index d200496..f66f7c6 100644
@@ -71,12 +71,10 @@ static const char *pvr2_client_29xxx[] = {
 
 static struct pvr2_string_table pvr2_client_lists[] = {
 	[PVR2_HDW_TYPE_29XXX] = {
-		pvr2_client_29xxx,
-		sizeof(pvr2_client_29xxx)/sizeof(pvr2_client_29xxx[0]),
+		pvr2_client_29xxx, ARRAY_SIZE(pvr2_client_29xxx)
 	},
 	[PVR2_HDW_TYPE_24XXX] = {
-		pvr2_client_24xxx,
-		sizeof(pvr2_client_24xxx)/sizeof(pvr2_client_24xxx[0]),
+		pvr2_client_24xxx, ARRAY_SIZE(pvr2_client_24xxx)
 	},
 };
 
@@ -212,7 +210,7 @@ static const struct pvr2_mpeg_ids mpeg_ids[] = {
 		.id = V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM,
 	}
 };
-#define MPEGDEF_COUNT (sizeof(mpeg_ids)/sizeof(mpeg_ids[0]))
+#define MPEGDEF_COUNT ARRAY_SIZE(mpeg_ids)
 
 
 static const char *control_values_srate[] = {
@@ -846,7 +844,7 @@ static const struct pvr2_ctl_info control_defs[] = {
 	}
 };
 
-#define CTRLDEF_COUNT (sizeof(control_defs)/sizeof(control_defs[0]))
+#define CTRLDEF_COUNT ARRAY_SIZE(control_defs)
 
 
 const char *pvr2_config_get_name(enum pvr2_config cfg)
@@ -960,12 +958,10 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
 	};
 	static const struct pvr2_string_table fw_file_defs[] = {
 		[PVR2_HDW_TYPE_29XXX] = {
-			fw_files_29xxx,
-			sizeof(fw_files_29xxx)/sizeof(fw_files_29xxx[0]),
+			fw_files_29xxx, ARRAY_SIZE(fw_files_29xxx)
 		},
 		[PVR2_HDW_TYPE_24XXX] = {
-			fw_files_24xxx,
-			sizeof(fw_files_24xxx)/sizeof(fw_files_24xxx[0]),
+			fw_files_24xxx, ARRAY_SIZE(fw_files_24xxx)
 		},
 	};
 	hdw->fw1_state = FW1_STATE_FAILED; // default result
@@ -1052,8 +1048,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
 	trace_firmware("pvr2_upload_firmware2");
 
 	ret = pvr2_locate_firmware(hdw,&fw_entry,"encoder",
-				   sizeof(fw_files)/sizeof(fw_files[0]),
-				   fw_files);
+				   ARRAY_SIZE(fw_files), fw_files);
 	if (ret < 0) return ret;
 	fwidx = ret;
 	ret = 0;
@@ -1750,8 +1745,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
 	struct pvr2_ctl_info *ciptr;
 
 	hdw_type = devid - pvr2_device_table;
-	if (hdw_type >=
-	    sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) {
+	if (hdw_type >= ARRAY_SIZE(pvr2_device_names)) {
 		pvr2_trace(PVR2_TRACE_ERROR_LEGS,
 			   "Bogus device type of %u reported",hdw_type);
 		return NULL;
drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +1 -2
index f9bb41d..83df9ee 100644
@@ -948,8 +948,7 @@ static void do_i2c_scan(struct pvr2_hdw *hdw)
 	printk("%s: i2c scan beginning\n",hdw->name);
 	for (i = 0; i < 128; i++) {
 		msg[0].addr = i;
-		rc = i2c_transfer(&hdw->i2c_adap,msg,
-				  sizeof(msg)/sizeof(msg[0]));
+		rc = i2c_transfer(&hdw->i2c_adap,msg, ARRAY_SIZE(msg));
 		if (rc != 1) continue;
 		printk("%s: i2c scan: found device @ 0x%x\n",hdw->name,i);
 	}
drivers/media/video/pvrusb2/pvrusb2-std.c +9 -16
index f95c598..677f126 100644
@@ -141,10 +141,8 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr,const char *bufPtr,
 			cnt = 0;
 			while ((cnt < bufSize) && (bufPtr[cnt] != '-')) cnt++;
 			if (cnt >= bufSize) return 0; // No more characters
-			sp = find_std_name(
-				std_groups,
-				sizeof(std_groups)/sizeof(std_groups[0]),
-				bufPtr,cnt);
+			sp = find_std_name(std_groups, ARRAY_SIZE(std_groups),
+					   bufPtr,cnt);
 			if (!sp) return 0; // Illegal color system name
 			cnt++;
 			bufPtr += cnt;
@@ -163,8 +161,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr,const char *bufPtr,
 			if (ch == '/') break;
 			cnt++;
 		}
-		sp = find_std_name(std_items,
-				   sizeof(std_items)/sizeof(std_items[0]),
+		sp = find_std_name(std_items, ARRAY_SIZE(std_items),
 				   bufPtr,cnt);
 		if (!sp) return 0; // Illegal modulation system ID
 		t = sp->id & cmsk;
@@ -189,14 +186,10 @@ unsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize,
 	unsigned int c1,c2;
 	cfl = 0;
 	c1 = 0;
-	for (idx1 = 0;
-	     idx1 < sizeof(std_groups)/sizeof(std_groups[0]);
-	     idx1++) {
+	for (idx1 = 0; idx1 < ARRAY_SIZE(std_groups); idx1++) {
 		gp = std_groups + idx1;
 		gfl = 0;
-		for (idx2 = 0;
-		     idx2 < sizeof(std_items)/sizeof(std_items[0]);
-		     idx2++) {
+		for (idx2 = 0; idx2 < ARRAY_SIZE(std_items); idx2++) {
 			ip = std_items + idx2;
 			if (!(gp->id & ip->id & id)) continue;
 			if (!gfl) {
@@ -279,7 +272,7 @@ static struct v4l2_standard generic_standards[] = {
 	}
 };
 
-#define generic_standards_cnt (sizeof(generic_standards)/sizeof(generic_standards[0]))
+#define generic_standards_cnt ARRAY_SIZE(generic_standards)
 
 static struct v4l2_standard *match_std(v4l2_std_id id)
 {
@@ -348,7 +341,7 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
 		fmsk |= idmsk;
 	}
 
-	for (idx2 = 0; idx2 < sizeof(std_mixes)/sizeof(std_mixes[0]); idx2++) {
+	for (idx2 = 0; idx2 < ARRAY_SIZE(std_mixes); idx2++) {
 		if ((id & std_mixes[idx2]) == std_mixes[idx2]) std_cnt++;
 	}
 
@@ -374,8 +367,8 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
 	idx = 0;
 
 	/* Enumerate potential special cases */
-	for (idx2 = 0; ((idx2 < sizeof(std_mixes)/sizeof(std_mixes[0])) &&
-			(idx < std_cnt)); idx2++) {
+	for (idx2 = 0; (idx2 < ARRAY_SIZE(std_mixes)) && (idx < std_cnt);
+	     idx2++) {
 		if (!(id & std_mixes[idx2])) continue;
 		if (pvr2_std_fill(stddefs+idx,std_mixes[idx2])) idx++;
 	}
drivers/media/video/pvrusb2/pvrusb2-sysfs.c +1 -1
index c294f46..17b5a3e 100644
@@ -491,7 +491,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
 	unsigned int cnt,acnt;
 	int ret;
 
-	if ((ctl_id < 0) || (ctl_id >= (sizeof(funcs)/sizeof(funcs[0])))) {
+	if ((ctl_id < 0) || (ctl_id >= ARRAY_SIZE(funcs))) {
 		return;
 	}
 
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c +3 -6
index 05f2cdd..b3eba8a 100644
@@ -137,8 +137,7 @@ static int decoder_check(struct pvr2_v4l_decoder *ctxt)
 	unsigned long msk;
 	unsigned int idx;
 
-	for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]);
-	     idx++) {
+	for (idx = 0; idx < ARRAY_SIZE(decoder_ops); idx++) {
 		msk = 1 << idx;
 		if (ctxt->stale_mask & msk) continue;
 		if (decoder_ops[idx].check(ctxt)) {
@@ -154,8 +153,7 @@ static void decoder_update(struct pvr2_v4l_decoder *ctxt)
 	unsigned long msk;
 	unsigned int idx;
 
-	for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]);
-	     idx++) {
+	for (idx = 0; idx < ARRAY_SIZE(decoder_ops); idx++) {
 		msk = 1 << idx;
 		if (!(ctxt->stale_mask & msk)) continue;
 		ctxt->stale_mask &= ~msk;
@@ -230,8 +228,7 @@ int pvr2_i2c_decoder_v4l_setup(struct pvr2_hdw *hdw,
 	ctxt->ctrl.tuned = (int (*)(void *))decoder_is_tuned;
 	ctxt->client = cp;
 	ctxt->hdw = hdw;
-	ctxt->stale_mask = (1 << (sizeof(decoder_ops)/
-				  sizeof(decoder_ops[0]))) - 1;
+	ctxt->stale_mask = (1 << ARRAY_SIZE(decoder_ops)) - 1;
 	hdw->decoder_ctrl = &ctxt->ctrl;
 	cp->handler = &ctxt->handler;
 	pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x saa711x V4L2 handler set up",
drivers/media/video/pvrusb2/pvrusb2-wm8775.c +3 -6
index 2413e51..3a29bb8 100644
@@ -99,8 +99,7 @@ static int wm8775_check(struct pvr2_v4l_wm8775 *ctxt)
 	unsigned long msk;
 	unsigned int idx;
 
-	for (idx = 0; idx < sizeof(wm8775_ops)/sizeof(wm8775_ops[0]);
-	     idx++) {
+	for (idx = 0; idx < ARRAY_SIZE(wm8775_ops); idx++) {
 		msk = 1 << idx;
 		if (ctxt->stale_mask & msk) continue;
 		if (wm8775_ops[idx].check(ctxt)) {
@@ -116,8 +115,7 @@ static void wm8775_update(struct pvr2_v4l_wm8775 *ctxt)
 	unsigned long msk;
 	unsigned int idx;
 
-	for (idx = 0; idx < sizeof(wm8775_ops)/sizeof(wm8775_ops[0]);
-	     idx++) {
+	for (idx = 0; idx < ARRAY_SIZE(wm8775_ops); idx++) {
 		msk = 1 << idx;
 		if (!(ctxt->stale_mask & msk)) continue;
 		ctxt->stale_mask &= ~msk;
@@ -148,8 +146,7 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
 	ctxt->handler.func_table = &hfuncs;
 	ctxt->client = cp;
 	ctxt->hdw = hdw;
-	ctxt->stale_mask = (1 << (sizeof(wm8775_ops)/
-				  sizeof(wm8775_ops[0]))) - 1;
+	ctxt->stale_mask = (1 << ARRAY_SIZE(wm8775_ops)) - 1;
 	cp->handler = &ctxt->handler;
 	pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x wm8775 V4L2 handler set up",
 		   cp->client->addr);
Signature · 2 lines
Ahmed S. Darwish
http://darwish-07.blogspot.com
#7 lore raw
In reply to Ahmed S. Darwish

Em Ter, 2007-01-16 às 20:54 +0200, Ahmed S. Darwish escreveu:

Quoted 14 lines · Robert P. J. Day
Quoted 12 lines · Ahmed S. Darwish
Quoted 4 lines

Use ARRAY_SIZE macro in pvrusb2-hdw.c file

... snip ...

i'm not sure it's worth submitting multiple patches to convert code expressions to the ARRAY_SIZE() macro since i was going to wait for the next kernel release, and do that in one fell swoop with a single patch.

Quoted 5 lines

No problem :). But will a single patch be accepted ?. Grepping the tree,I found many results that will make the patch very very big.
Should I stop sending them till 2.6.20 ?.
If so, I've made any way about 10 patches dealing with different subsytems. I can send them to you to avoid this little work duplication.

The folded patch doesn't seem to be big. I'll apply it at development tree to be sent to 2.6.21. There's no hurry of such patch for 2.6.20.

Quoted 3 lines

Regards

#5 lore raw
In reply to Ahmed S. Darwish
Quoted 22 lines · Ahmed S. Darwish
Quoted 15 lines · Randy Dunlap
Quoted 13 lines · On Tue, 16 Jan 2007 03:36:16 -0500 (EST) Robert P. J. Day wrote:
Quoted 3 lines · Ahmed S. Darwish

Use ARRAY_SIZE macro in pvrusb2-hdw.c file

... snip ...

i'm not sure it's worth submitting multiple patches to convert code expressions to the ARRAY_SIZE() macro since i was going to wait for the next kernel release, and do that in one fell swoop with a single patch.

Quoted 5 lines
Quoted 2 lines

but if people higher up the food chain think it's a better idea to do it a little at a time, that's fine.

I'm not strictly on the food chain, but these 4 patches to pvrusb2 should have been sent as one patch IMO.

Quoted 6 lines

Here's the same patch in one file as suggested.

A patch to use ARRAY_SIZE macro when appropriate.

---

Ahmed:

I've pulled your patch into my driver source and will propagate it up appropriately as part of the next batch of pvrusb2 changes to come out of the v4l-dvb repository.

-Mike

Signature · 4 lines
                        |         Mike Isely          |     PGP fingerprint
     Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                        |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                        |                             |