From: SF Markus Elfring <hidden> Date: 2017-11-24 20:48:32
From: Markus Elfring <redacted>
Date: Fri, 24 Nov 2017 21:45:54 +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 two functions
Return an error code only as a constant in dlfb_realloc_framebuffer()
Improve a size determination in dlfb_alloc_urb_list()
Delete an unnecessary return statement in two functions
drivers/video/fbdev/udlfb.c | 23 +++++------------------
1 file changed, 5 insertions(+), 18 deletions(-)
--
2.15.0
From: SF Markus Elfring <hidden> Date: 2017-11-24 20:50:25
From: Markus Elfring <redacted>
Date: Fri, 24 Nov 2017 21:12:54 +0100
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <redacted>
---
drivers/video/fbdev/udlfb.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
@@ -1599,10 +1597,8 @@ static int dlfb_usb_probe(struct usb_interface *interface,usbdev=interface_to_usbdev(interface);dev=kzalloc(sizeof(*dev),GFP_KERNEL);-if(dev=NULL){-dev_err(&interface->dev,"dlfb_usb_probe: failed alloc of dev struct\n");+if(!dev)gotoerror;-}kref_init(&dev->kref);/* matching kref_put in usb .disconnect fn */
From: SF Markus Elfring <hidden> Date: 2017-11-24 20:51:25
From: Markus Elfring <redacted>
Date: Fri, 24 Nov 2017 21:22:25 +0100
* Return an error code without storing it in an intermediate variable.
* Delete the label "error" and local variable "retval"
which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <redacted>
---
drivers/video/fbdev/udlfb.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
From: SF Markus Elfring <hidden> Date: 2017-11-24 20:53:06
From: Markus Elfring <redacted>
Date: Fri, 24 Nov 2017 21:30:37 +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 <redacted>
---
drivers/video/fbdev/udlfb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: SF Markus Elfring <hidden> Date: 2017-11-24 20:55:15
From: Markus Elfring <redacted>
Date: Fri, 24 Nov 2017 21:36:39 +0100
The script "checkpatch.pl" pointed information out like the following.
WARNING: void function return statements are not generally useful
Thus remove such a statement in the affected functions.
Signed-off-by: Markus Elfring <redacted>
---
drivers/video/fbdev/udlfb.c | 4 ----
1 file changed, 4 deletions(-)
On Friday, November 24, 2017 09:48:14 PM SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Fri, 24 Nov 2017 21:45:54 +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 two functions
This patch removes the information about the device for which the allocation
fails.
Return an error code only as a constant in dlfb_realloc_framebuffer()
This patch depends on the earlier patch (which is not being merged) so please
re-base it if you want it to be applied.
Improve a size determination in dlfb_alloc_urb_list()
Patch queued for 4.16, thanks.
Delete an unnecessary return statement in two functions
On Friday, December 29, 2017 07:10:00 PM SF Markus Elfring wrote:
quoted
quoted
Delete an error message for a failed memory allocation in two functions
This patch removes the information about the device for which the allocation fails.
* Do you find a Linux allocation failure report insufficient in this use case?
Yes, there is more information available currently in the driver and
I see no real improvement in removing it.
* Are you looking for any more clarification?
I will not apply any of such patches for now. The only exception
being drivers that support hardware that can have only one instance
in the system (but it needs to be explicitly stated in the patch
description and the patch needs to be reviewed by a someone else
than the author).
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
From: SF Markus Elfring <hidden> Date: 2018-01-07 13:33:52
From: Markus Elfring <redacted>
Date: Sun, 7 Jan 2018 14:24:34 +0100
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Return an error code only as a constant
Delete an error message for a failed memory allocation
---
v2:
Rebased on Linux next-20180105.
drivers/video/fbdev/udlfb.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
--
2.15.1
From: SF Markus Elfring <hidden> Date: 2018-01-07 13:35:04
From: Markus Elfring <redacted>
Date: Sun, 7 Jan 2018 14:02:36 +0100
* Return an error code without storing it in an intermediate variable.
* Delete the label "error" and local variable "retval"
which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <redacted>
---
v2:
This update suggestion was rebased on source files from the software
"Linux next-20180105".
drivers/video/fbdev/udlfb.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
From: SF Markus Elfring <hidden> Date: 2018-01-07 13:38:37
From: Markus Elfring <redacted>
Date: Sun, 7 Jan 2018 14:07:36 +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 <redacted>
---
v2:
This update suggestion was rebased on source files from the software
"Linux next-20180105" together with an other change combination.
drivers/video/fbdev/udlfb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
On Sunday, January 07, 2018 02:34:51 PM SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Sun, 7 Jan 2018 14:02:36 +0100
* Return an error code without storing it in an intermediate variable.
* Delete the label "error" and local variable "retval"
which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <redacted>
Patch queued for 4.17, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics