kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] UWB: Adjustments for four function implementations
@ 2017-12-05 20:25 SF Markus Elfring
  2017-12-05 20:27 ` [PATCH 1/4] uwb: Delete an error message for a failed memory allocation in hwarc_probe() SF Markus Elfring
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-12-05 20:25 UTC (permalink / raw)
  To: linux-usb, Andrey Konovalov, Greg Kroah-Hartman, Johan Hovold
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 5 Dec 2017 21:17:55 +0100

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (4):
  Delete an error message for a failed memory allocation in hwarc_probe()
  Delete an error message for a failed memory allocation in whcrc_probe()
  Delete an error message for a failed memory allocation in fw_hdrs_load()
  Delete two error messages for a failed memory allocation in i1480_usb_probe()

 drivers/uwb/hwa-rc.c        | 5 ++---
 drivers/uwb/i1480/dfu/mac.c | 4 +---
 drivers/uwb/i1480/dfu/usb.c | 4 +---
 drivers/uwb/whc-rc.c        | 5 ++---
 4 files changed, 6 insertions(+), 12 deletions(-)

-- 
2.15.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] uwb: Delete an error message for a failed memory allocation in hwarc_probe()
  2017-12-05 20:25 [PATCH 0/4] UWB: Adjustments for four function implementations SF Markus Elfring
@ 2017-12-05 20:27 ` SF Markus Elfring
  2017-12-05 20:28 ` [PATCH 2/4] uwb: Delete an error message for a failed memory allocation in whcrc_probe() SF Markus Elfring
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-12-05 20:27 UTC (permalink / raw)
  To: linux-usb, Andrey Konovalov, Greg Kroah-Hartman, Johan Hovold
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 5 Dec 2017 20:30:50 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/uwb/hwa-rc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index 9a53912bdfe9..ecd1f0d60487 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -835,10 +835,9 @@ static int hwarc_probe(struct usb_interface *iface,
 		goto error_rc_alloc;
 	}
 	hwarc = kzalloc(sizeof(*hwarc), GFP_KERNEL);
-	if (hwarc = NULL) {
-		dev_err(dev, "unable to allocate HWA RC instance\n");
+	if (!hwarc)
 		goto error_alloc;
-	}
+
 	hwarc_init(hwarc);
 	hwarc->usb_dev = usb_get_dev(interface_to_usbdev(iface));
 	hwarc->usb_iface = usb_get_intf(iface);
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] uwb: Delete an error message for a failed memory allocation in whcrc_probe()
  2017-12-05 20:25 [PATCH 0/4] UWB: Adjustments for four function implementations SF Markus Elfring
  2017-12-05 20:27 ` [PATCH 1/4] uwb: Delete an error message for a failed memory allocation in hwarc_probe() SF Markus Elfring
@ 2017-12-05 20:28 ` SF Markus Elfring
  2017-12-05 20:29 ` [PATCH 3/4] uwb/i1480/dfu/mac: Delete an error message for a failed memory allocation in fw_hdrs_loa SF Markus Elfring
  2017-12-05 20:30 ` [PATCH 4/4] uwb/i1480/dfu/usb: Delete two error messages for a failed memory allocation in i1480_usb SF Markus Elfring
  3 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-12-05 20:28 UTC (permalink / raw)
  To: linux-usb, Andrey Konovalov, Greg Kroah-Hartman, Johan Hovold
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 5 Dec 2017 20:43:31 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/uwb/whc-rc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/uwb/whc-rc.c b/drivers/uwb/whc-rc.c
index 3ae3c702500d..f69511166aad 100644
--- a/drivers/uwb/whc-rc.c
+++ b/drivers/uwb/whc-rc.c
@@ -374,10 +374,9 @@ int whcrc_probe(struct umc_dev *umc_dev)
 		goto error_rc_alloc;
 	}
 	whcrc = kzalloc(sizeof(*whcrc), GFP_KERNEL);
-	if (whcrc = NULL) {
-		dev_err(dev, "unable to allocate WHC-RC instance\n");
+	if (!whcrc)
 		goto error_alloc;
-	}
+
 	whcrc_init(whcrc);
 	whcrc->umc_dev = umc_dev;
 
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] uwb/i1480/dfu/mac: Delete an error message for a failed memory allocation in fw_hdrs_loa
  2017-12-05 20:25 [PATCH 0/4] UWB: Adjustments for four function implementations SF Markus Elfring
  2017-12-05 20:27 ` [PATCH 1/4] uwb: Delete an error message for a failed memory allocation in hwarc_probe() SF Markus Elfring
  2017-12-05 20:28 ` [PATCH 2/4] uwb: Delete an error message for a failed memory allocation in whcrc_probe() SF Markus Elfring
@ 2017-12-05 20:29 ` SF Markus Elfring
  2017-12-05 20:30 ` [PATCH 4/4] uwb/i1480/dfu/usb: Delete two error messages for a failed memory allocation in i1480_usb SF Markus Elfring
  3 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-12-05 20:29 UTC (permalink / raw)
  To: linux-usb, Andrey Konovalov, Greg Kroah-Hartman, Johan Hovold
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 5 Dec 2017 21:00:03 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/uwb/i1480/dfu/mac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/uwb/i1480/dfu/mac.c b/drivers/uwb/i1480/dfu/mac.c
index 6ec14f5fcde4..ee71973f47ad 100644
--- a/drivers/uwb/i1480/dfu/mac.c
+++ b/drivers/uwb/i1480/dfu/mac.c
@@ -123,11 +123,9 @@ int fw_hdrs_load(struct i1480 *i1480, struct fw_hdr **phdr,
 	data_itr = data;
 	data_top = (u32 *) (_data + data_size);
 	while (data_itr < data_top) {
-		result = -ENOMEM;
 		hdr = kmalloc(sizeof(*hdr), GFP_KERNEL);
 		if (hdr = NULL) {
-			dev_err(i1480->dev, "Cannot allocate fw header "
-			       "for chunk #%u\n", hdr_cnt);
+			result = -ENOMEM;
 			goto error_alloc;
 		}
 		result = fw_hdr_load(i1480, hdr, hdr_cnt,
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] uwb/i1480/dfu/usb: Delete two error messages for a failed memory allocation in i1480_usb
  2017-12-05 20:25 [PATCH 0/4] UWB: Adjustments for four function implementations SF Markus Elfring
                   ` (2 preceding siblings ...)
  2017-12-05 20:29 ` [PATCH 3/4] uwb/i1480/dfu/mac: Delete an error message for a failed memory allocation in fw_hdrs_loa SF Markus Elfring
@ 2017-12-05 20:30 ` SF Markus Elfring
  3 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-12-05 20:30 UTC (permalink / raw)
  To: linux-usb, Andrey Konovalov, Greg Kroah-Hartman, Johan Hovold
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 5 Dec 2017 21:07:47 +0100

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/uwb/i1480/dfu/usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c
index a50cf45e530f..56bbdc5504d4 100644
--- a/drivers/uwb/i1480/dfu/usb.c
+++ b/drivers/uwb/i1480/dfu/usb.c
@@ -366,10 +366,9 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id)
 	if (iface->cur_altsetting->desc.bNumEndpoints < 1)
 		return -ENODEV;
 
-	result = -ENOMEM;
 	i1480_usb = kzalloc(sizeof(*i1480_usb), GFP_KERNEL);
 	if (i1480_usb = NULL) {
-		dev_err(dev, "Unable to allocate instance\n");
+		result = -ENOMEM;
 		goto error;
 	}
 	i1480_usb_init(i1480_usb);
@@ -378,7 +377,6 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id)
 	i1480->buf_size = 512;
 	i1480->cmd_buf = kmalloc(2 * i1480->buf_size, GFP_KERNEL);
 	if (i1480->cmd_buf = NULL) {
-		dev_err(dev, "Cannot allocate transfer buffers\n");
 		result = -ENOMEM;
 		goto error_buf_alloc;
 	}
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-05 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-05 20:25 [PATCH 0/4] UWB: Adjustments for four function implementations SF Markus Elfring
2017-12-05 20:27 ` [PATCH 1/4] uwb: Delete an error message for a failed memory allocation in hwarc_probe() SF Markus Elfring
2017-12-05 20:28 ` [PATCH 2/4] uwb: Delete an error message for a failed memory allocation in whcrc_probe() SF Markus Elfring
2017-12-05 20:29 ` [PATCH 3/4] uwb/i1480/dfu/mac: Delete an error message for a failed memory allocation in fw_hdrs_loa SF Markus Elfring
2017-12-05 20:30 ` [PATCH 4/4] uwb/i1480/dfu/usb: Delete two error messages for a failed memory allocation in i1480_usb SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).