Skip to contentSkip to conversation

staging: rtl8192e: fixed pointer error by adding '*'

PATCH Superseded Mitali Borkar 3 participants 6 messages Apr 10, 2021 Staging

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8192e: fixed pointer error by adding '*'

Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e. boolean expression. This makes code more readable alternative.
Reported by checkpatch.

---
Changes from v1:- added pointer to the function, which was missed during fixing v1.

 drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl819x_TSProc.c +1 -1
index 4457c1acfbf6..78b5b4eaec5f 100644
@@ -327,7 +327,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
 	}
 
 	*ppTS = SearchAdmitTRStream(ieee, Addr, UP, TxRxSelect);
-	if (ppTS)
+	if (*ppTS)
 		return true;
 
 	if (!bAddNewTs) {
Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 4 lines · Mitali Borkar

Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e. boolean expression. This makes code more readable alternative.
Reported by checkpatch.

Checkpatch did not report this specific problem, Julia did :)

And this changelog text does not reflect the commit you made here.

Quoted 2 lines

We need a "Reported-by:" line here to reflect that someone reported the problem as well.

Ideally it will have a "Fixes:" tag also, but I can add that if you don't know how to do that just yet.

thanks,

greg k-h

#4 lore raw
In reply to Mitali Borkar
Quoted 18 lines · Mitali Borkar

Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e. boolean expression. This makes code more readable alternative.
Reported by checkpatch.

---
Changes from v1:- added pointer to the function, which was missed during fixing v1.

 drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl819x_TSProc.c +0 -0
index 4457c1acfbf6..78b5b4eaec5f 100644

drivers/staging/rtl8192e/rtl819x_TSProc.c bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, · line 330

Quoted 5 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c +1 -1
@@ -327,7 +327,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
 	}
 
 	*ppTS = SearchAdmitTRStream(ieee, Addr, UP, TxRxSelect);
-	if (ppTS)
+	if (*ppTS)

This looks like a patch against your previous patch, and not against the original code.

julia

Quoted 11 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c +0 -1
 		return true;
 
 	if (!bAddNewTs) {
--

2.30.2

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/YHGhdtldqAlRsPHT%40kali.

maintainer
#5 lore raw
Quoted 24 lines · Julia Lawall
Quoted 20 lines · Mitali Borkar

Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e. boolean expression. This makes code more readable alternative.
Reported by checkpatch.

---
Changes from v1:- added pointer to the function, which was missed during fixing v1.

 drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl819x_TSProc.c +0 -0
index 4457c1acfbf6..78b5b4eaec5f 100644
@@ -327,7 +327,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
 	}
 
Quoted 6 lines

drivers/staging/rtl8192e/rtl819x_TSProc.c bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, · line 330

Quoted 3 lines
drivers/staging/rtl8192e/rtl819x_TSProc.c +1 -1
 	*ppTS = SearchAdmitTRStream(ieee, Addr, UP, TxRxSelect);
-	if (ppTS)
+	if (*ppTS)

This looks like a patch against your previous patch, and not against the original code.

That's fine as I already accepted the previous patch.

thanks,

greg k-h

#2 lore raw
In reply to Greg KH
Quoted 10 lines · Greg KH
Quoted 4 lines · Mitali Borkar

Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e. boolean expression. This makes code more readable alternative.
Reported by checkpatch.

Checkpatch did not report this specific problem, Julia did :)

And this changelog text does not reflect the commit you made here.

Making the changes now.

Quoted 6 lines
Quoted 2 lines

We need a "Reported-by:" line here to reflect that someone reported the problem as well.

I am resending this as patch v3. I have to add reprted by Julia, right?

Quoted 6 lines

Ideally it will have a "Fixes:" tag also, but I can add that if you don't know how to do that just yet.

thanks,

greg k-h

maintainer
#3 lore raw
Quoted 14 lines · Mitali Borkar
Quoted 10 lines · Greg KH
Quoted 4 lines · Mitali Borkar

Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e. boolean expression. This makes code more readable alternative.
Reported by checkpatch.

Checkpatch did not report this specific problem, Julia did :)

And this changelog text does not reflect the commit you made here.

Making the changes now.

Quoted 1 line
Quoted 1 line
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

We need a "Reported-by:" line here to reflect that someone reported the problem as well.

I am resending this as patch v3. I have to add reprted by Julia, right?

Yes please.