Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Diomidis Spinellis <dds@aueb.gr>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Subject: Re: [Intel-wired-lan] [PATCH] Break include dependency cycle
Date: Thu, 15 Aug 2024 15:49:59 -0700	[thread overview]
Message-ID: <2a5fea4b-fd00-eb27-2e5f-28d7ead9fc70@intel.com> (raw)
In-Reply-To: <20240811112837.3323753-1-dds@aueb.gr>

On 8/11/2024 4:28 AM, Diomidis Spinellis wrote:

Hi Diomidis,

Thank you for the patch. Could you please include the driver name in the 
title.

i.e. ixgbe: Break include dependency cycle

and also specify the tree you are targeting; presumably '[PATCH iwl-next]'.

> Header ixgbe_type.h includes ixgbe_mbx.h.  Also, header ixgbe_mbx.h
> included ixgbe_type.h, thus introducing a circular dependency.
> Removing the second include is OK, because its includers, ixgbe_mbx.c
> and ixgbe_82599.c, include ixgbe.h, which includes ixgbe_type.h.

While this does resolve the dependency, the preference is to not rely on 
includes from other files to supplement the needed includes. It would be 
better for the headers to explicitly include what they need. Easier said 
than done unfortunately.

I believe for ixgbe_mbx.h, linux/types.h and a forward declaration of 
ixgbe_hw would suffice.

For ixgbe_type.h, it doesn't appear to need ixgbe_mbx.h; though we would 
need add the include to the other files that rely on the include. 
ixgbe_main.c, _sriov.c, _x540.c, and _x550.c are what I'm seeing.

Thanks,
Tony

> Signed-off-by: Diomidis Spinellis <dds@aueb.gr>
> ---
>   drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
> index bd205306934b..34bc042da4ed 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
> @@ -4,8 +4,6 @@
>   #ifndef _IXGBE_MBX_H_
>   #define _IXGBE_MBX_H_
>   
> -#include "ixgbe_type.h"
> -
>   #define IXGBE_VFMAILBOX_SIZE        16 /* 16 32 bit words - 64 bytes */
>   
>   #define IXGBE_VFMAILBOX             0x002FC

      reply	other threads:[~2024-08-15 22:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11 11:28 [Intel-wired-lan] [PATCH] Break include dependency cycle Diomidis Spinellis
2024-08-15 22:49 ` Tony Nguyen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a5fea4b-fd00-eb27-2e5f-28d7ead9fc70@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=dds@aueb.gr \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox