All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Input-gtco: Adjustments for gtco_probe()
@ 2018-01-24 15:13 ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-24 15:13 UTC (permalink / raw)
  To: linux-input, Andrey Konovalov, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 Jan 2018 15:26:56 +0100

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

Markus Elfring (2):
  Delete an error message for a failed memory allocation
  Improve a size determination

 drivers/input/tablet/gtco.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.16.1

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

* [PATCH 0/2] Input-gtco: Adjustments for gtco_probe()
@ 2018-01-24 15:13 ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-24 15:13 UTC (permalink / raw)
  To: linux-input, Andrey Konovalov, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 Jan 2018 15:26:56 +0100

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

Markus Elfring (2):
  Delete an error message for a failed memory allocation
  Improve a size determination

 drivers/input/tablet/gtco.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.16.1


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

* [PATCH 1/2] Input: gtco: Delete an error message for a failed memory allocation in gtco_probe()
  2018-01-24 15:13 ` SF Markus Elfring
@ 2018-01-24 15:14   ` SF Markus Elfring
  -1 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-24 15:14 UTC (permalink / raw)
  To: linux-input, Andrey Konovalov, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 Jan 2018 15:03:33 +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/input/tablet/gtco.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 4b8b9d7aa75e..f2670872735f 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -902,7 +902,6 @@ static int gtco_probe(struct usb_interface *usbinterface,
 
 	report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL);
 	if (!report) {
-		dev_err(&usbinterface->dev, "No more memory for report\n");
 		error = -ENOMEM;
 		goto err_free_urb;
 	}
-- 
2.16.1

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

* [PATCH 1/2] Input: gtco: Delete an error message for a failed memory allocation in gtco_probe()
@ 2018-01-24 15:14   ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-24 15:14 UTC (permalink / raw)
  To: linux-input, Andrey Konovalov, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 Jan 2018 15:03:33 +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/input/tablet/gtco.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 4b8b9d7aa75e..f2670872735f 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -902,7 +902,6 @@ static int gtco_probe(struct usb_interface *usbinterface,
 
 	report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL);
 	if (!report) {
-		dev_err(&usbinterface->dev, "No more memory for report\n");
 		error = -ENOMEM;
 		goto err_free_urb;
 	}
-- 
2.16.1


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

* [PATCH 2/2] Input: gtco: Improve a size determination in gtco_probe()
  2018-01-24 15:13 ` SF Markus Elfring
@ 2018-01-24 15:15   ` SF Markus Elfring
  -1 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-24 15:15 UTC (permalink / raw)
  To: linux-input, Andrey Konovalov, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 Jan 2018 15:08:42 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/input/tablet/gtco.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index f2670872735f..6094241d4aa1 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -829,7 +829,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
 	struct usb_device	*udev = interface_to_usbdev(usbinterface);
 
 	/* Allocate memory for device structure */
-	gtco = kzalloc(sizeof(struct gtco), GFP_KERNEL);
+	gtco = kzalloc(sizeof(*gtco), GFP_KERNEL);
 	input_dev = input_allocate_device();
 	if (!gtco || !input_dev) {
 		dev_err(&usbinterface->dev, "No more memory\n");
-- 
2.16.1

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

* [PATCH 2/2] Input: gtco: Improve a size determination in gtco_probe()
@ 2018-01-24 15:15   ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-24 15:15 UTC (permalink / raw)
  To: linux-input, Andrey Konovalov, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 Jan 2018 15:08:42 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/input/tablet/gtco.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index f2670872735f..6094241d4aa1 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -829,7 +829,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
 	struct usb_device	*udev = interface_to_usbdev(usbinterface);
 
 	/* Allocate memory for device structure */
-	gtco = kzalloc(sizeof(struct gtco), GFP_KERNEL);
+	gtco = kzalloc(sizeof(*gtco), GFP_KERNEL);
 	input_dev = input_allocate_device();
 	if (!gtco || !input_dev) {
 		dev_err(&usbinterface->dev, "No more memory\n");
-- 
2.16.1


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

end of thread, other threads:[~2018-01-24 15:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24 15:13 [PATCH 0/2] Input-gtco: Adjustments for gtco_probe() SF Markus Elfring
2018-01-24 15:13 ` SF Markus Elfring
2018-01-24 15:14 ` [PATCH 1/2] Input: gtco: Delete an error message for a failed memory allocation in gtco_probe() SF Markus Elfring
2018-01-24 15:14   ` SF Markus Elfring
2018-01-24 15:15 ` [PATCH 2/2] Input: gtco: Improve a size determination " SF Markus Elfring
2018-01-24 15:15   ` SF Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.