bool type doesn't exist in C, don't try to emulate one.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
This commit is contained in:
vhanquez@kneesa.uk.xensource.com committed 2006-01-16 22:11:43 +00:00
1 parent 562b48cc4f
commit 403ce4ff82
4 files changed
+13 -23

No files matched your search

@@ -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__ */
/*
@@ -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:
@@ -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);
}
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.