Skip to contentSkip to conversation

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

PATCH Superseded Omer Faruk BULUT 2 participants 2 messages Oct 22, 2024 – Nov 4, 2024 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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

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.

---
 drivers/staging/gpib/common/gpib_os.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/gpib/common/gpib_os.c +2 -3
index 6b12404efe7d..27654b2180a5 100644
@@ -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);
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 1 line · Omer Faruk BULUT

It duplicate the MM subsystem generic OOM message. This patch fixes the following checkpatch warning.

Please wrap your changelog text at 72 columns.

Quoted 5 lines

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?

Quoted 11 lines
---
 drivers/staging/gpib/common/gpib_os.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/gpib/common/gpib_os.c +0 -0
index 6b12404efe7d..27654b2180a5 100644

drivers/staging/gpib/common/gpib_os.c void gpib_register_driver(gpib_interface_t *interface, struct module *provider_m · line 2098

Quoted 9 lines
drivers/staging/gpib/common/gpib_os.c +2 -3
@@ -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