Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1107538imm; Wed, 8 Aug 2018 10:52:10 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzkHDJeW7D+j6XozUw2cIe2fJgz4C9I8t3fQccRShU6rsgK74uaUgzfqt5dugznJBIKlP1n X-Received: by 2002:a62:64d0:: with SMTP id y199-v6mr4014659pfb.255.1533750730902; Wed, 08 Aug 2018 10:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533750730; cv=none; d=google.com; s=arc-20160816; b=o6/kxEvCZPNJbkRcivT0TiuH58Qvvi2uB5rDbBPZaEYDUqbcxqY7rkaFz4gZJYR6iG IlNlW9uNKSe4xIaLBe3zvodGf66xzH3k2l0yV/Kxi8uiJ1LyZRFMYuoWpHcI+H6lox0X Ovn6qnKAcECFNRn3koi0bo6Y/eckT47lGYn0NtsIQP/ARgkZhPRiF+FBBu7yaqLKDNzc YMsWUh3xsi64BN+d7V65x4o5LpPRrWCUXB3/Fbzn+veBfFBr6ghdCad00yId3kLePkMa iJfbyXdNrY7lAgSJETJ1xq263jlVayQlELykiK0g/a3emGfbAOxMc7Bp0ZC4DlA6Tewo 8t7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ngxSF88L3UPmGJiFCLGrUmz76gNbLrC+CIojozODNoU=; b=Zc9OVUyKzJmDWDU5lTSFBxTi8juJOjV3lcUwi6u3HD7ioVgHlBKuxuzpKS2oW5fJK5 l5I4iyVyT18SgjUkmwNaDcqAwal95DP3pqESUhvP8sJPI6XfZuYXrAkON+BJ1Fkg9iVW Ox7Yi3QEhTaEUcQTmFydKA8MFgWygvHj8NJHhzqJdfXRGpeEIOazJzBF6uH/31OD8WgS RpkoAFdUg95FiAhgatm/dwOv59LfidcGhjRDO8x70BhXDXihzyCrd6o/u5YwSLVqg/Gp HVIfwCTtbwe8Ucil6m89fNgsD1k0HtuF5Bov7ISGnet2nhvv00SCS0I2FDCltucJCMdm 0VNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CHQcLzTf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p131-v6si4838660pgp.343.2018.08.08.10.51.56; Wed, 08 Aug 2018 10:52:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CHQcLzTf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729668AbeHHULp (ORCPT + 99 others); Wed, 8 Aug 2018 16:11:45 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:33099 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727062AbeHHULp (ORCPT ); Wed, 8 Aug 2018 16:11:45 -0400 Received: by mail-ua0-f193.google.com with SMTP id i4-v6so3355401uak.0; Wed, 08 Aug 2018 10:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ngxSF88L3UPmGJiFCLGrUmz76gNbLrC+CIojozODNoU=; b=CHQcLzTfBE62taG8EKKEpED36TtIvBYBKcU7MxitLbwbaTTtOQ8iiyO1xc26oMHjMX wlyxa3heJx44p6scDp1kglvY+Fkq/zM+NGMmH6JcRu1j5P7TwpaR1knNIiR3xKIfc+u2 4kUFY4jd82OGKNy+c1SKwTqdW5nou9bVpfQzLb816O79lPEQH8PRZO87jiCMSifJAJ/x 0uFWHnJ/NO7Zd2wPIzSRWe1iTGoCnhDfRAgW2GmkvuAiU0mjsHqDDJ7TZendYOZ3J61z Irwzg7y6A+SlMQaHHVav74qL8jpeBayKTP3DToqVwiRwHtGXWLZ8mPyN8tQDSPF28eob nUKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ngxSF88L3UPmGJiFCLGrUmz76gNbLrC+CIojozODNoU=; b=bDzHMKEKrSU9lMTlLGwdCFySHQpV1L8gNVWpJNSrL2hnblUl5/vFt3S6mf7e0WEFiE ofDpOjdCM5H6IjoawhKjUAQr6aCM8C3uPk6lufKrS2n6pF7B4AhVL86d69s7r+8hgQO4 zEadgWSNauGp7aF1sgcyCKgKdB2XBBmSeEJ9y+1bLYextjYm67QbGTwlJ6BdujHS5yeB AfhCym7H1xnGQlpJoyosQq4eMVAlcGyo5j3G68FP3DULcGv6VpP23b/+aCe0MiQu3oRK bMGlEcnw2njor/xrY5hoJFT2OPL6nFlhRA/ExQj25gX5+IqArm+Hb5UkwfgZjiC8UsE4 L2DQ== X-Gm-Message-State: AOUpUlFUxlru50cdOzzuaKm03SHs99l8niMny00xGTLwmL161qX9b+5y huP193ZVnEWtURb7tQcH+OFtrfgJn0S+y35jv1E= X-Received: by 2002:a1f:4c7:: with SMTP id 190-v6mr2488178vke.63.1533750659079; Wed, 08 Aug 2018 10:50:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 10:50:58 -0700 (PDT) In-Reply-To: <20180808153150.23444-15-brgl@bgdev.pl> References: <20180808153150.23444-1-brgl@bgdev.pl> <20180808153150.23444-15-brgl@bgdev.pl> From: Andy Shevchenko Date: Wed, 8 Aug 2018 20:50:58 +0300 Message-ID: Subject: Re: [PATCH 14/28] net: split eth_platform_get_mac_address() into subroutines To: Bartosz Golaszewski Cc: Jonathan Corbet , Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Naren , Mauro Carvalho Chehab , Andrew Morton , Lukas Wunner , Dan Carpenter , Florian Fainelli , Ivan Khoronzhuk , Sven Van Asbroeck , Paolo Abeni , Alban Bedel , Rob Herring , David Lechner , Andrew Lunn , Linux Documentation List , Linux Kernel Mailing List , linux-arm Mailing List , linux-i2c , "open list:MEMORY TECHNOLOGY..." , Linux OMAP Mailing List , netdev , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 8, 2018 at 6:31 PM, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > We want do add more sources from which to read the MAC address. In > order to avoid bloating this function too much, start by splitting it > into subroutines, each of which takes care of reading the MAC from > one source. > +static int mac_address_from_of(struct device *dev, u8 *mac_addr) > { > const unsigned char *addr; > + struct device_node *np; > > + np = dev_is_pci(dev) ? pci_device_to_OF_node(to_pci_dev(dev)) > + : dev->of_node; I didn't get these manipulations. What the scenario when pci_dev->dev.of_node != dev->of_node? -- With Best Regards, Andy Shevchenko