From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755582AbbJHLlu (ORCPT ); Thu, 8 Oct 2015 07:41:50 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:60918 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755467AbbJHLlq (ORCPT ); Thu, 8 Oct 2015 07:41:46 -0400 Date: Thu, 08 Oct 2015 04:57:32 -0700 (PDT) Message-Id: <20151008.045732.1781136095864323644.davem@davemloft.net> To: vivien.didelot@savoirfairelinux.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, sfeldma@gmail.com, jiri@resnulli.us, f.fainelli@gmail.com, andrew@lunn.ch, narmstrong@baylibre.com, sergei.shtylyov@cogentembedded.com Subject: Re: [PATCH net-next 0/3] net: remove dsa.h from netdevice.h From: David Miller In-Reply-To: <1444168467-10293-1-git-send-email-vivien.didelot@savoirfairelinux.com> References: <1444168467-10293-1-git-send-email-vivien.didelot@savoirfairelinux.com> X-Mailer: Mew version 6.4 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 08 Oct 2015 04:41:46 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivien Didelot Date: Tue, 6 Oct 2015 17:54:24 -0400 > In order to push switchdev objects down to DSA drivers, I need to include > switchdev.h in dsa.h. But compilation fails because of a circular dependency > issue, since dsa.h is also included in linux/netdevice.h. > > dsa.h is included for two purposes: to have the definition of struct > dsa_switch_tree; and to have access to dsa_uses_tagged_protocol(), used by > netdev_uses_dsa(). > > This patchset forward declares struct dsa_switch_tree; adds a new uses_hw_tag > boolean to struct net_device, which is more explicit than the DSA helper, and > finally get rid of the dsa.h include. > > With this patchset, switchdev.h can safely be included in dsa.h. The netdevice structure is already too big, and bloating it up even more to satisfy some include ordering issue is rather unacceptable as far as I am concerned. Just forward declare the pointer type, you're not dereferencing it.