From patchwork Mon Jun 29 12:47:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11630903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9D3E618 for ; Mon, 29 Jun 2020 12:49:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 829E423D22 for ; Mon, 29 Jun 2020 12:49:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hdVfN3b5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Jlf/+bu6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 829E423D22 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5OvLEAqc/luCKjAVpfJOF1jRcgtq6u8r/6jG0FuOj8g=; b=hdVfN3b54ecIWIs8vG2g1ox5d ClQ/XxxmW9AMYSvNeO0bpMTd3/mnGu9mB34px5Dc71u9jQGRfYiE/Yd4rHMSSiZ225UrPu7EmrVod P+8xuMuiIS4nwZVgfblsq9+xB/+Z9ZG9oHrWS8bGv/nMij5r0TKWaAdvoY5I2FjwrwlmRvIx92D6/ daCKhkI7nLExEAYJBOEg9Apv5caJlmt53OdwFtPbBc071Wtbt8c/KVwr7ndXKZF63USS9qkBZ/I6N 9Ol6XYH0oxm/+nmK95lOgy53W6ODAVCSdES4ee6WJq2t535KFPLYsFrjWteo6kmVy2ljdVExeeFIe 0ZR8mkkZw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jptCd-0001jF-Uz; Mon, 29 Jun 2020 12:48:03 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jptCX-0001gp-Bk for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 12:47:57 +0000 Received: by mail-wm1-x344.google.com with SMTP id a6so13679128wmm.0 for ; Mon, 29 Jun 2020 05:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MXWPj65SsgiOS9zBWng/y3B2dHdHCzzNx8KN4IFF3T0=; b=Jlf/+bu6MQO1H2Y1nOpHwS2pO3hXcUe/HKZCIAl8BbtiP7Kf0yEVgv1uZN932HwADc 133TMwpc3TtvSaPRg1M+WFSrLYTatgIZv2mcd/+YFO4O6JtO2y//GGZpwk8nnUrhGdYQ hMsTYPm9uxGpufCX1GKnRNjRNFLSlDT5dQXKo2WuBUcsIN677aUB958DsS2Ufpw3Ef1L nFdL6uQVDk5/7DG88H8PBdiJnSa0JYbh6CpzKvzVtC54HCTmX3MW25q6eJUouLqxLHNI k0W+rWsYph1/w8326KtVbvoRim9UDd1hixtZ35evPkPMsFz+gjbP/UFmtrYOWW786+7s t8lg== 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:mime-version:content-transfer-encoding; bh=MXWPj65SsgiOS9zBWng/y3B2dHdHCzzNx8KN4IFF3T0=; b=dgslXZN3R16Zc68ruoU1prf2q/6z+xcWBWAsTc6YdhxN3CgXgveVryyaaaTOp80eTe JDfHgAKYc82HzeaIKJkujr3Oujy4TnwCmP4R4Ui5fyEhDxqp9j7QKEmrqpN7CHrpskAL f86BQisXvyd36RiA9Q+uO4F0RbC/h442hsi3I+us5KR/uWVtdyWpxb4BcGfhVjhriq4c hkzWEwsHTKrmGGJGNZaxUNF+QiisfBDG8niKiY5DwikShv/9aTCSHjoF03l9oHjH6135 7jwNq0KDYcGYkj0uhEFwb9rfHHVrrnLaFR15h2jvGE8hQtZVHZ+pyxRqXy9UKbsHTcLo DjKg== X-Gm-Message-State: AOAM531jKTQFuFVBARCZbT82k56P3YaNZfAp8klbHws3WlGARMGdo+xk FXVfrU6AZO1RAi8AsUd/3Te3wQ== X-Google-Smtp-Source: ABdhPJwFsoOz7r0nFMjUVsQWVlIpJeZRYkCocmfI+AhlI+deNKBfMmUDPAunud4nny3pLzOyhu25ug== X-Received: by 2002:a7b:cbc5:: with SMTP id n5mr16593514wmi.95.1593434876317; Mon, 29 Jun 2020 05:47:56 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id e17sm12995924wrr.88.2020.06.29.05.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 05:47:55 -0700 (PDT) From: Lee Jones To: thierry.reding@gmail.com, u.kleine-koenig@pengutronix.de, linux-pwm@vger.kernel.org Subject: [PATCH 1/4] pwm: bcm-iproc: Remove impossible comparison when validating duty cycle Date: Mon, 29 Jun 2020 13:47:49 +0100 Message-Id: <20200629124752.1018358-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629124752.1018358-1-lee.jones@linaro.org> References: <20200629124752.1018358-1-lee.jones@linaro.org> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:344 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Scott Branden , Ray Jui , linux-kernel@vger.kernel.org, Yendapally Reddy Dhananjaya Reddy , bcm-kernel-feedback-list@broadcom.com, Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 'duty' here is an unsigned int, thus checking for <0 will always evaluate to false. Fixes the following W=1 warning: drivers/pwm/pwm-bcm-iproc.c:147:12: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Cc: Ray Jui Cc: Scott Branden Cc: Yendapally Reddy Dhananjaya Reddy Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-pwm@vger.kernel.org Signed-off-by: Lee Jones Reviewed-by: Florian Fainelli Tested-by: Scott Branden Acked-by: Uwe Kleine-König --- 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 1f829edd8ee70..46f0a45e9049c 100644 --- a/drivers/pwm/pwm-bcm-iproc.c +++ b/drivers/pwm/pwm-bcm-iproc.c @@ -143,8 +143,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 &&