Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp687684pxj; Thu, 17 Jun 2021 11:24:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNmRhtbBRrh2KpcRFOql1j2tSZ1Z+SWrDu3cNaVWBo2bjNfvGP8bKPkm2N9sXeLaO55V24 X-Received: by 2002:a6b:7617:: with SMTP id g23mr3545177iom.63.1623954283541; Thu, 17 Jun 2021 11:24:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623954283; cv=pass; d=google.com; s=arc-20160816; b=gMfJ6quTxlxibovskjFTu/v/pICgXmvVAtvKT8SM7b9TtJMnx8cAhilUg8hOkVnL99 Q9cxB9I7enu9bKgKoCinkeWp85slBxMb282FDLbcUBSsbD/ZCXy/LKL2R0JIHpStE8S+ /PsDj23Dcv4pKcKZkVW00IE/QMHgD3ePikZcgqH55vKYUL6xPOZ4KTsv5i666n3g4kJg 1BjTi47Gc7dAFG7QBufy1kUR9dIcA+07ZVwLB5ucEjwWHBNyQH+BhubfweCn6iCzEcSx /CFRWv8RLAVL+DQUmPamrFa7iUn2fcZwz6WNIXgJkP0JmYzvuJLLgdDZk3g+5199jZiP cukg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=M8VZjsFt7WC4H+OmJqMFWZv1MNcyH3cg2ziMfK9bVy4=; b=snUXflTU3XEEchfuoyVDaHh/tg/ABdPzd8K8TSzOFWKbd38lzhvjBIxnmcTcW2rvUz UX40jcAi6LScYU5wXvFC8ONLvrgNdOwJz9KZGCr1gJNT24f8qIFJGDicbPbumx2zsaQL 7S3Rdgs6DHHEucblZ5vKX1z7+K/ukGmWEdOA7UuAfHXWKsqjOpRxVsmSp+o+QgnCMg50 So/P4jdDJrIMcY6XJU5oaV4k2DB9TwJi5Pll0erSFaCtlhuLv05yBLGAn7ctvVksmBDP fYjHBXUYlJxJM+lz2GPxx7U7c4IjyhDC6fYa6IkiZc0k98IfMUrxmhF6a3srsRnQ86fX CuEw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector2-renesasgroup-onmicrosoft-com header.b="DQg9cL/M"; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dkim=pass dkdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.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 l6si2048928jaj.10.2021.06.17.11.24.17; Thu, 17 Jun 2021 11:24:43 -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; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector2-renesasgroup-onmicrosoft-com header.b="DQg9cL/M"; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dkim=pass dkdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.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 S232971AbhFQOmg (ORCPT + 99 others); Thu, 17 Jun 2021 10:42:36 -0400 Received: from mail-eopbgr1400114.outbound.protection.outlook.com ([40.107.140.114]:54342 "EHLO JPN01-TY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230299AbhFQOme (ORCPT ); Thu, 17 Jun 2021 10:42:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YPWa/DrkXjNr2+3+6U7FEoq89pR1SjG5CipWHkHz7PU+ecHDVXs3M2Oo3/zbRlW/OfmZOGBx6Ys4RXFGCmMfDl9dBZCp/sUgmvkNDbNWZXOPhRSal9LZyUNgDp7DviP5b83hLYihk3sb5WQp3xjEbyx4wSGKBvIc2lMOpn09bn2pLirKJyECP67fgDSIlCSwV5lUjIJKb4DEuD3r7F/Pk/pWIpqhFtGLoDlmY2Xr3otvsMoNCwMjC03lj9FLcUW+surKK6R8x05G6zziMbb9ktSB6tPbhdFHkNm+5Ao99KhZijKj3Gaq4+LGTn1CPDoOp5Noi2HF9I0EN/jLFZY3LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M8VZjsFt7WC4H+OmJqMFWZv1MNcyH3cg2ziMfK9bVy4=; b=oYGVZi3wN2UwH1Z9SbIQG3DJer+7JF79UGhe/jib2CirDPTi7VTe/dT8nlwSDasoJvsX3xjDnDgWX381Xcp1l2d7OigyngCurFDyRSH1o3LHKknk8A68RqDmLCeRM6qg3ijZi5qQ3cMvcYTJRFU5gQGlbriAbJgXRUOqr9kBk7CHsoJmJq8aLS/4AB3VrSN9V0KaVg5Py+nFpFlMptQ9RCLJQBVoAiKn6pkIFotmbyuU4D0u3IaeabihQXyEiXulPsmPuE9KDlgM2EDU6y38qZqQ2ka1W8xBgPXqrq6l0Q4KgbCtsS0VaM1ORovew7sbSUgzPhC4KTcNC/DQ6OgeWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bp.renesas.com; dmarc=pass action=none header.from=bp.renesas.com; dkim=pass header.d=bp.renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector2-renesasgroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M8VZjsFt7WC4H+OmJqMFWZv1MNcyH3cg2ziMfK9bVy4=; b=DQg9cL/MJkpUES3XeEcZzfqptXP5fN5amM9aBiVjMqim4QvnLpAGBLdpbkXmlwzzUHs5gqNu1EqpbKf0NWHlEL7cDF9ye0IEqjcUia6FetQWzBDEF5YLL6PUFarR4SbUERV8blmhCbSQNH3QXEM68A6UvL1bUHPZT3ZU6fplGgA= Received: from OSZPR01MB7019.jpnprd01.prod.outlook.com (2603:1096:604:13c::8) by OSAPR01MB1571.jpnprd01.prod.outlook.com (2603:1096:603:2b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Thu, 17 Jun 2021 14:40:24 +0000 Received: from OSZPR01MB7019.jpnprd01.prod.outlook.com ([fe80::79f9:fd59:1111:55e6]) by OSZPR01MB7019.jpnprd01.prod.outlook.com ([fe80::79f9:fd59:1111:55e6%8]) with mapi id 15.20.4242.021; Thu, 17 Jun 2021 14:40:24 +0000 From: Prabhakar Mahadev Lad To: Dan Carpenter , Geert Uytterhoeven CC: Michael Turquette , Stephen Boyd , "linux-renesas-soc@vger.kernel.org" , "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-janitors@vger.kernel.org" Subject: RE: [PATCH 2/2] clk: renesas: Avoid mixing error pointers and NULL Thread-Topic: [PATCH 2/2] clk: renesas: Avoid mixing error pointers and NULL Thread-Index: AQHXY4M3wrjBeuM+7kuOudE2VajpBKsYQlag Date: Thu, 17 Jun 2021 14:40:24 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=none action=none header.from=bp.renesas.com; x-originating-ip: [193.141.219.24] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 611e27fa-28e8-40d3-f59c-08d9319dd791 x-ms-traffictypediagnostic: OSAPR01MB1571: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CHZZlcDukadNEGx1gBlX/zfW6Maf1IohrCTmpsTscMQYGQ4tAucfWm6UJ7yEV+T00cVS6yzHHA02wDphXbYoqi2GbLR9K3qfVySo1GCdPk54Vk+Zww1kDQRXSl1quNlPzCHbg6UMX3hgGEg2qcy9tZcqJMv+dVwrG3H7VEPrgJTQmuzPPiU1nAw8wELLBWLIkfQAftNdf9+8y/DkDQOk3cj/072hw/R5zXGFdAYDi66/ldmv5eCCNrPkqX4GKj/e0RyVbZUG2nG1AEk//iY5/A+6TFRos+PiszJ1jy79Mhl/9AjyohbPuBmtVnUluXv7PDTutkxP3be/osBeIWfv9pgUWp2XKeAReyOuONf1UAAT6G4pqJbPA9TosdbaT7HftJYdVoETzeFJBiDSuDAQR7dgkiNe2H1u3Osf2GVPHs2ljcc8jw4CngjLBTr4Nts/83fx0GeAKnlxdrfkCWB1cDdzO+Sc5fghr3BKuFugrNO7gFb6HlZ/Ycbv3BO9G2zD0Z1m+BCp26oqRmIrlv8fecugZkzOjNQVahwVG2bAzONCj3c30kLATVh4sqPW1e2lgP3QMEZ6//h4wA2JD3Kmd1EHg7spty05gFaZhmlqGhg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OSZPR01MB7019.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(396003)(136003)(346002)(39850400004)(9686003)(86362001)(8936002)(52536014)(66556008)(110136005)(5660300002)(26005)(186003)(2906002)(4326008)(66446008)(55016002)(66946007)(316002)(66476007)(54906003)(64756008)(8676002)(71200400001)(76116006)(53546011)(122000001)(33656002)(7696005)(38100700002)(6506007)(478600001)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam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SN9miIAJIE1ZU3Cd1B+F+2W9cyZaC9D?= =?us-ascii?Q?XxtGNgjFz6vsuEzDYgllV64BIRfMZ4H/QJO7CfYuxAwGPvfzD16MMaKgMTu7?= =?us-ascii?Q?TtcADf+3p7b+43rMrWRIIRljlw3oKWP5Cdb2v7MCsJ/mBiG8wR7b0TVnrPQI?= =?us-ascii?Q?wTTNG2i5VQYgFG77HSBWHGrSBORWFPKRNxqYc55f11UdOecRW7Tf6bCd0hDC?= =?us-ascii?Q?+iGb4c68rZB9LUE4i5niHL/dt01SWPRk8QfQCfseeuPU8YdDmpJdwpEYYGlx?= =?us-ascii?Q?ZckRB92C1ekbuR4sVIOXEHFpLHU9+aOAkR08m/Gfosmsj7JZviJsfdJdBFxh?= =?us-ascii?Q?6o5BfisYnyfKdVYRmFki2IJVdVDeqvtv78WRYBcwpBBa1/l92qPsQqmCP8Ny?= =?us-ascii?Q?3naEMNuAuU9RYTQQW6stMcdHMqBIR7hoWBDh1l+3YSOf97/vVuK6Ewp7BTDp?= =?us-ascii?Q?3h1G3ojCEAx9kwudCMoyhpf3?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: bp.renesas.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OSZPR01MB7019.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 611e27fa-28e8-40d3-f59c-08d9319dd791 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jun 2021 14:40:24.4406 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: aeFFgjCwiamtTiR2JgNWn4ggHC4HnaNDOEHloVhhObLKxY9eAfkaTvgg1/1Q3+fRKbJvalmJwyAElt2hKbV24f8YpYRzNMdPCajXiPkgInRBo91gypy3LijEAgKh/dvP X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSAPR01MB1571 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, Thank you for the patch. > -----Original Message----- > From: Dan Carpenter > Sent: 17 June 2021 15:15 > To: Geert Uytterhoeven ; Prabhakar Mahadev Lad <= prabhakar.mahadev- > lad.rj@bp.renesas.com> > Cc: Michael Turquette ; Stephen Boyd ; linux-renesas- > soc@vger.kernel.org; linux-clk@vger.kernel.org; linux-kernel@vger.kernel.= org; kernel- > janitors@vger.kernel.org > Subject: [PATCH 2/2] clk: renesas: Avoid mixing error pointers and NULL >=20 > These functions accidentally return both error pointers and NULL when the= re is an error. It doesn't > cause a problem but it is confusing and seems unintentional. >=20 > Signed-off-by: Dan Carpenter > --- > drivers/clk/renesas/renesas-rzg2l-cpg.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) >=20 Reviewed-by: Lad Prabhakar Cheers, Prabhakar > diff --git a/drivers/clk/renesas/renesas-rzg2l-cpg.c b/drivers/clk/renesa= s/renesas-rzg2l-cpg.c > index 7ba36f19896f..83b58e1cb78f 100644 > --- 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); >=20 > if (IS_ERR(clk_hw)) > - return NULL; > + return ERR_CAST(clk_hw); >=20 > return clk_hw->clk; > } > @@ -174,17 +174,14 @@ rzg2l_cpg_pll_clk_register(const struct cpg_core_cl= k *core, > struct clk_init_data init; > const char *parent_name; > struct pll_clk *pll_clk; > - struct clk *clk; >=20 > parent =3D clks[core->parent & 0xffff]; > if (IS_ERR(parent)) > return ERR_CAST(parent); >=20 > pll_clk =3D devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL); > - if (!pll_clk) { > - clk =3D ERR_PTR(-ENOMEM); > - return NULL; > - } > + if (!pll_clk) > + return ERR_PTR(-ENOMEM); >=20 > parent_name =3D __clk_get_name(parent); > init.name =3D core->name; > -- > 2.30.2