[PATCH] Staging: gpib/common/gpib_os.c - Remove unnecessary OOM message

Omer Faruk BULUT posted 1 patch 1 month ago
drivers/staging/gpib/common/gpib_os.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[PATCH] Staging: gpib/common/gpib_os.c - Remove unnecessary OOM message
Posted by Omer Faruk BULUT 1 month ago
It duplicate the MM subsystem generic OOM message. This patch fixes the following checkpatch warning.

    WARNING: Possible unnecessary 'out of memory' message

Also, this patch itself might teach to module writers or readers that they have to give attention to MM subsystem
even they interest another one.

Signed-off-by: Omer Faruk BULUT <m.omerfarukbulut@gmail.com>
---
 drivers/staging/gpib/common/gpib_os.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index 6b12404efe7d..27654b2180a5 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -2093,10 +2093,9 @@ void gpib_register_driver(gpib_interface_t *interface, struct module *provider_m
 	struct gpib_interface_list_struct *entry;
 
 	entry = kmalloc(sizeof(*entry), GFP_KERNEL);
-	if (!entry) {
-		pr_err("gpib: failed register %s interface, out of memory\n", interface->name);
+	if (!entry) 
 		return;
-	}
+	
 	entry->interface = interface;
 	entry->module = provider_module;
 	list_add(&entry->list, &registered_drivers);
-- 
2.17.1
Re: [PATCH] Staging: gpib/common/gpib_os.c - Remove unnecessary OOM message
Posted by Greg KH 3 weeks, 1 day ago
On Tue, Oct 22, 2024 at 09:06:20PM +0300, Omer Faruk BULUT wrote:
> It duplicate the MM subsystem generic OOM message. This patch fixes the following checkpatch warning.

Please wrap your changelog text at 72 columns.

> 
>     WARNING: Possible unnecessary 'out of memory' message
> 
> Also, this patch itself might teach to module writers or readers that they have to give attention to MM subsystem
> even they interest another one.

I do not understand this comment at all, sorry, what does it have to do
with the change happening in this proposal?

> 
> Signed-off-by: Omer Faruk BULUT <m.omerfarukbulut@gmail.com>
> ---
>  drivers/staging/gpib/common/gpib_os.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
> index 6b12404efe7d..27654b2180a5 100644
> --- a/drivers/staging/gpib/common/gpib_os.c
> +++ b/drivers/staging/gpib/common/gpib_os.c
> @@ -2093,10 +2093,9 @@ void gpib_register_driver(gpib_interface_t *interface, struct module *provider_m
>  	struct gpib_interface_list_struct *entry;
>  
>  	entry = kmalloc(sizeof(*entry), GFP_KERNEL);
> -	if (!entry) {
> -		pr_err("gpib: failed register %s interface, out of memory\n", interface->name);
> +	if (!entry) 
>  		return;
> -	}
> +	

You added trailing whitespace, ALWAYS run scripts/checkpatch.pl on
changes you are submitting to the kernel, you don't want to add a new
problem when trying to fix a different one :)

thanks,

greg k-h