All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Bitan Biswas <bbiswas@nvidia.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Thierry Reding <treding@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Shardar Mohammed <smohammed@nvidia.com>,
	Sowjanya Komatineni <skomatineni@nvidia.com>,
	Mantravadi Karthik <mkarthik@nvidia.com>
Subject: Re: [PATCH V4] drivers: i2c: tegra: fix checkpatch defects
Date: Thu, 6 Jun 2019 20:45:52 +0000	[thread overview]
Message-ID: <8df7648d-c5bd-7179-6368-66dab9b7fa39@axentia.se> (raw)
In-Reply-To: <1559806523-1352-1-git-send-email-bbiswas@nvidia.com>

On 2019-06-06 09:35, Bitan Biswas wrote:
> Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c
> 
> Remove redundant BUG_ON calls or replace with WARN_ON_ONCE
> as needed. Replace BUG() with error handling code.
> Define I2C_ERR_UNEXPECTED_STATUS for error handling.
> 
> Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
> ---
>  drivers/i2c/busses/i2c-tegra.c | 67 +++++++++++++++++++++++-------------------
>  1 file changed, 37 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index 76b7926..55a5d87 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -78,6 +78,7 @@
>  #define I2C_ERR_NO_ACK				0x01
>  #define I2C_ERR_ARBITRATION_LOST		0x02
>  #define I2C_ERR_UNKNOWN_INTERRUPT		0x04
> +#define I2C_ERR_UNEXPECTED_STATUS               0x08

Use tabs like the the surrounding code. And perhaps convert all
these flags to use the BIT() macro?

>  
>  #define PACKET_HEADER0_HEADER_SIZE_SHIFT	28
>  #define PACKET_HEADER0_PACKET_ID_SHIFT		16
> @@ -112,7 +113,7 @@
>  #define I2C_CLKEN_OVERRIDE			0x090
>  #define I2C_MST_CORE_CLKEN_OVR			BIT(0)
>  
> -#define I2C_CONFIG_LOAD_TIMEOUT			1000000
> +#define I2C_CONFIG_LOAD_TMOUT			1000000

Similar to xfer_tm already mentioned by Dmitry; just keep it as
..._TIMEOUT and ignore checkpatch on this issue. Or juggle the
code in some other way to pacify checkpatch. E.g. abbreviate
CONFIG instead? Or something. CONF is way easier to read than
TMOUT IMHO...

Cheers,
Peter

  parent reply	other threads:[~2019-06-06 20:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06  7:35 [PATCH V4] drivers: i2c: tegra: fix checkpatch defects Bitan Biswas
2019-06-06  7:35 ` Bitan Biswas
2019-06-06 11:39 ` Dmitry Osipenko
2019-06-06 14:02   ` Bitan Biswas
2019-06-06 14:02     ` Bitan Biswas
2019-06-06 15:34     ` Dmitry Osipenko
2019-06-06 11:57 ` Wolfram Sang
2019-06-06 18:22   ` Bitan Biswas
2019-06-06 18:22     ` Bitan Biswas
2019-06-06 20:45 ` Peter Rosin [this message]
2019-06-07  3:40   ` Bitan Biswas

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=8df7648d-c5bd-7179-6368-66dab9b7fa39@axentia.se \
    --to=peda@axentia.se \
    --cc=bbiswas@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkarthik@nvidia.com \
    --cc=skomatineni@nvidia.com \
    --cc=smohammed@nvidia.com \
    --cc=treding@nvidia.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 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.