Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp310776ybh; Wed, 15 Jul 2020 02:34:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx35H5/ba548rrb4wth0OrVP4aJ+lJb1OOClkIiIVPQpMvUszDceLUF1tJ6tvgVLYLIJ0FE X-Received: by 2002:a05:6402:543:: with SMTP id i3mr8414500edx.182.1594805680154; Wed, 15 Jul 2020 02:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594805680; cv=none; d=google.com; s=arc-20160816; b=z69kZtuJQAnliewDL6PUvmv+BMqzWA3TXDszRd6DViKFyJnF3TUx+M1auR1XiuuAyB 5jlwf0zthAmK56lsJ8UfaT7IsibdXivrBojbck8qKTUGAW6iNeA7SIcp0gyg/oL5Srax 3srTIZXh714RmimiFK+zEOFF+0g/5ZPI2VyOSF5quEdeSn+ETUKq4r2kk67ewkcQ5eOK fL1BseM0L1Fxp/rlDz5xKsOfjGdeRHxZoCeW0MPH6KqgS/8cEQOQk/BXh/YVfImgvfxj 7LJvKx7nzFyHwzQ1LExBn8LPCue+poK8KwuU3pLE50BWGnUqs9nU6L9eQgYLwt5+LXqF ySKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=lFuYCX4mqmypDDsl0+cVuDsukYsM5P01ZrLxGSqLVtc=; b=Ke6+wh9SXn2Yo0gDBZV9TKBhqICquDsaZsNFNEyPnSRSA4QsUmbWbZ3aK3D4llM0pz dFFgRMkEMOW5CF9/Tdl8xJK3PQ9sUiy+V5PQysvX046fgyhH2GZ5wRj8lfVwEpeIemJI kSJ0o3+DrnVFJuo234rAyhPt6piEIbfnYEeXgCz9rf/cMBsEudYZqrS3nvpzh4kRDHb9 9v6ekhGMPf7Z6M+0i6GNLAoAJfHFdUdC6yzWbPQs7nTXEWaVd8J0atInwlsxQu1h7RO0 8aX6FCLChu8N3hCs6d+Q6kAIUKvjbGYB21wM5u2rnhqXWAqtUf76Ey5hGS/lpcdPYWTU V8Cg== 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 s6si857646ejo.502.2020.07.15.02.34.17; Wed, 15 Jul 2020 02:34: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 S1730624AbgGOJXd convert rfc822-to-8bit (ORCPT + 99 others); Wed, 15 Jul 2020 05:23:33 -0400 Received: from mail-ej1-f66.google.com ([209.85.218.66]:44318 "EHLO mail-ej1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729672AbgGOJXc (ORCPT ); Wed, 15 Jul 2020 05:23:32 -0400 Received: by mail-ej1-f66.google.com with SMTP id ga4so1412653ejb.11; Wed, 15 Jul 2020 02:23:31 -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=ZjUBYbCAhkMSlEf1D1VjAPqeltcV9sJtDSHasy83UmE=; b=ifhmI0N3dDcqPL5TV9oj7Fn/Ncit4UO5XhbPfngAIS6+iqRO24OiAwnNgtn/zE8NUY j8Hg+gHHY/bM7JW9RE3ZQt26K5/NHS0ad98VOlezrPEonNKSahoWvgBem+FvzGALj3YT WhZ3Ox9yP5hUmOq7igQdnhM4PPzamlQHkWtI1uHL0jW7gq+RbSizcOg0Ry7Rt++AbfE/ bEqxn/VLjFkZVq5tKttVh2JWSU5lfzMgu6rDR2Rqm3u8VuCTFl+y9az/6EE+tK2K3Bas AWSPNvosU0iPKG5vxkm4SXVwGhksgFxOmbgHeWUgtMnf5zxrXOAGE3fhmKJCVFgVVS5Y IjBw== X-Gm-Message-State: AOAM532ZH17tBj/pejpWkjEfw4259RZujdIitkEv1U5vtu/TjTPZ8cXW 2uBlhyaAhnMZrqWdodbZ3au9IHYw7LQxq6intFY= X-Received: by 2002:a17:906:a44:: with SMTP id x4mr8965528ejf.193.1594805010582; Wed, 15 Jul 2020 02:23:30 -0700 (PDT) MIME-Version: 1.0 References: <20200713032143.21362-1-vulab@iscas.ac.cn> In-Reply-To: <20200713032143.21362-1-vulab@iscas.ac.cn> From: Barry Song Date: Wed, 15 Jul 2020 21:23:20 +1200 Message-ID: Subject: Re: [PATCH] clk: clk-atlas6: fix return value check in atlas6_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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Xu Wang 于2020年7月13日周一 下午3:27写道: > > 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 > --- > drivers/clk/sirf/clk-atlas6.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/sirf/clk-atlas6.c b/drivers/clk/sirf/clk-atlas6.c > index c84d5bab7ac2..b95483bb6a5e 100644 > --- a/drivers/clk/sirf/clk-atlas6.c > +++ b/drivers/clk/sirf/clk-atlas6.c > @@ -135,7 +135,7 @@ static void __init atlas6_clk_init(struct device_node *np) > > for (i = pll1; i < maxclk; i++) { > atlas6_clks[i] = clk_register(NULL, atlas6_clk_hw_array[i]); > - BUG_ON(!atlas6_clks[i]); > + BUG_ON(IS_ERR(atlas6_clks[i])); > } > clk_register_clkdev(atlas6_clks[cpu], NULL, "cpu"); > clk_register_clkdev(atlas6_clks[io], NULL, "io"); > -- > 2.17.1 >