From: Luke Kenneth Casson Leighton Date: Mon, 5 Oct 2020 10:51:17 +0000 (+0100) Subject: return test rather than "if test return True else False" X-Git-Tag: 24jan2021_ls180~232 X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=commitdiff_plain;h=6f8178aab36b954b2c7f1c5b93a92cfa476942ce return test rather than "if test return True else False" --- diff --git a/src/soc/experiment/icache.py b/src/soc/experiment/icache.py index 30dae677..be30d32b 100644 --- a/src/soc/experiment/icache.py +++ b/src/soc/experiment/icache.py @@ -140,11 +140,7 @@ print("WAY_BITS =", WAY_BITS) # from microwatt/utils.vhdl def ispow2(n): - if ((n << 32) & ((n-1) << 32)) == 0: - return True - - else: - return False + return if ((n << 32) & ((n-1) << 32)) == 0: assert LINE_SIZE % ROW_SIZE == 0 assert ispow2(LINE_SIZE), "LINE_SIZE not power of 2"