Skip to contentSkip to conversation

Staging: rtlwifi: Remove unnecessary 'out of memory' message.

PATCH Superseded Shreeya Patel 3 participants 13 messages Sep 10, 2017 – Sep 11, 2017 Staging

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Staging: rtlwifi: Remove unnecessary 'out of memory' message.

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

 drivers/staging/rtlwifi/rc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +0 -0
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
	struct rtl_rate_priv *rate_priv;

	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
		return NULL;

- }

	rtlpriv->rate_priv = rate_priv;

--
2.7.4

Acked-by on v4 1/1
#1 lore raw
Quoted 10 lines · Shreeya Patel

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

Quoted 41 lines

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

 drivers/staging/rtlwifi/rc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +1 -4
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 	struct rtl_rate_priv *rate_priv;
 
 	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
 		return NULL;
-	}
 
 	rtlpriv->rate_priv = rate_priv;
 
--

2.7.4

--
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 post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505036405-3702-1-git-send-email-shreeya.patel23498%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

maintainer
#2 lore raw
In reply to Shreeya Patel
Quoted 32 lines · Shreeya Patel

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

 drivers/staging/rtlwifi/rc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +0 -0
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 	struct rtl_rate_priv *rate_priv;

drivers/staging/rtlwifi/rc.c static void *rtl_rate_alloc_sta(void *ppriv, · line 288

Quoted 10 lines
drivers/staging/rtlwifi/rc.c +1 -3
 
 	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
 		return NULL;
-	}
 
 	rtlpriv->rate_priv = rate_priv;
 

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

thanks,

greg k-h

#3 lore raw
Quoted 41 lines · Greg KH
Quoted 40 lines · Shreeya Patel

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

  drivers/staging/rtlwifi/rc.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +1 -3
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 	struct rtl_rate_priv *rate_priv;
 
 	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
 		return NULL;
-	}
 
Quoted 8 lines

drivers/staging/rtlwifi/rc.c static void *rtl_rate_alloc_sta(void *ppriv, · line 288

Quoted 2 lines
drivers/staging/rtlwifi/rc.c +0 -0
 	rtlpriv->rate_priv = rate_priv;
 

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

thanks,

greg k-h

Hello sir,

If i am not removing the leading spaces then checkpatch is showing me errors for trailing whitespace. But there are no leading spaces present in the file which i have modified.
When i convert my changes into the patch, the whitespace errors are shown up.
Can you please help me with this to make me understand why this is happening?

maintainer
#4 lore raw
Quoted 1 line · Shreeya Patel

Please turn html email off in your email client, the kernel mailing lists will reject it.

Quoted 9 lines · Greg KH

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

Hello sir,

If i am not removing the leading spaces then checkpatch is showing me errors for trailing whitespace.

That is correct.

Quoted 3 lines

But there are no leading spaces present in the file which i have modified. When i convert my changes into the patch, the whitespace errors are shown up. Can you please help me with this to make me understand why this is happening?

The problem isn't in the original file, but in the patch format itself that you sent. What ever tool you used, stripped off the leading space, making it impossible to apply. So please fix that.

Try emailing the patch to yourself and applying it to ensure you are doing this correctly.

thanks,

greg k-h

#5 lore raw
Quoted 22 lines · Greg KH

On Mon, Sep 11, 2017 at 09:48:15PM +0530, Shreeya Patel wrote:
Please turn html email off in your email client, the kernel mailing lists will reject it.

Quoted 9 lines · Greg KH

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

Hello sir,

If i am not removing the leading spaces then checkpatch is showing me errors for trailing whitespace.

That is correct.

Quoted 3 lines

But there are no leading spaces present in the file which i have modified. When i convert my changes into the patch, the whitespace errors are shown up. Can you please help me with this to make me understand why this is happening?

The problem isn't in the original file, but in the patch format itself that you sent. What ever tool you used, stripped off the leading space, making it impossible to apply. So please fix that.

Quoted 6 lines

Try emailing the patch to yourself and applying it to ensure you are doing this correctly.

thanks,

greg k-h

ok, i will do that.

Thank you.

#6 lore raw
In reply to Shreeya Patel
Quoted 54 lines · Shreeya Patel

On Monday 11 September 2017 10:02 PM, Greg KH wrote:

On Sun, Sep 10, 2017 at 03:10:05PM +0530, Shreeya Patel wrote:

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

 drivers/staging/rtlwifi/rc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +1 -3
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 	struct rtl_rate_priv *rate_priv;
 
 	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
 		return NULL;
-	}
 
 	rtlpriv->rate_priv = rate_priv;
 

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

thanks,

Quoted 7 lines

greg k-h

Hello sir,

If i am not removing the leading spaces then checkpatch is showing me errors for trailing whitespace.

Maybe you are not using checkpatch properly? What is your command line?

julia

Quoted 18 lines

But there are no leading spaces present in the file which i have modified. When i convert my changes into the patch, the whitespace errors are shown up.
Can you please help me with this to make me understand why this is happening?

--
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 post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/6e7b1bf6-89b9-a40e-4a67- af79312b12a7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#7 lore raw
Quoted 59 lines · Julia Lawall
Quoted 56 lines · Shreeya Patel

On Monday 11 September 2017 10:02 PM, Greg KH wrote:

On Sun, Sep 10, 2017 at 03:10:05PM +0530, Shreeya Patel wrote:

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

  drivers/staging/rtlwifi/rc.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +1 -3
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 	struct rtl_rate_priv *rate_priv;
 
 	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
 		return NULL;
-	}
 
 	rtlpriv->rate_priv = rate_priv;
 

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

thanks,

greg k-h

Quoted 7 lines
Quoted 4 lines

Hello sir,

If i am not removing the leading spaces then checkpatch is showing me errors for trailing whitespace.

Maybe you are not using checkpatch properly? What is your command line?

julia

perl scripts/checkpatch.pl -f /tmp/0001-Staging-rtlwifi-Remove-unnecessary-out-of-memory-mes.patch

Quoted 19 lines
Quoted 19 lines

But there are no leading spaces present in the file which i have modified. When i convert my changes into the patch, the whitespace errors are shown up.
Can you please help me with this to make me understand why this is happening?

--
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 post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/6e7b1bf6-89b9-a40e-4a67- af79312b12a7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#8 lore raw
Quoted 69 lines · Shreeya Patel

On Monday 11 September 2017 10:31 PM, Julia Lawall wrote:

On Mon, 11 Sep 2017, Shreeya Patel wrote:

On Monday 11 September 2017 10:02 PM, Greg KH wrote:

On Sun, Sep 10, 2017 at 03:10:05PM +0530, Shreeya Patel wrote:

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

 drivers/staging/rtlwifi/rc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +1 -3
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 	struct rtl_rate_priv *rate_priv;
 
 	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
 		return NULL;
-	}
 
 	rtlpriv->rate_priv = rate_priv;
 

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

thanks,

greg k-h

Hello sir,

If i am not removing the leading spaces then checkpatch is showing me errors for trailing whitespace.

Quoted 6 lines

Maybe you are not using checkpatch properly? What is your command line?

julia

perl scripts/checkpatch.pl -f /tmp/0001-Staging-rtlwifi-Remove-unnecessary-out-of-memory-mes.patch

-f is for files, eg foo.c, not for patches. You should be able to just give the patch file name directly.

Also, could you change your mailer to make something visible when you quote other people? Otherwise, it's hard to sort out what is new and what is quoted from others.

thanks,
julia

Quoted 25 lines

But there are no leading spaces present in the file which i have modified. When i convert my changes into the patch, the whitespace errors are shown up.
Can you please help me with this to make me understand why this is happening?

--
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 post to this group, send email to [email protected]. To view this discussion on the web visithttps://groups.google.com/d/msgid/ou treachy-kernel/6e7b1bf6-89b9-a40e-4a67- af79312b12a7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#9 lore raw
Quoted 75 lines · Julia Lawall
Quoted 72 lines · Shreeya Patel

On Monday 11 September 2017 10:31 PM, Julia Lawall wrote:

On Mon, 11 Sep 2017, Shreeya Patel wrote:

On Monday 11 September 2017 10:02 PM, Greg KH wrote:

On Sun, Sep 10, 2017 at 03:10:05PM +0530, Shreeya Patel wrote:

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

  drivers/staging/rtlwifi/rc.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +1 -3
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 	struct rtl_rate_priv *rate_priv;
 
 	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
 		return NULL;
-	}
 
 	rtlpriv->rate_priv = rate_priv;
 

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

thanks,

greg k-h

Hello sir,

If i am not removing the leading spaces then checkpatch is showing me errors for trailing whitespace.

Maybe you are not using checkpatch properly? What is your command line?

julia

Quoted 8 lines
Quoted 2 lines

perl scripts/checkpatch.pl -f /tmp/0001-Staging-rtlwifi-Remove-unnecessary-out-of-memory-mes.patch

-f is for files, eg foo.c, not for patches. You should be able to just give the patch file name directly.

Also, could you change your mailer to make something visible when you quote other people? Otherwise, it's hard to sort out what is new and what is quoted from others.

Ok. I will do that soon.

Thanks.

Quoted 28 lines

thanks,
julia

Quoted 24 lines

But there are no leading spaces present in the file which i have modified. When i convert my changes into the patch, the whitespace errors are shown up.
Can you please help me with this to make me understand why this is happening?

--
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 post to this group, send email to [email protected]. To view this discussion on the web visithttps://groups.google.com/d/msgid/ou treachy-kernel/6e7b1bf6-89b9-a40e-4a67- af79312b12a7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#10 lore raw
In reply to Julia Lawall
Quoted 71 lines · Julia Lawall
Quoted 68 lines · Shreeya Patel

On Monday 11 September 2017 10:31 PM, Julia Lawall wrote:

On Mon, 11 Sep 2017, Shreeya Patel wrote:

On Monday 11 September 2017 10:02 PM, Greg KH wrote:

On Sun, Sep 10, 2017 at 03:10:05PM +0530, Shreeya Patel wrote:

Logging messages that show some type of 'out of memory' error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem.

These messages generally increase kernel size without much added value.

Problem found by checkpatch.

---

Changes in v4:
-Include v2 and v3 in the patch.

Changes in v3:
-Make the commit message more appropriate.

changes in v2:
-Original patch was not sent to the mailing list.
Also, add a tab before the return statement.

  drivers/staging/rtlwifi/rc.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/rc.c +1 -3
index 65de0c7..779a5c6 100644
@@ -281,10 +281,8 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 	struct rtl_rate_priv *rate_priv;
 
 	rate_priv = kzalloc(sizeof(*rate_priv), gfp);
-	if (!rate_priv) {
-		pr_err("Unable to allocate private rc structure\n");
+	if (!rate_priv)
 		return NULL;
-	}
 
 	rtlpriv->rate_priv = rate_priv;
 

This patch is sent corrupted (leading space is gone), and git doesn't like it. Can you please fix it up and resend?

thanks,

greg k-h

Hello sir,

If i am not removing the leading spaces then checkpatch is showing me errors for trailing whitespace.

Quoted 8 lines
Quoted 6 lines

Maybe you are not using checkpatch properly? What is your command line?

julia

perl scripts/checkpatch.pl -f /tmp/0001-Staging-rtlwifi-Remove-unnecessary-out-of-memory-mes.patch

-f is for files, eg foo.c, not for patches. You should be able to just give the patch file name directly.

When I give the file name, it is showing me 'permission denied'.

Quoted 32 lines

Also, could you change your mailer to make something visible when you quote other people? Otherwise, it's hard to sort out what is new and what is quoted from others.

thanks,
julia

Quoted 24 lines

But there are no leading spaces present in the file which i have modified. When i convert my changes into the patch, the whitespace errors are shown up.
Can you please help me with this to make me understand why this is happening?

--
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 post to this group, send email to [email protected]. To view this discussion on the web visithttps://groups.google.com/d/msgid/ou treachy-kernel/6e7b1bf6-89b9-a40e-4a67- af79312b12a7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#11 lore raw
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

perl scripts/checkpatch.pl -f /tmp/0001-Staging-rtlwifi-Remove-unnecessary-out-of-memory-mes.patch

-f is for files, eg foo.c, not for patches. You should be able to just give the patch file name directly.

When I give the file name, it is showing me 'permission denied'.

What is the exact command line?

scripts/checkpatch.pl patchfile

should work.

julia

#12 lore raw
Quoted 4 lines · Julia Lawall
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

perl scripts/checkpatch.pl -f /tmp/0001-Staging-rtlwifi-Remove-unnecessary-out-of-memory-mes.patch

-f is for files, eg foo.c, not for patches. You should be able to just give the patch file name directly.

Quoted 8 lines
Quoted 1 line

When I give the file name, it is showing me 'permission denied'.

What is the exact command line?

scripts/checkpatch.pl patchfile

should work.

julia

Oh, yes.
Sorry, my mistake, it worked with 0 errors now :)

Thanks.