[Intel-gfx] [PATCH v2 2/4] drm/i915: fix include order in intel_tc.*

Imre Deak imre.deak at intel.com
Tue Jul 9 10:49:04 UTC 2019


On Mon, Jul 08, 2019 at 10:28:13AM -0700, Lucas De Marchi wrote:
> Make intel_tc.h the first include so we guarantee it's self-contained.
> Sort the rest. Same principle applies for includes in the header.
> 
> v2: don't make intel_tc.h be the first include
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_tc.c | 2 +-
>  drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
> index 1a9dd32fb0a5..0c969f6fd714 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.c
> +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> @@ -3,9 +3,9 @@
>   * Copyright © 2019 Intel Corporation
>   */
>  
> +#include "i915_drv.h"
>  #include "intel_display.h"
>  #include "intel_dp_mst.h"
> -#include "i915_drv.h"
>  #include "intel_tc.h"
>  
>  static const char *tc_port_mode_name(enum tc_port_mode mode)
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.h b/drivers/gpu/drm/i915/display/intel_tc.h
> index 0d8411d4a91d..45ae30537b78 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.h
> +++ b/drivers/gpu/drm/i915/display/intel_tc.h
> @@ -6,10 +6,11 @@
>  #ifndef __INTEL_TC_H__
>  #define __INTEL_TC_H__
>  
> -#include <linux/types.h>
> -#include <linux/mutex.h>
>  #include "intel_drv.h"
>  
> +#include <linux/mutex.h>
> +#include <linux/types.h>

Sorry, I missed this in my v1 review: could you explain why you reorder
intel_drv.h wrt. linux/* includes? Everywhere else in i915 I see a more
generic->more specific order of includes, that is for instance:

#include <linux/*>
#include <drm/*>
#include "*"

Is that also to get a better guarantee that local includes are
self-contained? If so, that could also be done in a more uniform way
everywhere imo.

> +
>  bool intel_tc_port_connected(struct intel_digital_port *dig_port);
>  u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
>  int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port);
> -- 
> 2.21.0
> 


More information about the Intel-gfx mailing list