Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp509387ybj; Thu, 7 May 2020 00:47:08 -0700 (PDT) X-Google-Smtp-Source: APiQypI9WFS8BmornCi9sJ0XWx5qEKq3oPOGoLEr39Gm2S0RSx4rcopuZ8NyRLNOW8sWjBiCZZIi X-Received: by 2002:a17:906:a39a:: with SMTP id k26mr10274474ejz.172.1588837628033; Thu, 07 May 2020 00:47:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1588837628; cv=pass; d=google.com; s=arc-20160816; b=GsXnFsS+zFWj+DrOZm2eujC32iLFFynbtRcU2ZtzAh/+3DudIcx6m08GE+aOVoZef+ fgKFEJZpTuJYASBXYCLm96yuQqWecVY9djB1Z+NHzUjzwa4joSTk2Uqzvu+kPWiIOhCm bmCgL8ho2agyR9vkQietRp6tPkIHKiqWIfpCZPZjZgHCx4gYPmFW8cJ8nZQuslXePQeU w3p03bSrA1lAwWd30kYDEJpAcyr+okvtUlQScDr98oAQZYqhRX1drUdWIC5KzGyC6xnl 1pNthakjiTtb4WmV/rUPhUg0v3PavZ6pI0l1mC7GhCF+5WzQxm6B44NYbTJXtnuVSXEQ 2qhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature; bh=oHxS2xyHpsRPPIWtvTHszsk9Bx9HstHAWhmIu41Ty+A=; b=CrcTtqDnqFpcrs9c/BIbZlZtvHopmT/3/INKij+aw6rcgObValvjgdzKjKns70nFjS C05whJZWbTaKSO0I6NJwfmhH6C2AT7sguNEZPPlYEv7Xz1QBdqR9ulymvtoO7Z7dEp2t Gid+wJGGbEcoaah3qiNqp8fkvKh6vjkvmP7FSVw5UeiQPrW8qeyI+FkTSdObTDBiqaWD Htqj19IBB4oJv4H3tXmEN56W8JdFxd4/hjh4wCbH4U59k95mh2PlSICDG5rz9CPa3tcs biIc5fcagpg0HWGL7EIJC2xJqRfMXL0XFhhvT7uYNbwih36CgsmBLzJWDlMlrSnUjuIZ 8YwQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=QHYOA1oo; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.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=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si2472505edr.360.2020.05.07.00.46.44; Thu, 07 May 2020 00:47:08 -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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=QHYOA1oo; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbgEGHoy (ORCPT + 99 others); Thu, 7 May 2020 03:44:54 -0400 Received: from mail-db8eur05on2069.outbound.protection.outlook.com ([40.107.20.69]:18689 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725809AbgEGHox (ORCPT ); Thu, 7 May 2020 03:44:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KRyBeIrOAEUQbxeasaHvdp7m2y9cZoYKFrZ+2Bje+bKMG7WpUHnfdKegwQ0hxmb6oclopjB7XcODCezDopNJy+CbrQD2sNSe3jV76LLPzwjM9PtkT1Ekm54HgAabsG4XBQ97K16CsMPB785flJB6oXq5jm781oL6zd0v9eTWnO0tVv4lMEmcuWflDUW5RpO4zhEI/9YqjX1F8YOto3xqm+K10J0kO8aTh6+3T3JQcQRweUGv38Z4wQ7cV/Xk/eDImhJ846kvrlhDP7Adq7KnfIUiSn5lQtMovO/Rk9HnEt4rZdoF4dEnSIHsxYFDzK7MvWlvM+nrv9VuXw/bxiFoEw== 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=oHxS2xyHpsRPPIWtvTHszsk9Bx9HstHAWhmIu41Ty+A=; b=lvz5xD4Az0ATdyhL1OQQWcX/yMGAzKRqArYTzSKf9N48jO84bRxZqgc9ByWLe/dahCUzUVgb3d87EQiPXbmAKGqEQOlgcDOWwR5LcI+9PijUy+JqC5JxITg46GETxt7/KAkOuyB7UDnHd1yhooOXf7BRZo+OpbvPvymUsQkyjg0iAFB7fdZPJNzy87Rzi++UurQZJEXATFFE0L/mgQgi5zG7iBfJl6rZjL6x/j5+RO6PnXP7uq81z4+AZ/IYWYz/xYhgMERqmn+0c7gyaIXabP5LxMSZ6+U33V85n0v7qCf3WyFDlEVz89LZp5DTul22zpRoPUDOzJt9M3mo5c0Uqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oHxS2xyHpsRPPIWtvTHszsk9Bx9HstHAWhmIu41Ty+A=; b=QHYOA1ooSBTAbu3/o3hwhBdCZd/3vavXINa1ZxabOQJtnBROF3P65XR16uJGONz69Yb+XqR6b9sSdt+jH1bRjqcfh3yIDwwgGsND+39P9D5HaQCWXMrHb2J8+2sDWo2pyxfd+OGZ38VdC35fRGaWPYSCAvpWAVIE6DvJEqbusvU= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM0PR04MB6516.eurprd04.prod.outlook.com (2603:10a6:208:174::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Thu, 7 May 2020 07:44:48 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::c4fe:d4a4:f0e1:a75b]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::c4fe:d4a4:f0e1:a75b%4]) with mapi id 15.20.2979.028; Thu, 7 May 2020 07:44:48 +0000 Date: Thu, 7 May 2020 13:14:35 +0530 From: Calvin Johnson To: Andy Shevchenko Cc: "Rafael J . Wysocki" , Russell King - ARM Linux admin , linux.cj@gmail.com, Jeremy Linton , Andrew Lunn , Florian Fainelli , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Greg Kroah-Hartman , Heikki Krogerus , Varun Sethi , "Rajesh V . Bikkina" , ACPI Devel Maling List , Linux Kernel Mailing List , Diana Madalina Craciun , netdev , Marcin Wojtas , Laurentiu Tudor , Makarand Pawagi , linux-arm Mailing List , Pankaj Bansal , "David S. Miller" , Heiner Kallweit Subject: Re: [net-next PATCH v3 5/5] net: mdiobus: Introduce fwnode_mdiobus_register_phy() Message-ID: <20200507074435.GA10296@lsv03152.swis.in-blr01.nxp.com> References: <20200505132905.10276-1-calvin.johnson@oss.nxp.com> <20200505132905.10276-6-calvin.johnson@oss.nxp.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: SG2PR06CA0097.apcprd06.prod.outlook.com (2603:1096:3:14::23) To AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03152.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0097.apcprd06.prod.outlook.com (2603:1096:3:14::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28 via Frontend Transport; Thu, 7 May 2020 07:44:41 +0000 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5084270a-3d73-462c-d2e8-08d7f25a8416 X-MS-TrafficTypeDiagnostic: AM0PR04MB6516:|AM0PR04MB6516: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-Forefront-PRVS: 03965EFC76 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KZFywUdbZKsBavJMQXUJVzCcKRLgFyFnjtrJrcAfCQgDP6RzwLdAkeIv7pJzi/7kb1RkoNgG6pxsVFP2V6Yn+lGl6RVVoCL1YHllZIidnGNyaf8WJCagtU91nquwHul16IL9ywX2YRurinNQtQM1dx90u+fNXDho+UbBGSZSime1qUwz5aSYSLo6OocE5CApwjVosFB52IgDyJ4dTWenFNlf5TR/wJfUfRdJ0OuDN3cWDuF89EJREWUnM53PlQdxGUWw22+43zK7jBQ3syK17MY2EbNrZokodEDU4nk7tuCC+6TZGsPn3YkB7g/cNmxGqNRPQ0obofPWzRFUa5aBososMh5JQw740VZi30aDdheY/vcQ0ZL9UhZjlKNqZaIZ0wAdb5kTuDS9YhCJqHA5NLewiFMlKlH2PjSzxypfCEiFGJMXZHYN1HoRDMjEb73zSxvVHmbx0GHOh4Bx7pfGwt53fV0ecXH5+5GTvuLZ9e5cJbHAMfYwuDHIgW5w4O61r1WrtRuH3k8YBkq4lmIWdhQ2OuSYGxadMViykkZcYJHHPb4RGi9qmpWWjbNjsFUj X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5636.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(39860400002)(136003)(366004)(376002)(346002)(33430700001)(7416002)(6916009)(55016002)(4326008)(478600001)(5660300002)(33440700001)(66946007)(6506007)(2906002)(53546011)(54906003)(66556008)(9686003)(8936002)(66476007)(55236004)(956004)(16526019)(186003)(1006002)(1076003)(6666004)(33656002)(52116002)(7696005)(86362001)(4744005)(316002)(83280400001)(26005)(8676002)(83300400001)(83320400001)(83290400001)(44832011)(83310400001)(110426005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /KHV1TmiLjANoEnpv1d1Hymyd0o5yD/XgwVYNVPrJHnWIzCIOjNxX3+rl1iJWTC9TWQXxp9YvFTSEyOIYe22qv/kcsSeugW0Kp7MfWMD9kr/BdqwsgzzJLQHx3pFxz3irahH0OOav/r8F0HqHNONtdIZAe9KVleIGkSD2fD58tMJZ7gmBYHWqbWIFsJWIM9JPXqned6/ZjNEEATJFyUdgsQ0d7h/CVLG56fpRN8JTYYhKxHVaUG3IJSPwEeOtZefjKUVlXMPXDhRU/lSMHWqZ9fJeaNQlpKmITIAFM8GOttSNR2LVaQdLd04/StUlTK/nrg/+ViySIITuMxp4K/gQ51m0nh58402/4ZYhF7FoI7TWCq3HVCtKDtoKoCuMv5CdW1NNFZlVLOJfLH/CnaSGb7N+PkvXrTl4t4xrid1TAMrOsKqTJA6svNt2l9f4mQ04PPwkYUSWYOe1tUpOgf2se7euc/viNaRJhwwfhxUYQqTr7RGPi1zpIrmz7XunZDH8IDlCNTEMGO2ojtCNx63T/YDLFEjDaUPActJ4q4890S6VcL2K9tSq+8LoseYkLdNtd0dy6OkttbUGbSNwOcErwqtcn/r6GPxNybxQP6MX7LjZyy/YlTYgSQSCeazEMI8sxa1viM2WneMLWGBCvTumWgt7nnHiMkH6pvY7NTtYjZQqBIeeO2+wKX8SYcUhT0ULEsX6sm50xt/9Cy9zqXAPavXO+AS9F5ji06hGXhWjQrjP6JOJsvr44zOJ3YZfXTC+81ABxD+d0dAEtiTTjxfKN195+VAlZX/Gj0McRSun00= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5084270a-3d73-462c-d2e8-08d7f25a8416 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2020 07:44:47.9287 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: O+IOurK3LSnC7+4BH5QRxmcsVhATqMME1Iz3OmrSdHewnKrQ4JYtGe81HBmSjENa/dInowbZNzjWyivuHRpkRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6516 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 05, 2020 at 05:22:00PM +0300, Andy Shevchenko wrote: > On Tue, May 5, 2020 at 4:30 PM Calvin Johnson > wrote: > > > > Introduce fwnode_mdiobus_register_phy() to register PHYs on the > > mdiobus. From the compatible string, identify whether the PHY is > > c45 and based on this create a PHY device instance which is > > registered on the mdiobus. > > ... > > > +int fwnode_mdiobus_register_phy(struct mii_bus *bus, > > + struct fwnode_handle *child, u32 addr) > > +{ > > + struct phy_device *phy; > > > + bool is_c45 = false; > > Redundant assignment, see below. > > > + const char *cp; > > + u32 phy_id; > > + int rc; > > + > > > + fwnode_property_read_string(child, "compatible", &cp); > > Consider rc = ...; otherwise you will have UB below. > > > + if (!strcmp(cp, "ethernet-phy-ieee802.3-c45")) > > UB! Thanks for the comments! I've considered all of them. What is UB, by the way? :)- Regards Calvin