From patchwork Fri Jul 13 10:27:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10523005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73329602B3 for ; Fri, 13 Jul 2018 10:28:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FF4429929 for ; Fri, 13 Jul 2018 10:28:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 538672992D; Fri, 13 Jul 2018 10:28:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0006E29929 for ; Fri, 13 Jul 2018 10:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=GfvCRXo7esFporQr0JdpUxQBTM90tjp1ukNK5cJlabE=; b=au0 ZiDVh9gp0wogtExe3knx5VfzWsZGEJwEvo15wStTQ8d3Oudwbl4U8sXE7Wtrf2q51bXbYqjjhfJNc s3DYOzTIuTPWlnNWOuzhhLz2bdvl4Kh2TVGdxj4rfUGEsOueFeejjs4Gx7OHd2O7vsDSvuxqHhUv5 xQLr3UcUI/IAykZfcO/gspe43lpbKg2y0fJL9f9v/2yTjE3oQeY2q5hrZaH1VzE/0CR9aM8ynEvIU 7RJqXbTu+VAcDSmSqvIn7QXEDemlWWNoYAV+96N233L5fRtJTIFY9XULku+u9D+X9YpD4yJDBpFei hRRMcLXcAUKh6mCPX+H13h40hqvWBiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdvJa-0008EC-Hl; Fri, 13 Jul 2018 10:28:42 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdvJV-0008Cv-UG for linux-arm-kernel@lists.infradead.org; Fri, 13 Jul 2018 10:28:39 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 1A2E620741; Fri, 13 Jul 2018 12:28:25 +0200 (CEST) Received: from localhost (unknown [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id DF0CB206A6; Fri, 13 Jul 2018 12:28:24 +0200 (CEST) From: Gregory CLEMENT To: Stephen Boyd , Mike Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: mvebu: armada-37xx-periph: Fix wrong return value in get_parent Date: Fri, 13 Jul 2018 12:27:26 +0200 Message-Id: <20180713102726.1950-1-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180713_032838_119105_9E5F7B22 X-CRM114-Status: GOOD ( 11.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Jason Cooper , Hua Jing , Antoine Tenart , Gregory CLEMENT , Maxime Chevallier , Nadav Haklai , Ken Ma , Victor Gu , Neta Zur Hershkovits , Thomas Petazzoni , =?UTF-8?q?Miqu=C3=A8l=20Raynal?= , Marcin Wojtas , Wilson Ding , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The return value of the get_parent operation is a u8, whereas a -EINVAL was returned. This wrong value was return if the value was bigger that the number of parent but this case was already handled by the core. So we can just remove this chunk of code to fix the issue. Reported-by: Dan Carpenter Fixes: 9818a7a4fd10 ("clk: mvebu: armada-37xx-periph: prepare cpu clk to be used with DVFS") Signed-off-by: Gregory CLEMENT --- drivers/clk/mvebu/armada-37xx-periph.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c index a51edaab0c5c..287e98a7cff4 100644 --- a/drivers/clk/mvebu/armada-37xx-periph.c +++ b/drivers/clk/mvebu/armada-37xx-periph.c @@ -426,9 +426,6 @@ static u8 clk_pm_cpu_get_parent(struct clk_hw *hw) val &= pm_cpu->mask_mux; } - if (val >= num_parents) - return -EINVAL; - return val; }