[Mesa-dev] [PATCH 04/11] intel/isl: Add an isl_assert_div helper
Jason Ekstrand
jason at jlekstrand.net
Wed May 31 00:55:13 UTC 2017
This is a fairly common operation and it's nice to be able to just call
the one little function.
---
src/intel/isl/isl_priv.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/intel/isl/isl_priv.h b/src/intel/isl/isl_priv.h
index 3c4cc1e..186e84d 100644
--- a/src/intel/isl/isl_priv.h
+++ b/src/intel/isl/isl_priv.h
@@ -80,6 +80,13 @@ isl_align_npot(uintmax_t n, uintmax_t a)
return ((n + a - 1) / a) * a;
}
+static inline uintmax_t
+isl_assert_div(uintmax_t n, uintmax_t a)
+{
+ assert(n % a == 0);
+ return n / a;
+}
+
/**
* Alignment must be a power of 2.
*/
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list