bug-hurd
[Top][All Lists]
Advanced

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

[PATCH] chips: drop the register keyword and use boolean_t


From: Marin Ramesa
Subject: [PATCH] chips: drop the register keyword and use boolean_t
Date: Fri, 06 Sep 2013 17:48:18 +0200

I noticed a variable that only receives values 0 and 1, so I'm turning 
it into a boolean. I think the code is more readable that way. Also 
drop the register keyword since I've seen Justus mention it is ignored 
by modern compilers. And I must admit I've never seen it used in a more 
modern microkernel that I worked on. Anyway, here's the simple patch:

* chips/busses.c (configure_bus_master): Drop the register keyword.
(configure_bus_device): Likewise.
(configure_bus_master): Use boolean_t instead of an int.
(configure_bus_device): Likewise.
From 06668d05da299b969e69eb4d4e20180cb9e46ed7 Mon Sep 17 00:00:00 2001
From: Marin Ramesa <address@hidden>
Date: Fri, 6 Sep 2013 16:42:44 +0200
Subject: [PATCH] Drop the register keyword and use boolean_t

---
 chips/busses.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/chips/busses.c b/chips/busses.c
index 89afa97..f9f6f1b 100644
--- a/chips/busses.c
+++ b/chips/busses.c
@@ -65,11 +65,11 @@ boolean_t configure_bus_master(
        int              adpt_no,
        char            *bus_name)
 {
-       register struct bus_device *device;
-       register struct bus_ctlr *master;
-       register struct bus_driver *driver;
+       struct bus_device *device;
+       struct bus_ctlr *master;
+       struct bus_driver *driver;
 
-       int             found = 0;
+       boolean_t             found = FALSE;
 
        /*
         * Match the name in the table, then pick the entry that has the
@@ -81,7 +81,7 @@ boolean_t configure_bus_master(
                        continue;
                if (((master->adaptor == adpt_no) || (master->adaptor == '?')) 
&&
                    (strcmp(master->name, name) == 0)) {
-                       found = 1;
+                       found = TRUE;
                        break;
                }
        }
@@ -177,10 +177,10 @@ boolean_t configure_bus_device(
        int              adpt_no,
        char            *bus_name)
 {
-       register struct bus_device *device;
-       register struct bus_driver *driver;
+       struct bus_device *device;
+       struct bus_driver *driver;
 
-       int             found = 0;
+       boolean_t             found = FALSE;
 
        /*
         * Walk all devices to find one with the right name
@@ -196,7 +196,7 @@ boolean_t configure_bus_device(
                    ((!device->phys_address) ||
                     ((device->phys_address == phys) && (device->address == 
virt))) &&
                    (strcmp(device->name, name) == 0)) {
-                       found = 1;
+                       found = TRUE;
                        break;
                }
        }
-- 
1.8.1.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]