Skip to contentSkip to conversation

pvrusb2: replace !0 with 1

PATCH NAK Dan Carpenter 3 participants 3 messages Mar 26, 2011 – Mar 28, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/6 pvrusb2: replace !0 with 1

Using !0 is less readable than just saying 1.

drivers/media/video/pvrusb2/pvrusb2-std.c +5 -5
index 9bebc08..ca4f67b 100644
@@ -158,7 +158,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *buf,
 			cnt++;
 			buf += cnt;
 			buf_size -= cnt;
-			mMode = !0;
+			mMode = 1;
 			cmsk = sp->id;
 			continue;
 		}
@@ -190,7 +190,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *buf,
 
 	if (idPtr)
 		*idPtr = id;
-	return !0;
+	return 1;
 }
 
 unsigned int pvr2_std_id_to_str(char *buf, unsigned int buf_size,
@@ -217,10 +217,10 @@ unsigned int pvr2_std_id_to_str(char *buf, unsigned int buf_size,
 					buf_size -= c2;
 					buf += c2;
 				}
-				cfl = !0;
+				cfl = 1;
 				c2 = scnprintf(buf, buf_size,
 					       "%s-", gp->name);
-				gfl = !0;
+				gfl = 1;
 			} else {
 				c2 = scnprintf(buf, buf_size, "/");
 			}
@@ -315,7 +315,7 @@ static int pvr2_std_fill(struct v4l2_standard *std, v4l2_std_id id)
 	std->name[bcnt] = 0;
 	pvr2_trace(PVR2_TRACE_STD, "Set up standard idx=%u name=%s",
 		   std->index, std->name);
-	return !0;
+	return 1;
 }
 
 /*
Nacked-By on v1 6/6 NAK
#1 lore raw

That's an opinion which I as the driver author disagree with. Strongly. How hard is it to read "not false"?

Quoted 49 lines · Dan Carpenter

Using !0 is less readable than just saying 1.

drivers/media/video/pvrusb2/pvrusb2-std.c +5 -5
index 9bebc08..ca4f67b 100644
@@ -158,7 +158,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *buf,
 			cnt++;
 			buf += cnt;
 			buf_size -= cnt;
-			mMode = !0;
+			mMode = 1;
 			cmsk = sp->id;
 			continue;
 		}
@@ -190,7 +190,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *buf,
 
 	if (idPtr)
 		*idPtr = id;
-	return !0;
+	return 1;
 }
 
 unsigned int pvr2_std_id_to_str(char *buf, unsigned int buf_size,
@@ -217,10 +217,10 @@ unsigned int pvr2_std_id_to_str(char *buf, unsigned int buf_size,
 					buf_size -= c2;
 					buf += c2;
 				}
-				cfl = !0;
+				cfl = 1;
 				c2 = scnprintf(buf, buf_size,
 					       "%s-", gp->name);
-				gfl = !0;
+				gfl = 1;
 			} else {
 				c2 = scnprintf(buf, buf_size, "/");
 			}
@@ -315,7 +315,7 @@ static int pvr2_std_fill(struct v4l2_standard *std, v4l2_std_id id)
 	std->name[bcnt] = 0;
 	pvr2_trace(PVR2_TRACE_STD, "Set up standard idx=%u name=%s",
 		   std->index, std->name);
-	return !0;
+	return 1;
 }
 
 /*
Signature · 3 lines
Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
#2 lore raw
Quoted 3 lines · Mike Isely

That's an opinion which I as the driver author disagree with. Strongly. How hard is it to read "not false"?

Personally, I prefer use of "true" and "false" over both...

Quoted 61 lines · Dan Carpenter
Quoted 50 lines

Using !0 is less readable than just saying 1.

drivers/media/video/pvrusb2/pvrusb2-std.c +5 -5
index 9bebc08..ca4f67b 100644
@@ -158,7 +158,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *buf,
 			cnt++;
 			buf += cnt;
 			buf_size -= cnt;
-			mMode = !0;
+			mMode = 1;
 			cmsk = sp->id;
 			continue;
 		}
@@ -190,7 +190,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *buf,
 
 	if (idPtr)
 		*idPtr = id;
-	return !0;
+	return 1;
 }
 
 unsigned int pvr2_std_id_to_str(char *buf, unsigned int buf_size,
@@ -217,10 +217,10 @@ unsigned int pvr2_std_id_to_str(char *buf, unsigned int buf_size,
 					buf_size -= c2;
 					buf += c2;
 				}
-				cfl = !0;
+				cfl = 1;
 				c2 = scnprintf(buf, buf_size,
 					       "%s-", gp->name);
-				gfl = !0;
+				gfl = 1;
 			} else {
 				c2 = scnprintf(buf, buf_size, "/");
 			}
@@ -315,7 +315,7 @@ static int pvr2_std_fill(struct v4l2_standard *std, v4l2_std_id id)
 	std->name[bcnt] = 0;
 	pvr2_trace(PVR2_TRACE_STD, "Set up standard idx=%u name=%s",
 		   std->index, std->name);
-	return !0;
+	return 1;
 }
 
 /*
Signature · 7 lines
Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Jarod Wilson
[email protected]