bool type doesn't exist in C, don't try to emulate one.
authorvhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Mon, 16 Jan 2006 22:11:43 +0000 (22:11 +0000)
committervhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Mon, 16 Jan 2006 22:11:43 +0000 (22:11 +0000)
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
linux-2.6-xen-sparse/drivers/xen/tpmback/common.h
linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c
linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c
linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.h

index dce6ebb15149aebb05a18ac6b53b48d10a255d7d..cd001d58ef434dcb56233e256651853f6fa144c5 100644 (file)
@@ -76,11 +76,6 @@ extern int num_frontends;
 
 #define MMAP_VADDR(t,_req) ((t)->mmap_vstart + ((_req) * PAGE_SIZE))
 
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
 #endif /* __TPMIF__BACKEND__COMMON_H__ */
 
 /*
index 60f0c50d1c6830911f211fdf48006a61c1c212c4..7b62227b410170291371f6ec66272078bd38a462 100644 (file)
@@ -78,7 +78,7 @@ static int tpmback_probe(struct xenbus_device *dev,
 
        memset(be, 0, sizeof(*be));
 
-       be->is_instance_set = FALSE;
+       be->is_instance_set = 0;
        be->dev = dev;
        dev->data = be;
 
@@ -120,7 +120,7 @@ static void backend_changed(struct xenbus_watch *watch,
                return;
        }
 
-       if (be->is_instance_set != FALSE && be->instance != instance) {
+       if (be->is_instance_set != 0 && be->instance != instance) {
                printk(KERN_WARNING
                       "tpmback: changing instance (from %ld to %ld) "
                       "not allowed.\n",
@@ -128,7 +128,7 @@ static void backend_changed(struct xenbus_watch *watch,
                return;
        }
 
-       if (be->is_instance_set == FALSE) {
+       if (be->is_instance_set == 0) {
                be->tpmif = tpmif_find(dev->otherend_id,
                                       instance);
                if (IS_ERR(be->tpmif)) {
@@ -138,7 +138,7 @@ static void backend_changed(struct xenbus_watch *watch,
                        return;
                }
                be->instance = instance;
-               be->is_instance_set = TRUE;
+               be->is_instance_set = 1;
 
                /*
                 * There's an unfortunate problem:
index a85ab7e617913fbdb84234b761e96add5772db7e..a51831fe8c8e7e518a932545291ed80272ce838d 100644 (file)
@@ -241,7 +241,7 @@ fail:
 
 static void destroy_tpmring(struct tpmfront_info *info, struct tpm_private *tp)
 {
-       tpmif_set_connected_state(tp, FALSE);
+       tpmif_set_connected_state(tp, 0);
        if ( tp->tx != NULL ) {
                gnttab_end_foreign_access(info->ring_ref, 0,
                                          (unsigned long)tp->tx);
@@ -329,15 +329,15 @@ static void backend_changed(struct xenbus_device *dev,
                break;
 
        case XenbusStateConnected:
-               tpmif_set_connected_state(tp, TRUE);
+               tpmif_set_connected_state(tp, 1);
                break;
 
        case XenbusStateClosing:
-               tpmif_set_connected_state(tp, FALSE);
+               tpmif_set_connected_state(tp, 0);
                break;
 
        case XenbusStateClosed:
-               if (tp->is_suspended == FALSE) {
+               if (tp->is_suspended == 0) {
                        device_unregister(&dev->dev);
                }
                break;
@@ -401,7 +401,7 @@ tpmfront_suspend(struct xenbus_device *dev)
 
        /* lock, so no app can send */
        down(&suspend_lock);
-       tp->is_suspended = TRUE;
+       tp->is_suspended = 1;
 
        while (atomic_read(&tp->tx_busy) && ctr <= 25) {
                if ((ctr % 10) == 0)
@@ -571,7 +571,7 @@ tpm_xmit(struct tpm_private *tp,
                return -EBUSY;
        }
 
-       if (tp->is_connected != TRUE) {
+       if (tp->is_connected != 1) {
                spin_unlock_irq(&tp->tx_lock);
                return -EIO;
        }
@@ -660,7 +660,7 @@ static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
         * should disconnect - assumption is that we will resume
         * The semaphore keeps apps from sending.
         */
-       if (is_connected == FALSE && tp->is_suspended == TRUE) {
+       if (is_connected == 0 && tp->is_suspended == 1) {
                return;
        }
 
@@ -669,8 +669,8 @@ static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
         * after being suspended - now resuming.
         * This also removes the suspend state.
         */
-       if (is_connected == TRUE && tp->is_suspended == TRUE) {
-               tp->is_suspended = FALSE;
+       if (is_connected == 1 && tp->is_suspended == 1) {
+               tp->is_suspended = 0;
                /* unlock, so apps can resume sending */
                up(&suspend_lock);
        }
index 0eb5bf0d3e33d6633e69fc97627928556e391fcb..fdc0b151c835fdc3e4f0ead566182d2a4ea4ac51 100644 (file)
@@ -1,11 +1,6 @@
 #ifndef TPM_FRONT_H
 #define TPM_FRONT_H
 
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
 struct tpm_private {
        tpmif_tx_interface_t *tx;
        unsigned int evtchn;