Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4863232pjb; Mon, 27 Jul 2020 07:07:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+xeu2ZMQAAsqbY+xAkE17zinD3m/LOBqC0Vbkm5qQeKTobh8Wz0kXCI/5GHGl2GO/8I91 X-Received: by 2002:a05:6402:1845:: with SMTP id v5mr9865067edy.66.1595858828611; Mon, 27 Jul 2020 07:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595858828; cv=none; d=google.com; s=arc-20160816; b=GnWLUpBvoLjtia9e9F0X4Dc5DvDADxjdt3I1V+Ss6i0niqODcm/C9NriUhkE3ArOTP iThkRwkyxF5Q28TG4U13ZAGDtj0oZgi+SmRsVqHG1GYzk6IJRKGR99N4hI+rAwc02or+ 4ZAjQJ8G8CTng/yi8zsf1ajL7i0UTu1P2uPTDJTeiAmKkN1qcxgXkwGblRz+VHElhTr5 Ju9Ru/Ty+7n31H3wtMnb2P6oX5GJ/t+h0di6R6R7k4nxzueRjQFHNAdSh5UqyLrKJPEp BokK431vFdmwLwdHD34+VUro4fGF93m85sOT9sYwuJL2KWd/VHF41QzSL6R061e1YihS bUnA== 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=RhxskRj6upwF+/teq/zCOu9Q73NADB80gy0qt4H2Mww=; b=N8mFj21wwDHI+wpaCRwnwUp4H7AombnTVDv5w4kUxHasbgxjebDszpd143K9eBC0zh qr0GK4olQI6kaK5y6TUf4gMaRjGRCQnupYnV3mZxA5ygpjCeNt/6L9lTNvMqee82wKFG wqTIk4Z15gv0ieGrUbLHaKsW+B5ohUUcAZwBXP6xiviPhR90UMkKgvw8H+gdvDc9tgFj TuKKFNkCUt5WYPHwsQQQus+h1Ww7M6fp68w7YHS+UD0h3P9ztBVIBulUoaaL7+v2Br1n 6pzxIWbcJmyTH9L+AOs3HlAGU4wb+5WPsLEQhEKsr69Io0N2cjcyxQSvYXwstFty7Vr9 +XqQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si5670856edz.176.2020.07.27.07.06.46; Mon, 27 Jul 2020 07:07:08 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728565AbgG0OGD (ORCPT + 99 others); Mon, 27 Jul 2020 10:06:03 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43076 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgG0OGD (ORCPT ); Mon, 27 Jul 2020 10:06:03 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k03lR-0001ev-5a; Mon, 27 Jul 2020 14:06:01 +0000 From: Colin King To: Kamel Bouhara , William Breathitt Gray , linux-iio@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] counter: microchip-tcb-capture: remove ATMEL_TC_ETRGEDG_NONE bit check Date: Mon, 27 Jul 2020 15:06:00 +0100 Message-Id: <20200727140600.112562-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The macro ATMEL_TC_ETRGEDG_NONE is defined as 0 << 8 which is zero and hence the check cmr & ATMEL_TC_ETRGEDG_NONE can never be true. Since *action is already assigned MCHP_TC_SYNAPSE_ACTION_NONE then this check and set is redundant dead code and can be removed. Addresses-Coverity: ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/counter/microchip-tcb-capture.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c index f7b7743ddb94..119640d6d6ab 100644 --- a/drivers/counter/microchip-tcb-capture.c +++ b/drivers/counter/microchip-tcb-capture.c @@ -185,9 +185,7 @@ static int mchp_tc_count_action_get(struct counter_device *counter, *action = MCHP_TC_SYNAPSE_ACTION_NONE; - if (cmr & ATMEL_TC_ETRGEDG_NONE) - *action = MCHP_TC_SYNAPSE_ACTION_NONE; - else if (cmr & ATMEL_TC_ETRGEDG_RISING) + if (cmr & ATMEL_TC_ETRGEDG_RISING) *action = MCHP_TC_SYNAPSE_ACTION_RISING_EDGE; else if (cmr & ATMEL_TC_ETRGEDG_FALLING) *action = MCHP_TC_SYNAPSE_ACTION_FALLING_EDGE; -- 2.27.0