Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F7B2C2B9F4 for ; Tue, 22 Jun 2021 15:10:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4683E61289 for ; Tue, 22 Jun 2021 15:10:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232127AbhFVPMw (ORCPT ); Tue, 22 Jun 2021 11:12:52 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:49998 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232126AbhFVPMs (ORCPT ); Tue, 22 Jun 2021 11:12:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=/cGKfwVs1AmkgHe9Fl88oQ/GeDYG3RYVpN22bq5U/V8=; b=Iix64bOHSz0g0jbtXcJ4tAlTgt hf95fWoFBX3iETYrtYVMPzWxY38SiGQLaxtP5WSD5wfc/CY27h+waXwR/Kv6pR55H6E08wDZ+6kq8 qkToSlqW3q0dVyXfucViU1vGIbt0lge222EblY1b+DdsJlGJrxa4rT4UgiFLkkVNRtCo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lvi2k-00AicR-Hu; Tue, 22 Jun 2021 17:10:26 +0200 Date: Tue, 22 Jun 2021 17:10:26 +0200 From: Andrew Lunn To: Lukasz Majewski Cc: "David S . Miller" , Jakub Kicinski , Madalin Bucur , Nicolas Ferre , Joakim Zhang , Florian Fainelli , Vladimir Oltean , netdev@vger.kernel.org, Arnd Bergmann , Mark Einon , NXP Linux Team , linux-kernel@lists.infradead.org Subject: Re: [RFC 3/3] net: imx: Adjust fec_main.c to provide support for L2 switch Message-ID: References: <20210622144111.19647-1-lukma@denx.de> <20210622144111.19647-4-lukma@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210622144111.19647-4-lukma@denx.de> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > index 0602d5d5d2ee..dc2d31321cbd 100644 > --- a/drivers/net/ethernet/freescale/fec.h > +++ b/drivers/net/ethernet/freescale/fec.h > @@ -29,6 +29,10 @@ > */ > #define FEC_IEVENT 0x004 /* Interrupt event reg */ > #define FEC_IMASK 0x008 /* Interrupt mask reg */ > +#ifdef CONFIG_FEC_MTIP_L2SW > +#define FEC_MTIP_R_DES_ACTIVE_0 0x018 /* L2 switch Receive descriptor reg */ > +#define FEC_MTIP_X_DES_ACTIVE_0 0x01C /* L2 switch Transmit descriptor reg */ > +#endif Please don't scatter #ifdef everywhere. In this case, the register exists, even if the switch it not being used, so there is no need to have it conditional. > #include > > #include "fec.h" > +#ifdef CONFIG_FEC_MTIP_L2SW > +#include "./mtipsw/fec_mtip.h" > +#endif Why not just include it all the time? Andrew