Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1363247pxj; Fri, 18 Jun 2021 05:41:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoDyDwn6yVaw55NH9jbg8cYV3g5cuM4o6Mc6l2GtjQoJQqezAMA0hhDG8lfQoc2Pwt/be2 X-Received: by 2002:a17:907:3e26:: with SMTP id hp38mr11120237ejc.451.1624020086854; Fri, 18 Jun 2021 05:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624020086; cv=none; d=google.com; s=arc-20160816; b=bvb3RfmoQEswnpDfX6QgXylrYLifMEeuoXbbiSMcbSdl21HCSBBb0+GLw1tbUAtQ+0 m3zdrNWH9dkK+sjrIG3+6s8GYehFP9hGX956E6vjnK9RPugW+96tVOMN+cgqf2wdvLim FmslcDGdh36uWwKgkGd0s2Tf0vGJt4EV7npioTK0x0SjX/yGaaeY5f0ghBUGAPACZHoS 1C3Tu2/jPO0ADrc10ZXcZmZWi2tbRKup4Ame9k8muDGy4VqeUCXiuWFdGAdxrw2pHZKx wW5mJbupVGb7b5vI6n17BLvJsU2s59crjr1tuh42YLQJ59o8YjBajHnvn55OFkXyID6j yOHA== 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=LUEdaM1hppiNrgci9zgX87f5flI84RrFcNouNxBCARM=; b=EJU7jlYO6aQy/9qeODRjj3kWalW73gzLxnv42rAqokFchJzhzIo36KQYlKhVJtKxtq ZSIrpsGZQzCnwCXYcEnZAX62Wcl7nEaKZQHij3/CYQLyMxxiLzFMEezcEVi26vr1ibMd WxvK3OjC9g5QX6Vs5Ircimf1fxEJZtdG0d/XWUazAEZ4fKMy2Gu1bb72/Q0/jDSsHkru gGaXzB+whjTek6PDZJHEOIuAG9bHQ6RiCWGrRo1PlXF65FDHNTnSRYZEOrlRpVD+3qeY vrjkRJwHeOGSyKlUAu5eMJaCN2GJBXIu0LbIBnT8W/93Ovt/vtkjRFVdcWBG3n/kRDal t6oA== 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 z16si9296002edb.194.2021.06.18.05.41.04; Fri, 18 Jun 2021 05:41:26 -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 S234000AbhFRLXe (ORCPT + 99 others); Fri, 18 Jun 2021 07:23:34 -0400 Received: from mail-ua1-f47.google.com ([209.85.222.47]:37723 "EHLO mail-ua1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231240AbhFRLXd (ORCPT ); Fri, 18 Jun 2021 07:23:33 -0400 Received: by mail-ua1-f47.google.com with SMTP id f34so3256565uae.4; Fri, 18 Jun 2021 04:21:24 -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=LUEdaM1hppiNrgci9zgX87f5flI84RrFcNouNxBCARM=; b=VMjj+D641hTnyVNwzkJetQyb3NdFPfEQ/2PcQM3Ez3Q7IzRzkxcCXB5mYEazQ69LG8 fCbhxayPBi45sPBuyFx9uVnAmzXLBPzq0r3N9JSPyjrJLOb7EeNbv2Qfk2JCmBJEuub1 l1Cj9MwlgKYZnNRsfKLJyQdn9gWt0O0ZzpkeqEdyYVN3oP3A5EflHnz4qFG7nfraQzMb hYK01DZs4uZL1MOhq7zFWgjQkgwkYJuGnIxApj8VdloIR33m+dd3GyP69ihMSkbrxRJT gz3s/m+Nu7ntTQePI5YEBkzRJMbCVajIjsVmBGxX0DPZpw1O8qTQRfAsvkFNE6JWrlvq 46Vw== X-Gm-Message-State: AOAM530uvXX2yD/Mc44WtnUJFSPIM5W5OAITyet9d0+eTMAmOI8ocapd sZ2h33vZVyEW06gFmMHIj7CKpe5F8m22UMOeLQ8= X-Received: by 2002:ab0:70b3:: with SMTP id q19mr11421814ual.2.1624015284122; Fri, 18 Jun 2021 04:21:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Geert Uytterhoeven Date: Fri, 18 Jun 2021 13:21:13 +0200 Message-ID: Subject: Re: [PATCH 2/2] clk: renesas: Avoid mixing error pointers and NULL To: Dan Carpenter Cc: Lad Prabhakar , Michael Turquette , Stephen Boyd , Linux-Renesas , linux-clk , Linux Kernel Mailing List , kernel-janitors@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, On Thu, Jun 17, 2021 at 4:15 PM Dan Carpenter wrote: > These functions accidentally return both error pointers and NULL when > there is an error. It doesn't cause a problem but it is confusing and > seems unintentional. > > Signed-off-by: Dan Carpenter Reviewed-by: Geert Uytterhoeven i.e. will queue in renesas-clk-for-v5.15. > --- a/drivers/clk/renesas/renesas-rzg2l-cpg.c > +++ b/drivers/clk/renesas/renesas-rzg2l-cpg.c > @@ -124,7 +124,7 @@ rzg2l_cpg_div_clk_register(const struct cpg_core_clk *core, > core->flag, &priv->rmw_lock); > > if (IS_ERR(clk_hw)) > - return NULL; > + return ERR_CAST(clk_hw); > > return clk_hw->clk; > } > @@ -174,17 +174,14 @@ rzg2l_cpg_pll_clk_register(const struct cpg_core_clk *core, > struct clk_init_data init; > const char *parent_name; > struct pll_clk *pll_clk; > - struct clk *clk; > > parent = clks[core->parent & 0xffff]; > if (IS_ERR(parent)) > return ERR_CAST(parent); > > pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL); > - if (!pll_clk) { > - clk = ERR_PTR(-ENOMEM); > - return NULL; > - } > + if (!pll_clk) > + return ERR_PTR(-ENOMEM); This part I already have, by virtue of https://lore.kernel.org/r/1623896524-102058-1-git-send-email-yang.lee@linux.alibaba.com 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