diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2020-08-22 12:26:05 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2020-08-22 12:26:05 +0000 |
commit | a5b973669ec033f0f2b835e47108777ffe24bfde (patch) | |
tree | 8b52a9222a5eba8bc5872e2e7aa61c81d0db1bd4 | |
parent | b98c82c8427eccbb525ddecabafc62f794c8c33c (diff) |
Simplify some code by getting rid of an extra variable.
-rw-r--r-- | sys/dev/fdt/if_mvpp.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/fdt/if_mvpp.c b/sys/dev/fdt/if_mvpp.c index a8ae569bee4..ec815831f98 100644 --- a/sys/dev/fdt/if_mvpp.c +++ b/sys/dev/fdt/if_mvpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mvpp.c,v 1.21 2020/08/22 12:25:09 patrick Exp $ */ +/* $OpenBSD: if_mvpp.c,v 1.22 2020/08/22 12:26:04 patrick Exp $ */ /* * Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2017, 2020 Patrick Wildt <patrick@blueri.se> @@ -3324,7 +3324,6 @@ mvpp2_prs_sram_bits_clear(struct mvpp2_prs_entry *pe, uint32_t bit, uint32_t val void mvpp2_prs_sram_ri_update(struct mvpp2_prs_entry *pe, uint32_t bits, uint32_t mask) { - int ri_off = MVPP2_PRS_SRAM_RI_OFFS; int i; for (i = 0; i < MVPP2_PRS_SRAM_RI_CTRL_BITS; i++) { @@ -3332,9 +3331,11 @@ mvpp2_prs_sram_ri_update(struct mvpp2_prs_entry *pe, uint32_t bits, uint32_t mas continue; if (bits & BIT(i)) - mvpp2_prs_sram_bits_set(pe, ri_off + i, 1); + mvpp2_prs_sram_bits_set(pe, + MVPP2_PRS_SRAM_RI_OFFS + i, 1); else - mvpp2_prs_sram_bits_clear(pe, ri_off + i, 1); + mvpp2_prs_sram_bits_clear(pe, + MVPP2_PRS_SRAM_RI_OFFS + i, 1); mvpp2_prs_sram_bits_set(pe, MVPP2_PRS_SRAM_RI_CTRL_OFFS + i, 1); } @@ -3349,7 +3350,6 @@ mvpp2_prs_sram_ri_get(struct mvpp2_prs_entry *pe) void mvpp2_prs_sram_ai_update(struct mvpp2_prs_entry *pe, uint32_t bits, uint32_t mask) { - int ai_off = MVPP2_PRS_SRAM_AI_OFFS; int i; for (i = 0; i < MVPP2_PRS_SRAM_AI_CTRL_BITS; i++) { @@ -3357,9 +3357,11 @@ mvpp2_prs_sram_ai_update(struct mvpp2_prs_entry *pe, uint32_t bits, uint32_t mas continue; if (bits & BIT(i)) - mvpp2_prs_sram_bits_set(pe, ai_off + i, 1); + mvpp2_prs_sram_bits_set(pe, + MVPP2_PRS_SRAM_AI_OFFS + i, 1); else - mvpp2_prs_sram_bits_clear(pe, ai_off + i, 1); + mvpp2_prs_sram_bits_clear(pe, + MVPP2_PRS_SRAM_AI_OFFS + i, 1); mvpp2_prs_sram_bits_set(pe, MVPP2_PRS_SRAM_AI_CTRL_OFFS + i, 1); } |