From: Dan Carpenter <dan.carpenter@oracle.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-spi@vger.kernel.org, Mark Brown <broonie@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 14/17] spi/topcliff-pch: Adjust six checks for null pointers
Date: Sat, 14 Jan 2017 06:36:08 +0000 [thread overview]
Message-ID: <20170114063608.GD15314@mwanda> (raw)
In-Reply-To: <676a6351-ec06-9744-9f6f-753feb65f8fb@users.sourceforge.net>
On Fri, Jan 13, 2017 at 06:24:22PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 13 Jan 2017 16:16:05 +0100
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> The script "checkpatch.pl" pointed information out like the following.
>
> Comparison to NULL could be written …
>
> Thus fix the affected source code places.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/spi/spi-topcliff-pch.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
> index 0a876311b67b..e4f1f66b751b 100644
> --- a/drivers/spi/spi-topcliff-pch.c
> +++ b/drivers/spi/spi-topcliff-pch.c
> @@ -531,12 +531,11 @@ static int pch_spi_transfer(struct spi_device *pspi, struct spi_message *pmsg)
> static inline void pch_spi_select_chip(struct pch_spi_data *data,
> struct spi_device *pspi)
> {
> - if (data->current_chip != NULL) {
> + if (data->current_chip)
Put the curly braces back. Multi-line indents get curly braces for
readability.
> if (pspi->chip_select != data->n_curnt_chip) {
> dev_dbg(&pspi->dev, "%s : different slave\n", __func__);
> data->current_chip = NULL;
> }
> - }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-spi@vger.kernel.org, Mark Brown <broonie@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 14/17] spi/topcliff-pch: Adjust six checks for null pointers
Date: Sat, 14 Jan 2017 09:36:08 +0300 [thread overview]
Message-ID: <20170114063608.GD15314@mwanda> (raw)
In-Reply-To: <676a6351-ec06-9744-9f6f-753feb65f8fb@users.sourceforge.net>
On Fri, Jan 13, 2017 at 06:24:22PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 13 Jan 2017 16:16:05 +0100
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> The script "checkpatch.pl" pointed information out like the following.
>
> Comparison to NULL could be written …
>
> Thus fix the affected source code places.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/spi/spi-topcliff-pch.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
> index 0a876311b67b..e4f1f66b751b 100644
> --- a/drivers/spi/spi-topcliff-pch.c
> +++ b/drivers/spi/spi-topcliff-pch.c
> @@ -531,12 +531,11 @@ static int pch_spi_transfer(struct spi_device *pspi, struct spi_message *pmsg)
> static inline void pch_spi_select_chip(struct pch_spi_data *data,
> struct spi_device *pspi)
> {
> - if (data->current_chip != NULL) {
> + if (data->current_chip)
Put the curly braces back. Multi-line indents get curly braces for
readability.
> if (pspi->chip_select != data->n_curnt_chip) {
> dev_dbg(&pspi->dev, "%s : different slave\n", __func__);
> data->current_chip = NULL;
> }
> - }
regards,
dan carpenter
next prev parent reply other threads:[~2017-01-14 6:36 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 17:05 [PATCH 00/17] SPI: Fine-tuning for several function implementations SF Markus Elfring
2017-01-13 17:05 ` SF Markus Elfring
2017-01-13 17:07 ` [PATCH 01/17] spi: Use kcalloc() in spi_register_board_info() SF Markus Elfring
2017-01-13 17:07 ` SF Markus Elfring
[not found] ` <26b9015b-7ba2-3e26-5075-9a78f3884392-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-01-17 18:46 ` Applied "spi: Use kcalloc() in spi_register_board_info()" to the spi tree Mark Brown
2017-01-17 18:46 ` Mark Brown
2017-01-17 18:46 ` Mark Brown
2017-01-13 17:09 ` [PATCH 02/17] spi: Adjust checks for null pointers in two functions SF Markus Elfring
2017-01-13 17:09 ` SF Markus Elfring
2017-01-17 18:21 ` Mark Brown
2017-01-13 17:11 ` [PATCH 03/17] spi: fsl: Use kcalloc() in of_fsl_spi_get_chipselects() SF Markus Elfring
2017-01-13 17:11 ` SF Markus Elfring
[not found] ` <0b7517f1-5f9f-a002-ac59-c5921fec1eeb-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-01-17 18:46 ` Applied "spi: fsl: Use kcalloc() in of_fsl_spi_get_chipselects()" to the spi tree Mark Brown
2017-01-17 18:46 ` Mark Brown
2017-01-17 18:46 ` Mark Brown
[not found] ` <1413e173-dbac-7a6e-09cb-2287300a335e-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-01-13 17:12 ` [PATCH 04/17] spi: fsl: Use kmalloc_array() in of_fsl_spi_get_chipselects() SF Markus Elfring
2017-01-13 17:12 ` SF Markus Elfring
2017-01-13 17:12 ` SF Markus Elfring
2017-01-17 18:27 ` Mark Brown
2017-01-17 18:46 ` Applied "spi: fsl: Use kmalloc_array() in of_fsl_spi_get_chipselects()" to the spi tree Mark Brown
2017-01-17 18:46 ` Mark Brown
2017-01-13 17:13 ` [PATCH 05/17] spi: fsl: Combine substrings for two messages SF Markus Elfring
2017-01-13 17:13 ` SF Markus Elfring
2017-01-13 17:13 ` SF Markus Elfring
2017-01-17 18:46 ` Applied "spi: fsl: Combine substrings for two messages" to the spi tree Mark Brown
2017-01-17 18:46 ` Mark Brown
2017-01-13 17:16 ` [PATCH 08/17] spi/ppc4xx: Use kcalloc() in spi_ppc4xx_of_probe() SF Markus Elfring
2017-01-13 17:16 ` SF Markus Elfring
2017-01-13 17:16 ` SF Markus Elfring
2017-01-17 18:45 ` Applied "spi/ppc4xx: Use kcalloc() in spi_ppc4xx_of_probe()" to the spi tree Mark Brown
2017-01-17 18:45 ` Mark Brown
2017-01-13 17:18 ` [PATCH 09/17] spi/ppc4xx: Combine substrings for a message in spi_ppc4xx_of_probe() SF Markus Elfring
2017-01-13 17:18 ` SF Markus Elfring
2017-01-13 17:18 ` SF Markus Elfring
2017-01-17 18:45 ` Applied "spi/ppc4xx: Combine substrings for a message in spi_ppc4xx_of_probe()" to the spi tree Mark Brown
2017-01-17 18:45 ` Mark Brown
2017-01-13 17:23 ` [PATCH 13/17] spi/topcliff-pch: Delete an unnecessary return statement in two functions SF Markus Elfring
2017-01-13 17:23 ` SF Markus Elfring
2017-01-13 17:23 ` SF Markus Elfring
2017-01-17 18:45 ` Applied "spi/topcliff-pch: Delete an unnecessary return statement in two functions" to the spi tree Mark Brown
2017-01-17 18:45 ` Mark Brown
2017-01-13 17:25 ` [PATCH 15/17] spi/topcliff-pch: Combine substrings for four messages SF Markus Elfring
2017-01-13 17:25 ` SF Markus Elfring
2017-01-13 17:25 ` SF Markus Elfring
2017-01-17 18:45 ` Applied "spi/topcliff-pch: Combine substrings for four messages" to the spi tree Mark Brown
2017-01-17 18:45 ` Mark Brown
2017-01-13 17:14 ` [PATCH 06/17] spi/mpc52xx: Use kmalloc_array() in mpc52xx_spi_probe() SF Markus Elfring
2017-01-13 17:14 ` SF Markus Elfring
2017-01-17 18:46 ` Applied "spi/mpc52xx: Use kmalloc_array() in mpc52xx_spi_probe()" to the spi tree Mark Brown
2017-01-17 18:46 ` Mark Brown
2017-01-13 17:15 ` [PATCH 07/17] spi/mpc52xx: Combine substrings for two messages SF Markus Elfring
2017-01-13 17:15 ` SF Markus Elfring
2017-01-17 18:33 ` Mark Brown
2017-01-17 18:46 ` Applied "spi/mpc52xx: Combine substrings for two messages" to the spi tree Mark Brown
2017-01-17 18:46 ` Mark Brown
2017-01-13 17:19 ` [PATCH 10/17] spi/ppc4xx: Adjust checks for null pointers in two functions SF Markus Elfring
2017-01-13 17:19 ` SF Markus Elfring
2017-01-17 18:34 ` Mark Brown
2017-01-17 18:48 ` SF Markus Elfring
2017-01-17 18:48 ` SF Markus Elfring
2017-01-17 19:11 ` Mark Brown
[not found] ` <20170117191101.ndcmoafymhqixwnv-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-01-17 19:28 ` SF Markus Elfring
2017-01-17 19:28 ` SF Markus Elfring
2017-01-17 19:28 ` SF Markus Elfring
[not found] ` <2eb15f70-ecac-fafc-c2b8-323e1b9381f8-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-01-17 19:37 ` Mark Brown
2017-01-17 19:37 ` Mark Brown
2017-01-17 19:37 ` Mark Brown
2017-01-13 17:20 ` [PATCH 11/17] spi/topcliff-pch: Use kcalloc() in pch_spi_handle_dma() SF Markus Elfring
2017-01-13 17:20 ` SF Markus Elfring
[not found] ` <5c46b68f-192e-2982-6a0e-2017da26f83d-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-01-17 18:45 ` Applied "spi/topcliff-pch: Use kcalloc() in pch_spi_handle_dma()" to the spi tree Mark Brown
2017-01-17 18:45 ` Mark Brown
2017-01-17 18:45 ` Mark Brown
2017-01-13 17:21 ` [PATCH 12/17] spi/topcliff-pch: Improve size determinations in pch_spi_probe() SF Markus Elfring
2017-01-13 17:21 ` SF Markus Elfring
2017-01-17 18:45 ` Applied "spi/topcliff-pch: Improve size determinations in pch_spi_probe()" to the spi tree Mark Brown
2017-01-17 18:45 ` Mark Brown
2017-01-13 17:24 ` [PATCH 14/17] spi/topcliff-pch: Adjust six checks for null pointers SF Markus Elfring
2017-01-13 17:24 ` SF Markus Elfring
2017-01-14 6:36 ` Dan Carpenter [this message]
2017-01-14 6:36 ` Dan Carpenter
2017-01-13 17:27 ` [PATCH 16/17] spi/topcliff-pch: Delete an error message for a failed memory allocation in pch_spi_se SF Markus Elfring
2017-01-13 17:27 ` [PATCH 16/17] spi/topcliff-pch: Delete an error message for a failed memory allocation in pch_spi_set_tx() SF Markus Elfring
2017-01-17 18:45 ` Applied "spi/topcliff-pch: Delete an error message for a failed memory allocation in pch_spi_set_tx( Mark Brown
2017-01-17 18:45 ` Applied "spi/topcliff-pch: Delete an error message for a failed memory allocation in pch_spi_set_tx()" to the spi tree Mark Brown
2017-01-13 17:28 ` [PATCH 17/17] spi/topcliff-pch: One check less in pch_spi_set_tx() SF Markus Elfring
2017-01-13 17:28 ` SF Markus Elfring
2017-01-13 18:16 ` Geert Uytterhoeven
2017-01-13 18:16 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170114063608.GD15314@mwanda \
--to=dan.carpenter@oracle.com \
--cc=broonie@kernel.org \
--cc=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.