* [PATCH] staging: media: atomisp: Remove unnecessary else after return
@ 2026-07-04 12:01 Dileep Sankhla
2026-07-04 13:45 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Dileep Sankhla @ 2026-07-04 12:01 UTC (permalink / raw)
To: andy, hansg, mchehab
Cc: sakari.ailus, gregkh, abdelrahmanfekry375, error27,
dileepsankhla.ds, linux-kernel, linux-media, linux-staging
Remove unnecessary else clause after return statement as the else branch
is not needed when the if branch always returns.
Signed-off-by: Dileep Sankhla <dileepsankhla.ds@gmail.com>
---
drivers/staging/media/atomisp/pci/hmm/hmm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm.c b/drivers/staging/media/atomisp/pci/hmm/hmm.c
index f998b57f90c4..6ff77e053d5d 100644
--- a/drivers/staging/media/atomisp/pci/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/hmm/hmm.c
@@ -235,9 +235,8 @@ static int load_and_flush(ia_css_ptr virt, void *data, unsigned int bytes)
vptr = hmm_bo_vmap(bo, true);
if (!vptr)
return load_and_flush_by_kmap(virt, data, bytes);
- else
- vptr = vptr + (virt - bo->start);
+ vptr = vptr + (virt - bo->start);
memcpy(data, vptr, bytes);
clflush_cache_range(vptr, bytes);
hmm_bo_vunmap(bo);
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: media: atomisp: Remove unnecessary else after return
2026-07-04 12:01 [PATCH] staging: media: atomisp: Remove unnecessary else after return Dileep Sankhla
@ 2026-07-04 13:45 ` Andy Shevchenko
2026-07-06 5:20 ` Dileep Sankhla
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2026-07-04 13:45 UTC (permalink / raw)
To: Dileep Sankhla
Cc: andy, hansg, mchehab, sakari.ailus, gregkh, abdelrahmanfekry375,
error27, linux-kernel, linux-media, linux-staging
On Sat, Jul 04, 2026 at 05:31:13PM +0530, Dileep Sankhla wrote:
> Remove unnecessary else clause after return statement as the else branch
> is not needed when the if branch always returns.
Is this the only place (of a such kind) that can be amended
in the entire driver?
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: media: atomisp: Remove unnecessary else after return
2026-07-04 13:45 ` Andy Shevchenko
@ 2026-07-06 5:20 ` Dileep Sankhla
2026-07-06 5:28 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Dileep Sankhla @ 2026-07-06 5:20 UTC (permalink / raw)
To: Andy Shevchenko
Cc: andy, hansg, mchehab, sakari.ailus, gregkh, abdelrahmanfekry375,
error27, linux-kernel, linux-media, linux-staging
On Sat, Jul 4, 2026 at 7:15 PM Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
> Is this the only place (of a such kind) that can be amended
> in the entire driver?
Hi Andy,
No. There are other places too. I performed a quick check:
$ for f in $(find drivers/staging/media/atomisp -type f -name "*.[ch]"); do
./scripts/checkpatch.pl --file --terse "$f" | grep -i "else is not
generally useful"
done
drivers/staging/media/atomisp/pci/sh_css_params.c:2337: WARNING: else
is not generally useful after a break or return
drivers/staging/media/atomisp/pci/sh_css_params.c:3198: WARNING: else
is not generally useful after a break or return
drivers/staging/media/atomisp/pci/sh_css_params.c:4112: WARNING: else
is not generally useful after a break or return
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:413:
WARNING: else is not generally useful after a break or return
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1176:
WARNING: else is not generally useful after a break or return
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1221:
WARNING: else is not generally useful after a break or return
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1278:
WARNING: else is not generally useful after a break or return
drivers/staging/media/atomisp/pci/atomisp_fops.c:128: WARNING: else is
not generally useful after a break or return
drivers/staging/media/atomisp/pci/atomisp_fops.c:168: WARNING: else is
not generally useful after a break or return
drivers/staging/media/atomisp/pci/atomisp_fops.c:209: WARNING: else is
not generally useful after a break or return
drivers/staging/media/atomisp/pci/atomisp_v4l2.c:471: WARNING: else is
not generally useful after a break or return
drivers/staging/media/atomisp/pci/sh_css.c:7722: WARNING: else is not
generally useful after a break or return
drivers/staging/media/atomisp/pci/sh_css_firmware.c:249: WARNING: else
is not generally useful after a break or return
drivers/staging/media/atomisp/pci/isp/kernels/ctc/ctc1_5/ia_css_ctc1_5.host.c:32:
WARNING: else is not generally useful after a break or return
In my patch, I am trying to address the warning only from a single
file. If you want, I could try to send a patch addressing all the
above warnings.
--
Best Regards,
Dileep Sankhla
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: media: atomisp: Remove unnecessary else after return
2026-07-06 5:20 ` Dileep Sankhla
@ 2026-07-06 5:28 ` Andy Shevchenko
2026-07-06 7:34 ` Dileep Sankhla
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2026-07-06 5:28 UTC (permalink / raw)
To: Dileep Sankhla
Cc: Andy Shevchenko, andy, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, error27, linux-kernel, linux-media,
linux-staging
On Mon, Jul 6, 2026 at 8:13 AM Dileep Sankhla
<dileepsankhla.ds@gmail.com> wrote:
> On Sat, Jul 4, 2026 at 7:15 PM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > Is this the only place (of a such kind) that can be amended
> > in the entire driver?
> No. There are other places too. I performed a quick check:
> In my patch, I am trying to address the warning only from a single
> file. If you want, I could try to send a patch addressing all the
> above warnings.
This is a huge driver and doing half-baked work doesn't make sense.
Also if you want to continue working on this driver, get the hardware.
Almost any cheap second-hand Bay Trail and Cherry Trail tablet should
suffice (of course one needs to check the specifications beforehand to
be sure it uses AtomISP camera).
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: media: atomisp: Remove unnecessary else after return
2026-07-06 5:28 ` Andy Shevchenko
@ 2026-07-06 7:34 ` Dileep Sankhla
2026-07-06 9:25 ` Andy Shevchenko
2026-07-06 10:50 ` Dileep Sankhla
0 siblings, 2 replies; 8+ messages in thread
From: Dileep Sankhla @ 2026-07-06 7:34 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Andy Shevchenko, andy, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, error27, linux-kernel, linux-media,
linux-staging
On Mon, Jul 6, 2026 at 10:58 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> This is a huge driver and doing half-baked work doesn't make sense.
I will try to send a patch addressing all the "else is not generally
useful after a break or return" warnings.
> Also if you want to continue working on this driver, get the hardware.
> Almost any cheap second-hand Bay Trail and Cherry Trail tablet should
> suffice (of course one needs to check the specifications beforehand to
> be sure it uses AtomISP camera).
Sorry I cannot get the hardware right now.
--
Best Regards,
Dileep Sankhla
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: media: atomisp: Remove unnecessary else after return
2026-07-06 7:34 ` Dileep Sankhla
@ 2026-07-06 9:25 ` Andy Shevchenko
2026-07-06 9:58 ` Dileep Sankhla
2026-07-06 10:50 ` Dileep Sankhla
1 sibling, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2026-07-06 9:25 UTC (permalink / raw)
To: Dileep Sankhla
Cc: Andy Shevchenko, andy, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, error27, linux-kernel, linux-media,
linux-staging
On Mon, Jul 6, 2026 at 10:26 AM Dileep Sankhla
<dileepsankhla.ds@gmail.com> wrote:
>
> On Mon, Jul 6, 2026 at 10:58 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > This is a huge driver and doing half-baked work doesn't make sense.
>
> I will try to send a patch addressing all the "else is not generally
> useful after a break or return" warnings.
>
> > Also if you want to continue working on this driver, get the hardware.
> > Almost any cheap second-hand Bay Trail and Cherry Trail tablet should
> > suffice (of course one needs to check the specifications beforehand to
> > be sure it uses AtomISP camera).
>
> Sorry I cannot get the hardware right now.
I see, but please consider that to have in the future. The driver has
tons of work needed to be done, but most of that needs real testing on
a real HW.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: media: atomisp: Remove unnecessary else after return
2026-07-06 9:25 ` Andy Shevchenko
@ 2026-07-06 9:58 ` Dileep Sankhla
0 siblings, 0 replies; 8+ messages in thread
From: Dileep Sankhla @ 2026-07-06 9:58 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Andy Shevchenko, andy, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, error27, linux-kernel, linux-media,
linux-staging
On Mon, Jul 6, 2026 at 2:55 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> I see, but please consider that to have in the future. The driver has
> tons of work needed to be done, but most of that needs real testing on
> a real HW.
Sure, I will try.
--
Best Regards,
Dileep Sankhla
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: media: atomisp: Remove unnecessary else after return
2026-07-06 7:34 ` Dileep Sankhla
2026-07-06 9:25 ` Andy Shevchenko
@ 2026-07-06 10:50 ` Dileep Sankhla
1 sibling, 0 replies; 8+ messages in thread
From: Dileep Sankhla @ 2026-07-06 10:50 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Andy Shevchenko, andy, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, error27, linux-kernel, linux-media,
linux-staging
On Mon, Jul 6, 2026 at 1:04 PM Dileep Sankhla
<dileepsankhla.ds@gmail.com> wrote:
> I will try to send a patch addressing all the "else is not generally
> useful after a break or return" warnings.
Hi Andy,
I have sent the patch for the same here:
https://lore.kernel.org/linux-media/20260706103810.71919-1-dileepsankhla.ds@gmail.com/T/#u
--
Best Regards,
Dileep Sankhla
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-07-06 10:42 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-04 12:01 [PATCH] staging: media: atomisp: Remove unnecessary else after return Dileep Sankhla
2026-07-04 13:45 ` Andy Shevchenko
2026-07-06 5:20 ` Dileep Sankhla
2026-07-06 5:28 ` Andy Shevchenko
2026-07-06 7:34 ` Dileep Sankhla
2026-07-06 9:25 ` Andy Shevchenko
2026-07-06 9:58 ` Dileep Sankhla
2026-07-06 10:50 ` Dileep Sankhla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox