public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Jason Yan <yanaijie@huawei.com>
Cc: agross@kernel.org, wsa@the-dreams.de,
	linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: busses: remove unneeded conversion to bool
Date: Sun, 19 Apr 2020 21:44:20 -0700	[thread overview]
Message-ID: <20200420044420.GG987656@yoga> (raw)
In-Reply-To: <20200420042816.18989-1-yanaijie@huawei.com>

On Sun 19 Apr 21:28 PDT 2020, Jason Yan wrote:

> The '>' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
> 
> drivers/i2c/busses/i2c-qup.c:960:48-53: WARNING: conversion to bool not needed here
> drivers/i2c/busses/i2c-qup.c:962:47-52: WARNING: conversion to bool not needed here
> drivers/i2c/busses/i2c-qup.c:1531:29-34: WARNING: conversion to bool not needed here
> drivers/i2c/busses/i2c-qup.c:1533:29-34: WARNING: conversion to bool not needed here
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---
>  drivers/i2c/busses/i2c-qup.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
> index 155dcde70fc9..25d5fe2f8316 100644
> --- a/drivers/i2c/busses/i2c-qup.c
> +++ b/drivers/i2c/busses/i2c-qup.c
> @@ -956,10 +956,8 @@ static void qup_i2c_conf_v1(struct qup_i2c_dev *qup)
>  	u32 qup_config = I2C_MINI_CORE | I2C_N_VAL;
>  	u32 io_mode = QUP_REPACK_EN;
>  
> -	blk->is_tx_blk_mode =
> -		blk->total_tx_len > qup->out_fifo_sz ? true : false;
> -	blk->is_rx_blk_mode =
> -		blk->total_rx_len > qup->in_fifo_sz ? true : false;
> +	blk->is_tx_blk_mode = blk->total_tx_len > qup->out_fifo_sz;
> +	blk->is_rx_blk_mode = blk->total_rx_len > qup->in_fifo_sz;
>  
>  	if (blk->is_tx_blk_mode) {
>  		io_mode |= QUP_OUTPUT_BLK_MODE;
> @@ -1528,9 +1526,9 @@ qup_i2c_determine_mode_v2(struct qup_i2c_dev *qup,
>  		qup->use_dma = true;
>  	} else {
>  		qup->blk.is_tx_blk_mode = max_tx_len > qup->out_fifo_sz -
> -			QUP_MAX_TAGS_LEN ? true : false;
> +			QUP_MAX_TAGS_LEN;
>  		qup->blk.is_rx_blk_mode = max_rx_len > qup->in_fifo_sz -
> -			READ_RX_TAGS_LEN ? true : false;
> +			READ_RX_TAGS_LEN;
>  	}
>  
>  	return 0;
> -- 
> 2.21.1
> 

  reply	other threads:[~2020-04-20  4:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20  4:28 [PATCH] i2c: busses: remove unneeded conversion to bool Jason Yan
2020-04-20  4:44 ` Bjorn Andersson [this message]
2020-04-26  8:16 ` Wolfram Sang
2020-04-26  8:44   ` Jason Yan

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=20200420044420.GG987656@yoga \
    --to=bjorn.andersson@linaro.org \
    --cc=agross@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    --cc=yanaijie@huawei.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