linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Nuno Sa <Nuno.Sa@analog.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH v3 01/14] iio: adc: max1027: Fix style
Date: Wed, 15 Sep 2021 17:51:04 +0200	[thread overview]
Message-ID: <20210915155117.475962-2-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20210915155117.475962-1-miquel.raynal@bootlin.com>

Follow checkpatch.pl's main advices before hacking into the driver, mainly:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Prefer 'unsigned int *' to bare use of 'unsigned *'
CHECK: Comparison to NULL could be written "!foo"
CHECK: Alignment should match open parenthesis

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/iio/adc/max1027.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
index b753658bb41e..5c4633a54b30 100644
--- a/drivers/iio/adc/max1027.c
+++ b/drivers/iio/adc/max1027.c
@@ -327,8 +327,8 @@ static int max1027_read_raw(struct iio_dev *indio_dev,
 }
 
 static int max1027_debugfs_reg_access(struct iio_dev *indio_dev,
-				      unsigned reg, unsigned writeval,
-				      unsigned *readval)
+				      unsigned int reg, unsigned int writeval,
+				      unsigned int *readval)
 {
 	struct max1027_state *st = iio_priv(indio_dev);
 	u8 *val = (u8 *)st->buffer;
@@ -424,7 +424,7 @@ static int max1027_probe(struct spi_device *spi)
 	pr_debug("%s: probe(spi = 0x%p)\n", __func__, spi);
 
 	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-	if (indio_dev == NULL) {
+	if (!indio_dev) {
 		pr_err("Can't allocate iio device\n");
 		return -ENOMEM;
 	}
@@ -443,9 +443,9 @@ static int max1027_probe(struct spi_device *spi)
 	indio_dev->available_scan_masks = st->info->available_scan_masks;
 
 	st->buffer = devm_kmalloc_array(&indio_dev->dev,
-				  indio_dev->num_channels, 2,
-				  GFP_KERNEL);
-	if (st->buffer == NULL) {
+					indio_dev->num_channels, 2,
+					GFP_KERNEL);
+	if (!st->buffer) {
 		dev_err(&indio_dev->dev, "Can't allocate buffer\n");
 		return -ENOMEM;
 	}
@@ -462,7 +462,7 @@ static int max1027_probe(struct spi_device *spi)
 
 		st->trig = devm_iio_trigger_alloc(&spi->dev, "%s-trigger",
 						  indio_dev->name);
-		if (st->trig == NULL) {
+		if (!st->trig) {
 			ret = -ENOMEM;
 			dev_err(&indio_dev->dev,
 				"Failed to allocate iio trigger\n");
-- 
2.27.0


  reply	other threads:[~2021-09-15 15:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 15:51 [PATCH v3 00/14] Bring external triggers support to MAX1027-like ADCs Miquel Raynal
2021-09-15 15:51 ` Miquel Raynal [this message]
2021-09-15 15:51 ` [PATCH v3 02/14] iio: adc: max1027: Drop extra warning message Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 03/14] iio: adc: max1027: Drop useless debug messages Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 04/14] iio: adc: max1027: Minimize the number of converted channels Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 05/14] iio: adc: max1027: Rename a helper Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 06/14] iio: adc: max1027: Create a helper to enable/disable the cnvst trigger Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 07/14] iio: adc: max1027: Simplify the _set_trigger_state() helper Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 08/14] iio: adc: max1027: Ensure a default cnvst trigger configuration Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 09/14] iio: adc: max1027: Create a helper to configure the channels to scan Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 10/14] iio: adc: max1027: Prevent single channel accesses during buffer reads Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 11/14] iio: adc: max1027: Separate the IRQ handler from the read logic Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 12/14] iio: adc: max1027: Introduce an end of conversion helper Miquel Raynal
2021-09-15 15:51 ` [PATCH v3 13/14] iio: adc: max1027: Deeply rework interrupt handling Miquel Raynal
2021-09-18 17:09   ` Jonathan Cameron
2021-09-15 15:51 ` [PATCH v3 14/14] iio: adc: max1027: Don't reject external triggers when there is no IRQ Miquel Raynal

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=20210915155117.475962-2-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=Nuno.Sa@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).