[PATCH v2] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke --- Changes in v2- Updated commit message and removed error message. drivers/platform/goldfish/goldfish_pipe.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..9f6734c 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,16 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); if (!aps) - return -1; + return -ENOMEM; - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH v2] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Changes in v2- Updated commit message and removed error message. drivers/platform/goldfish/goldfish_pipe.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..9f6734c 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,16 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); if (!aps) - return -1; + return -ENOMEM; - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke --- drivers/platform/goldfish/goldfish_pipe.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..49f877d 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,18 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); - if (!aps) - return -1; + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); + if (!aps) { + dev_err(>dev, "allocate buffer failed\n"); + return -ENOMEM; + } - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/platform/goldfish/goldfish_pipe.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..49f877d 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,18 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); - if (!aps) - return -1; + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); + if (!aps) { + dev_err(>dev, "allocate buffer failed\n"); + return -ENOMEM; + } - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke --- drivers/platform/goldfish/goldfish_pipe.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..4b0babb 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,16 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); if (!aps) - return -1; + return -ENOMEM; - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/platform/goldfish/goldfish_pipe.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..4b0babb 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,16 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); if (!aps) - return -1; + return -ENOMEM; - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH v3] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke --- Changes in v3- Both writel in the same style Changes in v2- Updated commit message, use upper_32_bits and lower_32_bits drivers/platform/goldfish/goldfish_pipe.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..9f6734c 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,16 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); if (!aps) - return -1; + return -ENOMEM; - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH v2] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke --- Changes in v2- Updated commit message, use upper_32_bits and lower_32_bits drivers/platform/goldfish/goldfish_pipe.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..c531a29 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,17 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); if (!aps) - return -1; + return -ENOMEM; - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
Function setup_access_params_addr is called only from probe function, hence managed version dmam_alloc_coherent is used. setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke --- drivers/platform/goldfish/goldfish_pipe.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..fb982ac 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,19 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); - if (!aps) - return -1; + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); + if (!aps) { + dev_err(>dev, "allocate buffer failed\n"); + return -ENOMEM; + } - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel((u32)((u64)dma_handle >> 32), dev->base + + PIPE_REG_PARAMS_ADDR_HIGH); + writel((u32)dma_handle, dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH v2] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Changes in v2- Updated commit message, use upper_32_bits and lower_32_bits drivers/platform/goldfish/goldfish_pipe.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..c531a29 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,17 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); if (!aps) - return -1; + return -ENOMEM; - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH v3] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Changes in v3- Both writel in the same style Changes in v2- Updated commit message, use upper_32_bits and lower_32_bits drivers/platform/goldfish/goldfish_pipe.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..9f6734c 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,16 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); if (!aps) - return -1; + return -ENOMEM; - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel(upper_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
[PATCH] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version
Function setup_access_params_addr is called only from probe function, hence managed version dmam_alloc_coherent is used. setup_access_params_addr has 2 goals- -Initialize the access_params field so that it can be used to send and read commands from the device in access_with_param -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/platform/goldfish/goldfish_pipe.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..fb982ac 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -57,6 +57,7 @@ #include #include #include +#include /* * IMPORTANT: The following constants must match the ones used and defined @@ -217,17 +218,19 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, static int setup_access_params_addr(struct platform_device *pdev, struct goldfish_pipe_dev *dev) { - u64 paddr; + dma_addr_t dma_handle; struct access_params *aps; - aps = devm_kzalloc(>dev, sizeof(struct access_params), GFP_KERNEL); - if (!aps) - return -1; + aps = dmam_alloc_coherent(>dev, sizeof(struct access_params), + _handle, GFP_KERNEL); + if (!aps) { + dev_err(>dev, "allocate buffer failed\n"); + return -ENOMEM; + } - /* FIXME */ - paddr = __pa(aps); - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); + writel((u32)((u64)dma_handle >> 32), dev->base + + PIPE_REG_PARAMS_ADDR_HIGH); + writel((u32)dma_handle, dev->base + PIPE_REG_PARAMS_ADDR_LOW); if (valid_batchbuffer_addr(dev, aps)) { dev->aps = aps; -- 2.1.4
Re: [PATCH] Staging: iio: meter: Use devm functions
On Sun, 4 Oct 2015, Jonathan Cameron wrote: On 04/10/15 05:34, Shraddha Barke wrote: Introduce use of managed resource function devm_iio_trigger_alloc instead of iio_trigger_alloc and devm_request_irq instead of request_irq Remove corresponding calls to iio_trigger_free and free_irq in the probe and remove functions. The now unnecessary labels error_free_trig and err_free_irq are dropped. Signed-off-by: Shraddha Barke --- drivers/staging/iio/meter/ade7758_trigger.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c index 5b35a7f..e313b37 100644 --- a/drivers/staging/iio/meter/ade7758_trigger.c +++ b/drivers/staging/iio/meter/ade7758_trigger.c @@ -63,21 +63,21 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) struct ade7758_state *st = iio_priv(indio_dev); int ret; - st->trig = iio_trigger_alloc("%s-dev%d", - spi_get_device_id(st->us)->name, - indio_dev->id); + st->trig = devm_iio_trigger_alloc(_dev->id, "%s-dev%d", + spi_get_device_id(st->us)->name, + indio_dev->id); if (!st->trig) { ret = -ENOMEM; goto error_ret; } - ret = request_irq(st->us->irq, - ade7758_data_rdy_trig_poll, - IRQF_TRIGGER_LOW, - spi_get_device_id(st->us)->name, - st->trig); + ret = devm_request_irq(_dev->dev, st->us->irq, + ade7758_data_rdy_trig_poll, + IRQF_TRIGGER_LOW, + spi_get_device_id(st->us)->name, + st->trig); if (ret) - goto error_free_trig; + goto error_ret st->trig->dev.parent = >us->dev; st->trig->ops = _trigger_ops; @@ -87,14 +87,10 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) /* select default trigger */ indio_dev->trig = iio_trigger_get(st->trig); if (ret) - goto error_free_irq; + goto error_ret; return 0; -error_free_irq: - free_irq(st->us->irq, st->trig); -error_free_trig: - iio_trigger_free(st->trig); error_ret: return ret; Whilst you are here, direct returns are preferred when there is no unwinding to do so if you could just return the error from anywhere it does the goto error_ret that would be great! I was a little skeptical about the change from request_irq to devm_request_irq because I'm not sure whether the things that are freed by the function are needed by the interrupt handler. Do you think it's correct? Shraddha Thanks, Jonathan } @@ -104,6 +100,4 @@ void ade7758_remove_trigger(struct iio_dev *indio_dev) struct ade7758_state *st = iio_priv(indio_dev); iio_trigger_unregister(st->trig); - free_irq(st->us->irq, st->trig); - iio_trigger_free(st->trig); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Staging: iio: meter: Use devm functions
On Sun, 4 Oct 2015, Jonathan Cameron wrote: On 04/10/15 05:34, Shraddha Barke wrote: Introduce use of managed resource function devm_iio_trigger_alloc instead of iio_trigger_alloc and devm_request_irq instead of request_irq Remove corresponding calls to iio_trigger_free and free_irq in the probe and remove functions. The now unnecessary labels error_free_trig and err_free_irq are dropped. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/iio/meter/ade7758_trigger.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c index 5b35a7f..e313b37 100644 --- a/drivers/staging/iio/meter/ade7758_trigger.c +++ b/drivers/staging/iio/meter/ade7758_trigger.c @@ -63,21 +63,21 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) struct ade7758_state *st = iio_priv(indio_dev); int ret; - st->trig = iio_trigger_alloc("%s-dev%d", - spi_get_device_id(st->us)->name, - indio_dev->id); + st->trig = devm_iio_trigger_alloc(_dev->id, "%s-dev%d", + spi_get_device_id(st->us)->name, + indio_dev->id); if (!st->trig) { ret = -ENOMEM; goto error_ret; } - ret = request_irq(st->us->irq, - ade7758_data_rdy_trig_poll, - IRQF_TRIGGER_LOW, - spi_get_device_id(st->us)->name, - st->trig); + ret = devm_request_irq(_dev->dev, st->us->irq, + ade7758_data_rdy_trig_poll, + IRQF_TRIGGER_LOW, + spi_get_device_id(st->us)->name, + st->trig); if (ret) - goto error_free_trig; + goto error_ret st->trig->dev.parent = >us->dev; st->trig->ops = _trigger_ops; @@ -87,14 +87,10 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) /* select default trigger */ indio_dev->trig = iio_trigger_get(st->trig); if (ret) - goto error_free_irq; + goto error_ret; return 0; -error_free_irq: - free_irq(st->us->irq, st->trig); -error_free_trig: - iio_trigger_free(st->trig); error_ret: return ret; Whilst you are here, direct returns are preferred when there is no unwinding to do so if you could just return the error from anywhere it does the goto error_ret that would be great! I was a little skeptical about the change from request_irq to devm_request_irq because I'm not sure whether the things that are freed by the function are needed by the interrupt handler. Do you think it's correct? Shraddha Thanks, Jonathan } @@ -104,6 +100,4 @@ void ade7758_remove_trigger(struct iio_dev *indio_dev) struct ade7758_state *st = iio_priv(indio_dev); iio_trigger_unregister(st->trig); - free_irq(st->us->irq, st->trig); - iio_trigger_free(st->trig); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: iio: meter: Use devm functions
Introduce use of managed resource function devm_iio_trigger_alloc instead of iio_trigger_alloc and devm_request_irq instead of request_irq Remove corresponding calls to iio_trigger_free and free_irq in the probe and remove functions. The now unnecessary labels error_free_trig and err_free_irq are dropped. Signed-off-by: Shraddha Barke --- drivers/staging/iio/meter/ade7758_trigger.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c index 5b35a7f..e313b37 100644 --- a/drivers/staging/iio/meter/ade7758_trigger.c +++ b/drivers/staging/iio/meter/ade7758_trigger.c @@ -63,21 +63,21 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) struct ade7758_state *st = iio_priv(indio_dev); int ret; - st->trig = iio_trigger_alloc("%s-dev%d", - spi_get_device_id(st->us)->name, - indio_dev->id); + st->trig = devm_iio_trigger_alloc(_dev->id, "%s-dev%d", + spi_get_device_id(st->us)->name, + indio_dev->id); if (!st->trig) { ret = -ENOMEM; goto error_ret; } - ret = request_irq(st->us->irq, - ade7758_data_rdy_trig_poll, - IRQF_TRIGGER_LOW, - spi_get_device_id(st->us)->name, - st->trig); + ret = devm_request_irq(_dev->dev, st->us->irq, + ade7758_data_rdy_trig_poll, + IRQF_TRIGGER_LOW, + spi_get_device_id(st->us)->name, + st->trig); if (ret) - goto error_free_trig; + goto error_ret st->trig->dev.parent = >us->dev; st->trig->ops = _trigger_ops; @@ -87,14 +87,10 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) /* select default trigger */ indio_dev->trig = iio_trigger_get(st->trig); if (ret) - goto error_free_irq; + goto error_ret; return 0; -error_free_irq: - free_irq(st->us->irq, st->trig); -error_free_trig: - iio_trigger_free(st->trig); error_ret: return ret; } @@ -104,6 +100,4 @@ void ade7758_remove_trigger(struct iio_dev *indio_dev) struct ade7758_state *st = iio_priv(indio_dev); iio_trigger_unregister(st->trig); - free_irq(st->us->irq, st->trig); - iio_trigger_free(st->trig); } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: iio: meter: Use devm functions
Introduce use of managed resource function devm_iio_trigger_alloc instead of iio_trigger_alloc and devm_request_irq instead of request_irq Remove corresponding calls to iio_trigger_free and free_irq in the probe and remove functions. The now unnecessary labels error_free_trig and err_free_irq are dropped. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/iio/meter/ade7758_trigger.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c index 5b35a7f..e313b37 100644 --- a/drivers/staging/iio/meter/ade7758_trigger.c +++ b/drivers/staging/iio/meter/ade7758_trigger.c @@ -63,21 +63,21 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) struct ade7758_state *st = iio_priv(indio_dev); int ret; - st->trig = iio_trigger_alloc("%s-dev%d", - spi_get_device_id(st->us)->name, - indio_dev->id); + st->trig = devm_iio_trigger_alloc(_dev->id, "%s-dev%d", + spi_get_device_id(st->us)->name, + indio_dev->id); if (!st->trig) { ret = -ENOMEM; goto error_ret; } - ret = request_irq(st->us->irq, - ade7758_data_rdy_trig_poll, - IRQF_TRIGGER_LOW, - spi_get_device_id(st->us)->name, - st->trig); + ret = devm_request_irq(_dev->dev, st->us->irq, + ade7758_data_rdy_trig_poll, + IRQF_TRIGGER_LOW, + spi_get_device_id(st->us)->name, + st->trig); if (ret) - goto error_free_trig; + goto error_ret st->trig->dev.parent = >us->dev; st->trig->ops = _trigger_ops; @@ -87,14 +87,10 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) /* select default trigger */ indio_dev->trig = iio_trigger_get(st->trig); if (ret) - goto error_free_irq; + goto error_ret; return 0; -error_free_irq: - free_irq(st->us->irq, st->trig); -error_free_trig: - iio_trigger_free(st->trig); error_ret: return ret; } @@ -104,6 +100,4 @@ void ade7758_remove_trigger(struct iio_dev *indio_dev) struct ade7758_state *st = iio_priv(indio_dev); iio_trigger_unregister(st->trig); - free_irq(st->us->irq, st->trig); - iio_trigger_free(st->trig); } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Clk: tegra: Use module_platform_driver
Use module_platform_driver for drivers whose init and exit functions only register and unregister, respectively. Coccinelle patch used- @a@ identifier f, x; @@ -static f(...) { return platform_driver_register(); } @b depends on a@ identifier e, a.x; @@ -static e(...) { platform_driver_unregister(); } @c depends on a && b@ identifier a.f; declarer name module_init; @@ -module_init(f); @d depends on a && b && c@ identifier b.e, a.x; declarer name module_exit; declarer name module_platform_driver; @@ -module_exit(e); +module_platform_driver(x); Signed-off-by: Shraddha Barke --- drivers/clk/tegra/clk-tegra124-dfll-fcpu.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c index 6125333..88b4ef4 100644 --- a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c +++ b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c @@ -147,18 +147,7 @@ static struct platform_driver tegra124_dfll_fcpu_driver = { .pm = _dfll_pm_ops, }, }; - -static int __init tegra124_dfll_fcpu_init(void) -{ - return platform_driver_register(_dfll_fcpu_driver); -} -module_init(tegra124_dfll_fcpu_init); - -static void __exit tegra124_dfll_fcpu_exit(void) -{ - platform_driver_unregister(_dfll_fcpu_driver); -} -module_exit(tegra124_dfll_fcpu_exit); +module_platform_driver(tegra124_dfll_fcpu_driver); MODULE_DESCRIPTION("Tegra124 DFLL clock source driver"); MODULE_LICENSE("GPL v2"); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Clk: tegra: Use module_platform_driver
Use module_platform_driver for drivers whose init and exit functions only register and unregister, respectively. Coccinelle patch used- @a@ identifier f, x; @@ -static f(...) { return platform_driver_register(); } @b depends on a@ identifier e, a.x; @@ -static e(...) { platform_driver_unregister(); } @c depends on a && b@ identifier a.f; declarer name module_init; @@ -module_init(f); @d depends on a && b && c@ identifier b.e, a.x; declarer name module_exit; declarer name module_platform_driver; @@ -module_exit(e); +module_platform_driver(x); Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/clk/tegra/clk-tegra124-dfll-fcpu.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c index 6125333..88b4ef4 100644 --- a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c +++ b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c @@ -147,18 +147,7 @@ static struct platform_driver tegra124_dfll_fcpu_driver = { .pm = _dfll_pm_ops, }, }; - -static int __init tegra124_dfll_fcpu_init(void) -{ - return platform_driver_register(_dfll_fcpu_driver); -} -module_init(tegra124_dfll_fcpu_init); - -static void __exit tegra124_dfll_fcpu_exit(void) -{ - platform_driver_unregister(_dfll_fcpu_driver); -} -module_exit(tegra124_dfll_fcpu_exit); +module_platform_driver(tegra124_dfll_fcpu_driver); MODULE_DESCRIPTION("Tegra124 DFLL clock source driver"); MODULE_LICENSE("GPL v2"); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Scsi: Use module_pci_driver
Use module_pci_driver for drivers whose init and exit functions only register and unregister Signed-off-by: Shraddha Barke --- drivers/scsi/initio.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 6a926ba..ea12a66 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2994,19 +2994,7 @@ static struct pci_driver initio_pci_driver = { .remove = initio_remove_one, }; -static int __init initio_init_driver(void) -{ - return pci_register_driver(_pci_driver); -} - -static void __exit initio_exit_driver(void) -{ - pci_unregister_driver(_pci_driver); -} - MODULE_DESCRIPTION("Initio INI-9X00U/UW SCSI device driver"); MODULE_AUTHOR("Initio Corporation"); MODULE_LICENSE("GPL"); - -module_init(initio_init_driver); -module_exit(initio_exit_driver); +module_pci_driver(initio_pci_driver); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] Staging: fbtft: Remove debug messages
Remove debug messages related to fbtft_par_dbg(DEBUG_INIT_DISPLAY.. ) as this info can be obtained using kernel function tracer Signed-off-by: Shraddha Barke --- Change in v2- No change. Resending due to malformed patch error drivers/staging/fbtft/fb_agm1264k-fl.c | 2 -- drivers/staging/fbtft/fb_bd663474.c| 4 drivers/staging/fbtft/fb_hx8347d.c | 4 drivers/staging/fbtft/fb_hx8353d.c | 6 -- drivers/staging/fbtft/fb_hx8357d.c | 4 drivers/staging/fbtft/fb_ili9163.c | 6 -- drivers/staging/fbtft/fb_ili9320.c | 6 -- drivers/staging/fbtft/fb_ili9325.c | 6 -- drivers/staging/fbtft/fb_ili9340.c | 4 drivers/staging/fbtft/fb_ili9341.c | 6 -- drivers/staging/fbtft/fb_ili9481.c | 2 -- drivers/staging/fbtft/fb_ili9486.c | 2 -- drivers/staging/fbtft/fb_pcd8544.c | 4 drivers/staging/fbtft/fb_s6d02a1.c | 2 -- drivers/staging/fbtft/fb_s6d1121.c | 6 -- drivers/staging/fbtft/fb_ssd1289.c | 6 -- drivers/staging/fbtft/fb_ssd1306.c | 4 drivers/staging/fbtft/fb_ssd1331.c | 4 drivers/staging/fbtft/fb_ssd1351.c | 6 -- drivers/staging/fbtft/fb_st7735r.c | 4 drivers/staging/fbtft/fb_tinylcd.c | 4 drivers/staging/fbtft/fb_tls8204.c | 4 drivers/staging/fbtft/fb_uc1611.c | 4 drivers/staging/fbtft/fb_uc1701.c | 2 -- drivers/staging/fbtft/fb_upd161704.c | 4 drivers/staging/fbtft/fb_watterott.c | 4 drivers/staging/fbtft/fbtft-core.c | 4 27 files changed, 114 deletions(-) diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 8eb5e69..2a2d53c 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -74,8 +74,6 @@ static int init_display(struct fbtft_par *par) { u8 i; - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - par->fbtftops.reset(par); for (i = 0; i < 2; ++i) { diff --git a/drivers/staging/fbtft/fb_bd663474.c b/drivers/staging/fbtft/fb_bd663474.c index ea013e9..6010e6c 100644 --- a/drivers/staging/fbtft/fb_bd663474.c +++ b/drivers/staging/fbtft/fb_bd663474.c @@ -33,8 +33,6 @@ static int init_display(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - if (par->gpio.cs != -1) gpio_set_value(par->gpio.cs, 0); /* Activate chip */ @@ -143,8 +141,6 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) static int set_var(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - switch (par->info->var.rotate) { /* AM: GRAM update direction */ case 0: diff --git a/drivers/staging/fbtft/fb_hx8347d.c b/drivers/staging/fbtft/fb_hx8347d.c index 8b3ee24..6ff76e5 100644 --- a/drivers/staging/fbtft/fb_hx8347d.c +++ b/drivers/staging/fbtft/fb_hx8347d.c @@ -31,8 +31,6 @@ static int init_display(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - par->fbtftops.reset(par); /* driving ability */ @@ -113,8 +111,6 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves) int i, j; int acc = 0; - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - /* apply mask */ for (i = 0; i < par->gamma.num_curves; i++) for (j = 0; j < par->gamma.num_values; j++) { diff --git a/drivers/staging/fbtft/fb_hx8353d.c b/drivers/staging/fbtft/fb_hx8353d.c index b36f6e1..8552411 100644 --- a/drivers/staging/fbtft/fb_hx8353d.c +++ b/drivers/staging/fbtft/fb_hx8353d.c @@ -28,8 +28,6 @@ static int init_display(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - par->fbtftops.reset(par); mdelay(150); @@ -89,8 +87,6 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) #define mv BIT(5) static int set_var(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - /* madctl - memory data access control rgb/bgr: 1. mode selection pin srgb @@ -120,8 +116,6 @@ static int set_var(struct fbtft_par *par) */ static int set_gamma(struct fbtft_par *par, unsigned long *curves) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - write_reg(par, 0xE0, curves[0], curves[1], curves[2], curves[3], curves[4], curves[5], curves[6], curves[7], diff --git a/drivers/staging/fbtft/fb_hx8357d.c b/drivers/staging/fbtft/fb_hx8357d.c index 3a28a36..a381dbc 100644 --- a/drivers/staging/fbtft/fb_hx8357d.c +++ b/drivers/staging/fbtft/fb_hx8357d.c @@ -32,8 +32,6 @@ static int init
[PATCH] Scsi: Use module_pci_driver
Use module_pci_driver for drivers whose init and exit functions only register and unregister Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/scsi/initio.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 6a926ba..ea12a66 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2994,19 +2994,7 @@ static struct pci_driver initio_pci_driver = { .remove = initio_remove_one, }; -static int __init initio_init_driver(void) -{ - return pci_register_driver(_pci_driver); -} - -static void __exit initio_exit_driver(void) -{ - pci_unregister_driver(_pci_driver); -} - MODULE_DESCRIPTION("Initio INI-9X00U/UW SCSI device driver"); MODULE_AUTHOR("Initio Corporation"); MODULE_LICENSE("GPL"); - -module_init(initio_init_driver); -module_exit(initio_exit_driver); +module_pci_driver(initio_pci_driver); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] Staging: fbtft: Remove debug messages
Remove debug messages related to fbtft_par_dbg(DEBUG_INIT_DISPLAY.. ) as this info can be obtained using kernel function tracer Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Change in v2- No change. Resending due to malformed patch error drivers/staging/fbtft/fb_agm1264k-fl.c | 2 -- drivers/staging/fbtft/fb_bd663474.c| 4 drivers/staging/fbtft/fb_hx8347d.c | 4 drivers/staging/fbtft/fb_hx8353d.c | 6 -- drivers/staging/fbtft/fb_hx8357d.c | 4 drivers/staging/fbtft/fb_ili9163.c | 6 -- drivers/staging/fbtft/fb_ili9320.c | 6 -- drivers/staging/fbtft/fb_ili9325.c | 6 -- drivers/staging/fbtft/fb_ili9340.c | 4 drivers/staging/fbtft/fb_ili9341.c | 6 -- drivers/staging/fbtft/fb_ili9481.c | 2 -- drivers/staging/fbtft/fb_ili9486.c | 2 -- drivers/staging/fbtft/fb_pcd8544.c | 4 drivers/staging/fbtft/fb_s6d02a1.c | 2 -- drivers/staging/fbtft/fb_s6d1121.c | 6 -- drivers/staging/fbtft/fb_ssd1289.c | 6 -- drivers/staging/fbtft/fb_ssd1306.c | 4 drivers/staging/fbtft/fb_ssd1331.c | 4 drivers/staging/fbtft/fb_ssd1351.c | 6 -- drivers/staging/fbtft/fb_st7735r.c | 4 drivers/staging/fbtft/fb_tinylcd.c | 4 drivers/staging/fbtft/fb_tls8204.c | 4 drivers/staging/fbtft/fb_uc1611.c | 4 drivers/staging/fbtft/fb_uc1701.c | 2 -- drivers/staging/fbtft/fb_upd161704.c | 4 drivers/staging/fbtft/fb_watterott.c | 4 drivers/staging/fbtft/fbtft-core.c | 4 27 files changed, 114 deletions(-) diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 8eb5e69..2a2d53c 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -74,8 +74,6 @@ static int init_display(struct fbtft_par *par) { u8 i; - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - par->fbtftops.reset(par); for (i = 0; i < 2; ++i) { diff --git a/drivers/staging/fbtft/fb_bd663474.c b/drivers/staging/fbtft/fb_bd663474.c index ea013e9..6010e6c 100644 --- a/drivers/staging/fbtft/fb_bd663474.c +++ b/drivers/staging/fbtft/fb_bd663474.c @@ -33,8 +33,6 @@ static int init_display(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - if (par->gpio.cs != -1) gpio_set_value(par->gpio.cs, 0); /* Activate chip */ @@ -143,8 +141,6 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) static int set_var(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - switch (par->info->var.rotate) { /* AM: GRAM update direction */ case 0: diff --git a/drivers/staging/fbtft/fb_hx8347d.c b/drivers/staging/fbtft/fb_hx8347d.c index 8b3ee24..6ff76e5 100644 --- a/drivers/staging/fbtft/fb_hx8347d.c +++ b/drivers/staging/fbtft/fb_hx8347d.c @@ -31,8 +31,6 @@ static int init_display(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - par->fbtftops.reset(par); /* driving ability */ @@ -113,8 +111,6 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves) int i, j; int acc = 0; - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - /* apply mask */ for (i = 0; i < par->gamma.num_curves; i++) for (j = 0; j < par->gamma.num_values; j++) { diff --git a/drivers/staging/fbtft/fb_hx8353d.c b/drivers/staging/fbtft/fb_hx8353d.c index b36f6e1..8552411 100644 --- a/drivers/staging/fbtft/fb_hx8353d.c +++ b/drivers/staging/fbtft/fb_hx8353d.c @@ -28,8 +28,6 @@ static int init_display(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - par->fbtftops.reset(par); mdelay(150); @@ -89,8 +87,6 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) #define mv BIT(5) static int set_var(struct fbtft_par *par) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - /* madctl - memory data access control rgb/bgr: 1. mode selection pin srgb @@ -120,8 +116,6 @@ static int set_var(struct fbtft_par *par) */ static int set_gamma(struct fbtft_par *par, unsigned long *curves) { - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); - write_reg(par, 0xE0, curves[0], curves[1], curves[2], curves[3], curves[4], curves[5], curves[6], curves[7], diff --git a/drivers/staging/fbtft/fb_hx8357d.c b/drivers/staging/fbtft/fb_hx8357d.c index 3a28a36..a381dbc 100644 --- a/drivers/staging/fbtft/fb_hx8357d.c +++ b/drivers/staging/fbtft/fb_hx8357d.c @@ -32,8 +32,6
[PATCH] Staging: ft1000: use usleep_range()
This patch fixes checkpatch.pl warning WARNING : msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt Signed-off-by: Shraddha Barke --- drivers/staging/ft1000/ft1000-usb/ft1000_download.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index 297b7ae..cf85021 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -131,7 +131,7 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) break; } loopcnt++; - msleep(10); + usleep_range(1, 11000); } @@ -142,7 +142,7 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) pr_debug("Doorbell = 0x%x\n", temp); if (temp & 0x8000) { loopcnt++; - msleep(10); + usleep_range(1, 11000); } else { pr_debug("door bell is cleared, return 0\n"); return 0; @@ -191,7 +191,7 @@ static u16 get_handshake(struct ft1000_usb *ft1000dev, u16 expected_value) return handshake; } loopcnt++; - msleep(10); + usleep_range(1, 11000); } return HANDSHAKE_TIMEOUT_VALUE; @@ -254,7 +254,7 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value) } loopcnt++; - msleep(10); + usleep_range(1, 11000); handshake = ntohs(handshake); if ((handshake == expected_value) || (handshake == HANDSHAKE_RESET_VALUE_USB)) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 3/3] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Signed-off-by: Shraddha Barke --- Changes in v4- Remove unnecessary parenthesis drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 9dfe583..3952df3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -269,7 +269,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -898,7 +898,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif @@ -915,13 +915,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) u8 mstatus; - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) + if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || + check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) return; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ LPS_Leave(padapter); } @@ -1373,7 +1373,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * spin_lock_bh(>lock); - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) + if (check_fwstate(pmlmepriv, WIFI_MP_STATE) && check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_LINKED); diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..bc1bfb9 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter) mod_timer(>assoc_timer, jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock; @@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); @@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter); -
[PATCH v4 2/3] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Signed-off-by: Shraddha Barke --- Change in v4- No changes drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..c8e69ff 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (!priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Signed-off-by: Shraddha Barke --- Changes in v4- No change drivers/staging/rtl8723au/core/rtw_ap.c | 10 +- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 28 +-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index b96e7b6..7f46b7a 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ @@ -662,7 +662,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) update_hw_ht_param(padapter); } - if (pmlmepriv->cur_network.join_res != true) { + if (!pmlmepriv->cur_network.join_res) { /* setting only at first time */ /* WEP Key will be set before this function, do not clear CAM. */ if (psecuritypriv->dot11PrivacyAlgrthm != @@ -1370,7 +1370,7 @@ static int rtw_ht_operation_update(struct rtw_adapter *padapter) void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated) { /* update associated stations cap. */ - if (updated == true) { + if (updated) { struct list_head *phead, *plist, *ptmp; struct sta_info *psta; struct sta_priv *pstapriv = >stapriv; @@ -1882,7 +1882,7 @@ void stop_ap_mode23a(struct rtw_adapter *padapter) list_for_each_safe(plist, ptmp, phead) { paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - if (paclnode->valid == true) { + if (paclnode->valid) { paclnode->valid = false; list_del_init(>list); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..65ef4a4 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -602,7 +602,7 @@ void free_mlme_ext_priv23a (struct mlme_ext_priv *pmlmeext) if (!padapter) return; - if (padapter->bDriverStopped == true) { + if (padapter->bDriverStopped) { del_timer_sync(>survey_timer); del_timer_sync(>link_timer); /* del_timer_sync(>ADDBA_timer); */ @@ -959,7 +959,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) goto auth_fail; } - if (rtw_access_ctrl23a(padapter, sa) == false) { + if (!rtw_access_ctrl23a(padapter, sa)) { status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } @@ -2049,7 +2049,7 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter, sizeof(struct ADDBA_request)); process_addba_req23a(padapter, (u8 *)>ADDBA_req, addr); - if (pmlmeinfo->bAcceptAddbaReq == true) + if (pmlmeinfo->bAcceptAddbaReq) issue_action_BA23a(padapter, addr, WLAN_ACTION_ADDBA_RESP, 0); else { @@ -2253,8 +2253,8 @@ void update_mgntframe_attrib23a(struct rtw_adapter *padapter, void dump_mgntframe23a(struct rtw_adapter *padapter, struct xmit_frame *pmgntframe) { - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (padapter->bSurpriseRemoved || + padapter->bDriverStopped) return; rtl8723au_mgnt_xmit(padapter, pmgntframe); @@ -2269,8 +2269,8 @@ int dump_mgntframe23a_and_wait(struct rtw_adapter *padapter, struct xmit_buf *pxmitbuf = pmgntframe->pxmitbuf; struct submit_ctx sctx; - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (padapter->bSurpriseRemoved || + padapter->bDriverStopped) return ret; rtw_sctx_init23a(, timeou
[PATCH v4 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Changes in v4- No change Signed-off-by: Shraddha Barke --- drivers/staging/rtl8723au/core/rtw_ap.c | 10 +- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 28 +-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index b96e7b6..7f46b7a 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ @@ -662,7 +662,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) update_hw_ht_param(padapter); } - if (pmlmepriv->cur_network.join_res != true) { + if (!pmlmepriv->cur_network.join_res) { /* setting only at first time */ /* WEP Key will be set before this function, do not clear CAM. */ if (psecuritypriv->dot11PrivacyAlgrthm != @@ -1370,7 +1370,7 @@ static int rtw_ht_operation_update(struct rtw_adapter *padapter) void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated) { /* update associated stations cap. */ - if (updated == true) { + if (updated) { struct list_head *phead, *plist, *ptmp; struct sta_info *psta; struct sta_priv *pstapriv = >stapriv; @@ -1882,7 +1882,7 @@ void stop_ap_mode23a(struct rtw_adapter *padapter) list_for_each_safe(plist, ptmp, phead) { paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - if (paclnode->valid == true) { + if (paclnode->valid) { paclnode->valid = false; list_del_init(>list); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..65ef4a4 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -602,7 +602,7 @@ void free_mlme_ext_priv23a (struct mlme_ext_priv *pmlmeext) if (!padapter) return; - if (padapter->bDriverStopped == true) { + if (padapter->bDriverStopped) { del_timer_sync(>survey_timer); del_timer_sync(>link_timer); /* del_timer_sync(>ADDBA_timer); */ @@ -959,7 +959,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) goto auth_fail; } - if (rtw_access_ctrl23a(padapter, sa) == false) { + if (!rtw_access_ctrl23a(padapter, sa)) { status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } @@ -2049,7 +2049,7 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter, sizeof(struct ADDBA_request)); process_addba_req23a(padapter, (u8 *)>ADDBA_req, addr); - if (pmlmeinfo->bAcceptAddbaReq == true) + if (pmlmeinfo->bAcceptAddbaReq) issue_action_BA23a(padapter, addr, WLAN_ACTION_ADDBA_RESP, 0); else { @@ -2253,8 +2253,8 @@ void update_mgntframe_attrib23a(struct rtw_adapter *padapter, void dump_mgntframe23a(struct rtw_adapter *padapter, struct xmit_frame *pmgntframe) { - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (padapter->bSurpriseRemoved || + padapter->bDriverStopped) return; rtl8723au_mgnt_xmit(padapter, pmgntframe); @@ -2269,8 +2269,8 @@ int dump_mgntframe23a_and_wait(struct rtw_adapter *padapter, struct xmit_buf *pxmitbuf = pmgntframe->pxmitbuf; struct submit_ctx sctx; - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (padapter->bSurpriseRemoved || + padapter->bDriverStopped) return ret; rtw_sctx_init23a(, timeout_ms); @@ -
[PATCH v4 3/3] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Changes in v4- Remove unnecessary braces Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 9dfe583..3952df3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -269,7 +269,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -898,7 +898,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif @@ -915,13 +915,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) u8 mstatus; - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) + if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || + check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) return; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ LPS_Leave(padapter); } @@ -1373,7 +1373,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * spin_lock_bh(>lock); - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) + if (check_fwstate(pmlmepriv, WIFI_MP_STATE) && check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_LINKED); diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..bc1bfb9 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter) mod_timer(>assoc_timer, jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock; @@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); @@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter); -
[PATCH v4 2/3] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Change in v4- No changes Signed-off-by: Shraddha Barke --- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..c8e69ff 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (!priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Changes in v4- No change Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8723au/core/rtw_ap.c | 10 +- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 28 +-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index b96e7b6..7f46b7a 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ @@ -662,7 +662,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) update_hw_ht_param(padapter); } - if (pmlmepriv->cur_network.join_res != true) { + if (!pmlmepriv->cur_network.join_res) { /* setting only at first time */ /* WEP Key will be set before this function, do not clear CAM. */ if (psecuritypriv->dot11PrivacyAlgrthm != @@ -1370,7 +1370,7 @@ static int rtw_ht_operation_update(struct rtw_adapter *padapter) void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated) { /* update associated stations cap. */ - if (updated == true) { + if (updated) { struct list_head *phead, *plist, *ptmp; struct sta_info *psta; struct sta_priv *pstapriv = >stapriv; @@ -1882,7 +1882,7 @@ void stop_ap_mode23a(struct rtw_adapter *padapter) list_for_each_safe(plist, ptmp, phead) { paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - if (paclnode->valid == true) { + if (paclnode->valid) { paclnode->valid = false; list_del_init(>list); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..65ef4a4 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -602,7 +602,7 @@ void free_mlme_ext_priv23a (struct mlme_ext_priv *pmlmeext) if (!padapter) return; - if (padapter->bDriverStopped == true) { + if (padapter->bDriverStopped) { del_timer_sync(>survey_timer); del_timer_sync(>link_timer); /* del_timer_sync(>ADDBA_timer); */ @@ -959,7 +959,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) goto auth_fail; } - if (rtw_access_ctrl23a(padapter, sa) == false) { + if (!rtw_access_ctrl23a(padapter, sa)) { status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } @@ -2049,7 +2049,7 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter, sizeof(struct ADDBA_request)); process_addba_req23a(padapter, (u8 *)>ADDBA_req, addr); - if (pmlmeinfo->bAcceptAddbaReq == true) + if (pmlmeinfo->bAcceptAddbaReq) issue_action_BA23a(padapter, addr, WLAN_ACTION_ADDBA_RESP, 0); else { @@ -2253,8 +2253,8 @@ void update_mgntframe_attrib23a(struct rtw_adapter *padapter, void dump_mgntframe23a(struct rtw_adapter *padapter, struct xmit_frame *pmgntframe) { - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (padapter->bSurpriseRemoved || + padapter->bDriverStopped) return; rtl8723au_mgnt_xmit(padapter, pmgntframe); @@ -2269,8 +2269,8 @@ int dump_mgntframe23a_and_wait(struct rtw_adapter *padapter, struct xmit_buf *pxmitbuf = pmgntframe->pxmitbuf; struct submit_ctx sctx; - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (padapter->bSurpriseRemoved || + padapter->bDriverStopped) return ret;
[PATCH v4 3/3] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Changes in v4- Remove unnecessary braces Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 9dfe583..3952df3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -269,7 +269,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -898,7 +898,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif @@ -915,13 +915,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) u8 mstatus; - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) + if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || + check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) return; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ LPS_Leave(padapter); } @@ -1373,7 +1373,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * spin_lock_bh(>lock); - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) + if (check_fwstate(pmlmepriv, WIFI_MP_STATE) && check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_LINKED); diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..bc1bfb9 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter) mod_timer(>assoc_timer, jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock; @@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); @@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_asso
[PATCH v4 2/3] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Change in v4- No changes Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..c8e69ff 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (!priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Changes in v4- No change drivers/staging/rtl8723au/core/rtw_ap.c | 10 +- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 28 +-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index b96e7b6..7f46b7a 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ @@ -662,7 +662,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) update_hw_ht_param(padapter); } - if (pmlmepriv->cur_network.join_res != true) { + if (!pmlmepriv->cur_network.join_res) { /* setting only at first time */ /* WEP Key will be set before this function, do not clear CAM. */ if (psecuritypriv->dot11PrivacyAlgrthm != @@ -1370,7 +1370,7 @@ static int rtw_ht_operation_update(struct rtw_adapter *padapter) void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated) { /* update associated stations cap. */ - if (updated == true) { + if (updated) { struct list_head *phead, *plist, *ptmp; struct sta_info *psta; struct sta_priv *pstapriv = >stapriv; @@ -1882,7 +1882,7 @@ void stop_ap_mode23a(struct rtw_adapter *padapter) list_for_each_safe(plist, ptmp, phead) { paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - if (paclnode->valid == true) { + if (paclnode->valid) { paclnode->valid = false; list_del_init(>list); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..65ef4a4 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -602,7 +602,7 @@ void free_mlme_ext_priv23a (struct mlme_ext_priv *pmlmeext) if (!padapter) return; - if (padapter->bDriverStopped == true) { + if (padapter->bDriverStopped) { del_timer_sync(>survey_timer); del_timer_sync(>link_timer); /* del_timer_sync(>ADDBA_timer); */ @@ -959,7 +959,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) goto auth_fail; } - if (rtw_access_ctrl23a(padapter, sa) == false) { + if (!rtw_access_ctrl23a(padapter, sa)) { status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } @@ -2049,7 +2049,7 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter, sizeof(struct ADDBA_request)); process_addba_req23a(padapter, (u8 *)>ADDBA_req, addr); - if (pmlmeinfo->bAcceptAddbaReq == true) + if (pmlmeinfo->bAcceptAddbaReq) issue_action_BA23a(padapter, addr, WLAN_ACTION_ADDBA_RESP, 0); else { @@ -2253,8 +2253,8 @@ void update_mgntframe_attrib23a(struct rtw_adapter *padapter, void dump_mgntframe23a(struct rtw_adapter *padapter, struct xmit_frame *pmgntframe) { - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (padapter->bSurpriseRemoved || + padapter->bDriverStopped) return; rtl8723au_mgnt_xmit(padapter, pmgntframe); @@ -2269,8 +2269,8 @@ int dump_mgntframe23a_and_wait(struct rtw_adapter *padapter, struct xmit_buf *pxmitbuf = pmgntframe->pxmitbuf; struct submit_ctx sctx; - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (padapter->bSurpriseRemoved || + padapter->bDriverStopped) return ret;
[PATCH v4 3/3] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Changes in v4- Remove unnecessary parenthesis drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 9dfe583..3952df3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -269,7 +269,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -898,7 +898,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif @@ -915,13 +915,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) u8 mstatus; - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) + if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || + check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) return; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ LPS_Leave(padapter); } @@ -1373,7 +1373,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * spin_lock_bh(>lock); - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) + if (check_fwstate(pmlmepriv, WIFI_MP_STATE) && check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_LINKED); diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..bc1bfb9 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter) mod_timer(>assoc_timer, jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock; @@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); @@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_asso
[PATCH v4 2/3] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Change in v4- No changes drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..c8e69ff 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (!priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: ft1000: use usleep_range()
This patch fixes checkpatch.pl warning WARNING : msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/ft1000/ft1000-usb/ft1000_download.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index 297b7ae..cf85021 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -131,7 +131,7 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) break; } loopcnt++; - msleep(10); + usleep_range(1, 11000); } @@ -142,7 +142,7 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) pr_debug("Doorbell = 0x%x\n", temp); if (temp & 0x8000) { loopcnt++; - msleep(10); + usleep_range(1, 11000); } else { pr_debug("door bell is cleared, return 0\n"); return 0; @@ -191,7 +191,7 @@ static u16 get_handshake(struct ft1000_usb *ft1000dev, u16 expected_value) return handshake; } loopcnt++; - msleep(10); + usleep_range(1, 11000); } return HANDSHAKE_TIMEOUT_VALUE; @@ -254,7 +254,7 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value) } loopcnt++; - msleep(10); + usleep_range(1, 11000); handshake = ntohs(handshake); if ((handshake == expected_value) || (handshake == HANDSHAKE_RESET_VALUE_USB)) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: rtl8192u: Remove unnecessary printk
This patch removes the commented printk inside else block as it is not needed. Signed-off-by: Shraddha Barke --- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 051ec8c..7656e56 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -277,7 +277,6 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee printk("%s():insert to waitqueue!\n",__func__); skb_queue_tail(>skb_waitQ[tcb_desc->queue_index], skb); } else { - //printk("TX packet!\n"); ieee->softmac_hard_start_xmit(skb, ieee->dev); //dev_kfree_skb_any(skb);//edit by thomas } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 3/3] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Changes in v3- Fix made manually Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 001a2f3..591ac5d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif @@ -920,13 +920,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) u8 mstatus; - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) return; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ LPS_Leave(padapter); } @@ -1384,7 +1384,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * spin_lock_bh(>lock); - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) + if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_LINKED); diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..64bfefc 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter) mod_timer(>assoc_timer, jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock; @@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); @@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter); -
[PATCH v3 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Changes in v3- Made fix manually Signed-off-by: Shraddha Barke --- drivers/staging/rtl8723au/core/rtw_ap.c | 13 ++--- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 28 +-- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 65b209a..b6bfbbf 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ @@ -662,7 +662,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) update_hw_ht_param(padapter); } - if (pmlmepriv->cur_network.join_res != true) { + if (!pmlmepriv->cur_network.join_res) { /* setting only at first time */ /* WEP Key will be set before this function, do not clear CAM. */ if (psecuritypriv->dot11PrivacyAlgrthm != @@ -1061,7 +1061,7 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { - if (paclnode->valid == true) { + if (paclnode->valid) { added = true; DBG_8723A("%s, sta has been added\n", __func__); break; @@ -1370,7 +1370,7 @@ static int rtw_ht_operation_update(struct rtw_adapter *padapter) void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated) { /* update associated stations cap. */ - if (updated == true) { + if (updated) { struct list_head *phead, *plist, *ptmp; struct sta_info *psta; struct sta_priv *pstapriv = >stapriv; @@ -1882,9 +1882,8 @@ void stop_ap_mode23a(struct rtw_adapter *padapter) list_for_each_safe(plist, ptmp, phead) { paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - if (paclnode->valid == true) { + if (paclnode->valid) { paclnode->valid = false; - list_del_init(>list); pacl_list->num--; diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..65ef4a4 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -602,7 +602,7 @@ void free_mlme_ext_priv23a (struct mlme_ext_priv *pmlmeext) if (!padapter) return; - if (padapter->bDriverStopped == true) { + if (padapter->bDriverStopped) { del_timer_sync(>survey_timer); del_timer_sync(>link_timer); /* del_timer_sync(>ADDBA_timer); */ @@ -959,7 +959,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) goto auth_fail; } - if (rtw_access_ctrl23a(padapter, sa) == false) { + if (!rtw_access_ctrl23a(padapter, sa)) { status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } @@ -2049,7 +2049,7 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter, sizeof(struct ADDBA_request)); process_addba_req23a(padapter, (u8 *)>ADDBA_req, addr); - if (pmlmeinfo->bAcceptAddbaReq == true) + if (pmlmeinfo->bAcceptAddbaReq) issue_action_BA23a(padapter, addr, WLAN_ACTION_ADDBA_RESP, 0); else { @@ -2253,8 +2253,8 @@ void update_mgntframe_attrib23a(struct rtw_adapter *padapter, void dump_mgntframe23a(struct rtw_adapter *padapter, struct xmit_frame *pmgntframe) { - if (padapter->bSurpriseRemoved == true || - padapter->bDriverStopped == true) + if (pada
[PATCH v3 2/3] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Change in v3- Fix made manually Signed-off-by: Shraddha Barke --- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..c8e69ff 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (!priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/4] Staging: rtl8712: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Changes in v2- More instances covered Signed-off-by: Shraddha Barke --- drivers/staging/rtl8712/rtl871x_ioctl_set.c | 24 - drivers/staging/rtl8712/rtl871x_mlme.c | 77 ++--- 2 files changed, 50 insertions(+), 51 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 22262b3..fd78941 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c @@ -136,12 +136,12 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) } spin_lock_irqsave(>lock, irqL); if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | - _FW_UNDER_LINKING) == true) { + _FW_UNDER_LINKING)) { status = check_fwstate(pmlmepriv, _FW_UNDER_LINKING); goto _Abort_Set_BSSID; } if (check_fwstate(pmlmepriv, - _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) { + _FW_LINKED|WIFI_ADHOC_MASTER_STATE)) { if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) @@ -149,7 +149,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) * WIFI_ADHOC_MASTER_STATE */ } else { r8712_disassoc_cmd(padapter); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if ((check_fwstate(pmlmepriv, @@ -197,7 +197,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, */ r8712_disassoc_cmd(padapter); if (check_fwstate(pmlmepriv, - _FW_LINKED) == true) + _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if (check_fwstate(pmlmepriv, @@ -213,18 +213,18 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, } } else { r8712_disassoc_cmd(padapter); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if (check_fwstate(pmlmepriv, - WIFI_ADHOC_MASTER_STATE) == true) { + WIFI_ADHOC_MASTER_STATE)) { _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); } } } - if (padapter->securitypriv.btkip_countermeasure == true) + if (padapter->securitypriv.btkip_countermeasure) goto _Abort_Set_SSID; if (!validate_ssid(ssid)) goto _Abort_Set_SSID; @@ -248,13 +248,13 @@ void r8712_set_802_11_infrastructure_mode(struct _adapter *padapter, if (*pold_state != networktype) { spin_lock_irqsave(>lock, irqL); - if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || + if ((check_fwstate(pmlmepriv, _FW_LINKED)) || (*pold_state == Ndis802_11IBSS)) r8712_disassoc_cmd(padapter); if (check_fwstate(pmlmepriv, - _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) + _FW_LINKED | WIFI_ADHOC_MASTER_STATE)) r8712_free_assoc_resources(padapter); - if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || + if ((check_fwstate(pmlmepriv, _FW_LINKED)) || (*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { /* will clr Linked_state before this function, @@ -291,7 +291,7 @@ u8 r8712_set_802_11_disassociate(struct _adapter *padapter) struct mlme_priv *pmlmepriv = >mlmepriv; spin_lock_irqsave(>lock, irqL); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { r8712_disassoc_cmd(padapter); r8712_ind_disconnect(padapter); r8712_free_ass
[PATCH v2 4/4] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Changes in v2- Included more instances of true and false Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 ++-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 26 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 001a2f3..591ac5d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif @@ -920,13 +920,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) u8 mstatus; - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) return; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ LPS_Leave(padapter); } @@ -1384,7 +1384,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * spin_lock_bh(>lock); - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) + if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_LINKED); diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..8ba2689 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter) mod_timer(>assoc_timer, jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock; @@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); @@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_
[PATCH v2 2/4] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Change in v2- Fixing logical error Signed-off-by: Shraddha Barke --- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..c8e69ff 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (!priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/4] Staging: rtl8723au: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fixed using Coccinelle Change in v2- Consider cases with false Signed-off-by: Shraddha Barke --- drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++-- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 4 ++-- drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 6 +++--- drivers/staging/rtl8723au/hal/rtl8723au_recv.c | 2 +- drivers/staging/rtl8723au/hal/usb_halinit.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 65b209a..bd1a306 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..9cab19f 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -4092,7 +4092,7 @@ static void rtw_site_survey(struct rtw_adapter *padapter) /* turn on dynamic functions */ rtl8723a_odm_support_ability_restore(padapter); - if (is_client_associated_to_ap23a(padapter) == true) + if (is_client_associated_to_ap23a(padapter)) issue_nulldata23a(padapter, NULL, 0, 3, 500); rtl8723a_mlme_sitesurvey(padapter, 0); @@ -5195,7 +5195,7 @@ void linked_status_chk23a(struct rtw_adapter *padapter) if (psta) { bool is_p2p_enable = false; - if (chk_ap_is_alive(padapter, psta) == false) + if (!chk_ap_is_alive(padapter, psta)) rx_chk = _FAIL; if (pxmitpriv->last_tx_pkts == pxmitpriv->tx_pkts) diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 3c1315fc..208b24d 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -231,7 +231,7 @@ static unsigned int ratetbl2rateset(struct rtw_adapter *padapter, default: rate = ratetbl_val_2wifirate(rate); - if (is_basicrate(padapter, rate) == true) + if (is_basicrate(padapter, rate)) rate |= IEEE80211_BASIC_RATE_MASK; rateset[len] = rate; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index cf15f80..503231c 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -5192,7 +5192,7 @@ static void btdm_NotifyFwScan(struct rtw_adapter *padapter, u8 scanType) { u8 H2C_Parameter[1] = {0}; - if (scanType == true) + if (scanType) H2C_Parameter[0] = 0x1; RTPRINT(FBT, BT_TRACE, ("[BTCoex], Notify FW for wifi scan, write 0x3b = 0x%02x\n", @@ -9141,7 +9141,7 @@ u8 BTDM_IsWifiConnectionExist(struct rtw_adapter *padapter) if (BTHCI_HsConnectionEstablished(padapter)) bRet = true; - if (check_fwstate(>mlmepriv, WIFI_ASOC_STATE) == true) + if (check_fwstate(>mlmepriv, WIFI_ASOC_STATE)) bRet = true; return bRet; @@ -9945,7 +9945,7 @@ void BTDM_CheckBTIdleChange1Ant(struct rtw_adapter *padapter) } if (!pBtMgnt->ExtConfig.bBTBusy) { RTPRINT(FBT, BT_TRACE, ("[DM][BT], BT is idle or disable\n")); - if (check_fwstate(>mlmepriv, WIFI_UNDER_LINKING|WIFI_SITE_MONITOR) == true) + if (check_fwstate(>mlmepriv, WIFI_UNDER_LINKING | WIFI_SITE_MONITOR)) BTDM_SetAntenna(padapter, BTDM_ANT_WIFI); } } diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c b/drivers/staging/rtl8723au/hal/rtl8723au_recv.c index 0fec84b..7acd8ae 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c +++ b/drivers/staging/rtl8723au/hal/rtl8723au_recv.
[PATCH v2] Staging: ft1000: ft1000-usb: Use USB API functions rather than constants
Introduce the use of the function usb_endpoint_is_bulk_in(). Signed-off-by: Shraddha Barke --- Change in v2- Make commmit message clearer drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c index fd255c6..d1ba0b8 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c @@ -111,17 +111,13 @@ static int ft1000_probe(struct usb_interface *interface, pr_debug("endpoint %d\n", i); pr_debug("bEndpointAddress=%x, bmAttributes=%x\n", endpoint->bEndpointAddress, endpoint->bmAttributes); - if ((endpoint->bEndpointAddress & USB_DIR_IN) - && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { + if (usb_endpoint_is_bulk_in(endpoint)) { ft1000dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; pr_debug("in: %d\n", endpoint->bEndpointAddress); } - if (!(endpoint->bEndpointAddress & USB_DIR_IN) - && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { + if (usb_endpoint_is_bulk_in(endpoint)) { ft1000dev->bulk_out_endpointAddr = endpoint->bEndpointAddress; pr_debug("out: %d\n", endpoint->bEndpointAddress); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 3/3] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Changes in v3- Fix made manually Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 28 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 001a2f3..591ac5d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif @@ -920,13 +920,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) u8 mstatus; - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) return; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ LPS_Leave(padapter); } @@ -1384,7 +1384,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * spin_lock_bh(>lock); - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) + if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_LINKED); diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..64bfefc 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter) mod_timer(>assoc_timer, jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock; @@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); @@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_asso
[PATCH v3 1/3] Staging: rtl8723au: core: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Changes in v3- Made fix manually Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8723au/core/rtw_ap.c | 13 ++--- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 28 +-- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 65b209a..b6bfbbf 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ @@ -662,7 +662,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) update_hw_ht_param(padapter); } - if (pmlmepriv->cur_network.join_res != true) { + if (!pmlmepriv->cur_network.join_res) { /* setting only at first time */ /* WEP Key will be set before this function, do not clear CAM. */ if (psecuritypriv->dot11PrivacyAlgrthm != @@ -1061,7 +1061,7 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { - if (paclnode->valid == true) { + if (paclnode->valid) { added = true; DBG_8723A("%s, sta has been added\n", __func__); break; @@ -1370,7 +1370,7 @@ static int rtw_ht_operation_update(struct rtw_adapter *padapter) void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated) { /* update associated stations cap. */ - if (updated == true) { + if (updated) { struct list_head *phead, *plist, *ptmp; struct sta_info *psta; struct sta_priv *pstapriv = >stapriv; @@ -1882,9 +1882,8 @@ void stop_ap_mode23a(struct rtw_adapter *padapter) list_for_each_safe(plist, ptmp, phead) { paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - if (paclnode->valid == true) { + if (paclnode->valid) { paclnode->valid = false; - list_del_init(>list); pacl_list->num--; diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..65ef4a4 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -602,7 +602,7 @@ void free_mlme_ext_priv23a (struct mlme_ext_priv *pmlmeext) if (!padapter) return; - if (padapter->bDriverStopped == true) { + if (padapter->bDriverStopped) { del_timer_sync(>survey_timer); del_timer_sync(>link_timer); /* del_timer_sync(>ADDBA_timer); */ @@ -959,7 +959,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) goto auth_fail; } - if (rtw_access_ctrl23a(padapter, sa) == false) { + if (!rtw_access_ctrl23a(padapter, sa)) { status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } @@ -2049,7 +2049,7 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter, sizeof(struct ADDBA_request)); process_addba_req23a(padapter, (u8 *)>ADDBA_req, addr); - if (pmlmeinfo->bAcceptAddbaReq == true) + if (pmlmeinfo->bAcceptAddbaReq) issue_action_BA23a(padapter, addr, WLAN_ACTION_ADDBA_RESP, 0); else { @@ -2253,8 +2253,8 @@ void update_mgntframe_attrib23a(struct rtw_adapter *padapter, void dump_mgntframe23a(struct rtw_adapter *padapter, struct xmit_frame *pmgntframe) { - if (padapter->bSurpriseRemoved == true || - padapter->bDriverSto
[PATCH v3 2/3] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Change in v3- Fix made manually Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..c8e69ff 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (!priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: rtl8192u: Remove unnecessary printk
This patch removes the commented printk inside else block as it is not needed. Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 051ec8c..7656e56 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -277,7 +277,6 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee printk("%s():insert to waitqueue!\n",__func__); skb_queue_tail(>skb_waitQ[tcb_desc->queue_index], skb); } else { - //printk("TX packet!\n"); ieee->softmac_hard_start_xmit(skb, ieee->dev); //dev_kfree_skb_any(skb);//edit by thomas } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] Staging: ft1000: ft1000-usb: Use USB API functions rather than constants
Introduce the use of the function usb_endpoint_is_bulk_in(). Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Change in v2- Make commmit message clearer drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c index fd255c6..d1ba0b8 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c @@ -111,17 +111,13 @@ static int ft1000_probe(struct usb_interface *interface, pr_debug("endpoint %d\n", i); pr_debug("bEndpointAddress=%x, bmAttributes=%x\n", endpoint->bEndpointAddress, endpoint->bmAttributes); - if ((endpoint->bEndpointAddress & USB_DIR_IN) - && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { + if (usb_endpoint_is_bulk_in(endpoint)) { ft1000dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; pr_debug("in: %d\n", endpoint->bEndpointAddress); } - if (!(endpoint->bEndpointAddress & USB_DIR_IN) - && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { + if (usb_endpoint_is_bulk_in(endpoint)) { ft1000dev->bulk_out_endpointAddr = endpoint->bEndpointAddress; pr_debug("out: %d\n", endpoint->bEndpointAddress); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 4/4] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Changes in v2- Included more instances of true and false Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 ++-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 26 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 001a2f3..591ac5d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif @@ -920,13 +920,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) u8 mstatus; - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) return; switch (lps_ctrl_type) { case LPS_CTRL_SCAN: - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ LPS_Leave(padapter); } @@ -1384,7 +1384,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * spin_lock_bh(>lock); - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) + if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_LINKED); diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..8ba2689 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -89,7 +89,7 @@ u8 rtw_do_join(struct adapter *padapter) mod_timer(>assoc_timer, jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* submit createbss_cmd to change to a ADHOC_MASTER */ /* pmlmepriv->lock has been acquired by caller... */ @@ -162,7 +162,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) goto handle_tkip_countermeasure; else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) goto release_mlme_lock; @@ -171,7 +171,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) + if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); @@ -180,12 +180,12 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disc
[PATCH v2 3/4] Staging: rtl8712: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Changes in v2- More instances covered Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8712/rtl871x_ioctl_set.c | 24 - drivers/staging/rtl8712/rtl871x_mlme.c | 77 ++--- 2 files changed, 50 insertions(+), 51 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 22262b3..fd78941 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c @@ -136,12 +136,12 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) } spin_lock_irqsave(>lock, irqL); if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | - _FW_UNDER_LINKING) == true) { + _FW_UNDER_LINKING)) { status = check_fwstate(pmlmepriv, _FW_UNDER_LINKING); goto _Abort_Set_BSSID; } if (check_fwstate(pmlmepriv, - _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) { + _FW_LINKED|WIFI_ADHOC_MASTER_STATE)) { if (!memcmp(>cur_network.network.MacAddress, bssid, ETH_ALEN)) { if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) @@ -149,7 +149,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) * WIFI_ADHOC_MASTER_STATE */ } else { r8712_disassoc_cmd(padapter); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if ((check_fwstate(pmlmepriv, @@ -197,7 +197,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, */ r8712_disassoc_cmd(padapter); if (check_fwstate(pmlmepriv, - _FW_LINKED) == true) + _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if (check_fwstate(pmlmepriv, @@ -213,18 +213,18 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, } } else { r8712_disassoc_cmd(padapter); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if (check_fwstate(pmlmepriv, - WIFI_ADHOC_MASTER_STATE) == true) { + WIFI_ADHOC_MASTER_STATE)) { _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); } } } - if (padapter->securitypriv.btkip_countermeasure == true) + if (padapter->securitypriv.btkip_countermeasure) goto _Abort_Set_SSID; if (!validate_ssid(ssid)) goto _Abort_Set_SSID; @@ -248,13 +248,13 @@ void r8712_set_802_11_infrastructure_mode(struct _adapter *padapter, if (*pold_state != networktype) { spin_lock_irqsave(>lock, irqL); - if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || + if ((check_fwstate(pmlmepriv, _FW_LINKED)) || (*pold_state == Ndis802_11IBSS)) r8712_disassoc_cmd(padapter); if (check_fwstate(pmlmepriv, - _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) + _FW_LINKED | WIFI_ADHOC_MASTER_STATE)) r8712_free_assoc_resources(padapter); - if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || + if ((check_fwstate(pmlmepriv, _FW_LINKED)) || (*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { /* will clr Linked_state before this function, @@ -291,7 +291,7 @@ u8 r8712_set_802_11_disassociate(struct _adapter *padapter) struct mlme_priv *pmlmepriv = >mlmepriv; spin_lock_irqsave(>lock, irqL); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { + if (check_fwstate(pmlmepriv, _FW_LINKED)) { r8712_disassoc_cmd(padapter); r8
[PATCH v2 1/4] Staging: rtl8723au: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fixed using Coccinelle Change in v2- Consider cases with false Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++-- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 4 ++-- drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 6 +++--- drivers/staging/rtl8723au/hal/rtl8723au_recv.c | 2 +- drivers/staging/rtl8723au/hal/usb_halinit.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 65b209a..bd1a306 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..9cab19f 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -4092,7 +4092,7 @@ static void rtw_site_survey(struct rtw_adapter *padapter) /* turn on dynamic functions */ rtl8723a_odm_support_ability_restore(padapter); - if (is_client_associated_to_ap23a(padapter) == true) + if (is_client_associated_to_ap23a(padapter)) issue_nulldata23a(padapter, NULL, 0, 3, 500); rtl8723a_mlme_sitesurvey(padapter, 0); @@ -5195,7 +5195,7 @@ void linked_status_chk23a(struct rtw_adapter *padapter) if (psta) { bool is_p2p_enable = false; - if (chk_ap_is_alive(padapter, psta) == false) + if (!chk_ap_is_alive(padapter, psta)) rx_chk = _FAIL; if (pxmitpriv->last_tx_pkts == pxmitpriv->tx_pkts) diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 3c1315fc..208b24d 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -231,7 +231,7 @@ static unsigned int ratetbl2rateset(struct rtw_adapter *padapter, default: rate = ratetbl_val_2wifirate(rate); - if (is_basicrate(padapter, rate) == true) + if (is_basicrate(padapter, rate)) rate |= IEEE80211_BASIC_RATE_MASK; rateset[len] = rate; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index cf15f80..503231c 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -5192,7 +5192,7 @@ static void btdm_NotifyFwScan(struct rtw_adapter *padapter, u8 scanType) { u8 H2C_Parameter[1] = {0}; - if (scanType == true) + if (scanType) H2C_Parameter[0] = 0x1; RTPRINT(FBT, BT_TRACE, ("[BTCoex], Notify FW for wifi scan, write 0x3b = 0x%02x\n", @@ -9141,7 +9141,7 @@ u8 BTDM_IsWifiConnectionExist(struct rtw_adapter *padapter) if (BTHCI_HsConnectionEstablished(padapter)) bRet = true; - if (check_fwstate(>mlmepriv, WIFI_ASOC_STATE) == true) + if (check_fwstate(>mlmepriv, WIFI_ASOC_STATE)) bRet = true; return bRet; @@ -9945,7 +9945,7 @@ void BTDM_CheckBTIdleChange1Ant(struct rtw_adapter *padapter) } if (!pBtMgnt->ExtConfig.bBTBusy) { RTPRINT(FBT, BT_TRACE, ("[DM][BT], BT is idle or disable\n")); - if (check_fwstate(>mlmepriv, WIFI_UNDER_LINKING|WIFI_SITE_MONITOR) == true) + if (check_fwstate(>mlmepriv, WIFI_UNDER_LINKING | WIFI_SITE_MONITOR)) BTDM_SetAntenna(padapter, BTDM_ANT_WIFI); } } diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c b/drivers/staging/rtl8723au/hal/rtl8723au_recv.c index 0fec84b..7acd8ae 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c +++ b/drivers/stagin
[PATCH v2 2/4] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Change in v2- Fixing logical error Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..c8e69ff 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (!priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/4] Staging: rtl8712: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Signed-off-by: Shraddha Barke --- drivers/staging/rtl8712/rtl871x_ioctl_set.c | 4 -- drivers/staging/rtl8712/rtl871x_mlme.c | 3 +-- drivers/staging/rtl8712/rtl871x_recv.c | 4 ++-- drivers/staging/rtl8712/rtl871x_xmit.c | 2 +- drivers/staging/rtl8712/usb_intf.c | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 22262b3..528ef7a 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c @@ -149,7 +149,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) * WIFI_ADHOC_MASTER_STATE */ } else { r8712_disassoc_cmd(padapter); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if ((check_fwstate(pmlmepriv, @@ -213,7 +212,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, } } else { r8712_disassoc_cmd(padapter); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if (check_fwstate(pmlmepriv, diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index fc5dbea..a7d8d7f 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -897,8 +897,7 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) update_ht_cap(adapter, cur_network->network.IEs, cur_network->network.IELength); /*indicate connect*/ - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) - == true) + if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) r8712_indicate_connect(adapter); del_timer(>assoc_timer); } else diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index 046a46c..10b1ad5 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -198,7 +198,7 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter, bmic_err = true; } if (bmic_err == true) { - if (prxattrib->bdecrypted == true) + if (prxattrib->bdecrypted) r8712_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra)); res = _FAIL; @@ -369,7 +369,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter, else *psta = r8712_get_stainfo(pstapriv, sta_addr); /* get ap_info */ if (*psta == NULL) { - if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) adapter->mppriv.rx_pktloss++; return _FAIL; } diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c index 2e4fa88..7ceeab3 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.c +++ b/drivers/staging/rtl8712/rtl871x_xmit.c @@ -337,7 +337,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, pattrib->bswenc = false; /* if in MP_STATE, update pkt_attrib from mp_txcmd, and overwrite * some settings above.*/ - if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) pattrib->priority = (txdesc.txdw1 >> QSEL_SHT) & 0x1f; return _SUCCESS; } diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index f8b5b33..7e6a29c 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c @@ -611,7 +611,7 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf) release_firmware(padapter->fw); /* never exit with a firmware callback pending */ wait_for_completion(>rtl8712_fw_ready); - if (drvpriv.drv_registered == true) + if (drvpriv.drv_registered)
[PATCH 4/4] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Signed-off-by: Shraddha Barke --- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..ab7401e 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/4] Staging: rtl8723au: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fixed using Coccinelle Signed-off-by: Shraddha Barke --- drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++-- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 4 +++--- drivers/staging/rtl8723au/hal/rtl8723au_recv.c | 2 +- drivers/staging/rtl8723au/hal/usb_halinit.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 65b209a..bd1a306 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..b22a698 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -4092,7 +4092,7 @@ static void rtw_site_survey(struct rtw_adapter *padapter) /* turn on dynamic functions */ rtl8723a_odm_support_ability_restore(padapter); - if (is_client_associated_to_ap23a(padapter) == true) + if (is_client_associated_to_ap23a(padapter)) issue_nulldata23a(padapter, NULL, 0, 3, 500); rtl8723a_mlme_sitesurvey(padapter, 0); diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 3c1315fc..208b24d 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -231,7 +231,7 @@ static unsigned int ratetbl2rateset(struct rtw_adapter *padapter, default: rate = ratetbl_val_2wifirate(rate); - if (is_basicrate(padapter, rate) == true) + if (is_basicrate(padapter, rate)) rate |= IEEE80211_BASIC_RATE_MASK; rateset[len] = rate; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index cf15f80..503231c 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -5192,7 +5192,7 @@ static void btdm_NotifyFwScan(struct rtw_adapter *padapter, u8 scanType) { u8 H2C_Parameter[1] = {0}; - if (scanType == true) + if (scanType) H2C_Parameter[0] = 0x1; RTPRINT(FBT, BT_TRACE, ("[BTCoex], Notify FW for wifi scan, write 0x3b = 0x%02x\n", @@ -9141,7 +9141,7 @@ u8 BTDM_IsWifiConnectionExist(struct rtw_adapter *padapter) if (BTHCI_HsConnectionEstablished(padapter)) bRet = true; - if (check_fwstate(>mlmepriv, WIFI_ASOC_STATE) == true) + if (check_fwstate(>mlmepriv, WIFI_ASOC_STATE)) bRet = true; return bRet; diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c b/drivers/staging/rtl8723au/hal/rtl8723au_recv.c index 0fec84b..7acd8ae 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c +++ b/drivers/staging/rtl8723au/hal/rtl8723au_recv.c @@ -231,7 +231,7 @@ void update_recvframe_phyinfo(struct recv_frame *precvframe, pkt_info.StationID = 0xFF; if (pkt_info.bPacketBeacon) { - if (check_fwstate(>mlmepriv, WIFI_STATION_STATE) == true) + if (check_fwstate(>mlmepriv, WIFI_STATION_STATE)) sa = padapter->mlmepriv.cur_network.network.MacAddress; /* to do Ad-hoc */ } else { diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index 9926b07..f2d3f54 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -1256,7 +1256,7 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter, arg = mac_id & 0x1f;/* MACID */ arg |= BIT(7); - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); DBG_8723A("update raid entry, mask
[PATCH 2/4] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 ++-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 6 drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++-- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8188eu/core/rtw_xmit.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 001a2f3..898e33e 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..6566540 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -180,7 +180,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter); @@ -290,7 +290,7 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter); @@ -369,7 +369,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, rtw_free_assoc_resources(padapter); if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ } diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 44eeb03..8c99c69 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -1028,7 +1028,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter, pxmitframe->attrib.triggered = 1; spin_unlock_bh(>sleep_q.lock); - if (rtw_hal_xmit(padapter, pxmitframe) == true) + if (rtw_hal_xmit(padapter, pxmitframe)) rtw_os_xmit_complete(padapter, pxmitframe); spin_lock_bh(>sleep_q.lock); @@ -1925,7 +1925,7 @@ void rtw_reordering_ctrl_timeout_handler(unsigned long data) spin_lock_bh(_recvframe_queue->lock); - if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true) == true) + if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true)) mod_timer(_ctrl->reordering_ctrl_timer, jiffies + msecs_to_jiffies(REORDER_WAIT_TIME)); diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index 077b39a..3d17808 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -203,7 +203,7 @@ static unsigned int ratetbl2rateset(struct adapter *padapter, unsigned char *rat default: rate = ratetbl_val_2wifirate(rate); - if (is_basicrate(padapter, rate) == true) + if (is_basicrate(padapter, rate)) rate |= IEEE80211_BASIC_RATE_MASK;
[PATCH] Staging: ft1000: ft1000-usb: Use USB API functions rather than constants
This patch introduces the use of the function usb_endpoint_is_bulk_in(). Signed-off-by: Shraddha Barke --- drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c index fd255c6..d1ba0b8 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c @@ -111,17 +111,13 @@ static int ft1000_probe(struct usb_interface *interface, pr_debug("endpoint %d\n", i); pr_debug("bEndpointAddress=%x, bmAttributes=%x\n", endpoint->bEndpointAddress, endpoint->bmAttributes); - if ((endpoint->bEndpointAddress & USB_DIR_IN) - && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { + if (usb_endpoint_is_bulk_in(endpoint)) { ft1000dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; pr_debug("in: %d\n", endpoint->bEndpointAddress); } - if (!(endpoint->bEndpointAddress & USB_DIR_IN) - && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { + if (usb_endpoint_is_bulk_in(endpoint)) { ft1000dev->bulk_out_endpointAddr = endpoint->bEndpointAddress; pr_debug("out: %d\n", endpoint->bEndpointAddress); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 01/16] Staging: speakup: varhandlers.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- Considering cases with != NULL also drivers/staging/speakup/varhandlers.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index 75bf40c..b2afec6 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -90,7 +90,7 @@ void speakup_register_var(struct var_t *var) struct st_var_header *p_header; BUG_ON(!var || var->var_id < 0 || var->var_id >= MAXVARS); - if (var_ptrs[0] == NULL) { + if (!var_ptrs[0]) { for (i = 0; i < MAXVARS; i++) { p_header = _headers[i]; var_ptrs[p_header->var_id] = p_header; @@ -130,7 +130,7 @@ struct st_var_header *spk_get_var_header(enum var_id_t var_id) if (var_id < 0 || var_id >= MAXVARS) return NULL; p_header = var_ptrs[var_id]; - if (p_header->data == NULL) + if (!p_header->data) return NULL; return p_header; } @@ -163,7 +163,7 @@ struct punc_var_t *spk_get_punc_var(enum var_id_t var_id) struct punc_var_t *where; where = punc_vars; - while ((where->var_id != -1) && (rv == NULL)) { + while ((where->var_id != -1) && (!rv)) { if (where->var_id == var_id) rv = where; else @@ -183,7 +183,7 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) char *cp; struct var_t *var_data = var->data; - if (var_data == NULL) + if (!var_data) return -ENODATA; if (how == E_NEW_DEFAULT) { @@ -221,9 +221,9 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) if (var_data->u.n.multiplier != 0) val *= var_data->u.n.multiplier; val += var_data->u.n.offset; - if (var->var_id < FIRST_SYNTH_VAR || synth == NULL) + if (var->var_id < FIRST_SYNTH_VAR || !synth) return ret; - if (synth->synth_adjust != NULL) { + if (synth->synth_adjust) { int status = synth->synth_adjust(var); return (status != 0) ? status : ret; @@ -247,7 +247,7 @@ int spk_set_string_var(const char *page, struct st_var_header *var, int len) { struct var_t *var_data = var->data; - if (var_data == NULL) + if (!var_data) return -ENODATA; if (len > MAXVARLEN) return -E2BIG; @@ -288,7 +288,7 @@ int spk_set_mask_bits(const char *input, const int which, const int how) if (*cp < SPACE) break; if (mask < PUNC) { - if (!(spk_chartab[*cp])) + if (!(spk_chartab[*cp] & PUNC)) break; } else if (spk_chartab[*cp]_NUM) break; @@ -313,7 +313,7 @@ char *spk_strlwr(char *s) { char *p; - if (s == NULL) + if (!s) return NULL; for (p = s; *p; p++) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 02/16] Staging: speakup: devsynth.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/speakup/devsynth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/speakup/devsynth.c b/drivers/staging/speakup/devsynth.c index 71c728a..d1ffdf4 100644 --- a/drivers/staging/speakup/devsynth.c +++ b/drivers/staging/speakup/devsynth.c @@ -22,7 +22,7 @@ static ssize_t speakup_file_write(struct file *fp, const char __user *buffer, unsigned long flags; u_char buf[256]; - if (synth == NULL) + if (!synth) return -ENODEV; while (count > 0) { bytes = min(count, sizeof(buf)); @@ -45,7 +45,7 @@ static ssize_t speakup_file_read(struct file *fp, char __user *buf, static int speakup_file_open(struct inode *ip, struct file *fp) { - if (synth == NULL) + if (!synth) return -ENODEV; if (xchg(_opened, 1)) return -EBUSY; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 04/16] Staging: speakup: kobjects.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/speakup/kobjects.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 958add4..fdfeb42 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -368,7 +368,7 @@ static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr, { int rv; - if (synth == NULL) + if (!synth) rv = sprintf(buf, "%s\n", "none"); else rv = sprintf(buf, "%s\n", synth->name); @@ -459,14 +459,14 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -501,14 +501,14 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr, return -EINVAL; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -546,7 +546,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; spin_lock_irqsave(_info.spinlock, flags); @@ -622,9 +622,9 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; - if (param->data == NULL) + if (!param->data) return 0; ret = 0; cp = (char *)buf; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 03/16] Staging: speakup: serialio.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/speakup/serialio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index 66ac999..3b5835b 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -101,7 +101,7 @@ static void start_serial_interrupt(int irq) { int rv; - if (synth->read_buff_add == NULL) + if (!synth->read_buff_add) return; rv = request_irq(irq, synth_readbuf_handler, IRQF_SHARED, @@ -127,7 +127,7 @@ void spk_stop_serial_interrupt(void) if (speakup_info.port_tts == 0) return; - if (synth->read_buff_add == NULL) + if (!synth->read_buff_add) return; /* Turn off interrupts */ -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 02/16] Staging: speakup: devsynth.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Change in v2- No change drivers/staging/speakup/devsynth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/speakup/devsynth.c b/drivers/staging/speakup/devsynth.c index 71c728a..d1ffdf4 100644 --- a/drivers/staging/speakup/devsynth.c +++ b/drivers/staging/speakup/devsynth.c @@ -22,7 +22,7 @@ static ssize_t speakup_file_write(struct file *fp, const char __user *buffer, unsigned long flags; u_char buf[256]; - if (synth == NULL) + if (!synth) return -ENODEV; while (count > 0) { bytes = min(count, sizeof(buf)); @@ -45,7 +45,7 @@ static ssize_t speakup_file_read(struct file *fp, char __user *buf, static int speakup_file_open(struct inode *ip, struct file *fp) { - if (synth == NULL) + if (!synth) return -ENODEV; if (xchg(_opened, 1)) return -EBUSY; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 04/16] Staging: speakup: kobjects.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Change in v2- No change drivers/staging/speakup/kobjects.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 958add4..fdfeb42 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -368,7 +368,7 @@ static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr, { int rv; - if (synth == NULL) + if (!synth) rv = sprintf(buf, "%s\n", "none"); else rv = sprintf(buf, "%s\n", synth->name); @@ -459,14 +459,14 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -501,14 +501,14 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr, return -EINVAL; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -546,7 +546,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; spin_lock_irqsave(_info.spinlock, flags); @@ -622,9 +622,9 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; - if (param->data == NULL) + if (!param->data) return 0; ret = 0; cp = (char *)buf; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 03/16] Staging: speakup: serialio.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Change in v2- No change drivers/staging/speakup/serialio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index 66ac999..3b5835b 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -101,7 +101,7 @@ static void start_serial_interrupt(int irq) { int rv; - if (synth->read_buff_add == NULL) + if (!synth->read_buff_add) return; rv = request_irq(irq, synth_readbuf_handler, IRQF_SHARED, @@ -127,7 +127,7 @@ void spk_stop_serial_interrupt(void) if (speakup_info.port_tts == 0) return; - if (synth->read_buff_add == NULL) + if (!synth->read_buff_add) return; /* Turn off interrupts */ -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 01/16] Staging: speakup: varhandlers.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- Change in v2- Considering cases with != NULL also drivers/staging/speakup/varhandlers.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index 75bf40c..b2afec6 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -90,7 +90,7 @@ void speakup_register_var(struct var_t *var) struct st_var_header *p_header; BUG_ON(!var || var->var_id < 0 || var->var_id >= MAXVARS); - if (var_ptrs[0] == NULL) { + if (!var_ptrs[0]) { for (i = 0; i < MAXVARS; i++) { p_header = _headers[i]; var_ptrs[p_header->var_id] = p_header; @@ -130,7 +130,7 @@ struct st_var_header *spk_get_var_header(enum var_id_t var_id) if (var_id < 0 || var_id >= MAXVARS) return NULL; p_header = var_ptrs[var_id]; - if (p_header->data == NULL) + if (!p_header->data) return NULL; return p_header; } @@ -163,7 +163,7 @@ struct punc_var_t *spk_get_punc_var(enum var_id_t var_id) struct punc_var_t *where; where = punc_vars; - while ((where->var_id != -1) && (rv == NULL)) { + while ((where->var_id != -1) && (!rv)) { if (where->var_id == var_id) rv = where; else @@ -183,7 +183,7 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) char *cp; struct var_t *var_data = var->data; - if (var_data == NULL) + if (!var_data) return -ENODATA; if (how == E_NEW_DEFAULT) { @@ -221,9 +221,9 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) if (var_data->u.n.multiplier != 0) val *= var_data->u.n.multiplier; val += var_data->u.n.offset; - if (var->var_id < FIRST_SYNTH_VAR || synth == NULL) + if (var->var_id < FIRST_SYNTH_VAR || !synth) return ret; - if (synth->synth_adjust != NULL) { + if (synth->synth_adjust) { int status = synth->synth_adjust(var); return (status != 0) ? status : ret; @@ -247,7 +247,7 @@ int spk_set_string_var(const char *page, struct st_var_header *var, int len) { struct var_t *var_data = var->data; - if (var_data == NULL) + if (!var_data) return -ENODATA; if (len > MAXVARLEN) return -E2BIG; @@ -288,7 +288,7 @@ int spk_set_mask_bits(const char *input, const int which, const int how) if (*cp < SPACE) break; if (mask < PUNC) { - if (!(spk_chartab[*cp])) + if (!(spk_chartab[*cp] & PUNC)) break; } else if (spk_chartab[*cp]_NUM) break; @@ -313,7 +313,7 @@ char *spk_strlwr(char *s) { char *p; - if (s == NULL) + if (!s) return NULL; for (p = s; *p; p++) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/4] Staging: vt6656: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/vt6656/wcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3cbf479..ab7401e 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -177,7 +177,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; - if (priv->cmd_running == false) + if (priv->cmd_running) vnt_cmd_complete(priv); return true; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: ft1000: ft1000-usb: Use USB API functions rather than constants
This patch introduces the use of the function usb_endpoint_is_bulk_in(). Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c index fd255c6..d1ba0b8 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c @@ -111,17 +111,13 @@ static int ft1000_probe(struct usb_interface *interface, pr_debug("endpoint %d\n", i); pr_debug("bEndpointAddress=%x, bmAttributes=%x\n", endpoint->bEndpointAddress, endpoint->bmAttributes); - if ((endpoint->bEndpointAddress & USB_DIR_IN) - && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { + if (usb_endpoint_is_bulk_in(endpoint)) { ft1000dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; pr_debug("in: %d\n", endpoint->bEndpointAddress); } - if (!(endpoint->bEndpointAddress & USB_DIR_IN) - && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { + if (usb_endpoint_is_bulk_in(endpoint)) { ft1000dev->bulk_out_endpointAddr = endpoint->bEndpointAddress; pr_debug("out: %d\n", endpoint->bEndpointAddress); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/4] Staging: rtl8723au: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fixed using Coccinelle Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++-- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 4 +++--- drivers/staging/rtl8723au/hal/rtl8723au_recv.c | 2 +- drivers/staging/rtl8723au/hal/usb_halinit.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 65b209a..bd1a306 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -409,7 +409,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf000); @@ -424,7 +424,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l /* arg[5] = Short GI */ rtl8723a_add_rateatid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate == true) + if (shortGIrate) init_rate |= BIT(6); /* set ra_id, init_rate */ diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index be9a3d5..b22a698 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -4092,7 +4092,7 @@ static void rtw_site_survey(struct rtw_adapter *padapter) /* turn on dynamic functions */ rtl8723a_odm_support_ability_restore(padapter); - if (is_client_associated_to_ap23a(padapter) == true) + if (is_client_associated_to_ap23a(padapter)) issue_nulldata23a(padapter, NULL, 0, 3, 500); rtl8723a_mlme_sitesurvey(padapter, 0); diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 3c1315fc..208b24d 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -231,7 +231,7 @@ static unsigned int ratetbl2rateset(struct rtw_adapter *padapter, default: rate = ratetbl_val_2wifirate(rate); - if (is_basicrate(padapter, rate) == true) + if (is_basicrate(padapter, rate)) rate |= IEEE80211_BASIC_RATE_MASK; rateset[len] = rate; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index cf15f80..503231c 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -5192,7 +5192,7 @@ static void btdm_NotifyFwScan(struct rtw_adapter *padapter, u8 scanType) { u8 H2C_Parameter[1] = {0}; - if (scanType == true) + if (scanType) H2C_Parameter[0] = 0x1; RTPRINT(FBT, BT_TRACE, ("[BTCoex], Notify FW for wifi scan, write 0x3b = 0x%02x\n", @@ -9141,7 +9141,7 @@ u8 BTDM_IsWifiConnectionExist(struct rtw_adapter *padapter) if (BTHCI_HsConnectionEstablished(padapter)) bRet = true; - if (check_fwstate(>mlmepriv, WIFI_ASOC_STATE) == true) + if (check_fwstate(>mlmepriv, WIFI_ASOC_STATE)) bRet = true; return bRet; diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c b/drivers/staging/rtl8723au/hal/rtl8723au_recv.c index 0fec84b..7acd8ae 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723au_recv.c +++ b/drivers/staging/rtl8723au/hal/rtl8723au_recv.c @@ -231,7 +231,7 @@ void update_recvframe_phyinfo(struct recv_frame *precvframe, pkt_info.StationID = 0xFF; if (pkt_info.bPacketBeacon) { - if (check_fwstate(>mlmepriv, WIFI_STATION_STATE) == true) + if (check_fwstate(>mlmepriv, WIFI_STATION_STATE)) sa = padapter->mlmepriv.cur_network.network.MacAddress; /* to do Ad-hoc */ } else { diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index 9926b07..f2d3f54 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -1256,7 +1256,7 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter, arg = mac_id & 0x1f;/* MACID */ arg |= BIT(7); - if (shortGIrate == true) + if (shortGIrate) arg |= BIT(5); DBG_8723A(
[PATCH 2/4] Staging: rtl8188eu: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 ++-- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 6 drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++-- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8188eu/core/rtw_xmit.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 001a2f3..898e33e 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -272,7 +272,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = >cmdpriv; struct mlme_priv*pmlmepriv = >mlmepriv; - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); @@ -903,7 +903,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) pmlmepriv = &(padapter->mlmepriv); #ifdef CONFIG_88EU_AP_MODE - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) expire_timeout_chk(padapter); #endif diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 22f5b45..6566540 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -180,7 +180,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter); @@ -290,7 +290,7 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid) rtw_disassoc_cmd(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter); @@ -369,7 +369,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, rtw_free_assoc_resources(padapter); if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ } diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 44eeb03..8c99c69 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -1028,7 +1028,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter, pxmitframe->attrib.triggered = 1; spin_unlock_bh(>sleep_q.lock); - if (rtw_hal_xmit(padapter, pxmitframe) == true) + if (rtw_hal_xmit(padapter, pxmitframe)) rtw_os_xmit_complete(padapter, pxmitframe); spin_lock_bh(>sleep_q.lock); @@ -1925,7 +1925,7 @@ void rtw_reordering_ctrl_timeout_handler(unsigned long data) spin_lock_bh(_recvframe_queue->lock); - if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true) == true) + if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true)) mod_timer(_ctrl->reordering_ctrl_timer, jiffies + msecs_to_jiffies(REORDER_WAIT_TIME)); diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index 077b39a..3d17808 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -203,7 +203,7 @@ static unsigned int ratetbl2rateset(struct adapter *padapter, unsigned char *rat default: rate = ratetbl_val_2wifirate(rate); - if (is_basicrate(padapter, rate) == true) + if (is_basicrate(padapter, rate))
[PATCH 3/4] Staging: rtl8712: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables. Fix made using Coccinelle Signed-off-by: Shraddha Barke <shraddha.6...@gmail.com> --- drivers/staging/rtl8712/rtl871x_ioctl_set.c | 4 -- drivers/staging/rtl8712/rtl871x_mlme.c | 3 +-- drivers/staging/rtl8712/rtl871x_recv.c | 4 ++-- drivers/staging/rtl8712/rtl871x_xmit.c | 2 +- drivers/staging/rtl8712/usb_intf.c | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 22262b3..528ef7a 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c @@ -149,7 +149,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) * WIFI_ADHOC_MASTER_STATE */ } else { r8712_disassoc_cmd(padapter); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if ((check_fwstate(pmlmepriv, @@ -213,7 +212,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, } } else { r8712_disassoc_cmd(padapter); - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) + if (check_fwstate(pmlmepriv, _FW_LINKED)) r8712_ind_disconnect(padapter); r8712_free_assoc_resources(padapter); if (check_fwstate(pmlmepriv, diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index fc5dbea..a7d8d7f 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -897,8 +897,7 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) update_ht_cap(adapter, cur_network->network.IEs, cur_network->network.IELength); /*indicate connect*/ - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) - == true) + if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) r8712_indicate_connect(adapter); del_timer(>assoc_timer); } else diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index 046a46c..10b1ad5 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -198,7 +198,7 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter, bmic_err = true; } if (bmic_err == true) { - if (prxattrib->bdecrypted == true) + if (prxattrib->bdecrypted) r8712_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra)); res = _FAIL; @@ -369,7 +369,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter, else *psta = r8712_get_stainfo(pstapriv, sta_addr); /* get ap_info */ if (*psta == NULL) { - if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) adapter->mppriv.rx_pktloss++; return _FAIL; } diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c index 2e4fa88..7ceeab3 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.c +++ b/drivers/staging/rtl8712/rtl871x_xmit.c @@ -337,7 +337,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, pattrib->bswenc = false; /* if in MP_STATE, update pkt_attrib from mp_txcmd, and overwrite * some settings above.*/ - if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) + if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) pattrib->priority = (txdesc.txdw1 >> QSEL_SHT) & 0x1f; return _SUCCESS; } diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index f8b5b33..7e6a29c 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c @@ -611,7 +611,7 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf) release_firmware(padapter->fw); /* never exit with a firmware callback pending */ wait_for_completion(>rtl8712_fw_ready); - if (drvpriv.drv_registered ==
[PATCH v2 09/16] Staging: lustre: obdclass: obd_config.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change .../staging/lustre/lustre/obdclass/obd_config.c| 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index e0470c0..fb432e8 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -61,7 +61,7 @@ int class_find_param(char *buf, char *key, char **valp) return 1; ptr = strstr(buf, key); - if (ptr == NULL) + if (!ptr) return 1; if (valp) @@ -92,11 +92,11 @@ struct cfg_interop_param *class_find_old_param(const char *param, char *value = NULL; int name_len = 0; - if (param == NULL || ptr == NULL) + if (!param || !ptr) return NULL; value = strchr(param, '='); - if (value == NULL) + if (!value) name_len = strlen(param); else name_len = value - param; @@ -144,7 +144,7 @@ int class_get_next_param(char **params, char *copy) while (1) { q1 = strpbrk(str, " '\""); - if (q1 == NULL) { + if (!q1) { len = strlen(str); memcpy(copy, str, len); copy[len] = '\0'; @@ -165,7 +165,7 @@ int class_get_next_param(char **params, char *copy) /* search for the matching closing quote */ str = q1 + 1; q2 = strchr(str, *q1); - if (q2 == NULL) { + if (!q2) { CERROR("Unbalanced quota in parameters: \"%s\"\n", *params); return -EINVAL; @@ -243,7 +243,7 @@ static int class_parse_value(char *buf, int opc, void *value, char **endh, /* nid separators or end of nids */ endp = strpbrk(buf, ",: /"); - if (endp == NULL) + if (!endp) endp = buf + strlen(buf); tmp = *endp; @@ -841,14 +841,14 @@ int class_add_profile(int proflen, char *prof, int osclen, char *osc, LASSERT(proflen == (strlen(prof) + 1)); lprof->lp_profile = kmemdup(prof, proflen, GFP_NOFS); - if (lprof->lp_profile == NULL) { + if (!lprof->lp_profile) { err = -ENOMEM; goto free_lprof; } LASSERT(osclen == (strlen(osc) + 1)); lprof->lp_dt = kmemdup(osc, osclen, GFP_NOFS); - if (lprof->lp_dt == NULL) { + if (!lprof->lp_dt) { err = -ENOMEM; goto free_lp_profile; } @@ -856,7 +856,7 @@ int class_add_profile(int proflen, char *prof, int osclen, char *osc, if (mdclen > 0) { LASSERT(mdclen == (strlen(mdc) + 1)); lprof->lp_md = kmemdup(mdc, mdclen, GFP_NOFS); - if (lprof->lp_md == NULL) { + if (!lprof->lp_md) { err = -ENOMEM; goto free_lp_dt; } @@ -963,15 +963,15 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg, int name_len = 0; int new_len = 0; - if (cfg == NULL || new_name == NULL) + if (!cfg || !new_name) return ERR_PTR(-EINVAL); param = lustre_cfg_string(cfg, 1); - if (param == NULL) + if (!param) return ERR_PTR(-EINVAL); value = strchr(param, '='); - if (value == NULL) + if (!value) name_len = strlen(param); else name_len = value - param; @@ -1000,7 +1000,7 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg, kfree(new_param); kfree(bufs); - if (new_cfg == NULL) + if (!new_cfg) return ERR_PTR(-ENOMEM); new_cfg->lcfg_num = cfg->lcfg_num; @@ -1178,7 +1178,7 @@ int class_process_config(struct lustre_cfg *lcfg) } /* Commands that require a device */ obd = class_name2obd(lustre_cfg_string(lcfg, 0)); - if (obd == NULL) { + if (!obd) { if (!LUSTRE_CFG_BUFLEN(lcfg, 0)) CERROR("this lcfg command requires a device name\n"); else @@ -1481,7 +1481,7 @@ int class_config_llog_handler(const struct lu_env *env, * moving them to index [1] and [2], and insert MGC's * obdname at index [0]. */ - if (clli && clli->cfg_instance == NULL && + if (clli && !clli->c
[PATCH v2 10/16] Staging: lustre: obdclass: genops.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Changes in v2- Considering cases with != NULL also drivers/staging/lustre/lustre/obdclass/genops.c | 54 - 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index c12ebd5..6112df9 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -178,9 +178,9 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, type->typ_md_ops = kzalloc(sizeof(*type->typ_md_ops), GFP_NOFS); type->typ_name = kzalloc(strlen(name) + 1, GFP_NOFS); - if (type->typ_dt_ops == NULL || - type->typ_md_ops == NULL || - type->typ_name == NULL) + if (!type->typ_dt_ops || + !type->typ_md_ops || + !type->typ_name) goto failed; *(type->typ_dt_ops) = *dt_ops; @@ -293,13 +293,13 @@ struct obd_device *class_newdev(const char *type_name, const char *name) } type = class_get_type(type_name); - if (type == NULL) { + if (!type) { CERROR("OBD: unknown type: %s\n", type_name); return ERR_PTR(-ENODEV); } newdev = obd_device_alloc(); - if (newdev == NULL) { + if (!newdev) { result = ERR_PTR(-ENOMEM); goto out_type; } @@ -339,7 +339,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name) } write_unlock(_dev_lock); - if (result == NULL && i >= class_devno_max()) { + if (!result && i >= class_devno_max()) { CERROR("all %u OBD devices used, increase MAX_OBD_DEVICES\n", class_devno_max()); result = ERR_PTR(-EOVERFLOW); @@ -463,7 +463,7 @@ struct obd_device *class_num2obd(int num) if (num < class_devno_max()) { obd = obd_devs[num]; - if (obd == NULL) + if (!obd) return NULL; LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, @@ -509,7 +509,7 @@ void class_obd_list(void) for (i = 0; i < class_devno_max(); i++) { struct obd_device *obd = class_num2obd(i); - if (obd == NULL) + if (!obd) continue; if (obd->obd_stopping) status = "ST"; @@ -540,7 +540,7 @@ struct obd_device *class_find_client_obd(struct obd_uuid *tgt_uuid, for (i = 0; i < class_devno_max(); i++) { struct obd_device *obd = class_num2obd(i); - if (obd == NULL) + if (!obd) continue; if ((strncmp(obd->obd_type->typ_name, typ_name, strlen(typ_name)) == 0)) { @@ -567,7 +567,7 @@ struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, int *next) { int i; - if (next == NULL) + if (!next) i = 0; else if (*next >= 0 && *next < class_devno_max()) i = *next; @@ -578,10 +578,10 @@ struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, int *next) for (; i < class_devno_max(); i++) { struct obd_device *obd = class_num2obd(i); - if (obd == NULL) + if (!obd) continue; if (obd_uuid_equals(grp_uuid, >obd_uuid)) { - if (next != NULL) + if (next) *next = i+1; read_unlock(_dev_lock); return obd; @@ -609,7 +609,7 @@ int class_notify_sptlrpc_conf(const char *fsname, int namelen) for (i = 0; i < class_devno_max(); i++) { obd = class_num2obd(i); - if (obd == NULL || obd->obd_set_up == 0 || obd->obd_stopping) + if (!obd || obd->obd_set_up == 0 || obd->obd_stopping) continue; /* only notify mdc, osc, mdt, ost */ @@ -659,27 +659,27 @@ void obd_cleanup_caches(void) int obd_init_caches(void) { - LASSERT(obd_device_cachep == NULL); + LASSERT(!obd_device_cachep); obd_device_cachep = kmem_cache_create("ll_obd_dev_cache", sizeof(struct obd_device), 0, 0, NULL); if (!obd_device_cachep) goto out; - LASSERT(obdo_cachep == NULL); + LASSERT(!obdo_cachep); ob
[PATCH v2 08/16] Staging: lustre: libcfs: libcfs_mem.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/lustre/lustre/libcfs/libcfs_mem.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c index 1debdda..f4e08da 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c @@ -84,7 +84,7 @@ cfs_percpt_alloc(struct cfs_cpt_table *cptab, unsigned int size) count = cfs_cpt_number(cptab); LIBCFS_ALLOC(arr, offsetof(struct cfs_var_array, va_ptrs[count])); - if (arr == NULL) + if (!arr) return NULL; arr->va_size= size = L1_CACHE_ALIGN(size); @@ -93,7 +93,7 @@ cfs_percpt_alloc(struct cfs_cpt_table *cptab, unsigned int size) for (i = 0; i < count; i++) { LIBCFS_CPT_ALLOC(arr->va_ptrs[i], cptab, i, size); - if (arr->va_ptrs[i] == NULL) { + if (!arr->va_ptrs[i]) { cfs_percpt_free((void *)>va_ptrs[0]); return NULL; } @@ -160,7 +160,7 @@ cfs_array_free(void *vars) arr = container_of(vars, struct cfs_var_array, va_ptrs[0]); for (i = 0; i < arr->va_count; i++) { - if (arr->va_ptrs[i] == NULL) + if (!arr->va_ptrs[i]) continue; LIBCFS_FREE(arr->va_ptrs[i], arr->va_size); @@ -182,7 +182,7 @@ cfs_array_alloc(int count, unsigned int size) int i; LIBCFS_ALLOC(arr, offsetof(struct cfs_var_array, va_ptrs[count])); - if (arr == NULL) + if (!arr) return NULL; arr->va_count = count; @@ -191,7 +191,7 @@ cfs_array_alloc(int count, unsigned int size) for (i = 0; i < count; i++) { LIBCFS_ALLOC(arr->va_ptrs[i], size); - if (arr->va_ptrs[i] == NULL) { + if (!arr->va_ptrs[i]) { cfs_array_free((void *)>va_ptrs[0]); return NULL; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 07/16] Staging: lustre: libcfs: libcfs_lock.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/lustre/lustre/libcfs/libcfs_lock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c index 2c199c7..29308ba 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c @@ -63,12 +63,12 @@ cfs_percpt_lock_alloc(struct cfs_cpt_table *cptab) /* NB: cptab can be NULL, pcl will be for HW CPUs on that case */ LIBCFS_ALLOC(pcl, sizeof(*pcl)); - if (pcl == NULL) + if (!pcl) return NULL; pcl->pcl_cptab = cptab; pcl->pcl_locks = cfs_percpt_alloc(cptab, sizeof(*lock)); - if (pcl->pcl_locks == NULL) { + if (!pcl->pcl_locks) { LIBCFS_FREE(pcl, sizeof(*pcl)); return NULL; } @@ -164,7 +164,7 @@ cfs_percpt_atomic_alloc(struct cfs_cpt_table *cptab, int init_val) int i; refs = cfs_percpt_alloc(cptab, sizeof(*ref)); - if (refs == NULL) + if (!refs) return NULL; cfs_percpt_for_each(ref, i, refs) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 11/16] Staging: rtl8188eu: hal: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 06d1e65..d6d009a 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -43,7 +43,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter) precvpriv->pallocated_recv_buf = kcalloc(NR_RECVBUFF, sizeof(struct recv_buf), GFP_KERNEL); - if (precvpriv->pallocated_recv_buf == NULL) { + if (!precvpriv->pallocated_recv_buf) { res = _FAIL; RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n")); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 16/16] Staging: rtl8188eu: os_dep: osdep_service.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/rtl8188eu/os_dep/osdep_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c b/drivers/staging/rtl8188eu/os_dep/osdep_service.c index acb4eb1..466cd76 100644 --- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c +++ b/drivers/staging/rtl8188eu/os_dep/osdep_service.c @@ -52,7 +52,7 @@ void *rtw_malloc2d(int h, int w, int size) int j; void **a = kzalloc(h*sizeof(void *) + h*w*size, GFP_KERNEL); - if (a == NULL) { + if (!a) { pr_info("%s: alloc memory fail!\n", __func__); return NULL; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 14/16] Staging: rtl8188eu: os_dep: recv_linux.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/rtl8188eu/os_dep/recv_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index 3ebb8b2..d4734baf 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -94,7 +94,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, pfree_recv_queue = &(precvpriv->free_recv_queue); skb = precv_frame->pkt; - if (skb == NULL) { + if (!skb) { RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong\n")); goto _recv_indicatepkt_drop; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 15/16] Staging: rtl8188eu: os_dep: mlme_linux.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No changes drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index 218adaa..eb8ecb7 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -152,7 +152,7 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *pst union iwreq_data wrqu; struct sta_priv *pstapriv = >stapriv; - if (psta == NULL) + if (!psta) return; if (psta->aid > NUM_STA) @@ -176,7 +176,7 @@ void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info * union iwreq_data wrqu; struct sta_priv *pstapriv = >stapriv; - if (psta == NULL) + if (!psta) return; if (psta->aid > NUM_STA) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 13/16] Staging: rtl8188eu: hal: rtl8188eu_xmit.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Changes in v2- No change drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c index 594c1da..4433560 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c @@ -649,7 +649,7 @@ static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe) goto enqueue; pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv); - if (pxmitbuf == NULL) + if (!pxmitbuf) goto enqueue; spin_unlock_bh(>lock); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 05/16] Staging: rtl8188eu: core: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Changes in v2- No change drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index b340e4a..497fb06 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -273,7 +273,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) struct sta_priv *pstapriv = >stapriv; - if (psta == NULL) + if (!psta) goto exit; pfree_sta_queue = >free_sta_queue; @@ -433,7 +433,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - if (hwaddr == NULL) + if (!hwaddr) return NULL; if (IS_MCAST(hwaddr)) @@ -473,7 +473,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter) psta = rtw_alloc_stainfo(pstapriv, bcast_addr); - if (psta == NULL) { + if (!psta) { res = _FAIL; RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail")); goto exit; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 06/16] Staging: rtl8188eu: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change. drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c index 0a62bfa..d528140 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c @@ -467,7 +467,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) DBG_88E("%s\n", __func__); ReservedPagePacket = kzalloc(1000, GFP_KERNEL); - if (ReservedPagePacket == NULL) { + if (!ReservedPagePacket) { DBG_88E("%s: alloc ReservedPagePacket fail!\n", __func__); return; } @@ -537,7 +537,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) TotalPacketLen = BufIndex + QosNullLength; pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (pmgntframe == NULL) + if (!pmgntframe) goto exit; /* update attribute */ -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 12/16] Staging: rtl8188eu: hal: Hal8188ERateAdaptive.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- Change in v2- No change drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c b/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c index 2633a13..a108e80 100644 --- a/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c +++ b/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c @@ -127,7 +127,7 @@ static int odm_RateDown_8188E(struct odm_dm_struct *dm_odm, ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("=>odm_RateDown_8188E()\n")); - if (NULL == pRaInfo) { + if (!pRaInfo) { ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("odm_RateDown_8188E(): pRaInfo is NULL\n")); return -1; @@ -193,7 +193,7 @@ static int odm_RateUp_8188E( ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("=>odm_RateUp_8188E()\n")); - if (NULL == pRaInfo) { + if (!pRaInfo) { ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("odm_RateUp_8188E(): pRaInfo is NULL\n")); return -1; @@ -624,7 +624,7 @@ int ODM_RAInfo_Init_all(struct odm_dm_struct *dm_odm) u8 ODM_RA_GetShortGI_8188E(struct odm_dm_struct *dm_odm, u8 macid) { - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return 0; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("macid =%d SGI =%d\n", macid, dm_odm->RAInfo[macid].RateSGI)); @@ -635,7 +635,7 @@ u8 ODM_RA_GetDecisionRate_8188E(struct odm_dm_struct *dm_odm, u8 macid) { u8 DecisionRate = 0; - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return 0; DecisionRate = dm_odm->RAInfo[macid].DecisionRate; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, @@ -647,7 +647,7 @@ u8 ODM_RA_GetHwPwrStatus_8188E(struct odm_dm_struct *dm_odm, u8 macid) { u8 PTStage = 5; - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return 0; PTStage = dm_odm->RAInfo[macid].PTStage; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, @@ -659,7 +659,7 @@ void ODM_RA_UpdateRateInfo_8188E(struct odm_dm_struct *dm_odm, u8 macid, u8 Rate { struct odm_ra_info *pRaInfo = NULL; - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("macid =%d RateID = 0x%x RateMask = 0x%x SGIEnable =%d\n", @@ -676,7 +676,7 @@ void ODM_RA_SetRSSI_8188E(struct odm_dm_struct *dm_odm, u8 macid, u8 Rssi) { struct odm_ra_info *pRaInfo = NULL; - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, (" macid =%d Rssi =%d\n", macid, Rssi)); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 06/16] Staging: rtl8188eu: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c index 0a62bfa..d528140 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c @@ -467,7 +467,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) DBG_88E("%s\n", __func__); ReservedPagePacket = kzalloc(1000, GFP_KERNEL); - if (ReservedPagePacket == NULL) { + if (!ReservedPagePacket) { DBG_88E("%s: alloc ReservedPagePacket fail!\n", __func__); return; } @@ -537,7 +537,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) TotalPacketLen = BufIndex + QosNullLength; pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (pmgntframe == NULL) + if (!pmgntframe) goto exit; /* update attribute */ -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 14/16] Staging: rtl8188eu: os_dep: recv_linux.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/os_dep/recv_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index 3ebb8b2..d4734baf 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -94,7 +94,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, pfree_recv_queue = &(precvpriv->free_recv_queue); skb = precv_frame->pkt; - if (skb == NULL) { + if (!skb) { RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong\n")); goto _recv_indicatepkt_drop; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 16/16] Staging: rtl8188eu: os_dep: osdep_service.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/os_dep/osdep_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c b/drivers/staging/rtl8188eu/os_dep/osdep_service.c index acb4eb1..466cd76 100644 --- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c +++ b/drivers/staging/rtl8188eu/os_dep/osdep_service.c @@ -52,7 +52,7 @@ void *rtw_malloc2d(int h, int w, int size) int j; void **a = kzalloc(h*sizeof(void *) + h*w*size, GFP_KERNEL); - if (a == NULL) { + if (!a) { pr_info("%s: alloc memory fail!\n", __func__); return NULL; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 12/16] Staging: rtl8188eu: hal: Hal8188ERateAdaptive.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c b/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c index 2633a13..a108e80 100644 --- a/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c +++ b/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c @@ -127,7 +127,7 @@ static int odm_RateDown_8188E(struct odm_dm_struct *dm_odm, ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("=>odm_RateDown_8188E()\n")); - if (NULL == pRaInfo) { + if (!pRaInfo) { ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("odm_RateDown_8188E(): pRaInfo is NULL\n")); return -1; @@ -193,7 +193,7 @@ static int odm_RateUp_8188E( ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("=>odm_RateUp_8188E()\n")); - if (NULL == pRaInfo) { + if (!pRaInfo) { ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("odm_RateUp_8188E(): pRaInfo is NULL\n")); return -1; @@ -624,7 +624,7 @@ int ODM_RAInfo_Init_all(struct odm_dm_struct *dm_odm) u8 ODM_RA_GetShortGI_8188E(struct odm_dm_struct *dm_odm, u8 macid) { - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return 0; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("macid =%d SGI =%d\n", macid, dm_odm->RAInfo[macid].RateSGI)); @@ -635,7 +635,7 @@ u8 ODM_RA_GetDecisionRate_8188E(struct odm_dm_struct *dm_odm, u8 macid) { u8 DecisionRate = 0; - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return 0; DecisionRate = dm_odm->RAInfo[macid].DecisionRate; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, @@ -647,7 +647,7 @@ u8 ODM_RA_GetHwPwrStatus_8188E(struct odm_dm_struct *dm_odm, u8 macid) { u8 PTStage = 5; - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return 0; PTStage = dm_odm->RAInfo[macid].PTStage; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, @@ -659,7 +659,7 @@ void ODM_RA_UpdateRateInfo_8188E(struct odm_dm_struct *dm_odm, u8 macid, u8 Rate { struct odm_ra_info *pRaInfo = NULL; - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("macid =%d RateID = 0x%x RateMask = 0x%x SGIEnable =%d\n", @@ -676,7 +676,7 @@ void ODM_RA_SetRSSI_8188E(struct odm_dm_struct *dm_odm, u8 macid, u8 Rssi) { struct odm_ra_info *pRaInfo = NULL; - if ((NULL == dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) + if ((!dm_odm) || (macid >= ASSOCIATE_ENTRY_NUM)) return; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, (" macid =%d Rssi =%d\n", macid, Rssi)); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 15/16] Staging: rtl8188eu: os_dep: mlme_linux.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index 218adaa..eb8ecb7 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -152,7 +152,7 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *pst union iwreq_data wrqu; struct sta_priv *pstapriv = >stapriv; - if (psta == NULL) + if (!psta) return; if (psta->aid > NUM_STA) @@ -176,7 +176,7 @@ void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info * union iwreq_data wrqu; struct sta_priv *pstapriv = >stapriv; - if (psta == NULL) + if (!psta) return; if (psta->aid > NUM_STA) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 13/16] Staging: rtl8188eu: hal: rtl8188eu_xmit.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c index 594c1da..4433560 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c @@ -649,7 +649,7 @@ static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe) goto enqueue; pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv); - if (pxmitbuf == NULL) + if (!pxmitbuf) goto enqueue; spin_unlock_bh(>lock); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 05/16] Staging: rtl8188eu: core: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index b340e4a..497fb06 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -273,7 +273,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) struct sta_priv *pstapriv = >stapriv; - if (psta == NULL) + if (!psta) goto exit; pfree_sta_queue = >free_sta_queue; @@ -433,7 +433,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - if (hwaddr == NULL) + if (!hwaddr) return NULL; if (IS_MCAST(hwaddr)) @@ -473,7 +473,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter) psta = rtw_alloc_stainfo(pstapriv, bcast_addr); - if (psta == NULL) { + if (!psta) { res = _FAIL; RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail")); goto exit; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 11/16] Staging: rtl8188eu: hal: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 06d1e65..d6d009a 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -43,7 +43,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter) precvpriv->pallocated_recv_buf = kcalloc(NR_RECVBUFF, sizeof(struct recv_buf), GFP_KERNEL); - if (precvpriv->pallocated_recv_buf == NULL) { + if (!precvpriv->pallocated_recv_buf) { res = _FAIL; RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n")); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 09/16] Staging: lustre: obdclass: obd_config.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- .../staging/lustre/lustre/obdclass/obd_config.c| 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index e0470c0..fb432e8 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -61,7 +61,7 @@ int class_find_param(char *buf, char *key, char **valp) return 1; ptr = strstr(buf, key); - if (ptr == NULL) + if (!ptr) return 1; if (valp) @@ -92,11 +92,11 @@ struct cfg_interop_param *class_find_old_param(const char *param, char *value = NULL; int name_len = 0; - if (param == NULL || ptr == NULL) + if (!param || !ptr) return NULL; value = strchr(param, '='); - if (value == NULL) + if (!value) name_len = strlen(param); else name_len = value - param; @@ -144,7 +144,7 @@ int class_get_next_param(char **params, char *copy) while (1) { q1 = strpbrk(str, " '\""); - if (q1 == NULL) { + if (!q1) { len = strlen(str); memcpy(copy, str, len); copy[len] = '\0'; @@ -165,7 +165,7 @@ int class_get_next_param(char **params, char *copy) /* search for the matching closing quote */ str = q1 + 1; q2 = strchr(str, *q1); - if (q2 == NULL) { + if (!q2) { CERROR("Unbalanced quota in parameters: \"%s\"\n", *params); return -EINVAL; @@ -243,7 +243,7 @@ static int class_parse_value(char *buf, int opc, void *value, char **endh, /* nid separators or end of nids */ endp = strpbrk(buf, ",: /"); - if (endp == NULL) + if (!endp) endp = buf + strlen(buf); tmp = *endp; @@ -841,14 +841,14 @@ int class_add_profile(int proflen, char *prof, int osclen, char *osc, LASSERT(proflen == (strlen(prof) + 1)); lprof->lp_profile = kmemdup(prof, proflen, GFP_NOFS); - if (lprof->lp_profile == NULL) { + if (!lprof->lp_profile) { err = -ENOMEM; goto free_lprof; } LASSERT(osclen == (strlen(osc) + 1)); lprof->lp_dt = kmemdup(osc, osclen, GFP_NOFS); - if (lprof->lp_dt == NULL) { + if (!lprof->lp_dt) { err = -ENOMEM; goto free_lp_profile; } @@ -856,7 +856,7 @@ int class_add_profile(int proflen, char *prof, int osclen, char *osc, if (mdclen > 0) { LASSERT(mdclen == (strlen(mdc) + 1)); lprof->lp_md = kmemdup(mdc, mdclen, GFP_NOFS); - if (lprof->lp_md == NULL) { + if (!lprof->lp_md) { err = -ENOMEM; goto free_lp_dt; } @@ -963,15 +963,15 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg, int name_len = 0; int new_len = 0; - if (cfg == NULL || new_name == NULL) + if (!cfg || !new_name) return ERR_PTR(-EINVAL); param = lustre_cfg_string(cfg, 1); - if (param == NULL) + if (!param) return ERR_PTR(-EINVAL); value = strchr(param, '='); - if (value == NULL) + if (!value) name_len = strlen(param); else name_len = value - param; @@ -1000,7 +1000,7 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg, kfree(new_param); kfree(bufs); - if (new_cfg == NULL) + if (!new_cfg) return ERR_PTR(-ENOMEM); new_cfg->lcfg_num = cfg->lcfg_num; @@ -1178,7 +1178,7 @@ int class_process_config(struct lustre_cfg *lcfg) } /* Commands that require a device */ obd = class_name2obd(lustre_cfg_string(lcfg, 0)); - if (obd == NULL) { + if (!obd) { if (!LUSTRE_CFG_BUFLEN(lcfg, 0)) CERROR("this lcfg command requires a device name\n"); else @@ -1481,7 +1481,7 @@ int class_config_llog_handler(const struct lu_env *env, * moving them to index [1] and [2], and insert MGC's * obdname at index [0]. */ - if (clli && clli->cfg_instance == NULL && + if (clli && !clli->cfg_instance &&
[PATCH 10/16] Staging: lustre: obdclass: genops.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/lustre/lustre/obdclass/genops.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index c12ebd5..1248835 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -178,9 +178,9 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, type->typ_md_ops = kzalloc(sizeof(*type->typ_md_ops), GFP_NOFS); type->typ_name = kzalloc(strlen(name) + 1, GFP_NOFS); - if (type->typ_dt_ops == NULL || - type->typ_md_ops == NULL || - type->typ_name == NULL) + if (!type->typ_dt_ops || + !type->typ_md_ops || + !type->typ_name) goto failed; *(type->typ_dt_ops) = *dt_ops; @@ -293,13 +293,13 @@ struct obd_device *class_newdev(const char *type_name, const char *name) } type = class_get_type(type_name); - if (type == NULL) { + if (!type) { CERROR("OBD: unknown type: %s\n", type_name); return ERR_PTR(-ENODEV); } newdev = obd_device_alloc(); - if (newdev == NULL) { + if (!newdev) { result = ERR_PTR(-ENOMEM); goto out_type; } @@ -339,7 +339,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name) } write_unlock(_dev_lock); - if (result == NULL && i >= class_devno_max()) { + if (!result && i >= class_devno_max()) { CERROR("all %u OBD devices used, increase MAX_OBD_DEVICES\n", class_devno_max()); result = ERR_PTR(-EOVERFLOW); @@ -463,7 +463,7 @@ struct obd_device *class_num2obd(int num) if (num < class_devno_max()) { obd = obd_devs[num]; - if (obd == NULL) + if (!obd) return NULL; LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, @@ -509,7 +509,7 @@ void class_obd_list(void) for (i = 0; i < class_devno_max(); i++) { struct obd_device *obd = class_num2obd(i); - if (obd == NULL) + if (!obd) continue; if (obd->obd_stopping) status = "ST"; @@ -540,7 +540,7 @@ struct obd_device *class_find_client_obd(struct obd_uuid *tgt_uuid, for (i = 0; i < class_devno_max(); i++) { struct obd_device *obd = class_num2obd(i); - if (obd == NULL) + if (!obd) continue; if ((strncmp(obd->obd_type->typ_name, typ_name, strlen(typ_name)) == 0)) { @@ -567,7 +567,7 @@ struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, int *next) { int i; - if (next == NULL) + if (!next) i = 0; else if (*next >= 0 && *next < class_devno_max()) i = *next; @@ -578,7 +578,7 @@ struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, int *next) for (; i < class_devno_max(); i++) { struct obd_device *obd = class_num2obd(i); - if (obd == NULL) + if (!obd) continue; if (obd_uuid_equals(grp_uuid, >obd_uuid)) { if (next != NULL) @@ -609,7 +609,7 @@ int class_notify_sptlrpc_conf(const char *fsname, int namelen) for (i = 0; i < class_devno_max(); i++) { obd = class_num2obd(i); - if (obd == NULL || obd->obd_set_up == 0 || obd->obd_stopping) + if (!obd || obd->obd_set_up == 0 || obd->obd_stopping) continue; /* only notify mdc, osc, mdt, ost */ @@ -659,27 +659,27 @@ void obd_cleanup_caches(void) int obd_init_caches(void) { - LASSERT(obd_device_cachep == NULL); + LASSERT(!obd_device_cachep); obd_device_cachep = kmem_cache_create("ll_obd_dev_cache", sizeof(struct obd_device), 0, 0, NULL); if (!obd_device_cachep) goto out; - LASSERT(obdo_cachep == NULL); + LASSERT(!obdo_cachep); obdo_cachep = kmem_cache_create("ll_obdo_cache", sizeof(struct obdo), 0, 0, NULL); if (!obdo_cachep) goto out; - LASSERT(import_cachep == NULL); +
[PATCH 07/16] Staging: lustre: libcfs: libcfs_lock.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/lustre/lustre/libcfs/libcfs_lock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c index 2c199c7..29308ba 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c @@ -63,12 +63,12 @@ cfs_percpt_lock_alloc(struct cfs_cpt_table *cptab) /* NB: cptab can be NULL, pcl will be for HW CPUs on that case */ LIBCFS_ALLOC(pcl, sizeof(*pcl)); - if (pcl == NULL) + if (!pcl) return NULL; pcl->pcl_cptab = cptab; pcl->pcl_locks = cfs_percpt_alloc(cptab, sizeof(*lock)); - if (pcl->pcl_locks == NULL) { + if (!pcl->pcl_locks) { LIBCFS_FREE(pcl, sizeof(*pcl)); return NULL; } @@ -164,7 +164,7 @@ cfs_percpt_atomic_alloc(struct cfs_cpt_table *cptab, int init_val) int i; refs = cfs_percpt_alloc(cptab, sizeof(*ref)); - if (refs == NULL) + if (!refs) return NULL; cfs_percpt_for_each(ref, i, refs) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 08/16] Staging: lustre: libcfs: libcfs_mem.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/lustre/lustre/libcfs/libcfs_mem.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c index 1debdda..f4e08da 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c @@ -84,7 +84,7 @@ cfs_percpt_alloc(struct cfs_cpt_table *cptab, unsigned int size) count = cfs_cpt_number(cptab); LIBCFS_ALLOC(arr, offsetof(struct cfs_var_array, va_ptrs[count])); - if (arr == NULL) + if (!arr) return NULL; arr->va_size= size = L1_CACHE_ALIGN(size); @@ -93,7 +93,7 @@ cfs_percpt_alloc(struct cfs_cpt_table *cptab, unsigned int size) for (i = 0; i < count; i++) { LIBCFS_CPT_ALLOC(arr->va_ptrs[i], cptab, i, size); - if (arr->va_ptrs[i] == NULL) { + if (!arr->va_ptrs[i]) { cfs_percpt_free((void *)>va_ptrs[0]); return NULL; } @@ -160,7 +160,7 @@ cfs_array_free(void *vars) arr = container_of(vars, struct cfs_var_array, va_ptrs[0]); for (i = 0; i < arr->va_count; i++) { - if (arr->va_ptrs[i] == NULL) + if (!arr->va_ptrs[i]) continue; LIBCFS_FREE(arr->va_ptrs[i], arr->va_size); @@ -182,7 +182,7 @@ cfs_array_alloc(int count, unsigned int size) int i; LIBCFS_ALLOC(arr, offsetof(struct cfs_var_array, va_ptrs[count])); - if (arr == NULL) + if (!arr) return NULL; arr->va_count = count; @@ -191,7 +191,7 @@ cfs_array_alloc(int count, unsigned int size) for (i = 0; i < count; i++) { LIBCFS_ALLOC(arr->va_ptrs[i], size); - if (arr->va_ptrs[i] == NULL) { + if (!arr->va_ptrs[i]) { cfs_array_free((void *)>va_ptrs[0]); return NULL; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 03/16] Staging: speakup: serialio.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/speakup/serialio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index 66ac999..3b5835b 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -101,7 +101,7 @@ static void start_serial_interrupt(int irq) { int rv; - if (synth->read_buff_add == NULL) + if (!synth->read_buff_add) return; rv = request_irq(irq, synth_readbuf_handler, IRQF_SHARED, @@ -127,7 +127,7 @@ void spk_stop_serial_interrupt(void) if (speakup_info.port_tts == 0) return; - if (synth->read_buff_add == NULL) + if (!synth->read_buff_add) return; /* Turn off interrupts */ -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 04/16] Staging: speakup: kobjects.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/speakup/kobjects.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 958add4..fdfeb42 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -368,7 +368,7 @@ static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr, { int rv; - if (synth == NULL) + if (!synth) rv = sprintf(buf, "%s\n", "none"); else rv = sprintf(buf, "%s\n", synth->name); @@ -459,14 +459,14 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -501,14 +501,14 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr, return -EINVAL; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -546,7 +546,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; spin_lock_irqsave(_info.spinlock, flags); @@ -622,9 +622,9 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; - if (param->data == NULL) + if (!param->data) return 0; ret = 0; cp = (char *)buf; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 02/16] Staging: speakup: devsynth.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/speakup/devsynth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/speakup/devsynth.c b/drivers/staging/speakup/devsynth.c index 71c728a..d1ffdf4 100644 --- a/drivers/staging/speakup/devsynth.c +++ b/drivers/staging/speakup/devsynth.c @@ -22,7 +22,7 @@ static ssize_t speakup_file_write(struct file *fp, const char __user *buffer, unsigned long flags; u_char buf[256]; - if (synth == NULL) + if (!synth) return -ENODEV; while (count > 0) { bytes = min(count, sizeof(buf)); @@ -45,7 +45,7 @@ static ssize_t speakup_file_read(struct file *fp, char __user *buf, static int speakup_file_open(struct inode *ip, struct file *fp) { - if (synth == NULL) + if (!synth) return -ENODEV; if (xchg(_opened, 1)) return -EBUSY; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 01/16] Staging: speakup: varhandlers.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Shraddha Barke --- drivers/staging/speakup/varhandlers.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index 75bf40c..64042c9 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -90,7 +90,7 @@ void speakup_register_var(struct var_t *var) struct st_var_header *p_header; BUG_ON(!var || var->var_id < 0 || var->var_id >= MAXVARS); - if (var_ptrs[0] == NULL) { + if (!var_ptrs[0]) { for (i = 0; i < MAXVARS; i++) { p_header = _headers[i]; var_ptrs[p_header->var_id] = p_header; @@ -130,7 +130,7 @@ struct st_var_header *spk_get_var_header(enum var_id_t var_id) if (var_id < 0 || var_id >= MAXVARS) return NULL; p_header = var_ptrs[var_id]; - if (p_header->data == NULL) + if (!p_header->data) return NULL; return p_header; } @@ -163,7 +163,7 @@ struct punc_var_t *spk_get_punc_var(enum var_id_t var_id) struct punc_var_t *where; where = punc_vars; - while ((where->var_id != -1) && (rv == NULL)) { + while ((where->var_id != -1) && (!rv)) { if (where->var_id == var_id) rv = where; else @@ -183,7 +183,7 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) char *cp; struct var_t *var_data = var->data; - if (var_data == NULL) + if (!var_data) return -ENODATA; if (how == E_NEW_DEFAULT) { @@ -221,7 +221,7 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) if (var_data->u.n.multiplier != 0) val *= var_data->u.n.multiplier; val += var_data->u.n.offset; - if (var->var_id < FIRST_SYNTH_VAR || synth == NULL) + if (var->var_id < FIRST_SYNTH_VAR || !synth) return ret; if (synth->synth_adjust != NULL) { int status = synth->synth_adjust(var); @@ -247,7 +247,7 @@ int spk_set_string_var(const char *page, struct st_var_header *var, int len) { struct var_t *var_data = var->data; - if (var_data == NULL) + if (!var_data) return -ENODATA; if (len > MAXVARLEN) return -E2BIG; @@ -313,7 +313,7 @@ char *spk_strlwr(char *s) { char *p; - if (s == NULL) + if (!s) return NULL; for (p = s; *p; p++) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/