Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/cortex Remove an unnecessary if statement in gi...



details:   https://anonhg.NetBSD.org/src/rev/d11485656392
branches:  trunk
changeset: 981520:d11485656392
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Mar 14 08:09:20 2021 +0000

description:
Remove an unnecessary if statement in gic_v2m_msi_alloc when finding a
'count' that fits the available.

diffstat:

 sys/arch/arm/cortex/gic_v2m.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r cd68df159a84 -r d11485656392 sys/arch/arm/cortex/gic_v2m.c
--- a/sys/arch/arm/cortex/gic_v2m.c     Sun Mar 14 05:26:42 2021 +0000
+++ b/sys/arch/arm/cortex/gic_v2m.c     Sun Mar 14 08:09:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_v2m.c,v 1.10 2020/12/11 21:40:50 jmcneill Exp $ */
+/* $NetBSD: gic_v2m.c,v 1.11 2021/03/14 08:09:20 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gic_v2m.c,v 1.10 2020/12/11 21:40:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_v2m.c,v 1.11 2021/03/14 08:09:20 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -240,10 +240,9 @@
        if (exact && *count > avail)
                return NULL;
 
-       while (*count > avail) {
-               if (avail < *count)
-                       (*count) >>= 1;
-       }
+       while (*count > avail)
+               (*count) >>= 1;
+
        if (*count == 0)
                return NULL;
 



Home | Main Index | Thread Index | Old Index