Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1567467pxk; Fri, 25 Sep 2020 19:54:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHLsaf9mEdNlhA7ftILHy8tHD2XQRqiP62u9EDPDyR242IYlvVwy+qLyrFE/5irrv6oEia X-Received: by 2002:a17:906:d7a2:: with SMTP id pk2mr5526750ejb.149.1601088880708; Fri, 25 Sep 2020 19:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601088880; cv=none; d=google.com; s=arc-20160816; b=R+CD3AqIiPUpO+W5flAyWO3sEM1NZT/X4AMqd3e2TO73sGNytdC0HJy0Zeongvhiua wWbqvCxf1GQDXB+8sPzegvfizqUeuKfJcEU0QSeH9v6ji23/3rvm4XfVB+qz3HBKZCuh y58GVA6B/+sp7OlMiBivl2pw2ALFRyuVpu9rEHowxtqIQ7ZVPqk5L6SLzie5Qrc5CN68 uTV8n7ZJ/Rwc+UqstiZ+fo4Fw+WoQ+sAaFI49aGQ7SDE7v9YeHSQCtV+S4A0CkdBoE9v 9qMvb+ZPryFoGl2y4Vg60EVci7jOojDm7cNdkH5clKfunmsEKw3eZCzqaErsCHaZ54ou 3XGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=tGEhRbiaMqpvC1vuBCtqV99QgRqQkiQ3Wy0uchPEapY=; b=NqvL1pU0GOAIJOnaTH9SXZswUb6Ty0M2eNotslJF/eE6PG2olzaXDFAUb+T57silnr G1vGdE+Xh5fdy+S1hF/tPR1NUp5JzabKQlFBWFoCGZhc0sPrjkC5eKxUgx3gChXrnUmg 4SJ2VmSf4yEvM/kAvU7Uhqg5eirCDYHxQbbou+FXEyrY3qoS4G0v8uMJZih7xNipXGLK YJKr8pRgEu5Twh1njkpA20HZmI75bHXXtg2x+5Wf58m9nbpnJZir/IsYG0j/NDkwI6Lr rt8ezMsGsrQQHWYrqBXU5gLAzZCEZmLhuxQ1McCJQDsHzBD2jvz1gjWfQCCPxyxTg7LS Q75g== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si3028023ejx.47.2020.09.25.19.54.18; Fri, 25 Sep 2020 19:54:40 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729974AbgIZCur convert rfc822-to-8bit (ORCPT + 99 others); Fri, 25 Sep 2020 22:50:47 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37592 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbgIZCuq (ORCPT ); Fri, 25 Sep 2020 22:50:46 -0400 Received: by mail-ed1-f67.google.com with SMTP id n22so4467346edt.4; Fri, 25 Sep 2020 19:50:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4+5/tjL8muHqPuujhCRn3oXHZAmk1SML4ZsfnMZowuQ=; b=qXXYbzS+rsF1LY6MnlTffVxt5OujC25+8CLF+HbN3OaGFt4ILcxt/G378u0PHIys12 zrttFhjFo/bTLFKlxlVkxOqIjyWz/sGqJ7qBtTeOtzAGpZ2MGYj7WoL83gG8ZFZZDMOK 8Wds0oMUfVR1UrRbVfEx69gK6b94KiSNB4KAP1fNmRKbWe0CVAHCQWw4nsCxCxkgmYXf oe9lK1O2plI0R1q0qNntgBxDHx0LNOcdmQzaKg90hIUbK1DJVpYhnESsAIe5Kaf4TR1G kJsMlbWDHO+kJGZYb6vIOseTlvgavHko4MkvDHr9fiIwPbao0X/RHmI9KM5XCWO1yvQf dUPw== X-Gm-Message-State: AOAM531mBRXj9+WbG+YOLPdxkEc7lQ5Hr5cqd290Pv9rbx42rXoS4x3a xhKOww6tK41XCTGU+Z069KQ9hW/A2+DCsT2sg1A= X-Received: by 2002:a50:d65e:: with SMTP id c30mr4597188edj.57.1601088644811; Fri, 25 Sep 2020 19:50:44 -0700 (PDT) MIME-Version: 1.0 References: <20200921034522.9077-1-vulab@iscas.ac.cn> In-Reply-To: <20200921034522.9077-1-vulab@iscas.ac.cn> From: Barry Song Date: Sat, 26 Sep 2020 14:50:32 +1200 Message-ID: Subject: Re: [PATCH] clk: clk-prima2: fix return value check in prima2_clk_init() To: Xu Wang Cc: Michael Turquette , sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Xu Wang 于2020年9月21日周一 下午3:45写道: > > In case of error, the function clk_register() returns ERR_PTR() > and never returns NULL. The NULL test in the return value check > should be replaced with IS_ERR(). > > Signed-off-by: Xu Wang Acked-by: Barry Song Thanks > --- > drivers/clk/sirf/clk-prima2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/sirf/clk-prima2.c b/drivers/clk/sirf/clk-prima2.c > index 45dcbc9e0302..d17b345f4d2d 100644 > --- a/drivers/clk/sirf/clk-prima2.c > +++ b/drivers/clk/sirf/clk-prima2.c > @@ -134,7 +134,7 @@ static void __init prima2_clk_init(struct device_node *np) > > for (i = pll1; i < maxclk; i++) { > prima2_clks[i] = clk_register(NULL, prima2_clk_hw_array[i]); > - BUG_ON(!prima2_clks[i]); > + BUG_ON(IS_ERR(prima2_clks[i])); > } > clk_register_clkdev(prima2_clks[cpu], NULL, "cpu"); > clk_register_clkdev(prima2_clks[io], NULL, "io"); > -- > 2.17.1 >