Skip to contentSkip to conversation

media: docs: Change unintended assignment in v4l

PATCH In review Daniel Lundberg Pedersen 3 participants 5 messages Jan 11, 2022 – Jan 12, 2022 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: docs: Change unintended assignment in v4l

Example should be comparing errno to EINTR instead of doing assignment.

---
 Documentation/userspace-api/media/v4l/v4l2grab.c.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/userspace-api/media/v4l/v4l2grab.c.rst +1 -1
index eaa0f95048e7..c98a78d63a8b 100644
@@ -134,7 +134,7 @@ file: media/v4l/v4l2grab.c
 			    tv.tv_usec = 0;
 
 			    r = select(fd + 1, &fds, NULL, NULL, &tv);
-		    } while ((r == -1 && (errno = EINTR)));
+		    } while ((r == -1 && (errno == EINTR)));
 		    if (r == -1) {
 			    perror("select");
 			    return errno;
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#1 lore raw

Quoting Daniel Lundberg Pedersen (2022-01-11 16:48:55)

Quoted 2 lines

Example should be comparing errno to EINTR instead of doing assignment.

Ouch - that's not helpful in documentation indeed. Good spot, and fix.

It might help to say 'in v4l2grab' in the $SUBJECT rather than 'v4l' as that would be a bit more specific.

Quoted 21 lines
---
 Documentation/userspace-api/media/v4l/v4l2grab.c.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/userspace-api/media/v4l/v4l2grab.c.rst +1 -1
index eaa0f95048e7..c98a78d63a8b 100644
@@ -134,7 +134,7 @@ file: media/v4l/v4l2grab.c
                            tv.tv_usec = 0;
 
                            r = select(fd + 1, &fds, NULL, NULL, &tv);
-                   } while ((r == -1 && (errno = EINTR)));
+                   } while ((r == -1 && (errno == EINTR)));
                    if (r == -1) {
                            perror("select");
                            return errno;
Signature · 1 line
2.33.1
#2 lore raw
Quoted 2 lines

Ouch - that's not helpful in documentation indeed. Good spot, and fix.

Thanks :)

Quoted 2 lines

It might help to say 'in v4l2grab' in the $SUBJECT rather than 'v4l' as that would be a bit more specific.

Should I make a V2 with an updated subject?
Eg.: 'media: docs: Fix unintended assignment in v4l2grap'

Regards Daniel

#3 lore raw

Quoting Daniel Lundberg Pedersen (2022-01-12 09:43:49)

Quoted 10 lines
Quoted 2 lines

Ouch - that's not helpful in documentation indeed. Good spot, and fix.

Thanks :)

Quoted 2 lines

It might help to say 'in v4l2grab' in the $SUBJECT rather than 'v4l' as that would be a bit more specific.

Should I make a V2 with an updated subject?
Eg.: 'media: docs: Fix unintended assignment in v4l2grap'

Up to you and Mauro, I would expect it could be handled when applying for such a small change.

"media: docs: Fix unintended assignment in v4l2grab"

would indeed be a better title.

--
Kieran

Quoted 3 lines

Regards Daniel

#4 lore raw
In reply to Kieran Bingham
Quoted 9 lines · Kieran Bingham

Quoting Daniel Lundberg Pedersen (2022-01-11 16:48:55)

Quoted 2 lines

Example should be comparing errno to EINTR instead of doing assignment.

Ouch - that's not helpful in documentation indeed. Good spot, and fix.

It might help to say 'in v4l2grab' in the $SUBJECT rather than 'v4l' as that would be a bit more specific.

Yes, ideally something like this:

"media: docs: v4l2grab.c.rst: change unintended assignment"

I see way too often patches that do NOT specify the driver (or in this case the specific file) that has been changed. Just saying "media: docs:" suggests a 'media docs'-wide change.

Please post a v2 with the correct subject, I want to crack down on this practice.

While easy enough to fix, the problem is that by not mentioning what was changed the correct maintainers won't see the patch. Not a big deal here, but much more serious with driver patches.

Regards,

Hans

Quoted 24 lines
Quoted 21 lines
---
 Documentation/userspace-api/media/v4l/v4l2grab.c.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/userspace-api/media/v4l/v4l2grab.c.rst +1 -1
index eaa0f95048e7..c98a78d63a8b 100644
@@ -134,7 +134,7 @@ file: media/v4l/v4l2grab.c
                            tv.tv_usec = 0;
 
                            r = select(fd + 1, &fds, NULL, NULL, &tv);
-                   } while ((r == -1 && (errno = EINTR)));
+                   } while ((r == -1 && (errno == EINTR)));
                    if (r == -1) {
                            perror("select");
                            return errno;
Signature · 1 line
2.33.1