Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp454208pxj; Wed, 16 Jun 2021 06:21:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYAQUuxAEoaFkZbY4bVzY0H7M64+rX5wPhcxgoLi4W/glXVIP4RXNk7a+qWqEHMEe7+si7 X-Received: by 2002:a92:3f01:: with SMTP id m1mr3133739ila.122.1623849702478; Wed, 16 Jun 2021 06:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623849702; cv=none; d=google.com; s=arc-20160816; b=bFxlNObkAmwFPivjqIt06daDKBaoSVy9m+3tpGg2n81uQ6nxN5e9xtYDTCyPGd1zuT ALDcH4/tkz4RXMWuMdhctXzhO7Nj75rxBTvOS5GJvty3UNJIusv2EWh7RaXm6xgsS6UK kcS51z6HzcZv0KHuvse4UG6vku2GS/xQ7RFgr9OOGOVVYMlmf58LssyYibH4Fll1YPrQ 1cwMdQEkLmq+qGaGH/BMW1hZ5CDx6ITFkck0Qt5epy63rUTQr/r8uZhsb/u578+Z1aSd PILOmgeci9t5WZ8VAemo/99uNo5gsx1tpzkpvcT5bajAV4+sx1r1CT7dqpP1+E2W+51/ uYLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=6dEULrRQ8uXvER/nUGrYSi+bBawcYQZSbgmeM/kVt4s=; b=hbNtO2UTwucc0yd5qM83/xojnQ6j13ZTwpVa4NkvuO1Khrd3HhR/bSbSljX5qDnxzq dbCnAFIbW8Fj1n2vYj3KbeeEGGJ3RHKENztxo6kjwe0MLEftIpz+gqRilg8zUmAN4jY3 XPVBvX6KnOsT1ghtfQlB5WVKmlzD0myWLL1g5AGlDbsECVDtntjFftNM1hDYVmnnlFnz UaMbNmzZVxuJ+tfY6opSMa5n4tSZqPBLjNYPt2N5RGflFPrsbKODfDKxKpCp3g4N2YZ1 eBc9SLhtIiXt8VxKqbpYcTXAqwlAccyfZdaC7vw+brDWM0GJ/WoXFeHYP3IcV4UQIGZY IQlA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t10si2865248ilu.145.2021.06.16.06.21.30; Wed, 16 Jun 2021 06:21:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232673AbhFPL7T (ORCPT + 99 others); Wed, 16 Jun 2021 07:59:19 -0400 Received: from mail-vs1-f52.google.com ([209.85.217.52]:47047 "EHLO mail-vs1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232648AbhFPL7T (ORCPT ); Wed, 16 Jun 2021 07:59:19 -0400 Received: by mail-vs1-f52.google.com with SMTP id z15so838715vsn.13; Wed, 16 Jun 2021 04:57:12 -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; bh=6dEULrRQ8uXvER/nUGrYSi+bBawcYQZSbgmeM/kVt4s=; b=bZAAO4D8YcuXOqaC3TF6obBNegVEGFWRmMMD1dckMVAY5cmvsKeBYkPFYKkTU1/FfE bAES0NJz8kXJqIHHfuvzsTxbIyJ7ywIuA0tERvup7sJIUcr1p01sE4jPne+rjDcJOorl lJi2/YcCv5AvaUsAhniZ9SBEUsG9JWiOIx8ZhFuJSP3lsvlSo0zNvMBFNjAFOaQRD55A lV8k6Z1ssnZFXMpsFY2l0p3YZAv3K+J1bRU4E99DueZk5eCe8nSR5hF4yPGGSElFu0so w/vpP/+/GoQ5rVVKOyhO1Ns5u+v7WSeWarLed/p51yl+0RIE10KJcFHYC1cKxJyGYZh7 1QpQ== X-Gm-Message-State: AOAM533Ti+jw6A+5PNdBkeHB13cP2Fr5HzDfgMm8Bx7l0lK4UHa7SnsH it+QydIqD4xe3G/zus5JZ/allzsU54ykNZDRCbUqD7pSCtYxAg== X-Received: by 2002:a05:6102:2011:: with SMTP id p17mr10562353vsr.40.1623844632518; Wed, 16 Jun 2021 04:57:12 -0700 (PDT) MIME-Version: 1.0 References: <1623749970-38020-1-git-send-email-yang.lee@linux.alibaba.com> <1623749970-38020-2-git-send-email-yang.lee@linux.alibaba.com> In-Reply-To: <1623749970-38020-2-git-send-email-yang.lee@linux.alibaba.com> From: Geert Uytterhoeven Date: Wed, 16 Jun 2021 13:57:01 +0200 Message-ID: Subject: Re: [PATCH -next 2/2] clk: renesas: fix return value and unused assignment To: yang.lee@linux.alibaba.com Cc: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Linux-Renesas , linux-clk , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yang, On Tue, Jun 15, 2021 at 11:39 AM Yang Li wrote: > Currently the function returns NULL on error, so exact error code is lost. > This patch changes return convention of the function to use ERR_PTR() > on error instead. > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > drivers/clk/renesas/renesas-rzg2l-cpg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/renesas/renesas-rzg2l-cpg.c b/drivers/clk/renesas/renesas-rzg2l-cpg.c > index 1fcea17..5bc7e87 100644 > --- a/drivers/clk/renesas/renesas-rzg2l-cpg.c > +++ b/drivers/clk/renesas/renesas-rzg2l-cpg.c > @@ -183,7 +183,7 @@ static unsigned long rzg2l_cpg_pll_clk_recalc_rate(struct clk_hw *hw, > pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL); > if (!pll_clk) { > clk = ERR_PTR(-ENOMEM); > - return NULL; > + return clk; > } Why not simply "return ERR_PTR(-ENOMEM);"? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds