When a value has been tested for NULL in an expression, a
second NULL test on the same value in another expression
is unnecessary when the value has not been assigned NULL.
Remove unnecessary duplicate NULL tests on the same value that
has previously been NULL tested.
Found by Coccinelle
Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
---
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index e176483df301..0abac820299a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -1292,7 +1292,7 @@ static int gmin_get_config_dsm_var(struct device *dev,
* if it founds something different than string, letting it
* to fall back to the old code.
*/
- if (cur && cur->type != ACPI_TYPE_STRING) {
+ if (cur->type != ACPI_TYPE_STRING) {
dev_info(dev, "found non-string _DSM entry for '%s'\n", var);
ACPI_FREE(obj);
return -EINVAL;
--
2.34.1
On Thu, Apr 03, 2025 at 02:26:41PM +0100, Abraham Samuel Adekunle wrote: > When a value has been tested for NULL in an expression, a > second NULL test on the same value in another expression > is unnecessary when the value has not been assigned NULL. > > Remove unnecessary duplicate NULL tests on the same value that > has previously been NULL tested. > > Found by Coccinelle > > Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com> > --- > drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +- I can't take any drivers/staging/media/ changes for outreachy applications, sorry. That should have been in the instructions somewhere. thanks, greg k-h
Hi, On 3-Apr-25 3:54 PM, Greg KH wrote: > On Thu, Apr 03, 2025 at 02:26:41PM +0100, Abraham Samuel Adekunle wrote: >> When a value has been tested for NULL in an expression, a >> second NULL test on the same value in another expression >> is unnecessary when the value has not been assigned NULL. >> >> Remove unnecessary duplicate NULL tests on the same value that >> has previously been NULL tested. >> >> Found by Coccinelle >> >> Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com> >> --- >> drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +- > > I can't take any drivers/staging/media/ changes for outreachy > applications, sorry. That should have been in the instructions > somewhere. I don't know if this helps wrt outreachy but I can pick up this atomisp (and I plan to do so). Regards, Hans
On Thu, Apr 03, 2025 at 02:26:41PM +0100, Abraham Samuel Adekunle wrote: > When a value has been tested for NULL in an expression, a > second NULL test on the same value in another expression > is unnecessary when the value has not been assigned NULL. > > Remove unnecessary duplicate NULL tests on the same value that > has previously been NULL tested. > > Found by Coccinelle Missing period. And Subject should be as simple as "media: atomisp: Remove ..." ... Please, send this patch separately from the others. -- With Best Regards, Andy Shevchenko
On Thu, Apr 3, 2025 at 2:31 PM Andy Shevchenko <andy@kernel.org> wrote: > > On Thu, Apr 03, 2025 at 02:26:41PM +0100, Abraham Samuel Adekunle wrote: > > When a value has been tested for NULL in an expression, a > > second NULL test on the same value in another expression > > is unnecessary when the value has not been assigned NULL. > > > > Remove unnecessary duplicate NULL tests on the same value that > > has previously been NULL tested. > > > > Found by Coccinelle > > Missing period. And Subject should be as simple as > > "media: atomisp: Remove ..." > > ... > > Please, send this patch separately from the others. > > -- Thank you very much for your review Unfortunately I have been told I cannot work on the media driver as an outreachy applicant. I do appreciate your apparent reviews. I will Cc your email when I apply your review to my rtl8723bs driver patch of the patchset. Thanks Adekunle
© 2016 - 2025 Red Hat, Inc.