On Wed, 2023-03-01 at 22:39 +0530, Kajol Jain wrote: > From: Madhavan Srinivasan <ma...@linux.ibm.com> > > event.h header already includes utlis.h. Avoid including > the same explicitly in the code when event.h included. > > Signed-off-by: Madhavan Srinivasan <ma...@linux.ibm.com>
As I understand, transitive includes should not be depended upon. If you use a thing, and the thing is declared in a header, you should include _that_ header. Anything else is a recipe for weird include dependencies, ordering of the includes, etc. These files all use FAIL_IF, etc., which are declared in utils.h. So utils.h is a legitimate include. The fact that events.h also includes it (for u64) is a coincidence. If the u64 type def gets moved to, e.g., types.h, and utils.h is removed from events.h, suddenly all these files stop compiling.