Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3240690ybz; Sun, 19 Apr 2020 21:45:51 -0700 (PDT) X-Google-Smtp-Source: APiQypLWQlSmJ0xn2gMHsvGvRpXgOhR/XAk9py4biz/PKtaF4wlSV3WveePOrJ70y9T03i0ewWKp X-Received: by 2002:a17:906:ad9a:: with SMTP id la26mr14165858ejb.128.1587357951547; Sun, 19 Apr 2020 21:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587357951; cv=none; d=google.com; s=arc-20160816; b=glJLA89Pa6NprM80AWoDQDBOy0/IigDBcCJ/tUR4e3yYZjnMhwyKwzjXBq4ul3OA/w w9uoa7kICgf9xF+n87EBeHfsPHEI5tw5xAEPG6iS4eQmeu6ZDYMdrAm0NZNOGJlfT2Dk /Zz2LeAHunpS0mz9jZw4FkTHckzUYIKtD7RZoVF/WVfzAp3J1+e5sSqPNGVUfLFapd3r NJjz+7cae763iOyY6Y11kzckm+mC6L0auowzpqNzrAqcRjvMrs9I09nn7BnNYkCq4wHR hTMTuGLP9+UrlybBh/p+Hac0n2upMbYi52/1rToL4VMrpyTZT+/gibWTR4faQ3VE74H2 yUig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=MJIP8pHcT300D54AAT1yN4S1w4viB7U9JXrFMLuLerE=; b=TM5PS4oFRPS2mdyd4pbZ7jpTxxC3CYb/2VHB9p01lF0ETC/R4cz6/KCwwZyQTxcJp7 Ww5ThDrZ6jTmUoEosiaV1xUdayfxLfpHUNu/dxIhvlDD/ZOpWf9cNCCiX6qk58acsz5Z Lkg3Duu4v1W60bAxtt+4Kt2DK8GvCp9YeRKYtIlYao5IIeZ02fs2hGGt3/OZZWKmo2Na lHHXqeSB3Rjwu2Up9as1vmJ56UznC4xAsuQxwxCufP342FLCG2Nsch59Vbh5KyEkND0n 7gD0yqhUjwanqM3QOEFM6o6FBnAViR3IZWpG6pOZQ9ByaNBzQQwc8qtKP64aYqxNWvxp x0dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KQ6B7QT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si18661081edj.520.2020.04.19.21.45.27; Sun, 19 Apr 2020 21:45:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KQ6B7QT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726061AbgDTEo0 (ORCPT + 99 others); Mon, 20 Apr 2020 00:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgDTEoZ (ORCPT ); Mon, 20 Apr 2020 00:44:25 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 452C3C061A0F for ; Sun, 19 Apr 2020 21:44:24 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id h11so3487556plr.11 for ; Sun, 19 Apr 2020 21:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MJIP8pHcT300D54AAT1yN4S1w4viB7U9JXrFMLuLerE=; b=KQ6B7QT1vtZae/f6saQDPC1F+hKTVP9SjEi4M5AnDFpngSbILwyCEn89QG7jMCu5x2 Wi5ynabHoI3D1XslyJUOkWDkMvs7GfzKLnialIPNjZw6bfo8WdcJ4VR/8gHbS/SUNSOq mPTULBkLJyw8ELtdNz7i1AelUej5/0q7yCJHgvEkvCgEbJRnCegzJuzFlY3xBauIThjp 5kJBmdc9lL2Z88zDjhx2FREp9lFxBFvIhOFqNqhYywVpXi0tCqOuvLfIeC0HsfgZEUfA eawYMjg0CijPj+YtKHyQSFdtLAHWkftnZqZ60jUsx4ahla6kFttA0a89OZP07cu8Xuyx 8Mqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MJIP8pHcT300D54AAT1yN4S1w4viB7U9JXrFMLuLerE=; b=mdxZ1JkjY2Fd4ChmAXMUrv3z6XGx7jufuh07zTwAzCHopNDb6ad6Z0s+mpnK/gPsGW LrjVtgvFFXViYWunxeXi7UcgNlw0LYj3sN1Vd9FfvzJWoZ8rvoD+Ka9w+eiDzAIc9dev +t8+k+a02+K07Gu+0fruV0f6aSEPgYmk8W9s4LiolYpW4OfEBYDbMVO6j3wkVPp5OEHR gmh+sUPdl68bJcV0hdB/6aeSxU2aL2QH6QwG0LpycPprdj/k30emf6MPMhdkjkSSqY21 VSprQe5gr+tVx9gGyD3B9lpUGxb91YhE6vymGwMH+3jXVKPo/laYSIJJ2vo2UFe8GiVL wvHA== X-Gm-Message-State: AGi0PuYx80GvDZ9Bo7YshFncnDAi2oSeEpMxgVpunuPm6fk+QFBosmTn Rz8yroAyOmowRhkwLwTxH/uIdSYmu10= X-Received: by 2002:a17:90a:1f8f:: with SMTP id x15mr7116967pja.76.1587357863366; Sun, 19 Apr 2020 21:44:23 -0700 (PDT) Received: from yoga (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id e26sm25887897pfi.84.2020.04.19.21.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2020 21:44:22 -0700 (PDT) Date: Sun, 19 Apr 2020 21:44:20 -0700 From: Bjorn Andersson To: Jason Yan 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 Message-ID: <20200420044420.GG987656@yoga> References: <20200420042816.18989-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200420042816.18989-1-yanaijie@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Bjorn Andersson > --- > 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 >