[PATCH 0/3] [media] DVB-frontends: Deletion of a few unnecessary checks

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Wed, 19 Nov 2014 23:30:37 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (3): DVB-frontends: Deletion of unnecessary checks before the function call

[PATCH 2/3] [media] m88ds3103: One function call less in m88ds3103_init() after error detection

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Wed, 19 Nov 2014 23:20:51 +0100 The release_firmware() function was called in some cases by the m88ds3103_init() function during error handling even if the passed variable contained still a null pointer. This implementation detail could be

[PATCH 1/3] [media] DVB-frontends: Deletion of unnecessary checks before the function call release_firmware

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Wed, 19 Nov 2014 22:27:24 +0100 The release_firmware() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 3/3] [media] si2168: One function call less in si2168_init() after error detection

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Wed, 19 Nov 2014 23:23:15 +0100 The release_firmware() function was called in some cases by the si2168_init() function during error handling even if the passed variable contained still a null pointer. This implementation detail could be

[PATCH 1/1] [media] firewire: Deletion of an unnecessary check before the function call dvb_unregister_device

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Thu, 20 Nov 2014 10:49:07 +0100 The dvb_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 1/1] [media] i2c: Deletion of an unnecessary check before the function call rc_unregister_device

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Thu, 20 Nov 2014 11:13:16 +0100 The rc_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 1/1] [media] platform: Deletion of unnecessary checks before two function calls

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Thu, 20 Nov 2014 11:44:20 +0100 The functions i2c_put_adapter() and release_firmware() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the

[PATCH 1/1] [media] rc: Deletion of unnecessary checks before two function calls

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Thu, 20 Nov 2014 13:01:32 +0100 The functions input_free_device() and rc_close() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle

[PATCH 1/1] [media] USB: Deletion of unnecessary checks before three function calls

2014-11-20 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Thu, 20 Nov 2014 13:26:36 +0100 The functions pvr2_hdw_destroy(), rc_unregister_device() and vfree() perform also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle

[PATCH 1/1] [media] Siano: Deletion of an unnecessary check before the function call rc_unregister_device

2014-11-24 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 24 Nov 2014 22:32:30 +0100 The rc_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 0/2] [media] tuners: Deletion of two unnecessary checks

2014-11-30 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 30 Nov 2014 20:50:15 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Deletion of unnecessary checks before the function call release_firmware

[PATCH 1/2] [media] tuners: Deletion of unnecessary checks before the function call release_firmware

2014-11-30 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 30 Nov 2014 19:05:48 +0100 The release_firmware() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 2/2] [media] tuners-si2157: One function call less in si2157_init() after error detection

2014-11-30 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 30 Nov 2014 20:48:24 +0100 The release_firmware() function was called in some cases by the si2157_init() function during error handling even if the passed variable contained still a null pointer. This implementation detail could be

[PATCH 1/1] [media] ddbridge: Deletion of an unnecessary check before the function call dvb_unregister_device

2014-11-30 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 30 Nov 2014 22:50:20 +0100 The dvb_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 1/1] [media] V4L2: Deletion of an unnecessary check before the function call vb2_put_vma

2014-11-30 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 30 Nov 2014 23:10:51 +0100 The vb2_put_vma() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 1/1] [media] lirc_zilog: Deletion of unnecessary checks before the function call vfree

2014-12-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 1 Dec 2014 19:49:39 +0100 The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH 0/2] [media] mn88473: Delete an unnecessary check

2014-12-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 1 Dec 2014 23:16:34 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Deletion of an unnecessary check before the function call release_firmware

[PATCH 1/2] [media] mn88473: Deletion of an unnecessary check before the function call release_firmware

2014-12-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 1 Dec 2014 22:55:29 +0100 The release_firmware() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 2/2] [media] mn88473: One function call less in mn88473_init() after error detection

2014-12-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 1 Dec 2014 23:15:20 +0100 The release_firmware() function was called by the mn88473_init() function even if a previous function call request_firmware failed. This implementation detail could be improved by the introduction of another

Re: [git:media_tree/master] [media] tuners: remove unneeded checks before release_firmware()

2014-12-04 Thread SF Markus Elfring
This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/media_tree.git tree: Subject: [media] tuners: remove uneeded checks before release_firmware() Would you like to amend a typo in the commit title? Regards, Markus -- To

[PATCH] [media] V4L2: Delete an unnecessary check before the function call media_entity_put

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 15:27:38 +0100 The media_entity_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[media] staging: bcm2048: Delete an unnecessary check before the function call video_unregister_device

2015-02-02 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 2 Feb 2015 13:20:23 +0100 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 0/2] DVB: Deletion of a few unnecessary checks

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 16:50:07 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Delete an unnecessary check before the function call dvb_unregister_device

[PATCH 2/2] [media] DVB: Less function calls in dvb_ca_en50221_init() after error detection

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 16:47:48 +0100 The functions dvb_unregister_device and kfree could still be called by the dvb_ca_en50221_init() function in the case that a previous resource allocation failed. * Corresponding details could be improved by

[PATCH 1/2] [media] DVB: Delete an unnecessary check before the function call dvb_unregister_device

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 16:01:40 +0100 The dvb_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH] [media] sp2: Delete an unnecessary check before the function call kfree

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 15:05:26 +0100 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by:

[PATCH] [media] stk-webcam: Delete an unnecessary check before the function call vfree

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 18:36:35 +0100 The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH] [media] au0828: Delete unnecessary checks before the function call video_unregister_device

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 19:00:25 +0100 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 2/2] [media] mn88472: One function call less in mn88472_init() after error detection

2015-02-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 1 Feb 2015 19:34:37 +0100 The release_firmware() function was called in three cases by the mn88472_init() function during error handling even if the passed variable fw contained still a null pointer. This implementation detail could

[PATCH 1/2] [media] mn88472: Deletion of an unnecessary check before the function call release_firmware

2015-02-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 1 Feb 2015 19:12:56 +0100 The release_firmware() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 0/2] [media] mn88472: Delete an unnecessary check

2015-02-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 1 Feb 2015 20:00:17 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Deletion of an unnecessary check before the function call release_firmware

[PATCH 0/2] [media] c8sectpfe: Deletion of a few unnecessary checks

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 19:39:32 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Delete unnecessary checks before two function calls Combine three checks

[PATCH 1/2] [media] c8sectpfe: Delete unnecessary checks before two function calls

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 18:55:19 +0100 The functions i2c_put_adapter() and module_put() test whether their argument is NULL and then return immediately. Thus the tests around their calls are not needed. This issue was detected by using the

[PATCH 2/2] [media] c8sectpfe: Combine three checks into a single if block

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 19:23:50 +0100 The variable "tsin" was checked three times in a loop iteration of the c8sectpfe_tuner_unregister_frontend() function. This implementation detail could be improved by the combination of the involved

Re: [Cocci] [PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-27 Thread SF Markus Elfring
>> https://cwe.mitre.org/data/definitions/252.html > > The value is not unchecked. Would you like to express any stronger relationship between the function call example and the occurrence of an if statement by the discussed SmPL script? > I made a specific rule because the specific problem is

[media] af9013: Checking for register accesses?

2015-12-27 Thread SF Markus Elfring
Hello, I have looked at the implementations of functions like the following once more. https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/dvb-frontends/af9013.c?id=80c75a0f1d81922bf322c0634d1e1a15825a89e6#n124 * af9013_rd_regs * af9013_wr_regs Both functions will

[PATCH] [media] bttv: Returning only value constants in two functions

2015-12-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 27 Dec 2015 22:02:21 +0100 Return constant integer values without storing them in the local variable "err" or "rc". Signed-off-by: Markus Elfring --- drivers/media/pci/bt8xx/bttv-driver.c | 25

[PATCH] [media] si2165: Refactoring for si2165_writereg_mask8()

2015-12-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 27 Dec 2015 18:23:57 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the si2165_readreg8() function failed. 2. Reduce the scope for the local variables "ret" and "tmp" to

[PATCH] [media] au0828: Refactoring for start_urb_transfer()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 22:52:48 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a buffer allocation failed. 2. Delete the jump label "err" then. 3. Drop the explicit initialisation for the

Re: [Cocci] [PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-27 Thread SF Markus Elfring
> The error return value of platform_get_irq seems to often get dropped. How do you think about any more fine-tuning here? Commit message: * … of the platform_get_irq() function seems to get dropped too often. * Why do you concentrate on a single function name? Do you plan to extend this

Re: [media] tuners: One check less in m88rs6000t_get_rf_strength() after error detection

2015-12-28 Thread SF Markus Elfring
>> Move the jump label directly before the desired log statement >> so that the variable "ret" will not be checked once more >> after it was determined that a function call failed. > > Why not avoid both unnecessary ifs I would find such a fine-tuning also nice in principle at more source code

[PATCH] [media] tuners: One check less in m88rs6000t_get_rf_strength() after error detection

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 10:10:34 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "ret" will not be checked once more after it was determined that

[PATCH 1/2] [media] m88rs6000t: Better exception handling in five functions

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 15:10:30 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "ret" will not be checked once more after a function call. Use

[media] r820t: Checking lock scopes around i2c_gate_ctrl() calls?

2015-12-28 Thread SF Markus Elfring
Hello, I have looked at the implementation of the function "r820t_signal" once more. https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/tuners/r820t.c?id=80c75a0f1d81922bf322c0634d1e1a15825a89e6#n2242 The function which was assigned to the pointer "i2c_gate_ctrl"

[PATCH 2/2] [media] tuners: Refactoring for m88rs6000t_sleep()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 15:20:45 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the regmap_write() function failed. 2. Delete the jump label "err" then. 3. Return zero as a constant at

[PATCH 0/2] [media] m88rs6000t: Fine-tuning for some function implementations

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 15:32:20 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Better exception handling in five functions Refactoring for m88rs6000t_sleep()

Re: [media] m88rs6000t: Better exception handling in five functions

2015-12-28 Thread SF Markus Elfring
>> Move the jump label directly before the desired log statement >> so that the variable "ret" will not be checked once more >> after a function call. > > This commit message fits with the previous change. Do you prefer an other wording? > It could be nice to put a blank line before the error

[PATCH 1/2] [media] r820t: Delete an unnecessary variable initialisation in generic_set_freq()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 16:36:44 +0100 The variable "rc" will be set to an appropriate value from a call of the r820t_set_tv_standard() function. Thus let us omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring

[PATCH 2/2] [media] r820t: Better exception handling in generic_set_freq()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 17:13:02 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "rc" will not be checked once more after a function call. Use

[PATCH 0/2] [media] r820t: Fine-tuning for generic_set_freq()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 17:18:34 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an unnecessary variable initialisation Better exception handling

[PATCH] [media] airspy: Better exception handling in two functions

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 22:10:28 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "ret" will not be checked once more after a function call. Use

[PATCH] [media] xc5000: Faster result reporting in xc_load_fw_and_init_tuner()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 20:10:30 +0100 This issue was detected by using the Coccinelle software. Split the previous if statement at the end so that each final log statement will eventually be performed by a direct jump to these labels. *

[PATCH] [media] gsc-m2m: Use an unsigned data type for a variable

2015-12-19 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 19 Dec 2015 15:28:37 +0100 The data type "int" was used by the variable "ret" in the gsc_m2m_poll() function despite of the aspect that the type "unsigned int" will usually be needed for the return value from a call of the

[media] anysee: Checking failure reporting

2015-12-29 Thread SF Markus Elfring
Hello, I have looked at the implementation of the function "anysee_del_i2c_dev" once more. https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/usb/dvb-usb-v2/anysee.c?id=80c75a0f1d81922bf322c0634d1e1a15825a89e6#n685 Is it really appropriate to end this one with

[PATCH] [media] msi2500: Delete an unnecessary check in msi2500_set_usb_adc()

2015-12-29 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 29 Dec 2015 12:32:41 +0100 This issue was detected by using the Coccinelle software. Return the value from a call of the msi2500_ctrl_msg() function without using an extra check for the variable "ret" at the end. Signed-off-by:

[PATCH] [media] hdpvr: Refactoring for hdpvr_read()

2015-12-29 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 29 Dec 2015 11:02:43 +0100 Let us return directly if the element "status" of the variable "buf" indicates "BUFSTAT_READY". A check repetition can be excluded for the variable "ret" at the end then. Signed-off-by: Markus Elfring

[PATCH] media/i2c: Delete owner assignment

2016-08-14 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 14 Aug 2016 22:20:26 +0200 The field "owner" is set by core. Thus delete an extra initialisation. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Markus Elfring ---

[PATCH] [media] radio-si470x-i2c: Delete owner assignment

2016-08-14 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 15 Aug 2016 07:01:56 +0200 The field "owner" is set by core. Thus delete an extra initialisation. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Markus Elfring ---

[PATCH] [media] cec: Delete an unnecessary check before the function call "rc_free_device"

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 22:52:49 +0200 The rc_free_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH] [media] tw686x-kh: Delete an unnecessary check before the function call "video_unregister_device"

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 22:00:35 +0200 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle

[PATCH] [media] v4l2-common: Delete an unnecessary check before the function call "spi_unregister_device"

2016-07-19 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 19 Jul 2016 19:54:16 +0200 The spi_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH] [media] tw686x: Delete an unnecessary check before the function call "video_unregister_device"

2016-07-19 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 19 Jul 2016 21:24:26 +0200 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle

[PATCH] [media] dvb_frontend: Use memdup_user() rather than duplicating its implementation

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 19 Aug 2016 10:04:54 +0200 * Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. * Return directly if this copy operation failed.

[PATCH 1/2] uvc_v4l2: Use memdup_user() rather than duplicating its implementation

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 19 Aug 2016 10:50:05 +0200 Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH 0/2] uvc_v4l2: Fine-tuning for uvc_ioctl_ctrl_map()

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 19 Aug 2016 11:11:01 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use memdup_user() rather than duplicating its implementation One function call less after error

[PATCH 2/2] uvc_v4l2: One function call less in uvc_ioctl_ctrl_map() after error detection

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 19 Aug 2016 11:00:38 +0200 The kfree() function was called in two cases by the uvc_ioctl_ctrl_map() function during error handling even if the passed data structure element contained a null pointer. Adjust jump targets according to

[PATCH 2/2] [media] dvb-tc90522: Rename a jump label in tc90522_probe()

2016-10-07 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 21:13:57 +0200 Adjust a jump label according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/tc90522.c | 5 ++--- 1 file changed, 2

[PATCH 0/2] [media] dvb-tc90522: Fine-tuning for two function implementations

2016-10-07 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 21:38:12 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use kmalloc_array() Rename a jump label drivers/media/dvb-frontends/tc90522.c | 7 +++ 1 file

[PATCH 1/2] [media] dvb-tc90522: Use kmalloc_array() in tc90522_master_xfer()

2016-10-07 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 21:07:43 +0200 A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected by

[PATCH 0/2] [media] cx88-dsp: Fine-tuning for five function implementations

2016-10-08 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 8 Oct 2016 13:41:12 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use kmalloc_array() Add some spaces for better code readability drivers/media/pci/cx88/cx88-dsp.c

[PATCH 1/2] [media] cx88-dsp: Use kmalloc_array() in read_rds_samples()

2016-10-08 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 22:07:27 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was

[PATCH 2/2] [media] cx88-dsp: Add some spaces for better code readability

2016-10-08 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 22:30:40 +0200 Use space characters at some source code places according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/pci/cx88/cx88-dsp.c | 40

[PATCH 2/2] [media] blackfin-capture: Delete an error message for a failed memory allocation

2016-10-09 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 9 Oct 2016 21:30:18 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: Possible unnecessary 'out of memory' message Thus remove such a statement here. Link:

[PATCH v2 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-11-06 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 6 Nov 2016 20:40:20 +0100 * A function was called over the pointer "setup_if_config" in the data structure "venc_platform_data". But the return value was not used so far. Thus assign it to the local variable "ret" which will be

[PATCH v2 17/34] [media] DaVinci-VPFE-Capture: Replace a memcpy() call by an assignment in vpfe_enum_input()

2016-11-06 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 6 Nov 2016 21:54:38 +0100 Use a direct assignment for an array element which can be set over the pointer variable "inp" instead of calling the function "memcpy" here. Suggested-by: Hans Verkuil Signed-off-by:

[PATCH 3/5] [media] winbond-cir: Move assignments for three variables in wbcir_shutdown()

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 10:40:12 +0200 Move the setting for the local variables "mask", "match" and "rc6_csl" behind the source code for a condition check by this function at the beginning. Signed-off-by: Markus Elfring

[PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 12:48:41 +0200 The local variable "do_wake" was set to "false" after an invalid system setting was detected so that a bit of error handling was triggered. * Replace these assignments by direct jumps to the source code

[PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in wbcir_tx()

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 07:19:00 +0200 A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected

[PATCH 5/5] [media] winbond-cir: Move a variable assignment in two functions

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 13:13:11 +0200 Move the assignment for the local variable "data" behind the source code for condition checks by these functions. Signed-off-by: Markus Elfring ---

[PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx()

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 07:34:46 +0200 Move the assignment for the local variable "data" behind the source code for a memory allocation by this function. Signed-off-by: Markus Elfring ---

Re: [media] RedRat3: Move two assignments in redrat3_transmit_ir()?

2016-10-14 Thread SF Markus Elfring
> The original code was correct. Your view can be appropriate for this function implementation to some degree. I got the impression that it contains the specification of assignments which will happen a bit too early here. Is this a weakness for which software developers can care about? Regards,

[PATCH 0/5] [media] winbond-cir: Fine-tuning for four function implementations

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 13:24:35 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (5): Use kmalloc_array() in wbcir_tx() Move a variable assignment in wbcir_tx() Move assignments for

[PATCH 1/3] [media] au0828-video: Use kcalloc() in au0828_init_isoc()

2016-10-24 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 24 Oct 2016 22:08:47 +0200 * Multiplications for the size determination of memory allocations indicated that array data structures should be processed. Thus use the corresponding function "kcalloc". This issue was detected by

[PATCH 0/3] [media] au0828-video: Fine-tuning for au0828_init_isoc()

2016-10-24 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 24 Oct 2016 22:52:10 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (3): Use kcalloc() Delete three error messages for a failed memory allocation Move two assignments

[PATCH 3/3] [media] au0828-video: Move two assignments in au0828_init_isoc()

2016-10-24 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 24 Oct 2016 22:44:02 +0200 Move the assignment for the data structure members "isoc_copy" and "num_bufs" behind the source code for memory allocations by this function. Signed-off-by: Markus Elfring

[PATCH 2/3] [media] au0828-video: Delete three error messages for a failed memory allocation

2016-10-24 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 24 Oct 2016 22:28:03 +0200 Omit extra messages for a memory allocation failure in this function. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring

Re: [media] winbond-cir: Move assignments for three variables in wbcir_shutdown()

2016-10-19 Thread SF Markus Elfring
Move the setting for the local variables "mask", "match" and "rc6_csl" behind the source code for a condition check by this function at the beginning. >>> >>> Again, I can't see what the point is? >> >> * How do you think about to set these variables only after the initial >> check

Re: [media] winbond-cir: Move a variable assignment in wbcir_tx()

2016-10-19 Thread SF Markus Elfring
>> Move the assignment for the local variable "data" behind the source code >> for a memory allocation by this function. > > Sorry, I can't see what the point is? * How do you think about to avoid a variable assignment in case that this memory allocation failed anyhow? * Do you care for data

Re: [media] winbond-cir: Move a variable assignment in wbcir_tx()

2016-10-19 Thread SF Markus Elfring
>> * How do you think about to avoid a variable assignment in case >> that this memory allocation failed anyhow? > > There is no memory allocation that can fail at this point. Do you really know the failure probability for a call of the function "kmalloc" (within the function "wbcir_tx") under

Re: [media] winbond-cir: Move a variable assignment in two functions

2016-10-19 Thread SF Markus Elfring
>> Move the assignment for the local variable "data" behind the source code >> for condition checks by these functions. > > Why? * Would you like to set these variables only after the initial check succeeded? * Do you care for data access locality also in these cases? Regards, Markus -- To

Re: [media] winbond-cir: Move assignments for three variables in wbcir_shutdown()

2016-10-19 Thread SF Markus Elfring
>> Move the setting for the local variables "mask", "match" and "rc6_csl" >> behind the source code for a condition check by this function >> at the beginning. > > Again, I can't see what the point is? * How do you think about to set these variables only after the initial check succeded? *

Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection

2016-10-19 Thread SF Markus Elfring
+ /* Set CEIR_EN */ + wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, 0x01, 0x01); +set_irqmask: /* * ACPI will set the HW disable bit for SP3 which means that the * output signals are left in an undefined state which may cause @@ -876,6 +858,14 @@

Re: [PATCH] [media] DaVinci-VPFE-Capture: fix error handling

2016-11-23 Thread SF Markus Elfring
> A recent cleanup had the right idea to remove the initialization > of the error variable, but missed the actual benefit of that, > which is that we get warnings if there is a bug in it. > Now we get a warning about a bug that was introduced by this cleanup: > >

Re: [patch] [media] uvcvideo: freeing an error pointer

2016-11-25 Thread SF Markus Elfring
> A recent cleanup introduced a potential dereference of -EFAULT when we > call kfree(map->menu_info). > > Fixes: 4cc5bed1caeb ("[media] uvcvideo: Use memdup_user() rather than > duplicating its implementation") > Signed-off-by: Dan Carpenter Thanks for your

Re: [PATCH 3/3] [media] au0828-video: Move two assignments in au0828_init_isoc()

2016-11-03 Thread SF Markus Elfring
>> From: Markus Elfring >> Date: Mon, 24 Oct 2016 22:44:02 +0200 >> >> Move the assignment for the data structure members "isoc_copy" >> and "num_bufs" behind the source code for memory allocations >> by this function. > > I don't see the point, Another

Re: [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-11-03 Thread SF Markus Elfring
>> From: Markus Elfring >> Date: Wed, 12 Oct 2016 09:56:56 +0200 >> >> * A function was called over the pointer "setup_if_config" in the data >> structure "venc_platform_data". But the return value was not used so far. >> Thus assign it to the local variable

Re: [PATCH 17/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_enum_input()

2016-11-03 Thread SF Markus Elfring
>> @@ -1091,7 +1091,7 @@ static int vpfe_enum_input(struct file *file, void >> *priv, >> return -EINVAL; >> } >> sdinfo = _dev->cfg->sub_devs[subdev]; >> -memcpy(inp, >inputs[index], sizeof(struct v4l2_input)); >> +memcpy(inp, >inputs[index], sizeof(*inp)); > > If I am

[PATCH 16/18] [media] RedRat3: Move a variable assignment in redrat3_set_timeout()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 17:13:41 +0200 Move the assignment for the local variable "rr3" behind the source code for a memory allocation by this function. Signed-off-by: Markus Elfring ---

[PATCH 12/18] [media] RedRat3: Move a variable assignment in redrat3_init_rc_dev()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 14:50:05 +0200 Move the assignment for the local variable "prod" behind the source code for a memory allocation by this function. Signed-off-by: Markus Elfring ---

[PATCH 18/18] [media] RedRat3: Combine substrings for six messages

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 17:50:11 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: quoted string split across lines Thus fix the affected source code places. Signed-off-by: Markus Elfring

  1   2   3   4   5   6   >