From: Erik Arfvidson <erik.arfvid...@unisys.com>

This patch changes the following functions in visorchipset.[ch]
from bool to int:
visorchipset_cache_alloc
visorchipset_get_bus_info
visorchipset_get_device_info
visorchipset_set_bus_context

Signed-off-by: Erik Arfvidson <erik.arfvid...@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.ro...@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset.h |  10 +-
 .../unisys/visorchipset/visorchipset_main.c        | 102 ++++++++++-----------
 2 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 98f3ba4..15a20a0 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -218,19 +218,19 @@ typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (struct 
controlvm_message *msg,
 void visorchipset_device_pause_response(ulong bus_no, ulong dev_no,
                                        int response);
 
-BOOL visorchipset_get_bus_info(ulong bus_no,
+int visorchipset_get_bus_info(ulong bus_no,
                               struct visorchipset_bus_info *bus_info);
-BOOL visorchipset_get_device_info(ulong bus_no, ulong dev_no,
+int visorchipset_get_device_info(ulong bus_no, ulong dev_no,
                                  struct visorchipset_device_info *dev_info);
-BOOL visorchipset_set_bus_context(ulong bus_no, void *context);
-BOOL visorchipset_set_device_context(ulong bus_no, ulong dev_no, void 
*context);
+int visorchipset_set_bus_context(ulong bus_no, void *context);
+int visorchipset_set_device_context(ulong bus_no, ulong dev_no, void *context);
 int visorchipset_chipset_ready(void);
 int visorchipset_chipset_selftest(void);
 int visorchipset_chipset_notready(void);
 void visorchipset_save_message(struct controlvm_message *msg,
                               enum crash_obj_type type);
 void *visorchipset_cache_alloc(struct kmem_cache *pool,
-                              BOOL ok_to_block, char *fn, int ln);
+                              int ok_to_block, char *fn, int ln);
 void visorchipset_cache_free(struct kmem_cache *pool, void *p,
                             char *fn, int ln);
 
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f606ee9..da20e98 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -119,7 +119,7 @@ typedef struct {
        struct controlvm_message_header Dumpcapture_header;
        struct controlvm_message_header Gettextdump_header;
        struct controlvm_message_header Dumpcomplete_header;
-       BOOL Gettextdump_outstanding;
+       int Gettextdump_outstanding;
        u32 crc32;
        ulong length;
        atomic_t buffers_in_use;
@@ -136,7 +136,7 @@ static LIVEDUMP_INFO LiveDump_info;
  * process it again the next time controlvm_periodic_work() runs.
  */
 static struct controlvm_message ControlVm_Pending_Msg;
-static BOOL ControlVm_Pending_Msg_Valid = FALSE;
+static int ControlVm_Pending_Msg_Valid;
 
 /* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
  * TRANSMIT_FILE PutFile payloads.
@@ -827,7 +827,7 @@ static void
 bus_responder(enum controlvm_id cmdId, ulong busNo, int response)
 {
        struct visorchipset_bus_info *p = NULL;
-       BOOL need_clear = FALSE;
+       int need_clear = 0;
 
        p = findbus(&BusInfoList, busNo);
        if (!p) {
@@ -843,7 +843,7 @@ bus_responder(enum controlvm_id cmdId, ulong busNo, int 
response)
                if (cmdId == CONTROLVM_BUS_CREATE)
                        p->state.created = 1;
                if (cmdId == CONTROLVM_BUS_DESTROY)
-                       need_clear = TRUE;
+                       need_clear = 1;
        }
 
        if (p->pending_msg_hdr.id == CONTROLVM_INVALID) {
@@ -904,7 +904,7 @@ device_responder(enum controlvm_id cmdId, ulong busNo, 
ulong devNo,
                 int response)
 {
        struct visorchipset_device_info *p = NULL;
-       BOOL need_clear = FALSE;
+       int need_clear = 0;
 
        p = finddevice(&DevInfoList, busNo, devNo);
        if (!p) {
@@ -915,7 +915,7 @@ device_responder(enum controlvm_id cmdId, ulong busNo, 
ulong devNo,
                if (cmdId == CONTROLVM_DEVICE_CREATE)
                        p->state.created = 1;
                if (cmdId == CONTROLVM_DEVICE_DESTROY)
-                       need_clear = TRUE;
+                       need_clear = 1;
        }
 
        if (p->pending_msg_hdr.id == CONTROLVM_INVALID) {
@@ -935,9 +935,9 @@ device_responder(enum controlvm_id cmdId, ulong busNo, 
ulong devNo,
 static void
 bus_epilog(u32 busNo,
           u32 cmd, struct controlvm_message_header *msgHdr,
-          int response, BOOL needResponse)
+          int response, int needResponse)
 {
-       BOOL notified = FALSE;
+       int notified = 0;
 
        struct visorchipset_bus_info *pBusInfo = findbus(&BusInfoList, busNo);
 
@@ -967,23 +967,23 @@ bus_epilog(u32 busNo,
                        * devices */
                        if (BusDev_Server_Notifiers.bus_create) {
                                (*BusDev_Server_Notifiers.bus_create) (busNo);
-                               notified = TRUE;
+                               notified = 1;
                        }
                        if ((!pBusInfo->flags.server) /*client */ &&
                            BusDev_Client_Notifiers.bus_create) {
                                (*BusDev_Client_Notifiers.bus_create) (busNo);
-                               notified = TRUE;
+                               notified = 1;
                        }
                        break;
                case CONTROLVM_BUS_DESTROY:
                        if (BusDev_Server_Notifiers.bus_destroy) {
                                (*BusDev_Server_Notifiers.bus_destroy) (busNo);
-                               notified = TRUE;
+                               notified = 1;
                        }
                        if ((!pBusInfo->flags.server) /*client */ &&
                            BusDev_Client_Notifiers.bus_destroy) {
                                (*BusDev_Client_Notifiers.bus_destroy) (busNo);
-                               notified = TRUE;
+                               notified = 1;
                        }
                        break;
                }
@@ -1002,10 +1002,10 @@ bus_epilog(u32 busNo,
 static void
 device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
              struct controlvm_message_header *msgHdr, int response,
-             BOOL needResponse, BOOL for_visorbus)
+             int needResponse, int for_visorbus)
 {
        struct visorchipset_busdev_notifiers *notifiers = NULL;
-       BOOL notified = FALSE;
+       int notified = 0;
 
        struct visorchipset_device_info *pDevInfo =
                finddevice(&DevInfoList, busNo, devNo);
@@ -1034,7 +1034,7 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
                case CONTROLVM_DEVICE_CREATE:
                        if (notifiers->device_create) {
                                (*notifiers->device_create) (busNo, devNo);
-                               notified = TRUE;
+                               notified = 1;
                        }
                        break;
                case CONTROLVM_DEVICE_CHANGESTATE:
@@ -1045,7 +1045,7 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
                                if (notifiers->device_resume) {
                                        (*notifiers->device_resume) (busNo,
                                                                     devNo);
-                                       notified = TRUE;
+                                       notified = 1;
                                }
                        }
                        /* ServerNotReady / ServerLost / SegmentStateStandby */
@@ -1058,7 +1058,7 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
                                if (notifiers->device_pause) {
                                        (*notifiers->device_pause) (busNo,
                                                                    devNo);
-                                       notified = TRUE;
+                                       notified = 1;
                                }
                        } else if (state.alive == segment_state_paused.alive &&
                                   state.operating ==
@@ -1082,7 +1082,7 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
                case CONTROLVM_DEVICE_DESTROY:
                        if (notifiers->device_destroy) {
                                (*notifiers->device_destroy) (busNo, devNo);
-                               notified = TRUE;
+                               notified = 1;
                        }
                        break;
                }
@@ -1379,7 +1379,7 @@ Away:
 /* When provided with the physical address of the controlvm channel
  * (phys_addr), the offset to the payload area we need to manage
  * (offset), and the size of this payload area (bytes), fills in the
- * CONTROLVM_PAYLOAD_INFO struct.  Returns TRUE for success or FALSE
+ * CONTROLVM_PAYLOAD_INFO struct.  Returns 1 for success or 0
  * for failure.
  */
 static int
@@ -1544,7 +1544,7 @@ chipset_notready(struct controlvm_message_header *msgHdr)
 /* This is your "one-stop" shop for grabbing the next message from the
  * CONTROLVM_QUEUE_EVENT queue in the controlvm channel.
  */
-static BOOL
+static int
 read_controlvm_event(struct controlvm_message *msg)
 {
        if (visorchannel_signalremove(ControlVm_channel,
@@ -1553,11 +1553,11 @@ read_controlvm_event(struct controlvm_message *msg)
                if (msg->hdr.flags.test_message == 1) {
                        LOGERR("ignoring bad CONTROLVM_QUEUE_EVENT msg with 
controlvm_msg_id=0x%x because Flags.testMessage is nonsensical (=1)",
                               msg->hdr.id);
-                       return FALSE;
+                       return 0;
                }
-               return TRUE;
+               return 1;
        }
-       return FALSE;
+       return 0;
 }
 
 /*
@@ -1774,30 +1774,30 @@ parahotplug_process_message(struct controlvm_message 
*inmsg)
 
 /* Process a controlvm message.
  * Return result:
- *    FALSE - this function will return FALSE only in the case where the
+ *    0 - this function will return 0 only in the case where the
  *            controlvm message was NOT processed, but processing must be
  *            retried before reading the next controlvm message; a
  *            scenario where this can occur is when we need to throttle
  *            the allocation of memory in which to copy out controlvm
  *            payload data
- *    TRUE  - processing of the controlvm message completed,
+ *    1  - processing of the controlvm message completed,
  *            either successfully or with an error.
  */
-static BOOL
+static int
 handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 {
        struct controlvm_message_packet *cmd = &inmsg.cmd;
        u64 parametersAddr = 0;
        u32 parametersBytes = 0;
        PARSER_CONTEXT *parser_ctx = NULL;
-       BOOL isLocalAddr = FALSE;
+       int isLocalAddr = 0;
        struct controlvm_message ackmsg;
 
        /* create parsing context if necessary */
        isLocalAddr = (inmsg.hdr.flags.test_message == 1);
        if (channel_addr == 0) {
                LOGERR("HUH? channel_addr is 0!");
-               return TRUE;
+               return 1;
        }
        parametersAddr = channel_addr + inmsg.hdr.payload_vm_offset;
        parametersBytes = inmsg.hdr.payload_bytes;
@@ -1807,7 +1807,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
         * makes a difference in how we compute the virtual address.
         */
        if (parametersAddr != 0 && parametersBytes != 0) {
-               BOOL retry = FALSE;
+               int retry = 0;
 
                parser_ctx =
                    parser_init_byteStream(parametersAddr, parametersBytes,
@@ -1815,7 +1815,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
                if (!parser_ctx) {
                        if (retry) {
                                LOGWRN("throttling to copy payload");
-                               return FALSE;
+                               return 0;
                        }
                        LOGWRN("parsing failed");
                        LOGWRN("inmsg.hdr.Id=0x%lx", (ulong) inmsg.hdr.id);
@@ -1919,7 +1919,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
                parser_done(parser_ctx);
                parser_ctx = NULL;
        }
-       return TRUE;
+       return 1;
 }
 
 static HOSTADDRESS controlvm_get_channel_address(void)
@@ -1940,8 +1940,8 @@ static void
 controlvm_periodic_work(struct work_struct *work)
 {
        struct controlvm_message inmsg;
-       BOOL gotACommand = FALSE;
-       BOOL handle_command_failed = FALSE;
+       int gotACommand = 0;
+       int handle_command_failed = 0;
        static u64 Poll_Count;
 
        /* make sure visorbus server is registered for controlvm callbacks */
@@ -1990,13 +1990,13 @@ controlvm_periodic_work(struct work_struct *work)
                        * rather than reading a new one
                        */
                        inmsg = ControlVm_Pending_Msg;
-                       ControlVm_Pending_Msg_Valid = FALSE;
-                       gotACommand = TRUE;
+                       ControlVm_Pending_Msg_Valid = 0;
+                       gotACommand = 1;
                } else
                        gotACommand = read_controlvm_event(&inmsg);
        }
 
-       handle_command_failed = FALSE;
+       handle_command_failed = 0;
        while (gotACommand && (!handle_command_failed)) {
                Most_recent_message_jiffies = jiffies;
                if (handle_command(inmsg,
@@ -2010,9 +2010,9 @@ controlvm_periodic_work(struct work_struct *work)
                        * controlvm msg so we will attempt to
                        * reprocess it on our next loop
                        */
-                       handle_command_failed = TRUE;
+                       handle_command_failed = 1;
                        ControlVm_Pending_Msg = inmsg;
-                       ControlVm_Pending_Msg_Valid = TRUE;
+                       ControlVm_Pending_Msg_Valid = 1;
                }
        }
 
@@ -2198,35 +2198,35 @@ device_resume_response(ulong busNo, ulong devNo, int 
response)
                                     segment_state_running);
 }
 
-BOOL
+int
 visorchipset_get_bus_info(ulong bus_no, struct visorchipset_bus_info *bus_info)
 {
        void *p = findbus(&BusInfoList, bus_no);
 
        if (!p) {
                LOGERR("(%lu) failed", bus_no);
-               return FALSE;
+               return 0;
        }
        memcpy(bus_info, p, sizeof(struct visorchipset_bus_info));
-       return TRUE;
+       return 1;
 }
 EXPORT_SYMBOL_GPL(visorchipset_get_bus_info);
 
-BOOL
+int
 visorchipset_set_bus_context(ulong bus_no, void *context)
 {
        struct visorchipset_bus_info *p = findbus(&BusInfoList, bus_no);
 
        if (!p) {
                LOGERR("(%lu) failed", bus_no);
-               return FALSE;
+               return 0;
        }
        p->bus_driver_context = context;
-       return TRUE;
+       return 1;
 }
 EXPORT_SYMBOL_GPL(visorchipset_set_bus_context);
 
-BOOL
+int
 visorchipset_get_device_info(ulong bus_no, ulong dev_no,
                             struct visorchipset_device_info *dev_info)
 {
@@ -2234,14 +2234,14 @@ visorchipset_get_device_info(ulong bus_no, ulong dev_no,
 
        if (!p) {
                LOGERR("(%lu,%lu) failed", bus_no, dev_no);
-               return FALSE;
+               return 0;
        }
        memcpy(dev_info, p, sizeof(struct visorchipset_device_info));
-       return TRUE;
+       return 1;
 }
 EXPORT_SYMBOL_GPL(visorchipset_get_device_info);
 
-BOOL
+int
 visorchipset_set_device_context(ulong bus_no, ulong dev_no, void *context)
 {
        struct visorchipset_device_info *p =
@@ -2249,17 +2249,17 @@ visorchipset_set_device_context(ulong bus_no, ulong 
dev_no, void *context)
 
        if (!p) {
                LOGERR("(%lu,%lu) failed", bus_no, dev_no);
-               return FALSE;
+               return 0;
        }
        p->bus_driver_context = context;
-       return TRUE;
+       return 1;
 }
 EXPORT_SYMBOL_GPL(visorchipset_set_device_context);
 
 /* Generic wrapper function for allocating memory from a kmem_cache pool.
  */
 void *
-visorchipset_cache_alloc(struct kmem_cache *pool, BOOL ok_to_block,
+visorchipset_cache_alloc(struct kmem_cache *pool, int ok_to_block,
                         char *fn, int ln)
 {
        gfp_t gfp;
-- 
2.1.0

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to