public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michal Simek <michal.simek@xilinx.com>,
	Shubhrajyoti Datta <Shubhrajyoti.datta@amd.com>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH 3/5] i2c: cadence: Remove redundant expression in if clause
Date: Fri, 20 Jan 2023 09:56:36 +0100	[thread overview]
Message-ID: <Y8pXRNF98JL5BlQA@ninjato> (raw)
In-Reply-To: <20230107211814.1179438-4-lars@metafoo.de>

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

On Sat, Jan 07, 2023 at 01:18:12PM -0800, Lars-Peter Clausen wrote:
> In the mrecv() function the Cadence I2C driver has the following expression
> in an if clause.
> 
> 	((id->p_msg->flags & I2C_M_RECV_LEN) != I2C_M_RECV_LEN) &&
> 	 (id->recv_count <= CDNS_I2C_FIFO_DEPTH))
> 
> Earlier in the same function when I2C_M_RECV_LEN is set the recv_count is
> initialized to a value that is larger than CDNS_I2C_FIFO_DEPTH. This means
> if the first expression is false the second expression is also false.
> Checking the first expression is thus redundant and can be removed.
> 
> This slightly simplifies the logic.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2023-01-20  8:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07 21:18 [PATCH 0/5] i2c: cadence: Small cleanups Lars-Peter Clausen
2023-01-07 21:18 ` [PATCH 1/5] i2c: cadence: Remove unused CDNS_I2C_DATA_INTR_DEPTH define Lars-Peter Clausen
2023-01-16 14:37   ` Michal Simek
2023-01-20  8:56   ` Wolfram Sang
2023-01-07 21:18 ` [PATCH 2/5] i2c: cadence: Remove `irq` field from driver state struct Lars-Peter Clausen
2023-01-16 14:39   ` Michal Simek
2023-01-20  8:56   ` Wolfram Sang
2023-01-07 21:18 ` [PATCH 3/5] i2c: cadence: Remove redundant expression in if clause Lars-Peter Clausen
2023-01-16 14:44   ` Michal Simek
2023-01-20  8:56   ` Wolfram Sang [this message]
2023-01-07 21:18 ` [PATCH 4/5] i2c: cadence: Remove always false ternary operator Lars-Peter Clausen
2023-01-16 15:00   ` Michal Simek
2023-02-27 10:46   ` Michal Simek
2023-03-16 19:29   ` Wolfram Sang
2023-01-07 21:18 ` [PATCH 5/5] i2c: cadence: Remove unnecessary register reads Lars-Peter Clausen
2023-01-16 14:58   ` Michal Simek
2023-01-16 17:14     ` Lars-Peter Clausen
2023-02-27 10:47       ` Michal Simek
2023-03-16 19:28         ` Wolfram Sang
2023-03-16 19:29   ` Wolfram Sang
     [not found] ` <BY5PR12MB4902E8FC89477C6A1038F15281A09@BY5PR12MB4902.namprd12.prod.outlook.com>
2023-02-16  5:18   ` [PATCH 0/5] i2c: cadence: Small cleanups Guntupalli, Manikanta

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=Y8pXRNF98JL5BlQA@ninjato \
    --to=wsa@kernel.org \
    --cc=Shubhrajyoti.datta@amd.com \
    --cc=lars@metafoo.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=michal.simek@xilinx.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