Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp44099pxj; Wed, 16 Jun 2021 19:49:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd3c6iWXnQRbeMx5Pq6JLQqeaT5qQ/jcplh4PMv9AjpBFSTX8Kx2lfR8444DdgdYPJ0CWu X-Received: by 2002:a92:d451:: with SMTP id r17mr1922788ilm.109.1623898155876; Wed, 16 Jun 2021 19:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623898155; cv=none; d=google.com; s=arc-20160816; b=LsEWMVn8oYalfzjSuOlY+oXNy1bRIHHRAbB20f6lSx/a9pIxdAARliIjHMK8k2SfGL j9ffLx5LF/jNSsoLEONRABCdzLEYFUHzdHBjTe0sQh0bvnP9Q6iExCJ6H/ZnNHeftC2D KJBOg/ROjiqUXOFA/Zb7MsoifgRJ1g1FC5ki8T0OLwxHUKlYyYKarRhSLJCOTHtJeqCP ogl6Y1oQC+FKYr4myfu9YE3EafAEnwxz7lqp4IXFr3ESbNLdSSaZqXB4U60QsHOK6Nzk ZLQc8wchEH7lvrLYP44nufHNkXZs6Sl8Qrys9JFeDnOVqrYm+ZioauuTJ9oh/VJmTHuI 1QqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=42vaEwY9tH4fxGQ5fJCEc35XS2JBk1B3bPaaDACRbDM=; b=KbI6+N97Wji27AxxZYOxJIqK2Q52WNvPsQYLRrETd5l989/DRjFoonc5azJ4qEuiTo CO6uNjhTdbprZbGRlDLnmC8WM09IkQUMbtSQfQzZyqYIffqLBPb9g4eZPnhimOJ993O6 xvO0TVQCu462pk1yof1lig6BTgrF68vtk4QI5cZ6t74VSLL/WM+u6rj5wyy1+l5wzwRC nMQjJsJmSCdQKO1QUKBAD4tpEqle00YEiiEcy9RaO8Rebh6BVBSxb9Ru4H3lc0GD86kG FEjwvtYczZUwyphS5PzHDkcJVfwEIdchvUIpfAVPkjMNh0ViIFFLiUkC17yQLNBeShAb HgJg== 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si4111556iob.78.2021.06.16.19.49.04; Wed, 16 Jun 2021 19:49:15 -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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231786AbhFQCYU (ORCPT + 99 others); Wed, 16 Jun 2021 22:24:20 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:59382 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbhFQCYT (ORCPT ); Wed, 16 Jun 2021 22:24:19 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R991e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UcfeMjX_1623896529; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UcfeMjX_1623896529) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Jun 2021 10:22:10 +0800 From: Yang Li To: geert+renesas@glider.be Cc: mturquette@baylibre.com, sboyd@kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH -next v2] clk: renesas: fix return value and unused assignment Date: Thu, 17 Jun 2021 10:22:03 +0800 Message-Id: <1623896524-102058-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Change in v2: --simply "return ERR_PTR(-ENOMEM);" drivers/clk/renesas/renesas-rzg2l-cpg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/clk/renesas/renesas-rzg2l-cpg.c b/drivers/clk/renesas/renesas-rzg2l-cpg.c index 5009b9e..d46fffd 100644 --- a/drivers/clk/renesas/renesas-rzg2l-cpg.c +++ b/drivers/clk/renesas/renesas-rzg2l-cpg.c @@ -182,8 +182,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 ERR_PTR(-ENOMEM); } parent_name = __clk_get_name(parent); -- 1.8.3.1