From 0f2e20c80aa6bbc87f3791a8fdf81489ad501a40 Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Tue, 6 Feb 2018 11:24:30 +0100 Subject: [PATCH] mem-cache: Remove extra numSets zero check. numSets is unsigned, so it cannot be lower than 0. Besides, isPowerOf2(0) is false by definition (and implemmentation*), so there is no need for the double check. * As presented in base/intmath.hh Change-Id: I3f6296694a937434feddc7ed21f11c2a6fdfc5a9 Reviewed-on: https://gem5-review.googlesource.com/7901 Reviewed-by: Andreas Sandberg Reviewed-by: Nikos Nikoleris Maintainer: Andreas Sandberg --- src/mem/cache/tags/base_set_assoc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mem/cache/tags/base_set_assoc.cc b/src/mem/cache/tags/base_set_assoc.cc index ea74c97df..ba9447525 100644 --- a/src/mem/cache/tags/base_set_assoc.cc +++ b/src/mem/cache/tags/base_set_assoc.cc @@ -63,7 +63,7 @@ BaseSetAssoc::BaseSetAssoc(const Params *p) if (blkSize < 4 || !isPowerOf2(blkSize)) { fatal("Block size must be at least 4 and a power of 2"); } - if (numSets <= 0 || !isPowerOf2(numSets)) { + if (!isPowerOf2(numSets)) { fatal("# of sets must be non-zero and a power of 2"); } if (assoc <= 0) { -- 2.30.2