From patchwork Tue Sep 17 17:14:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saiyam Doshi X-Patchwork-Id: 1163522 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nL0fqthR"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46XqVx4MGRz9s7T for ; Wed, 18 Sep 2019 03:15:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727326AbfIQRPQ (ORCPT ); Tue, 17 Sep 2019 13:15:16 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41676 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbfIQRPP (ORCPT ); Tue, 17 Sep 2019 13:15:15 -0400 Received: by mail-pg1-f193.google.com with SMTP id x15so2350708pgg.8; Tue, 17 Sep 2019 10:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=Tj2R7ApU+R18kZtfMMHwpOo/TfY0rKl5+SwEZrS2MK8=; b=nL0fqthR3Yr0B1JZ28qUvy2WywfFQqdrbRxcoSiHsAsSUP59yEtv2B+06hnL6BY3jb G51vqCLP7S25TQZqdVVxkDNIpbVKiTpaHDIx6JUIwcs47xQDaNi4t6Q/KSCLYppKM5fP a5SGR1/GgIBno222ddzpdq8uuEdAOoVa0iRgemkV0saQG98r5yRk5SCTaVBMZkjqjAOB +F34KioPgwvnLkk+WSvtBaeEKb5PdeQ+LODzyZwMbOW0iXDttfXb1aUigPNi4UHaeskm 9r37p++wEYENAuNGgfAXZ5z8kgPoNRxF0+7ntUIQZ/XzbiA8TsDGhtlM2HCSo7wn9ePp 0dpw== 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:mime-version :content-disposition:user-agent; bh=Tj2R7ApU+R18kZtfMMHwpOo/TfY0rKl5+SwEZrS2MK8=; b=GJGCKWnBACFDGg0+NEdQ+WV02VKbkO5seF5E6YJLXiFYsJw7HLFAItSZKpvLXqKpay Z6CdKTiviSwNHwdvCkh6oAQXTkzkwZ9hLb/93VJR25mamwfswwJJXC02I1FRU8ds5uKP Z7asz77xFly2dTCY1D7BfKBrDyCMImGzZEw2+0LPU2P1hGqODc5dHv4ROr4EUHge8a5S 6h9WSJflHWg+LTVshwhDV97Nu2hwWxLOAPfU1Jfev9iAk8OyGKChJAF2+prOvQk3W7J1 RCdo1UM7bMJJLpoGNagYXuFwp4I0XX1xdIZ9LpAVpfasPJUPOM8a8tTMnGmtBZrkETVi m/fQ== X-Gm-Message-State: APjAAAXhqpxUJ99BppEWeOd3Iiqh9VKBBVI1fgrWjBqlFLI8fp7nmCsi rQMQoWIUD2GznPo9HKN8zgs= X-Google-Smtp-Source: APXvYqy8fG0q6iCMJJos1z/WHR4mu7VgHhmjsqcNKJNwGISeMBnPFajiPIVWixEmUHT6SsN22jN88g== X-Received: by 2002:a17:90a:e017:: with SMTP id u23mr5731639pjy.55.1568740513471; Tue, 17 Sep 2019 10:15:13 -0700 (PDT) Received: from SD ([106.222.12.103]) by smtp.gmail.com with ESMTPSA id a11sm3315255pfg.94.2019.09.17.10.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 10:15:12 -0700 (PDT) Date: Tue, 17 Sep 2019 22:44:55 +0530 From: Saiyam Doshi To: agross@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, markus.elfring@web.de Subject: [PATCH v2 1/3] i2c: qup: remove explicit conversion to boolean Message-ID: <20190917171455.GA7922@SD> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Relational and logical operators evaluate to bool, explicit conversion is overly verbose and unneeded. Generated by: scripts/coccinelle/misc/boolconv.cocci Signed-off-by: Saiyam Doshi --- Changes in v2: * Updated changelog drivers/i2c/busses/i2c-qup.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.20.1 diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index e09cd0775ae9..5519c19bfd9c 100644 --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c @@ -961,10 +961,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; @@ -1532,10 +1530,10 @@ qup_i2c_determine_mode_v2(struct qup_i2c_dev *qup, (total_len > qup->out_fifo_sz || total_len > qup->in_fifo_sz)) { 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->blk.is_rx_blk_mode = max_rx_len > qup->in_fifo_sz - - READ_RX_TAGS_LEN ? true : false; + qup->blk.is_tx_blk_mode = + max_tx_len > qup->out_fifo_sz - QUP_MAX_TAGS_LEN; + qup->blk.is_rx_blk_mode = + max_rx_len > qup->in_fifo_sz - READ_RX_TAGS_LEN; } return 0;