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

[Xen-changelog] [xen-unstable] linux: Remove an unused data structure from TPM frontend.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1173371177 0
# Node ID 59abe5204ca897e17a9a899029241f467f8b8407
# Parent  0e08d98dfd57ea1e950164460f342ea468ede795
linux: Remove an unused data structure from TPM frontend.
Some more code style changes.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c |    2 -
 linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h |   13 ----------
 linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c  |   28 ++---------------------
 3 files changed, 3 insertions(+), 40 deletions(-)

diff -r 0e08d98dfd57 -r 59abe5204ca8 
linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c
--- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c  Thu Mar 08 16:20:01 
2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c  Thu Mar 08 16:26:17 
2007 +0000
@@ -504,7 +504,6 @@ static struct tpm_vendor_specific tpm_vt
 };
 
 struct tpm_chip *init_vtpm(struct device *dev,
-                           struct tpm_virtual_device *tvd,
                            struct tpm_private *tp)
 {
        long rc;
@@ -516,7 +515,6 @@ struct tpm_chip *init_vtpm(struct device
                return ERR_PTR(-ENOMEM);
 
        vtpm_state_init(vtpms);
-       vtpms->tpmvd = tvd;
        vtpms->tpm_private = tp;
 
        chip = tpm_register_hardware(dev, &tpm_vtpm);
diff -r 0e08d98dfd57 -r 59abe5204ca8 
linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h
--- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h  Thu Mar 08 16:20:01 
2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h  Thu Mar 08 16:26:17 
2007 +0000
@@ -3,16 +3,6 @@
 
 struct tpm_chip;
 struct tpm_private;
-
-struct tpm_virtual_device {
-       /*
-        * This field indicates the maximum size the driver can
-        * transfer in one chunk. It is filled in by the front-end
-        * driver and should be propagated to the generic tpm driver
-        * for allocation of buffers.
-        */
-       unsigned int max_tx_size;
-};
 
 struct vtpm_state {
        struct transmission *current_request;
@@ -30,8 +20,6 @@ struct vtpm_state {
 
        unsigned long        disconnect_time;
 
-       struct tpm_virtual_device *tpmvd;
-
        /*
         * The following is a private structure of the underlying
         * driver. It is passed as parameter in the send function.
@@ -51,7 +39,6 @@ int vtpm_vd_send(struct tpm_private * tp
 
 /* these functions are offered by tpm_vtpm.c */
 struct tpm_chip *init_vtpm(struct device *,
-                           struct tpm_virtual_device *,
                            struct tpm_private *);
 void cleanup_vtpm(struct device *);
 int vtpm_vd_recv(const struct tpm_chip* chip,
diff -r 0e08d98dfd57 -r 59abe5204ca8 
linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c
--- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c   Thu Mar 08 16:20:01 
2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c   Thu Mar 08 16:26:17 
2007 +0000
@@ -369,10 +369,6 @@ static void backend_changed(struct xenbu
        }
 }
 
-struct tpm_virtual_device tvd = {
-       .max_tx_size = PAGE_SIZE * TPMIF_TX_RING_SIZE,
-};
-
 static int tpmfront_probe(struct xenbus_device *dev,
                           const struct xenbus_device_id *id)
 {
@@ -383,7 +379,7 @@ static int tpmfront_probe(struct xenbus_
        if (!tp)
                return -ENOMEM;
 
-       tp->chip = init_vtpm(&dev->dev, &tvd, tp);
+       tp->chip = init_vtpm(&dev->dev, tp);
        if (IS_ERR(tp->chip))
                return PTR_ERR(tp->chip);
 
@@ -500,11 +496,6 @@ static void __init init_tpm_xenbus(void)
        xenbus_register_frontend(&tpmfront);
 }
 
-static void __exit exit_tpm_xenbus(void)
-{
-       xenbus_unregister_driver(&tpmfront);
-}
-
 static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
 {
        unsigned int i;
@@ -530,13 +521,11 @@ static void tpmif_rx_action(unsigned lon
 static void tpmif_rx_action(unsigned long priv)
 {
        struct tpm_private *tp = (struct tpm_private *)priv;
-
        int i = 0;
        unsigned int received;
        unsigned int offset = 0;
        u8 *buffer;
-       tpmif_tx_request_t *tx;
-       tx = &tp->tx->ring[i].req;
+       tpmif_tx_request_t *tx = &tp->tx->ring[i].req;
 
        atomic_set(&tp->tx_busy, 0);
        wake_up_interruptible(&tp->wait_q);
@@ -545,7 +534,7 @@ static void tpmif_rx_action(unsigned lon
 
        buffer = kmalloc(received, GFP_ATOMIC);
        if (!buffer)
-               goto exit;
+               return;
 
        for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
                struct tx_buffer *txb = tp->tx_buffers[i];
@@ -566,10 +555,6 @@ static void tpmif_rx_action(unsigned lon
 
        vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
        kfree(buffer);
-
-exit:
-
-       return;
 }
 
 
@@ -730,13 +715,6 @@ static int __init tpmif_init(void)
 }
 
 
-void __exit tpmif_exit(void)
-{
-       exit_tpm_xenbus();
-       tpm_private_put();
-       gnttab_free_grant_references(gref_head);
-}
-
 module_init(tpmif_init);
 
 MODULE_LICENSE("Dual BSD/GPL");

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.