[igt-dev] [PATCH i-g-t v2 2/2] lib/intel_chipset: Move BIT macro to common place

Michal Wajdeczko michal.wajdeczko at intel.com
Thu Jul 4 15:17:43 UTC 2019


On Wed, 03 Jul 2019 15:43:03 +0200, Lukasz Kalamarz  
<lukasz.kalamarz at intel.com> wrote:

> This macro is defined in two tests. We can move it to common place
> in ioctl_wrappers, which is included by all tests.
> v2: Missed intel_device_info lib. Moved BIT definition to
> intel_chipset, which is part of igt.h
>
> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz at intel.com>
> Cc: Katarzyna Dec <katarzyna.dec at intel.com>
> Cc: Michal Winiarski <michal.winiarski at intel.com>
> ---
>  lib/intel_chipset.h            | 2 ++
>  lib/intel_device_info.c        | 2 --
>  tests/i915/gem_ctx_isolation.c | 1 -
>  tests/i915/gem_ctx_param.c     | 2 --
>  4 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/lib/intel_chipset.h b/lib/intel_chipset.h
> index 7fc9bd77..74a40a46 100644
> --- a/lib/intel_chipset.h
> +++ b/lib/intel_chipset.h
> @@ -31,6 +31,8 @@
>  #include <pciaccess.h>
>  #include <stdbool.h>
> +#define BIT(x) (1ul <<(x))
> +

instead of polluting innocent header file and introduce new
dependency on "intel_chipset.h" to use BIT macro, maybe better
option would be to create new header for such utilities and then:

	#include "igt_utils.h"
or
	#include "igt_bitops.h"

in intel_device_info.c and igt.h.

Michal


More information about the igt-dev mailing list