Skip to contentSkip to conversation

drivers/media/video/sn9c102/sn9c102_core.c Fix Unlikely(x) == y

PATCH In review Roel Kluin 2 participants 2 messages Feb 16, 2008 Media (V4L/DVB)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 2/3 drivers/media/video/sn9c102/sn9c102_core.c Fix Unlikely(x) == y

The patch below was not yet tested. If it's incorrect, please comment.
---
Fix Unlikely(x) == y

---

drivers/media/video/sn9c102/sn9c102_core.c +1 -1
index c40ba3a..66313b1 100644
@@ -528,7 +528,7 @@ sn9c102_find_sof_header(struct sn9c102_device* cam, void* mem, size_t len)
 
 		/* Search for the SOF marker (fixed part) in the header */
 		for (j = 0, b=cam->sof.bytesread; j+b < sizeof(marker); j++) {
-			if (unlikely(i+j) == len)
+			if (unlikely(i+j == len))
 				return NULL;
 			if (*(m+i+j) == marker[cam->sof.bytesread]) {
 				cam->sof.header[cam->sof.bytesread] = *(m+i+j);
Reviewed-by on v1 2/3
#1 lore raw

It's okay, thanks.

---

Quoted 19 lines · On Saturday 16 February 2008 17:12:26 Roel Kluin wrote:

The patch below was not yet tested. If it's incorrect, please comment.
---
Fix Unlikely(x) == y

---

(quoted diff) +0 -0

b/drivers/media/video/sn9c102/sn9c102_core.c index c40ba3a..66313b1 100644

drivers/media/video/sn9c102/sn9c102_core.c +1 -1
@@ -528,7 +528,7 @@ sn9c102_find_sof_header(struct sn9c102_device* cam,
 void* mem, size_t len)
 
 		/* Search for the SOF marker (fixed part) in the header */
 		for (j = 0, b=cam->sof.bytesread; j+b < sizeof(marker); j++) {
-			if (unlikely(i+j) == len)
+			if (unlikely(i+j == len))
 				return NULL;
 			if (*(m+i+j) == marker[cam->sof.bytesread]) {
Quoted 1 line

cam->sof.header[cam->sof.bytesread] = *(m+i+j);

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list