Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1541656ybj; Wed, 6 May 2020 00:05:06 -0700 (PDT) X-Google-Smtp-Source: APiQypISrHPqusqO/3VyeK4CWf5pFiuGnqdYsfUH4Xnzdpe5G9WC5NoI142i+IsglU4LQBr5/fiR X-Received: by 2002:a50:8dc2:: with SMTP id s2mr5944049edh.318.1588748706014; Wed, 06 May 2020 00:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588748706; cv=none; d=google.com; s=arc-20160816; b=fnIcxKKqTCHLs904MBROOg1iM3YYSr3S2N5dC6EaIiStcJT6Jcjsu9HclLYAShjJGe L6qJzcbHQsGf13r6SAh2yR2U29mgLdyFfmS4hEDB7WH+CUA0QwkXveUaOFwAoY8EkhHH y9fXjZohHhBeRzFt4WzgPdTDcvQhes93TNCr1lWgqwM87Bz+rwDjq19ADP8U4OYLz0EP pNqNkyXYfZKJEEkLb1f/Z7WYgnkKZKn9y4tdLyGyxR3aLs5KYlhSiZBC/2V2ihSqU5XE F8h8UIVTX0+7IekuWuSV1HGawzcKL78vnLWgxAuH5ZIswJIPNCTfg3u6EoFr/G5q9fqr Lkkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kNp8v77ILg0esKTUhtdtghBS9Oa/t4onJ0W3YRlQA2s=; b=QiCTIOm8G1tGdUFLKDH25nofwDYVKOUD0/2zpS2+OPJOLTuY3OHG01hJmGFMJCZghR sNeCHFgAfFtMLo+2xoeuTE25btne6X8+m1h1Dyes4BKxH5u0a3nlbl3NEQk1IVJAxz2A V9J4CDvimk68AQ05IHy7yH/7Ynm2HYlH/JC1jx14fkVFkU+1fCKKavXIcxT2MZKyTUMo LXidREyb7ksq0HiXQgGqD/HUVnB82L7v2ORNa/KhCjbziZsaIMn36zXBDZv4RNJiJ1tj FMIqhURG5JlzNrq93EuO5d2I/yomRXVY//kZ2HpjZ1QjpWKuhtILEkgurFHz0iYjDIl7 cu8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=FeY1euaz; 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 z25si483938edq.323.2020.05.06.00.04.41; Wed, 06 May 2020 00:05:05 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=FeY1euaz; 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 S1727934AbgEFHDK (ORCPT + 99 others); Wed, 6 May 2020 03:03:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726480AbgEFHDJ (ORCPT ); Wed, 6 May 2020 03:03:09 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56C58C061A41 for ; Wed, 6 May 2020 00:03:09 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id j8so1007222iog.13 for ; Wed, 06 May 2020 00:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kNp8v77ILg0esKTUhtdtghBS9Oa/t4onJ0W3YRlQA2s=; b=FeY1euazNQf3RbKL1bjD/43J4EwwmimWuHqwEOZnwBz1hd1L/dc031nSE9oFG+Wg3T 2MlLi4P3wjow8IWLNhEQw5wQzsUq1yR+pgmzkLdVVMq5F7acvzCJw8xt9tRwn4YzdTqI kq7B8RhWDy1Uvo/U/3HxmGo/XUghQ5rSkaM7QtRSng9YDN+DAZRzDNHwxdWW3bqi1RwX Xh5e60qZDatUFmTvM25J+WaTlWzSbN0N0nS7q/Emfd0rfMxf1322dnteGutZVlRQiV6j fm+T0G1XqnxcfRt5xUFvnQ+oI02GhWQhe3J5K8O2fEQKiuxWrHopugqtZsq2TI4F9eZL Ldxw== 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:content-transfer-encoding; bh=kNp8v77ILg0esKTUhtdtghBS9Oa/t4onJ0W3YRlQA2s=; b=JmM1FNSNN3PkFItmmZpCKk/0m/d92JHGiNk2WoRUh1VUFzmtfBZ9VxHtp51GWrhaiy VQxHXw0odePguaOtO5NfZlCFlAB6FahB7ENN0Dg/wD2dYObf0aV6uBMFfLNN9prRCQb6 LS/ebaXH0J5eoAnNnHtMM3FxmG7zRPo0VhdDmtShZU2xmpfrmQroAfOGonCjQJG7ITpd ib6CXEWp1o080WG+CpHRdmSzBn24CmNmg0xBFbjBFvY7p8e6vZt80YkmhrSVqzAeaT7a h4Y9kCHYT2ADaO5qhFC6gSs0c6lzQU4eBBjGuuRQeUlLQYm6YNA7SxMBCUpcozTm0ZFg oS0A== X-Gm-Message-State: AGi0PuYpT77h4x95Bq7jPQm8NqjLB4XkuI5iREKRkZTf8B+GgIRXlNYi HcBNjyLAiRHUXsKRNGQy0zeS65cTXrExuyrZQfs9QQ== X-Received: by 2002:a6b:8bd2:: with SMTP id n201mr7159413iod.131.1588748588553; Wed, 06 May 2020 00:03:08 -0700 (PDT) MIME-Version: 1.0 References: <20200505140231.16600-1-brgl@bgdev.pl> <20200505140231.16600-7-brgl@bgdev.pl> <20200505174709.GD224913@lunn.ch> In-Reply-To: <20200505174709.GD224913@lunn.ch> From: Bartosz Golaszewski Date: Wed, 6 May 2020 09:02:57 +0200 Message-ID: Subject: Re: [PATCH 06/11] net: ethernet: mtk-eth-mac: new driver To: Andrew Lunn Cc: Rob Herring , "David S . Miller" , Matthias Brugger , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Jakub Kicinski , Arnd Bergmann , Fabien Parent , devicetree , netdev , Linux Kernel Mailing List , Bartosz Golaszewski , linux-mediatek@lists.infradead.org, Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, thanks for the review. wt., 5 maj 2020 o 19:47 Andrew Lunn napisa=C5=82(a): > > > +static struct net_device *mtk_mac_get_netdev(struct mtk_mac_priv *priv= ) > > +{ > > + char *ptr =3D (char *)priv; > > + > > + return (struct net_device *)(ptr - ALIGN(sizeof(struct net_device= ), > > + NETDEV_ALIGN)); > > +} > > Bit of an odd way to do it. It is much more normal to just have > > return priv->netdev; > But then you store a pointer to the starting address of the structure in that very structure. This is actually weirder to me. :) I'd say: let's generalize it and provide a counterpart to netdev_priv(): priv_to_netdev(), how about that? For the other issues: I'll address them in v2. Bart