Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3406071ybb; Sun, 22 Mar 2020 23:55:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvsKSvgZ7NBv67A3TukVzrtm3w+s4lsgZwTeEYmBZGEdABGuybZjw2QtIhhvRW5vgjCzrlP X-Received: by 2002:a05:6830:2415:: with SMTP id j21mr16829470ots.93.1584946554853; Sun, 22 Mar 2020 23:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584946554; cv=none; d=google.com; s=arc-20160816; b=ddff9QLS92uiVCSaPuaKwgS0FfARvbTK7m6vbT7LI2SsXvAk8L/w3WlEarmxZfunWN tJN5a9rK86By6EAwmp1WEo4g9OwDO2vrn/CPp2x65LMpQGjPROFfmIIfeDNSYQPdIAmQ /GPyyZSygLClHG+KGp7AKd8UqSGT7g/6eti2174TECX/phg8iZl8zB2WNw255vjbvcK/ ncoN+QpMgCMyqVMdwIxSMpDdfI2ctlcliAld+1NoSoQIB4C9GhaCYrgEZNYYy5yNSexu xib+kPpGpDSzAytvIwY5ZK2td64GhG/lH4LKQB3ExBu2T5CpGWXoYHntjCS1AUgW0Rf7 U64g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DuqutkfVD4m7NtyrXjd1qFiuKaLZ6gnOOVtPX0RgVTY=; b=lG5ao+I+lkgAy+FSKRy5bR2apJse64dZa0Drfsm8x2X+k+yGquaumlWR4s2/INFb6C BYjSjP5tykeF0eDFSkt926L1UEVSDIExH9JBxcNSgxzzf1oLGEojASXiJgJ+wwafKB3s OU7ZklAhJdzzaxpwPNC7S01BkELBrnVrNomQ6IYUumrCnodxMWdPlshUnzH3R6p2JgM+ CBhuvZuzUjc2TUV5qvNYAzq5wTCDynCSMlzs/B2FLsfHjQNaZm/wNgjaM+k8kqSkVXsg bbduNZ4tSAUnoxOgF2CdPfmKNfhLwB1Dr4UJLgwYkj0g/FnwCXx8wGpCzDQPXWn2L4n1 L3Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="TguF1o1/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 141si6453607oii.44.2020.03.22.23.55.41; Sun, 22 Mar 2020 23:55:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="TguF1o1/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727420AbgCWGxr (ORCPT + 99 others); Mon, 23 Mar 2020 02:53:47 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:33693 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727399AbgCWGxr (ORCPT ); Mon, 23 Mar 2020 02:53:47 -0400 Received: by mail-wm1-f68.google.com with SMTP id r7so12445835wmg.0 for ; Sun, 22 Mar 2020 23:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DuqutkfVD4m7NtyrXjd1qFiuKaLZ6gnOOVtPX0RgVTY=; b=TguF1o1/qlgnZwU27lTm96jgi4/VmGaBU9Eea/Y1AGY4nm0JxN1hlQq8gngr0eXvRZ COkqUxmF+S78f7qM1i7WsXFrGqJBmuvAzIxi/Mx3KFXr2kUiPBQfEB7TEazWvWf1EJ8d kBhyfPSYv7fRe/9sVm6xPmpCcJzBLyo9FjBsA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DuqutkfVD4m7NtyrXjd1qFiuKaLZ6gnOOVtPX0RgVTY=; b=Ta9I0saKn5kq31ar3R+gM0dTYZP8EEG6E+TNGq/io6RkyfcRINjJvgcWGU7P7rmzAp peIKkeeCmiaaN+T2nEMCc8H1Y9loJnI5xDu4T1upcjpQvXY5eXTbLNzuRQ8ngLe6BoTb ZE81X7EL3G0IOfRh8vLJi7yV30l+7dO6LMX9BTuhtW9OTsF9ixWRe+twU/l0Ksap50jb lSO7PeIRikVW250OXYMRCuzSIKMeocFslz0gj4MpvYTvXTKyTY3ngEHAD9n6TuvsAbjb d2t2jOVzINHKhPHd8uQJVT8SBkA73MawfGL0DjAYv6kQ6Z9grlcfdbBBJLqhbbhcmfDb h5JA== X-Gm-Message-State: ANhLgQ3VJEP1xTPBVaWioMAuJJF0WRNgAMIardJYzqzgw7bSHlx7GUqJ JgE5Sf0ds2PDy/XlXT19Iea50w== X-Received: by 2002:a1c:196:: with SMTP id 144mr26056577wmb.100.1584946424816; Sun, 22 Mar 2020 23:53:44 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id g128sm21127453wmf.27.2020.03.22.23.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 23:53:44 -0700 (PDT) From: Rayagonda Kokatanur To: Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Yendapally Reddy Dhananjaya Reddy , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Rayagonda Kokatanur Subject: [PATCH v1 2/2] pwm: bcm-iproc: remove unnecessary check of 'duty' Date: Mon, 23 Mar 2020 12:23:18 +0530 Message-Id: <20200323065318.16533-3-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200323065318.16533-1-rayagonda.kokatanur@broadcom.com> References: <20200323065318.16533-1-rayagonda.kokatanur@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Variable 'duty' is u32. Hence the less-than zero comparison is never true, remove the check. Fixes: daa5abc41c80 ("pwm: Add support for Broadcom iProc PWM controller") Signed-off-by: Rayagonda Kokatanur --- drivers/pwm/pwm-bcm-iproc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pwm/pwm-bcm-iproc.c b/drivers/pwm/pwm-bcm-iproc.c index 8bbd2a04fead..1bb66721f985 100644 --- a/drivers/pwm/pwm-bcm-iproc.c +++ b/drivers/pwm/pwm-bcm-iproc.c @@ -149,8 +149,7 @@ static int iproc_pwmc_apply(struct pwm_chip *chip, struct pwm_device *pwm, value = rate * state->duty_cycle; duty = div64_u64(value, div); - if (period < IPROC_PWM_PERIOD_MIN || - duty < IPROC_PWM_DUTY_CYCLE_MIN) + if (period < IPROC_PWM_PERIOD_MIN) return -EINVAL; if (period <= IPROC_PWM_PERIOD_MAX && -- 2.17.1