projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58051ad
)
intel/isl: Add an isl_assert_div helper
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Tue, 30 May 2017 15:18:57 +0000
(08:18 -0700)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Thu, 1 Jun 2017 22:33:39 +0000
(15:33 -0700)
This is a fairly common operation and it's nice to be able to just call
the one little function.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/isl/isl_priv.h
patch
|
blob
|
history
diff --git
a/src/intel/isl/isl_priv.h
b/src/intel/isl/isl_priv.h
index 3c4cc1ed95be7056835fa79ce7b51025fe27b23e..186e84db46d194878705e7d25a65a2a200dd95f8 100644
(file)
--- 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.
*/