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

2020-08-31 Thread Cengiz Can
allthrough' 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 | 1 - 1 file changed, 1 deletio

[PATCH] staging: atomisp: Fix fallthrough keyword warning

2020-08-31 Thread Cengiz Can
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 --git a/drivers/staging/media/atomisp/pci/atomisp_compa

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 aware

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 function

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

2020-08-01 Thread Cengiz Can
= 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 Reported-by: Coverity

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

2020-08-01 Thread Cengiz Can
= 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 Reported-by: Coverity

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

2020-08-01 Thread Cengiz Can
= 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 Reported-by: Coverity

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

2020-08-01 Thread Cengiz Can
= 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 Reported-by: Co

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

2020-07-30 Thread Cengiz Can
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(-) diff

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's

[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: Cengi