netfilter: xtables: symmetric COMPAT_XT_ALIGN definition
[safe/jmp/linux-2.6] / drivers / ps3 / ps3-vuart.c
index a3e4ea9..e4ad5ba 100644 (file)
@@ -114,7 +114,7 @@ struct ports_bmp {
 static void __maybe_unused _dump_ports_bmp(
        const struct ports_bmp *bmp, const char *func, int line)
 {
-       pr_debug("%s:%d: ports_bmp: %016lxh\n", func, line, bmp->status);
+       pr_debug("%s:%d: ports_bmp: %016llxh\n", func, line, bmp->status);
 }
 
 #define dump_port_params(_b) _dump_port_params(_b, __func__, __LINE__)
@@ -159,11 +159,13 @@ int ps3_vuart_get_triggers(struct ps3_system_bus_device *dev,
        struct vuart_triggers *trig)
 {
        int result;
-       unsigned long size;
-       unsigned long val;
+       u64 size;
+       u64 val;
+       u64 tx;
 
        result = lv1_get_virtual_uart_param(dev->port_number,
-               PARAM_TX_TRIGGER, &trig->tx);
+               PARAM_TX_TRIGGER, &tx);
+       trig->tx = tx;
 
        if (result) {
                dev_dbg(&dev->core, "%s:%d: tx_trigger failed: %s\n",
@@ -201,7 +203,7 @@ int ps3_vuart_set_triggers(struct ps3_system_bus_device *dev, unsigned int tx,
        unsigned int rx)
 {
        int result;
-       unsigned long size;
+       u64 size;
 
        result = lv1_set_virtual_uart_param(dev->port_number,
                PARAM_TX_TRIGGER, tx);
@@ -248,7 +250,7 @@ static int ps3_vuart_get_rx_bytes_waiting(struct ps3_system_bus_device *dev,
                dev_dbg(&dev->core, "%s:%d: rx_bytes failed: %s\n",
                        __func__, __LINE__, ps3_result(result));
 
-       dev_dbg(&dev->core, "%s:%d: %lxh\n", __func__, __LINE__,
+       dev_dbg(&dev->core, "%s:%d: %llxh\n", __func__, __LINE__,
                *bytes_waiting);
        return result;
 }
@@ -295,7 +297,7 @@ static int ps3_vuart_get_interrupt_status(struct ps3_system_bus_device *dev,
 
        *status = tmp & priv->interrupt_mask;
 
-       dev_dbg(&dev->core, "%s:%d: m %lxh, s %lxh, m&s %lxh\n",
+       dev_dbg(&dev->core, "%s:%d: m %llxh, s %llxh, m&s %lxh\n",
                __func__, __LINE__, priv->interrupt_mask, tmp, *status);
 
        return result;
@@ -363,7 +365,7 @@ int ps3_vuart_disable_interrupt_disconnect(struct ps3_system_bus_device *dev)
  */
 
 static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
-       const void *buf, unsigned int bytes, unsigned long *bytes_written)
+       const void *buf, unsigned int bytes, u64 *bytes_written)
 {
        int result;
        struct ps3_vuart_port_priv *priv = to_port_priv(dev);
@@ -379,7 +381,7 @@ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
 
        priv->stats.bytes_written += *bytes_written;
 
-       dev_dbg(&dev->core, "%s:%d: wrote %lxh/%xh=>%lxh\n", __func__, __LINE__,
+       dev_dbg(&dev->core, "%s:%d: wrote %llxh/%xh=>%lxh\n", __func__, __LINE__,
                *bytes_written, bytes, priv->stats.bytes_written);
 
        return result;
@@ -393,7 +395,7 @@ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
  */
 
 static int ps3_vuart_raw_read(struct ps3_system_bus_device *dev, void *buf,
-       unsigned int bytes, unsigned long *bytes_read)
+       unsigned int bytes, u64 *bytes_read)
 {
        int result;
        struct ps3_vuart_port_priv *priv = to_port_priv(dev);
@@ -411,7 +413,7 @@ static int ps3_vuart_raw_read(struct ps3_system_bus_device *dev, void *buf,
 
        priv->stats.bytes_read += *bytes_read;
 
-       dev_dbg(&dev->core, "%s:%d: read %lxh/%xh=>%lxh\n", __func__, __LINE__,
+       dev_dbg(&dev->core, "%s:%d: read %llxh/%xh=>%lxh\n", __func__, __LINE__,
                *bytes_read, bytes, priv->stats.bytes_read);
 
        return result;
@@ -500,7 +502,7 @@ int ps3_vuart_write(struct ps3_system_bus_device *dev, const void *buf,
        spin_lock_irqsave(&priv->tx_list.lock, flags);
 
        if (list_empty(&priv->tx_list.head)) {
-               unsigned long bytes_written;
+               u64 bytes_written;
 
                result = ps3_vuart_raw_write(dev, buf, bytes, &bytes_written);
 
@@ -592,7 +594,7 @@ static int ps3_vuart_queue_rx_bytes(struct ps3_system_bus_device *dev,
        list_add_tail(&lb->link, &priv->rx_list.head);
        priv->rx_list.bytes_held += bytes;
 
-       dev_dbg(&dev->core, "%s:%d: buf_%lu: queued %lxh bytes\n",
+       dev_dbg(&dev->core, "%s:%d: buf_%lu: queued %llxh bytes\n",
                __func__, __LINE__, lb->dbg_number, bytes);
 
        *bytes_queued = bytes;
@@ -745,7 +747,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_system_bus_device *dev)
 
        list_for_each_entry_safe(lb, n, &priv->tx_list.head, link) {
 
-               unsigned long bytes_written;
+               u64 bytes_written;
 
                result = ps3_vuart_raw_write(dev, lb->head, lb->tail - lb->head,
                        &bytes_written);
@@ -762,7 +764,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_system_bus_device *dev)
                if (bytes_written < lb->tail - lb->head) {
                        lb->head += bytes_written;
                        dev_dbg(&dev->core,
-                               "%s:%d cleared buf_%lu, %lxh bytes\n",
+                               "%s:%d cleared buf_%lu, %llxh bytes\n",
                                __func__, __LINE__, lb->dbg_number,
                                bytes_written);
                        goto port_full;
@@ -877,7 +879,7 @@ static int ps3_vuart_handle_port_interrupt(struct ps3_system_bus_device *dev)
 struct vuart_bus_priv {
        struct ports_bmp *bmp;
        unsigned int virq;
-       struct semaphore probe_mutex;
+       struct mutex probe_mutex;
        int use_count;
        struct ps3_system_bus_device *devices[PORT_COUNT];
 } static vuart_bus_priv;
@@ -1015,7 +1017,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
                return -EINVAL;
        }
 
-       down(&vuart_bus_priv.probe_mutex);
+       mutex_lock(&vuart_bus_priv.probe_mutex);
 
        result = ps3_vuart_bus_interrupt_get();
 
@@ -1075,7 +1077,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
                goto fail_probe;
        }
 
-       up(&vuart_bus_priv.probe_mutex);
+       mutex_unlock(&vuart_bus_priv.probe_mutex);
 
        return result;
 
@@ -1088,7 +1090,7 @@ fail_dev_malloc:
 fail_busy:
        ps3_vuart_bus_interrupt_put();
 fail_setup_interrupt:
-       up(&vuart_bus_priv.probe_mutex);
+       mutex_unlock(&vuart_bus_priv.probe_mutex);
        dev_dbg(&dev->core, "%s:%d: failed\n", __func__, __LINE__);
        return result;
 }
@@ -1127,7 +1129,7 @@ static int ps3_vuart_remove(struct ps3_system_bus_device *dev)
 
        BUG_ON(!dev);
 
-       down(&vuart_bus_priv.probe_mutex);
+       mutex_lock(&vuart_bus_priv.probe_mutex);
 
        dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
                dev->match_id);
@@ -1135,7 +1137,7 @@ static int ps3_vuart_remove(struct ps3_system_bus_device *dev)
        if (!dev->core.driver) {
                dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
                        __LINE__);
-               up(&vuart_bus_priv.probe_mutex);
+               mutex_unlock(&vuart_bus_priv.probe_mutex);
                return 0;
        }
 
@@ -1158,7 +1160,7 @@ static int ps3_vuart_remove(struct ps3_system_bus_device *dev)
        priv = NULL;
 
        dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
-       up(&vuart_bus_priv.probe_mutex);
+       mutex_unlock(&vuart_bus_priv.probe_mutex);
        return 0;
 }
 
@@ -1178,7 +1180,7 @@ static int ps3_vuart_shutdown(struct ps3_system_bus_device *dev)
 
        BUG_ON(!dev);
 
-       down(&vuart_bus_priv.probe_mutex);
+       mutex_lock(&vuart_bus_priv.probe_mutex);
 
        dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
                dev->match_id);
@@ -1186,7 +1188,7 @@ static int ps3_vuart_shutdown(struct ps3_system_bus_device *dev)
        if (!dev->core.driver) {
                dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
                        __LINE__);
-               up(&vuart_bus_priv.probe_mutex);
+               mutex_unlock(&vuart_bus_priv.probe_mutex);
                return 0;
        }
 
@@ -1210,7 +1212,7 @@ static int ps3_vuart_shutdown(struct ps3_system_bus_device *dev)
 
        dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
 
-       up(&vuart_bus_priv.probe_mutex);
+       mutex_unlock(&vuart_bus_priv.probe_mutex);
        return 0;
 }
 
@@ -1221,7 +1223,7 @@ static int __init ps3_vuart_bus_init(void)
        if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
                return -ENODEV;
 
-       init_MUTEX(&vuart_bus_priv.probe_mutex);
+       mutex_init(&vuart_bus_priv.probe_mutex);
 
        return 0;
 }