From patchwork Mon Feb 22 20:54:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 8383021 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CE7B1C0553 for ; Mon, 22 Feb 2016 20:56:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0DA92027D for ; Mon, 22 Feb 2016 20:56:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26AF72021B for ; Mon, 22 Feb 2016 20:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755752AbcBVUzi (ORCPT ); Mon, 22 Feb 2016 15:55:38 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:51560 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755642AbcBVUyw (ORCPT ); Mon, 22 Feb 2016 15:54:52 -0500 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 012D2608AA; Mon, 22 Feb 2016 20:54:52 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id F0E866089C; Mon, 22 Feb 2016 20:54:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0C9C0608CB; Mon, 22 Feb 2016 20:54:51 +0000 (UTC) From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Hans de Goede , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-fbdev@vger.kernel.org Subject: [PATCH 9/9] simplefb: Remove impossible check for of_clk_get_parent_count() < 0 Date: Mon, 22 Feb 2016 12:54:47 -0800 Message-Id: <1456174487-28397-10-git-send-email-sboyd@codeaurora.org> X-Mailer: git-send-email 2.6.3.369.g91ad409 In-Reply-To: <1456174487-28397-1-git-send-email-sboyd@codeaurora.org> References: <1456174487-28397-1-git-send-email-sboyd@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The check for < 0 is impossible now that of_clk_get_parent_count() returns an unsigned int. Simplify the code and update the types. Cc: Hans de Goede Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Cc: Signed-off-by: Stephen Boyd Acked-by: Tomi Valkeinen --- Please ack so this can go through clk tree along with patch 1. drivers/video/fbdev/simplefb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 48ccf6db62a2..e9cf19977285 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -174,7 +174,7 @@ static int simplefb_parse_pd(struct platform_device *pdev, struct simplefb_par { u32 palette[PSEUDO_PALETTE_SIZE]; #if defined CONFIG_OF && defined CONFIG_COMMON_CLK - int clk_count; + unsigned int clk_count; struct clk **clks; #endif #if defined CONFIG_OF && defined CONFIG_REGULATOR @@ -213,7 +213,7 @@ static int simplefb_clocks_init(struct simplefb_par *par, return 0; par->clk_count = of_clk_get_parent_count(np); - if (par->clk_count <= 0) + if (!par->clk_count) return 0; par->clks = kcalloc(par->clk_count, sizeof(struct clk *), GFP_KERNEL);