[PATCH v2] staging: atomisp: Remove unnecessary 'fallthrough'

2020-08-31 Thread Cengiz Can
hat 'fallthrough' is unreachable due to the adjacent 'return false' statement. (Coverity ID CID 1466511) In order to fix the unreachable code warning, remove unnecessary fallthrough keyword. Signed-off-by: Cengiz Can --- drivers/staging/media/atomisp/pci/atomisp_compat_css20.c |

[PATCH] staging: atomisp: Fix fallthrough keyword warning

2020-08-31 Thread Cengiz Can
ning, make adjacent 'return false' a part of the previous if statement's else clause. Reported-by: Coverity Static Analyzer CID 1466511 Signed-off-by: Cengiz Can --- drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

Re: [PATCH v6] staging: atomisp: move null check to earlier point

2020-08-06 Thread Cengiz Can
On August 6, 2020 21:39:21 Greg KH wrote: On Thu, Aug 06, 2020 at 09:34:22PM +0300, Cengiz Can wrote: Hello Andy, Can I get some feedback on v6 please? It's been 4 days, in the middle of a merge window, please give people a chance to catch up on other things... I wasn't awa

Re: [PATCH v6] staging: atomisp: move null check to earlier point

2020-08-06 Thread Cengiz Can
Hello Andy, Can I get some feedback on v6 please? I hope it suits your standards this time. Thank you On August 2, 2020 01:02:22 Cengiz Can wrote: `find_gmin_subdev()` that returns a pointer to `struct gmin_subdev` can return NULL. In `gmin_v2p8_ctrl()` there's a call to this functio

[PATCH v6] staging: atomisp: move null check to earlier point

2020-08-01 Thread Cengiz Can
v *gs = find_gmin_subdev(subdev); /* v--Dereferenced here */ if (gs->v2p8_gpio >= 0) { ... } With this change we're null checking `find_gmin_subdev()` result and we return an error if that's the case. We also WARN() for the sake of debugging. Signed-off-by: Cengiz Can Reporte

[PATCH v5] staging: atomisp: move null check to earlier point

2020-08-01 Thread Cengiz Can
v *gs = find_gmin_subdev(subdev); /* v--Dereferenced here */ if (gs->v2p8_gpio >= 0) { ... } With this change we're null checking `find_gmin_subdev()` result and we return an error if that's the case. We also WARN() for the sake of debugging. Signed-off-by: Cengiz Can Reporte

[PATCHi v4] staging: atomisp: move null check to earlier point

2020-08-01 Thread Cengiz Can
v *gs = find_gmin_subdev(subdev); /* v--Dereferenced here */ if (gs->v2p8_gpio >= 0) { ... } With this change we're null checking `find_gmin_subdev()` result and we return an error if that's the case. We also WARN() for the sake of debugging. Signed-off-by: Cengiz Can Reporte

[PATCH v3] staging: atomisp: move null check to earlier point

2020-08-01 Thread Cengiz Can
v *gs = find_gmin_subdev(subdev); /* v--Dereferenced here */ if (gs->v2p8_gpio >= 0) { ... } With this change we're null checking `find_gmin_subdev()` result and return we return an error if that's the case. We also WARN() for the sake of debugging. Signed-off-by: Cengiz Can

[PATCH v2] staging: atomisp: move null check to earlier point

2020-07-30 Thread Cengiz Can
n result of `axp_regulator_set` or `gmin_i2c_write`. - return -EINVAL if unknown PMIC type. Caught-by: Coverity Static Analyzer CID 1465536 Signed-off-by: Cengiz Can --- drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) d

Re: [PATCH] staging: atomisp: move null check to earlier point

2020-07-30 Thread Cengiz Can
On July 30, 2020 11:48:06 Dan Carpenter wrote: On Wed, Jul 29, 2020 at 06:13:44PM +0300, Andy Shevchenko wrote: On Wed, Jul 29, 2020 at 5:00 PM Cengiz Can wrote: `find_gmin_subdev` function that returns a pointer to `struct gmin_subdev` can return NULL. In `gmin_v2p8_ctrl` there

[PATCH] staging: atomisp: move null check to earlier point

2020-07-29 Thread Cengiz Can
if (!ret) ret = gpio_direction_output(gs->v2p8_gpio, 0); if (ret) pr_err("V2P8 GPIO initialization failed\n"); } ``` I have moved the NULL check before deref point. Caught-by: Coverity Static Analyzer CID 1465536 Signed-off-by: