* [PATCH 0/3] Simplify NULL comparisons in staging/kpc2000
@ 2019-07-04 6:08 ` Simon Sandström
0 siblings, 0 replies; 8+ messages in thread
From: Simon Sandström @ 2019-07-04 6:08 UTC (permalink / raw)
To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström
Hi,
These patches simplifies a few comparisons to NULL ("foo == NULL" =>
"!foo") in staging/kpc2000, as reported by checkpatch.pl.
- Simon
Simon Sandström (3):
staging: kpc2000: simplify comparison to NULL in kpc2000_spi.c
staging: kpc2000: simplify comparison to NULL in dma.c
staging: kpc2000: simplify comparison to NULL in fileops.c
drivers/staging/kpc2000/kpc2000_spi.c | 4 ++--
drivers/staging/kpc2000/kpc_dma/dma.c | 4 ++--
drivers/staging/kpc2000/kpc_dma/fileops.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/3] Simplify NULL comparisons in staging/kpc2000
@ 2019-07-04 6:08 ` Simon Sandström
0 siblings, 0 replies; 8+ messages in thread
From: Simon Sandström @ 2019-07-04 6:08 UTC (permalink / raw)
To: gregkh; +Cc: devel, gneukum1, linux-kernel, Simon Sandström
Hi,
These patches simplifies a few comparisons to NULL ("foo == NULL" =>
"!foo") in staging/kpc2000, as reported by checkpatch.pl.
- Simon
Simon Sandström (3):
staging: kpc2000: simplify comparison to NULL in kpc2000_spi.c
staging: kpc2000: simplify comparison to NULL in dma.c
staging: kpc2000: simplify comparison to NULL in fileops.c
drivers/staging/kpc2000/kpc2000_spi.c | 4 ++--
drivers/staging/kpc2000/kpc_dma/dma.c | 4 ++--
drivers/staging/kpc2000/kpc_dma/fileops.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] staging: kpc2000: simplify comparison to NULL in kpc2000_spi.c
2019-07-04 6:08 ` Simon Sandström
@ 2019-07-04 6:08 ` Simon Sandström
-1 siblings, 0 replies; 8+ messages in thread
From: Simon Sandström @ 2019-07-04 6:08 UTC (permalink / raw)
To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström
Fixes checkpatch warning "Comparison to NULL could be written [...]".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
drivers/staging/kpc2000/kpc2000_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 009dec2f4641..35ac1d7070b3 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -436,7 +436,7 @@ kp_spi_probe(struct platform_device *pldev)
}
master = spi_alloc_master(&pldev->dev, sizeof(struct kp_spi));
- if (master == NULL) {
+ if (!master) {
dev_err(&pldev->dev, "%s: master allocation failed\n",
__func__);
return -ENOMEM;
@@ -460,7 +460,7 @@ kp_spi_probe(struct platform_device *pldev)
master->bus_num = pldev->id;
r = platform_get_resource(pldev, IORESOURCE_MEM, 0);
- if (r == NULL) {
+ if (!r) {
dev_err(&pldev->dev, "%s: Unable to get platform resources\n",
__func__);
status = -ENODEV;
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 1/3] staging: kpc2000: simplify comparison to NULL in kpc2000_spi.c
@ 2019-07-04 6:08 ` Simon Sandström
0 siblings, 0 replies; 8+ messages in thread
From: Simon Sandström @ 2019-07-04 6:08 UTC (permalink / raw)
To: gregkh; +Cc: devel, gneukum1, linux-kernel, Simon Sandström
Fixes checkpatch warning "Comparison to NULL could be written [...]".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
drivers/staging/kpc2000/kpc2000_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 009dec2f4641..35ac1d7070b3 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -436,7 +436,7 @@ kp_spi_probe(struct platform_device *pldev)
}
master = spi_alloc_master(&pldev->dev, sizeof(struct kp_spi));
- if (master == NULL) {
+ if (!master) {
dev_err(&pldev->dev, "%s: master allocation failed\n",
__func__);
return -ENOMEM;
@@ -460,7 +460,7 @@ kp_spi_probe(struct platform_device *pldev)
master->bus_num = pldev->id;
r = platform_get_resource(pldev, IORESOURCE_MEM, 0);
- if (r == NULL) {
+ if (!r) {
dev_err(&pldev->dev, "%s: Unable to get platform resources\n",
__func__);
status = -ENODEV;
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] staging: kpc2000: simplify comparison to NULL in dma.c
2019-07-04 6:08 ` Simon Sandström
@ 2019-07-04 6:08 ` Simon Sandström
-1 siblings, 0 replies; 8+ messages in thread
From: Simon Sandström @ 2019-07-04 6:08 UTC (permalink / raw)
To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström
Fixes checkpatch warning "Comparison to NULL could be written [...]".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
drivers/staging/kpc2000/kpc_dma/dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc_dma/dma.c b/drivers/staging/kpc2000/kpc_dma/dma.c
index 8092d0cf4a4a..51a4dd534a0d 100644
--- a/drivers/staging/kpc2000/kpc_dma/dma.c
+++ b/drivers/staging/kpc2000/kpc_dma/dma.c
@@ -119,7 +119,7 @@ int setup_dma_engine(struct kpc_dma_device *eng, u32 desc_cnt)
cur = eng->desc_pool_first;
for (i = 1 ; i < eng->desc_pool_cnt ; i++) {
next = dma_pool_alloc(eng->desc_pool, GFP_KERNEL | GFP_DMA, &next_handle);
- if (next == NULL)
+ if (!next)
goto done_alloc;
clear_desc(next);
@@ -245,7 +245,7 @@ int count_descriptors_available(struct kpc_dma_device *eng)
void clear_desc(struct kpc_dma_descriptor *desc)
{
- if (desc == NULL)
+ if (!desc)
return;
desc->DescByteCount = 0;
desc->DescStatusErrorFlags = 0;
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] staging: kpc2000: simplify comparison to NULL in dma.c
@ 2019-07-04 6:08 ` Simon Sandström
0 siblings, 0 replies; 8+ messages in thread
From: Simon Sandström @ 2019-07-04 6:08 UTC (permalink / raw)
To: gregkh; +Cc: devel, gneukum1, linux-kernel, Simon Sandström
Fixes checkpatch warning "Comparison to NULL could be written [...]".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
drivers/staging/kpc2000/kpc_dma/dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc_dma/dma.c b/drivers/staging/kpc2000/kpc_dma/dma.c
index 8092d0cf4a4a..51a4dd534a0d 100644
--- a/drivers/staging/kpc2000/kpc_dma/dma.c
+++ b/drivers/staging/kpc2000/kpc_dma/dma.c
@@ -119,7 +119,7 @@ int setup_dma_engine(struct kpc_dma_device *eng, u32 desc_cnt)
cur = eng->desc_pool_first;
for (i = 1 ; i < eng->desc_pool_cnt ; i++) {
next = dma_pool_alloc(eng->desc_pool, GFP_KERNEL | GFP_DMA, &next_handle);
- if (next == NULL)
+ if (!next)
goto done_alloc;
clear_desc(next);
@@ -245,7 +245,7 @@ int count_descriptors_available(struct kpc_dma_device *eng)
void clear_desc(struct kpc_dma_descriptor *desc)
{
- if (desc == NULL)
+ if (!desc)
return;
desc->DescByteCount = 0;
desc->DescStatusErrorFlags = 0;
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] staging: kpc2000: simplify comparison to NULL in fileops.c
2019-07-04 6:08 ` Simon Sandström
@ 2019-07-04 6:08 ` Simon Sandström
-1 siblings, 0 replies; 8+ messages in thread
From: Simon Sandström @ 2019-07-04 6:08 UTC (permalink / raw)
To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström
Fixes checkpatch warning "Comparison to NULL could be written [...]".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
drivers/staging/kpc2000/kpc_dma/fileops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c
index 7feb2fde0db2..48ca88bc6b0b 100644
--- a/drivers/staging/kpc2000/kpc_dma/fileops.c
+++ b/drivers/staging/kpc2000/kpc_dma/fileops.c
@@ -247,7 +247,7 @@ int kpc_dma_open(struct inode *inode, struct file *filp)
struct dev_private_data *priv;
struct kpc_dma_device *ldev = kpc_dma_lookup_device(iminor(inode));
- if (ldev == NULL)
+ if (!ldev)
return -ENODEV;
if (!atomic_dec_and_test(&ldev->open_count)) {
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] staging: kpc2000: simplify comparison to NULL in fileops.c
@ 2019-07-04 6:08 ` Simon Sandström
0 siblings, 0 replies; 8+ messages in thread
From: Simon Sandström @ 2019-07-04 6:08 UTC (permalink / raw)
To: gregkh; +Cc: devel, gneukum1, linux-kernel, Simon Sandström
Fixes checkpatch warning "Comparison to NULL could be written [...]".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
drivers/staging/kpc2000/kpc_dma/fileops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c
index 7feb2fde0db2..48ca88bc6b0b 100644
--- a/drivers/staging/kpc2000/kpc_dma/fileops.c
+++ b/drivers/staging/kpc2000/kpc_dma/fileops.c
@@ -247,7 +247,7 @@ int kpc_dma_open(struct inode *inode, struct file *filp)
struct dev_private_data *priv;
struct kpc_dma_device *ldev = kpc_dma_lookup_device(iminor(inode));
- if (ldev == NULL)
+ if (!ldev)
return -ENODEV;
if (!atomic_dec_and_test(&ldev->open_count)) {
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-07-04 6:08 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-04 6:08 [PATCH 0/3] Simplify NULL comparisons in staging/kpc2000 Simon Sandström
2019-07-04 6:08 ` Simon Sandström
2019-07-04 6:08 ` [PATCH 1/3] staging: kpc2000: simplify comparison to NULL in kpc2000_spi.c Simon Sandström
2019-07-04 6:08 ` Simon Sandström
2019-07-04 6:08 ` [PATCH 2/3] staging: kpc2000: simplify comparison to NULL in dma.c Simon Sandström
2019-07-04 6:08 ` Simon Sandström
2019-07-04 6:08 ` [PATCH 3/3] staging: kpc2000: simplify comparison to NULL in fileops.c Simon Sandström
2019-07-04 6:08 ` Simon Sandström
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.