From c52bf757f0ea628778777df45d2649ea5d1e77f4 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Wed, 18 Mar 2015 17:18:00 +0100 Subject: [PATCH] register: make bitfield-mask methods constexpr Ref #1458 --- repos/base/include/util/register.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/base/include/util/register.h b/repos/base/include/util/register.h index 5a96ad0c3..e42523d4f 100644 --- a/repos/base/include/util/register.h +++ b/repos/base/include/util/register.h @@ -165,17 +165,17 @@ struct Genode::Register /** * Get an unshifted mask of this field */ - static access_t mask() { return ((access_t)1 << WIDTH) - 1; } + static constexpr access_t mask() { return ((access_t)1 << WIDTH) - 1; } /** * Get a mask of this field shifted by its shift in the register */ - static access_t reg_mask() { return mask() << SHIFT; } + static constexpr access_t reg_mask() { return mask() << SHIFT; } /** * Get the bitwise negation of 'reg_mask' */ - static access_t clear_mask() { return ~reg_mask(); } + static constexpr access_t clear_mask() { return ~reg_mask(); } /** * Back reference to containing register