Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3216552ybz; Sun, 19 Apr 2020 21:03:49 -0700 (PDT) X-Google-Smtp-Source: APiQypL4XvGoP1yUxeg3lmA5l89gEpS8WLyR/e8rBhetC+Jy6zOOWUJZGSRixFv6sv+wlmoOV348 X-Received: by 2002:a17:907:20ce:: with SMTP id qq14mr13704602ejb.10.1587355429389; Sun, 19 Apr 2020 21:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587355429; cv=none; d=google.com; s=arc-20160816; b=GFcgjD0v6MucTjB5VxH5xTMMYpeysmPJd4jeHBEd1crEdmAgWiTM46SSSecUXdy4iI u34Lk36btNU+ujZXqvv8HfqSmHEVCKc1M5tffzR5U+5DjbcMC1l3lVwE5JuUN6XjYOAn fo8LTVcJ+sbgoTLVfU8/x6DL55HzllHdhzyq81j0FEYmzxtJprhZuLSt/43d2gUJFIt/ hmxrshxPTFcYKkN8cpTd8oqlU43qIq2lOHFdOIBfGSCjftc5AB6OtrHQbBTb5gVXmCVm J4CKZAqFAbf8yrZ8i0v1FrQQZzZg6VsPYCkFTII84uE/TRWOFWFESfUDyvgCGHQGjz2i yE6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WmIj/Z9RGRA1j4qQJSmjYcdH3Q/GaaAT13CSuATxoUU=; b=JsrhFUayK06f9LvnSsI4kE2NETt4orGW+1P8eG5cg34etiChqx19/umiQz2cuKiB3P yYhPD+8rPuWIyCWa7NImzTeYZLAbe+8jIPQFPIPGWJhtitlcHzj+GVkr054h/iOGeZmf 7RBk+ewcq9D0LMUerA7H1o4hHyn2iEkYc1K2RJdtiJQMm5UN8ILUzzwNv1YFDHgatdQ3 IWd4bw9tghwlXti+iFLBulTX65T3IzZRKm3zqyEdF3nK9WBt7bOhFYjeP4MKwku9tpRj xiXqfbyr5a1ZY2eGVhcN0/wAFfgurCbrceeRS3x2SESFXHB/RcpiIIWqnoA4sNZCHYMe MzVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si13812703edv.206.2020.04.19.21.03.26; Sun, 19 Apr 2020 21:03:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726303AbgDTEBo (ORCPT + 99 others); Mon, 20 Apr 2020 00:01:44 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2806 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725681AbgDTEBn (ORCPT ); Mon, 20 Apr 2020 00:01:43 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9FB90DEF3D2A265CF43F; Mon, 20 Apr 2020 12:01:41 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Mon, 20 Apr 2020 12:01:34 +0800 From: Jason Yan To: , , , , , CC: Jason Yan Subject: [PATCH] i2c: busses: remove unneeded conversion to bool Date: Mon, 20 Apr 2020 12:28:16 +0800 Message-ID: <20200420042816.18989-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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