Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178153
b: refs/heads/master
c: e64c026
h: refs/heads/master
i:
  178151: f43cb19
v: v3
  • Loading branch information
Stefani Seibold authored and Linus Torvalds committed Dec 22, 2009
1 parent 1cda3fe commit 000aa90
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 74 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1e13f25674ed564948ecb7dfe5f83e578892896
refs/heads/master: e64c026dd09b73faf20707711402fc5ed55a8e70
12 changes: 6 additions & 6 deletions trunk/drivers/char/nozomi.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ static int send_data(enum port_type index, struct nozomi *dc)
struct tty_struct *tty = tty_port_tty_get(&port->port);

/* Get data from tty and place in buf for now */
size = __kfifo_get(&port->fifo_ul, dc->send_buf,
size = kfifo_get(&port->fifo_ul, dc->send_buf,
ul_size < SEND_BUF_MAX ? ul_size : SEND_BUF_MAX);

if (size == 0) {
Expand Down Expand Up @@ -988,11 +988,11 @@ static int receive_flow_control(struct nozomi *dc)

} else if (old_ctrl.CTS == 0 && ctrl_dl.CTS == 1) {

if (__kfifo_len(&dc->port[port].fifo_ul)) {
if (kfifo_len(&dc->port[port].fifo_ul)) {
DBG1("Enable interrupt (0x%04X) on port: %d",
enable_ier, port);
DBG1("Data in buffer [%d], enable transmit! ",
__kfifo_len(&dc->port[port].fifo_ul));
kfifo_len(&dc->port[port].fifo_ul));
enable_transmit_ul(port, dc);
} else {
DBG1("No data in buffer...");
Expand Down Expand Up @@ -1672,7 +1672,7 @@ static int ntty_write(struct tty_struct *tty, const unsigned char *buffer,
goto exit;
}

rval = __kfifo_put(&port->fifo_ul, (unsigned char *)buffer, count);
rval = kfifo_put(&port->fifo_ul, (unsigned char *)buffer, count);

/* notify card */
if (unlikely(dc == NULL)) {
Expand Down Expand Up @@ -1720,7 +1720,7 @@ static int ntty_write_room(struct tty_struct *tty)
if (!port->port.count)
goto exit;

room = port->fifo_ul.size - __kfifo_len(&port->fifo_ul);
room = port->fifo_ul.size - kfifo_len(&port->fifo_ul);

exit:
mutex_unlock(&port->tty_sem);
Expand Down Expand Up @@ -1877,7 +1877,7 @@ static s32 ntty_chars_in_buffer(struct tty_struct *tty)
goto exit_in_buffer;
}

rval = __kfifo_len(&port->fifo_ul);
rval = kfifo_len(&port->fifo_ul);

exit_in_buffer:
return rval;
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/infiniband/hw/cxgb3/cxio_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int __cxio_init_resource_fifo(struct kfifo *fifo,
return -ENOMEM;

for (i = 0; i < skip_low + skip_high; i++)
__kfifo_put(fifo, (unsigned char *) &entry, sizeof(u32));
kfifo_put(fifo, (unsigned char *) &entry, sizeof(u32));
if (random) {
j = 0;
random_bytes = random32();
Expand All @@ -71,19 +71,19 @@ static int __cxio_init_resource_fifo(struct kfifo *fifo,
random_bytes = random32();
}
idx = (random_bytes >> (j * 2)) & 0xF;
__kfifo_put(fifo,
kfifo_put(fifo,
(unsigned char *) &rarray[idx],
sizeof(u32));
rarray[idx] = i;
j++;
}
for (i = 0; i < RANDOM_SIZE; i++)
__kfifo_put(fifo,
kfifo_put(fifo,
(unsigned char *) &rarray[i],
sizeof(u32));
} else
for (i = skip_low; i < nr - skip_high; i++)
__kfifo_put(fifo, (unsigned char *) &i, sizeof(u32));
kfifo_put(fifo, (unsigned char *) &i, sizeof(u32));

for (i = 0; i < skip_low + skip_high; i++)
kfifo_get_locked(fifo, (unsigned char *) &entry,
Expand Down Expand Up @@ -119,7 +119,7 @@ static int cxio_init_qpid_fifo(struct cxio_rdev *rdev_p)

for (i = 16; i < T3_MAX_NUM_QP; i++)
if (!(i & rdev_p->qpmask))
__kfifo_put(&rdev_p->rscp->qpid_fifo,
kfifo_put(&rdev_p->rscp->qpid_fifo,
(unsigned char *) &i, sizeof(u32));
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
priv->dnld_sent = DNLD_RES_RECEIVED;

/* If nothing to do, go back to sleep (?) */
if (!__kfifo_len(&priv->event_fifo) && !priv->resp_len[priv->resp_idx])
if (!kfifo_len(&priv->event_fifo) && !priv->resp_len[priv->resp_idx])
priv->psstate = PS_STATE_SLEEP;

spin_unlock_irqrestore(&priv->driver_lock, flags);
Expand Down Expand Up @@ -1439,7 +1439,7 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv)
}

/* Pending events or command responses? */
if (__kfifo_len(&priv->event_fifo) || priv->resp_len[priv->resp_idx]) {
if (kfifo_len(&priv->event_fifo) || priv->resp_len[priv->resp_idx]) {
allowed = 0;
lbs_deb_host("pending events or command responses\n");
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ static int lbs_thread(void *data)
else if (!list_empty(&priv->cmdpendingq) &&
!(priv->wakeup_dev_required))
shouldsleep = 0; /* We have a command to send */
else if (__kfifo_len(&priv->event_fifo))
else if (kfifo_len(&priv->event_fifo))
shouldsleep = 0; /* We have an event to process */
else
shouldsleep = 1; /* No command */
Expand Down Expand Up @@ -511,9 +511,9 @@ static int lbs_thread(void *data)

/* Process hardware events, e.g. card removed, link lost */
spin_lock_irq(&priv->driver_lock);
while (__kfifo_len(&priv->event_fifo)) {
while (kfifo_len(&priv->event_fifo)) {
u32 event;
__kfifo_get(&priv->event_fifo, (unsigned char *) &event,
kfifo_get(&priv->event_fifo, (unsigned char *) &event,
sizeof(event));
spin_unlock_irq(&priv->driver_lock);
lbs_process_event(priv, event);
Expand Down Expand Up @@ -1175,7 +1175,7 @@ void lbs_queue_event(struct lbs_private *priv, u32 event)
if (priv->psstate == PS_STATE_SLEEP)
priv->psstate = PS_STATE_AWAKE;

__kfifo_put(&priv->event_fifo, (unsigned char *) &event, sizeof(u32));
kfifo_put(&priv->event_fifo, (unsigned char *) &event, sizeof(u32));

wake_up_interruptible(&priv->waitq);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/platform/x86/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,7 @@ static int sonypi_misc_open(struct inode *inode, struct file *file)
spin_lock_irqsave(&sonypi_compat.fifo_lock, flags);

if (atomic_inc_return(&sonypi_compat.open_count) == 1)
__kfifo_reset(&sonypi_compat.fifo);
kfifo_reset(&sonypi_compat.fifo);

spin_unlock_irqrestore(&sonypi_compat.fifo_lock, flags);

Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ static void iscsi_free_task(struct iscsi_task *task)
if (conn->login_task == task)
return;

__kfifo_put(&session->cmdpool.queue, (void*)&task, sizeof(void*));
kfifo_put(&session->cmdpool.queue, (void*)&task, sizeof(void*));

if (sc) {
task->sc = NULL;
Expand Down Expand Up @@ -737,7 +737,7 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE);
BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);

if (!__kfifo_get(&session->cmdpool.queue,
if (!kfifo_get(&session->cmdpool.queue,
(void*)&task, sizeof(void*)))
return NULL;
}
Expand Down Expand Up @@ -1567,7 +1567,7 @@ static inline struct iscsi_task *iscsi_alloc_task(struct iscsi_conn *conn,
{
struct iscsi_task *task;

if (!__kfifo_get(&conn->session->cmdpool.queue,
if (!kfifo_get(&conn->session->cmdpool.queue,
(void *) &task, sizeof(void *)))
return NULL;

Expand Down Expand Up @@ -2469,7 +2469,7 @@ iscsi_pool_init(struct iscsi_pool *q, int max, void ***items, int item_size)
q->max = i;
goto enomem;
}
__kfifo_put(&q->queue, (void*)&q->pool[i], sizeof(void*));
kfifo_put(&q->queue, (void*)&q->pool[i], sizeof(void*));
}

if (items) {
Expand Down Expand Up @@ -2819,7 +2819,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,

/* allocate login_task used for the login/text sequences */
spin_lock_bh(&session->lock);
if (!__kfifo_get(&session->cmdpool.queue,
if (!kfifo_get(&session->cmdpool.queue,
(void*)&conn->login_task,
sizeof(void*))) {
spin_unlock_bh(&session->lock);
Expand All @@ -2839,7 +2839,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
return cls_conn;

login_task_data_alloc_fail:
__kfifo_put(&session->cmdpool.queue, (void*)&conn->login_task,
kfifo_put(&session->cmdpool.queue, (void*)&conn->login_task,
sizeof(void*));
login_task_alloc_fail:
iscsi_destroy_conn(cls_conn);
Expand Down Expand Up @@ -2902,7 +2902,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
free_pages((unsigned long) conn->data,
get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
kfree(conn->persistent_address);
__kfifo_put(&session->cmdpool.queue, (void*)&conn->login_task,
kfifo_put(&session->cmdpool.queue, (void*)&conn->login_task,
sizeof(void*));
if (session->leadconn == conn)
session->leadconn = NULL;
Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/scsi/libiscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,15 @@ void iscsi_tcp_cleanup_task(struct iscsi_task *task)
return;

/* flush task's r2t queues */
while (__kfifo_get(&tcp_task->r2tqueue, (void*)&r2t, sizeof(void*))) {
__kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t,
while (kfifo_get(&tcp_task->r2tqueue, (void*)&r2t, sizeof(void*))) {
kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t,
sizeof(void*));
ISCSI_DBG_TCP(task->conn, "pending r2t dropped\n");
}

r2t = tcp_task->r2t;
if (r2t != NULL) {
__kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t,
kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t,
sizeof(void*));
tcp_task->r2t = NULL;
}
Expand Down Expand Up @@ -541,7 +541,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
return 0;
}

rc = __kfifo_get(&tcp_task->r2tpool.queue, (void*)&r2t, sizeof(void*));
rc = kfifo_get(&tcp_task->r2tpool.queue, (void*)&r2t, sizeof(void*));
if (!rc) {
iscsi_conn_printk(KERN_ERR, conn, "Could not allocate R2T. "
"Target has sent more R2Ts than it "
Expand All @@ -554,7 +554,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
if (r2t->data_length == 0) {
iscsi_conn_printk(KERN_ERR, conn,
"invalid R2T with zero data len\n");
__kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t,
kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t,
sizeof(void*));
return ISCSI_ERR_DATALEN;
}
Expand All @@ -570,7 +570,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
"invalid R2T with data len %u at offset %u "
"and total length %d\n", r2t->data_length,
r2t->data_offset, scsi_out(task->sc)->length);
__kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t,
kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t,
sizeof(void*));
return ISCSI_ERR_DATALEN;
}
Expand All @@ -580,7 +580,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
r2t->sent = 0;

tcp_task->exp_datasn = r2tsn + 1;
__kfifo_put(&tcp_task->r2tqueue, (void*)&r2t, sizeof(void*));
kfifo_put(&tcp_task->r2tqueue, (void*)&r2t, sizeof(void*));
conn->r2t_pdus_cnt++;

iscsi_requeue_task(task);
Expand Down Expand Up @@ -951,7 +951,7 @@ int iscsi_tcp_task_init(struct iscsi_task *task)
return conn->session->tt->init_pdu(task, 0, task->data_count);
}

BUG_ON(__kfifo_len(&tcp_task->r2tqueue));
BUG_ON(kfifo_len(&tcp_task->r2tqueue));
tcp_task->exp_datasn = 0;

/* Prepare PDU, optionally w/ immediate data */
Expand Down Expand Up @@ -982,15 +982,15 @@ static struct iscsi_r2t_info *iscsi_tcp_get_curr_r2t(struct iscsi_task *task)
if (r2t->data_length <= r2t->sent) {
ISCSI_DBG_TCP(task->conn,
" done with r2t %p\n", r2t);
__kfifo_put(&tcp_task->r2tpool.queue,
kfifo_put(&tcp_task->r2tpool.queue,
(void *)&tcp_task->r2t,
sizeof(void *));
tcp_task->r2t = r2t = NULL;
}
}

if (r2t == NULL) {
__kfifo_get(&tcp_task->r2tqueue,
kfifo_get(&tcp_task->r2tqueue,
(void *)&tcp_task->r2t, sizeof(void *));
r2t = tcp_task->r2t;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/libsrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int srp_iu_pool_alloc(struct srp_queue *q, size_t max,
kfifo_init(&q->queue, (void *) q->pool, max * sizeof(void *));

for (i = 0, iue = q->items; i < max; i++) {
__kfifo_put(&q->queue, (void *) &iue, sizeof(void *));
kfifo_put(&q->queue, (void *) &iue, sizeof(void *));
iue->sbuf = ring[i];
iue++;
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/usb/host/fhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,19 +505,19 @@ static inline void cq_delete(struct kfifo *kfifo)

static inline unsigned int cq_howmany(struct kfifo *kfifo)
{
return __kfifo_len(kfifo) / sizeof(void *);
return kfifo_len(kfifo) / sizeof(void *);
}

static inline int cq_put(struct kfifo *kfifo, void *p)
{
return __kfifo_put(kfifo, (void *)&p, sizeof(p));
return kfifo_put(kfifo, (void *)&p, sizeof(p));
}

static inline void *cq_get(struct kfifo *kfifo)
{
void *p = NULL;

__kfifo_get(kfifo, (void *)&p, sizeof(p));
kfifo_get(kfifo, (void *)&p, sizeof(p));
return p;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/usb/serial/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static int usb_serial_generic_write_start(struct usb_serial_port *port)
if (port->write_urb_busy)
start_io = false;
else {
start_io = (__kfifo_len(port->write_fifo) != 0);
start_io = (kfifo_len(port->write_fifo) != 0);
port->write_urb_busy = start_io;
}
spin_unlock_irqrestore(&port->lock, flags);
Expand Down Expand Up @@ -370,7 +370,7 @@ int usb_serial_generic_write_room(struct tty_struct *tty)
(serial->type->max_in_flight_urbs -
port->urbs_in_flight);
} else if (serial->num_bulk_out)
room = port->write_fifo->size - __kfifo_len(port->write_fifo);
room = port->write_fifo->size - kfifo_len(port->write_fifo);
spin_unlock_irqrestore(&port->lock, flags);

dbg("%s - returns %d", __func__, room);
Expand Down
Loading

0 comments on commit 000aa90

Please sign in to comment.