arch: um: convert tasklets to use new tasklet_setup() API
Subsystems (28)
PATCH 1/1 arch: um: convert tasklets to use new tasklet_setup() API
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- arch/um/drivers/vector_kern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/um/drivers/vector_kern.c +3 -3
@@ -1196,9 +1196,9 @@ static int vector_net_close(struct net_device *dev)/* TX tasklet */ -static void vector_tx_poll (unsigned long data) +static void vector_tx_poll (struct tasklet_struct *t) { -struct vector_private *vp = (struct vector_private *)data; +struct vector_private *vp =from_tasklet (vp, t, tx_poll); vp->estats.tx_kicks++;vector_send (vp->tx_queue);
@@ -1629,7 +1629,7 @@ static void vector_eth_configure( }); dev->features = dev->hw_features = (NETIF_F_SG |NETIF_F_FRAGLIST ); -tasklet_init (&vp->tx_poll, vector_tx_poll, (unsigned long )vp); +tasklet_setup (&vp->tx_poll, vector_tx_poll);INIT_WORK (&vp->reset_tx, vector_reset_tx);timer_setup (&vp->tl, vector_timer_expire,0 );
Signature · 1 line
2.17.1
PATCH 1/1 block: convert tasklets to use new tasklet_setup() API
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/block/umem.c | 6 +++--- drivers/block/xsysace.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/block/umem.c +3 -3
@@ -405,7 +405,7 @@ static int add_bio(struct cardinfo *card)return 1 ; } -static void process_page (unsigned long data) +static void process_page (struct tasklet_struct *t) {/* check if any of the requests in the page are DMA_COMPLETE, * and deal with them appropriately.
@@ -415,7 +415,7 @@ static void process_page(unsigned long data)*/ struct mm_page *page;struct bio *return_bio =NULL ; -struct cardinfo *card = (struct cardinfo *)data; +struct cardinfo *card =from_tasklet (card, t, tasklet);unsigned int dma_status = card->dma_status;spin_lock (&card->lock);
@@ -891,7 +891,7 @@ static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)if (!card->queue) goto failed_alloc; -tasklet_init (&card->tasklet, process_page, (unsigned long )card); +tasklet_setup (&card->tasklet, process_page); card->check_batteries =0 ;
drivers/block/xsysace.c +3 -3
@@ -762,9 +762,9 @@ static void ace_fsm_dostate(struct ace_device *ace) } } -static void ace_fsm_tasklet (unsigned long data) +static void ace_fsm_tasklet (struct tasklet_struct *t) { -struct ace_device *ace = (void *)data; +struct ace_device *ace =from_tasklet (ace, t, fsm_tasklet);unsigned long flags;spin_lock_irqsave (&ace->lock, flags);
@@ -1001,7 +1001,7 @@ static int ace_setup(struct ace_device *ace)/* * Initialize the state machine tasklet and stall timer */ -tasklet_init (&ace->fsm_tasklet, ace_fsm_tasklet, (unsigned long )ace); +tasklet_setup (&ace->fsm_tasklet, ace_fsm_tasklet);timer_setup (&ace->stall_timer, ace_stall_timer,0 );/*
Signature · 1 line
2.17.1
PATCH 1/1 char: ipmi: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/char/ipmi/ipmi_msghandler.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/char/ipmi/ipmi_msghandler.c +6 -7
@@ -39,7 +39,7 @@static struct ipmi_recv_msg *ipmi_alloc_recv_msg (void );static int ipmi_init_msghandler (void ); -static void smi_recv_tasklet (unsigned long ); +static void smi_recv_tasklet (struct tasklet_struct *t);static void handle_new_recv_msgs (struct ipmi_smi *intf);static void need_waiter (struct ipmi_smi *intf); static int handle_one_recv_msg(struct ipmi_smi *intf,
@@ -3430,9 +3430,8 @@ int ipmi_add_smi(struct module *owner, intf->curr_seq =0 ;spin_lock_init (&intf->waiting_rcv_msgs_lock);INIT_LIST_HEAD (&intf->waiting_rcv_msgs); -tasklet_init (&intf->recv_tasklet, - smi_recv_tasklet, - (unsigned long ) intf); +tasklet_setup (&intf->recv_tasklet, + smi_recv_tasklet);atomic_set (&intf->watchdog_pretimeouts_to_deliver,0 );spin_lock_init (&intf->xmit_msgs_lock);INIT_LIST_HEAD (&intf->xmit_msgs);
@@ -4467,10 +4466,10 @@ static void handle_new_recv_msgs(struct ipmi_smi *intf) } } -static void smi_recv_tasklet (unsigned long val) +static void smi_recv_tasklet (struct tasklet_struct *t) {unsigned long flags =0 ;/* keep us warning-free. */ -struct ipmi_smi *intf = (struct ipmi_smi *) val; +struct ipmi_smi *intf =from_tasklet (intf, t, recv_tasklet);int run_to_completion = intf->run_to_completion;struct ipmi_smi_msg *newmsg =NULL ;
@@ -4542,7 +4541,7 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,spin_unlock_irqrestore (&intf->xmit_msgs_lock, flags);if (run_to_completion) -smi_recv_tasklet ((unsigned long ) intf); +smi_recv_tasklet (&intf->recv_tasklet);else tasklet_schedule (&intf->recv_tasklet); }
Signature · 1 line
2.17.1
PATCH 1/1 driver: hv: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/hv/channel_mgmt.c | 3 +-- drivers/hv/connection.c | 4 ++-- drivers/hv/hv.c | 3 +-- drivers/hv/hyperv_vmbus.h | 4 ++-- drivers/hv/vmbus_drv.c | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-)
drivers/hv/channel_mgmt.c +1 -2
@@ -321,8 +321,7 @@ static struct vmbus_channel *alloc_channel(void)INIT_LIST_HEAD (&channel->sc_list); -tasklet_init (&channel->callback_event, - vmbus_on_event, (unsigned long )channel); +tasklet_setup (&channel->callback_event, vmbus_on_event);hv_ringbuffer_pre_init (channel);
drivers/hv/connection.c +2 -2
@@ -322,9 +322,9 @@ struct vmbus_channel *relid2channel(u32 relid)* If this tasklet has been running for a long time * then reschedule ourselves. */ -void vmbus_on_event (unsigned long data) +void vmbus_on_event (struct tasklet_struct *t) { -struct vmbus_channel *channel = (void *) data; +struct vmbus_channel *channel =from_tasklet (channel, t, callback_event);unsigned long time_limit = jiffies +2 ;trace_vmbus_on_event (channel);
drivers/hv/hv.c +1 -2
@@ -96,8 +96,7 @@ int hv_synic_alloc(void)for_each_present_cpu (cpu) { hv_cpu =per_cpu_ptr (hv_context.cpu_context, cpu); -tasklet_init (&hv_cpu->msg_dpc, - vmbus_on_msg_dpc, (unsigned long ) hv_cpu); +tasklet_setup (&hv_cpu->msg_dpc, vmbus_on_msg_dpc); hv_cpu->synic_message_page = (void *)get_zeroed_page (GFP_ATOMIC );
drivers/hv/hyperv_vmbus.h +2 -2
@@ -351,8 +351,8 @@ void vmbus_disconnect(void);int vmbus_post_msg (void *buffer,size_t buflen,bool can_sleep); -void vmbus_on_event (unsigned long data); -void vmbus_on_msg_dpc (unsigned long data); +void vmbus_on_event (struct tasklet_struct *t); +void vmbus_on_msg_dpc (struct tasklet_struct *t);int hv_kvp_init (struct hv_util_service *srv);void hv_kvp_deinit (void );
drivers/hv/vmbus_drv.c +2 -2
@@ -1043,9 +1043,9 @@ static void vmbus_onmessage_work(struct work_struct *work)kfree (ctx); } -void vmbus_on_msg_dpc (unsigned long data) +void vmbus_on_msg_dpc (struct tasklet_struct *t) { -struct hv_per_cpu_context *hv_cpu = (void *)data; +struct hv_per_cpu_context *hv_cpu =from_tasklet (hv_cpu, t, msg_dpc);void *page_addr = hv_cpu->synic_message_page;struct hv_message *msg = (struct hv_message *)page_addr +VMBUS_MESSAGE_SINT ;
Signature · 1 line
2.17.1
PATCH 1/1 drivers: atm: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/atm/eni.c | 9 +++++---- drivers/atm/fore200e.c | 14 +++++++------- drivers/atm/he.c | 8 ++++---- drivers/atm/solos-pci.c | 8 ++++---- 4 files changed, 20 insertions(+), 19 deletions(-)
drivers/atm/eni.c +5 -4
@@ -1521,10 +1521,11 @@ static irqreturn_t eni_int(int irq,void *dev_id) } -static void eni_tasklet (unsigned long data) +static void eni_tasklet (struct tasklet_struct *t) { -struct atm_dev *dev = (struct atm_dev *) data; -struct eni_dev *eni_dev =ENI_DEV (dev); +struct eni_dev *eni_dev =from_tasklet (eni_dev, t, task); +struct atm_dev *dev =container_of ((void *)eni_dev,typeof (*dev), + dev_data);unsigned long flags;u32 events;
@@ -1838,7 +1839,7 @@ static int eni_start(struct atm_dev *dev) eni_dev->vci,eni_dev->rx_dma,eni_dev->tx_dma, eni_dev->service,buf);spin_lock_init (&eni_dev->lock); -tasklet_init (&eni_dev->task,eni_tasklet,(unsigned long ) dev); +tasklet_setup (&eni_dev->task,eni_tasklet); eni_dev->events =0 ;/* initialize memory management */ buffer_mem = eni_dev->mem - (buf - eni_dev->ram);
drivers/atm/fore200e.c +7 -7
@@ -1180,9 +1180,9 @@ fore200e_interrupt(int irq, void* dev)#ifdef FORE200E_USE_TASKLET static void -fore200e_tx_tasklet (unsigned long data) +fore200e_tx_tasklet (struct tasklet_struct *t) { -struct fore200e * fore200e = (struct fore200e *) data; +struct fore200e * fore200e =from_tasklet (fore200e, t, tx_tasklet);unsigned long flags;DPRINTK (3 ,"tx tasklet scheduled for device %d\n" , fore200e->atm_dev->number);
@@ -1194,15 +1194,15 @@ fore200e_tx_tasklet(unsigned long data)static void -fore200e_rx_tasklet (unsigned long data) +fore200e_rx_tasklet (struct tasklet_struct *t) { -struct fore200e * fore200e = (struct fore200e *) data; +struct fore200e * fore200e =from_tasklet (fore200e, t, rx_tasklet);unsigned long flags;DPRINTK (3 ,"rx tasklet scheduled for device %d\n" , fore200e->atm_dev->number);spin_lock_irqsave (&fore200e->q_lock, flags); -fore200e_rx_irq ((struct fore200e *) data); +fore200e_rx_irq (fore200e);spin_unlock_irqrestore (&fore200e->q_lock, flags); }#endif
@@ -1943,8 +1943,8 @@ static int fore200e_irq_request(struct fore200e *fore200e) fore200e_irq_itoa(fore200e->irq), fore200e->name);#ifdef FORE200E_USE_TASKLET -tasklet_init (&fore200e->tx_tasklet, fore200e_tx_tasklet, (unsigned long )fore200e); -tasklet_init (&fore200e->rx_tasklet, fore200e_rx_tasklet, (unsigned long )fore200e); +tasklet_setup (&fore200e->tx_tasklet, fore200e_tx_tasklet); +tasklet_setup (&fore200e->rx_tasklet, fore200e_rx_tasklet);#endif fore200e->state =FORE200E_STATE_IRQ ;
drivers/atm/he.c +4 -4
@@ -100,7 +100,7 @@ static void he_close(struct atm_vcc *vcc);static int he_send (struct atm_vcc *vcc,struct sk_buff *skb);static int he_ioctl (struct atm_dev *dev,unsigned int cmd,void __user *arg);static irqreturn_t he_irq_handler (int irq,void *dev_id); -static void he_tasklet (unsigned long data); +static void he_tasklet (struct tasklet_struct *t);static int he_proc_read (struct atm_dev *dev,loff_t *pos,char *page);static int he_start (struct atm_dev *dev);static void he_stop (struct he_dev *dev);
@@ -383,7 +383,7 @@ static int he_init_one(struct pci_dev *pci_dev, he_dev->atm_dev->dev_data = he_dev; atm_dev->dev_data = he_dev; he_dev->number = atm_dev->number; -tasklet_init (&he_dev->tasklet, he_tasklet, (unsigned long ) he_dev); +tasklet_setup (&he_dev->tasklet, he_tasklet);spin_lock_init (&he_dev->global_lock);if (he_start (atm_dev)) {
@@ -1925,10 +1925,10 @@ he_service_rbpl(struct he_dev *he_dev, int group) }static void -he_tasklet (unsigned long data) +he_tasklet (struct tasklet_struct *t) {unsigned long flags; -struct he_dev *he_dev = (struct he_dev *) data; +struct he_dev *he_dev =from_tasklet (he_dev, t, tasklet);int group, type;int updated =0 ;
drivers/atm/solos-pci.c +4 -4
@@ -167,7 +167,7 @@ static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);static int atm_init (struct solos_card *,struct device *);static void atm_remove (struct solos_card *);static int send_command (struct solos_card *card,int dev,const char *buf,size_t size); -static void solos_bh (unsigned long ); +static void solos_bh (struct tasklet_struct *t);static int print_buffer (struct sk_buff *buf);static inline void solos_pop (struct atm_vcc *vcc,struct sk_buff *skb)
@@ -754,9 +754,9 @@ static irqreturn_t solos_irq(int irq, void *dev_id)return IRQ_RETVAL (handled); } -static void solos_bh (unsigned long card_arg) +static void solos_bh (struct tasklet_struct *t) { -struct solos_card *card = (void *)card_arg; +struct solos_card *card =from_tasklet (card, t, tlet);uint32_t card_flags;uint32_t rx_done =0 ;int port;
@@ -1294,7 +1294,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)pci_set_drvdata (dev, card); -tasklet_init (&card->tlet, solos_bh, (unsigned long )card); +tasklet_setup (&card->tlet, solos_bh);spin_lock_init (&card->tx_lock);spin_lock_init (&card->tx_queue_lock);spin_lock_init (&card->cli_queue_lock);
Signature · 1 line
2.17.1
PATCH 1/1 drivers: ntb: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/ntb/ntb_transport.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/ntb/ntb_transport.c +4 -5
@@ -273,7 +273,7 @@ enum {#define NTB_QP_DEF_NUM_ENTRIES 100#define NTB_LINK_DOWN_TIMEOUT 10 -static void ntb_transport_rxc_db (unsigned long data); +static void ntb_transport_rxc_db (struct tasklet_struct *t);static const struct ntb_ctx_ops ntb_transport_ops;static struct ntb_client ntb_transport_client; static int ntb_async_tx_submit(struct ntb_transport_qp *qp,
@@ -1234,8 +1234,7 @@ static int ntb_transport_init_queue(struct ntb_transport_ctx *nt,INIT_LIST_HEAD (&qp->rx_free_q);INIT_LIST_HEAD (&qp->tx_free_q); -tasklet_init (&qp->rxc_db_work, ntb_transport_rxc_db, - (unsigned long )qp); +tasklet_setup (&qp->rxc_db_work, ntb_transport_rxc_db);return 0 ; }
@@ -1685,9 +1684,9 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp)return 0 ; } -static void ntb_transport_rxc_db (unsigned long data) +static void ntb_transport_rxc_db (struct tasklet_struct *t) { -struct ntb_transport_qp *qp = (void *)data; +struct ntb_transport_qp *qp =from_tasklet (qp, t, rxc_db_work);int rc, i; dev_dbg(&qp->ndev->pdev->dev, "%s: doorbell %d received\n",
Signature · 1 line
2.17.1
PATCH 1/1 drivers: rapidio: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/rapidio/devices/tsi721_dma.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/rapidio/devices/tsi721_dma.c +3 -4
@@ -566,9 +566,9 @@ static void tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan, bdma_chan->id); } -static void tsi721_dma_tasklet (unsigned long data) +static void tsi721_dma_tasklet (struct tasklet_struct *t) { -struct tsi721_bdma_chan *bdma_chan = (struct tsi721_bdma_chan *)data; +struct tsi721_bdma_chan *bdma_chan =from_tasklet (bdma_chan, t, tasklet);u32 dmac_int, dmac_sts; dmac_int =ioread32 (bdma_chan->regs +TSI721_DMAC_INT );
@@ -988,8 +988,7 @@ int tsi721_register_dma(struct tsi721_device *priv)INIT_LIST_HEAD (&bdma_chan->queue);INIT_LIST_HEAD (&bdma_chan->free_list); -tasklet_init (&bdma_chan->tasklet, tsi721_dma_tasklet, - (unsigned long )bdma_chan); +tasklet_setup (&bdma_chan->tasklet, tsi721_dma_tasklet);list_add_tail (&bdma_chan->dchan.device_node, &mport->dma.channels); nr_channels++;
Signature · 1 line
2.17.1
PATCH 1/1 drivers: s390: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/s390/block/dasd.c | 18 ++++++++---------- drivers/s390/char/con3215.c | 6 +++--- drivers/s390/char/con3270.c | 7 +++---- drivers/s390/char/tty3270.c | 15 +++++++-------- drivers/s390/cio/qdio.h | 6 +++--- drivers/s390/cio/qdio_main.c | 12 ++++++------ drivers/s390/cio/qdio_setup.c | 9 +++------ drivers/s390/net/ctcm_main.c | 8 +++----- drivers/s390/net/ctcm_mpc.c | 16 ++++++++-------- drivers/s390/net/ctcm_mpc.h | 6 +++--- 10 files changed, 47 insertions(+), 56 deletions(-)
drivers/s390/block/dasd.c +8 -10
@@ -72,8 +72,8 @@ MODULE_LICENSE("GPL");static int dasd_alloc_queue (struct dasd_block *);static void dasd_free_queue (struct dasd_block *);static int dasd_flush_block_queue (struct dasd_block *); -static void dasd_device_tasklet (unsigned long ); -static void dasd_block_tasklet (unsigned long ); +static void dasd_device_tasklet (struct tasklet_struct *); +static void dasd_block_tasklet (struct tasklet_struct *);static void do_kick_device (struct work_struct *);static void do_restore_device (struct work_struct *);static void do_reload_device (struct work_struct *);
@@ -133,8 +133,7 @@ struct dasd_device *dasd_alloc_device(void)dasd_init_chunklist (&device->ese_chunks, device->ese_mem,PAGE_SIZE *2 );spin_lock_init (&device->mem_lock);atomic_set (&device->tasklet_scheduled,0 ); -tasklet_init (&device->tasklet, dasd_device_tasklet, - (unsigned long ) device); +tasklet_setup (&device->tasklet, dasd_device_tasklet);INIT_LIST_HEAD (&device->ccw_queue);timer_setup (&device->timer, dasd_device_timeout,0 );INIT_WORK (&device->kick_work, do_kick_device);
@@ -174,8 +173,7 @@ struct dasd_block *dasd_alloc_block(void)atomic_set (&block->open_count,-1 );atomic_set (&block->tasklet_scheduled,0 ); -tasklet_init (&block->tasklet, dasd_block_tasklet, - (unsigned long ) block); +tasklet_setup (&block->tasklet, dasd_block_tasklet);INIT_LIST_HEAD (&block->ccw_queue);spin_lock_init (&block->queue_lock);INIT_LIST_HEAD (&block->format_list);
@@ -2187,9 +2185,9 @@ EXPORT_SYMBOL_GPL(dasd_flush_device_queue);/* * Acquire the device lock and process queues for the device. */ -static void dasd_device_tasklet (unsigned long data) +static void dasd_device_tasklet (struct tasklet_struct *t) { -struct dasd_device *device = (struct dasd_device *) data; +struct dasd_device *device =from_tasklet (device, t, tasklet);struct list_head final_queue;atomic_set (&device->tasklet_scheduled,0 );
@@ -2929,9 +2927,9 @@ static void __dasd_block_start_head(struct dasd_block *block)* block layer request queue, creates ccw requests, enqueues them on * a dasd_device and processes ccw requests that have been returned. */ -static void dasd_block_tasklet (unsigned long data) +static void dasd_block_tasklet (struct tasklet_struct *t) { -struct dasd_block *block = (struct dasd_block *) data; +struct dasd_block *block =from_tasklet (block, t, tasklet);struct list_head final_queue;struct list_head *l, *n;struct dasd_ccw_req *cqr;
drivers/s390/char/con3215.c +3 -3
@@ -334,9 +334,9 @@ static inline void raw3215_try_io(struct raw3215_info *raw)/* * Call tty_wakeup from tasklet context */ -static void raw3215_wakeup (unsigned long data) +static void raw3215_wakeup (struct tasklet_struct *t) { -struct raw3215_info *raw = (struct raw3215_info *) data; +struct raw3215_info *raw =from_tasklet (raw, t, tlet);struct tty_struct *tty; tty =tty_port_tty_get (&raw->port);
@@ -673,7 +673,7 @@ static struct raw3215_info *raw3215_alloc_info(void)timer_setup (&info->timer, raw3215_timeout,0 );init_waitqueue_head (&info->empty_wait); -tasklet_init (&info->tlet, raw3215_wakeup, (unsigned long )info); +tasklet_setup (&info->tlet, raw3215_wakeup);tty_port_init (&info->port);return info;
drivers/s390/char/con3270.c +3 -4
@@ -291,8 +291,9 @@ con3270_update(struct timer_list *t)* Read tasklet. */ static void -con3270_read_tasklet (struct raw3270_request *rrq) +con3270_read_tasklet (struct tasklet_struct *t) { +struct raw3270_request *rrq = condev->read;static char kreset_data =TW_KR ;struct con3270 *cp;unsigned long flags;
@@ -625,9 +626,7 @@ con3270_init(void)INIT_LIST_HEAD (&condev->lines);INIT_LIST_HEAD (&condev->update);timer_setup (&condev->timer, con3270_update,0 ); -tasklet_init (&condev->readlet, - (void (*)(unsigned long )) con3270_read_tasklet, - (unsigned long ) condev->read); +tasklet_setup (&condev->readlet, con3270_read_tasklet);raw3270_add_view (&condev->view, &con3270_fn,1 ,RAW3270_VIEW_LOCK_IRQ );
drivers/s390/char/tty3270.c +7 -8
@@ -556,9 +556,10 @@ tty3270_scroll_backward(struct kbd_data *kbd)* Pass input line to tty. */ static void -tty3270_read_tasklet (unsigned long data) +tty3270_read_tasklet (struct tasklet_struct *t) { -struct raw3270_request *rrq = (struct raw3270_request *)data; + struct tty3270 *tp = from_tasklet(tp, t, readlet) +struct raw3270_request *rrq = tp->read;static char kreset_data =TW_KR ; struct tty3270 *tp = container_of(rrq->view, struct tty3270, view);char *input;
@@ -653,9 +654,9 @@ tty3270_issue_read(struct tty3270 *tp, int lock)* Hang up the tty */ static void -tty3270_hangup_tasklet (unsigned long data) +tty3270_hangup_tasklet (struct tasklet_struct *t) { -struct tty3270 *tp = (struct tty3270 *)data; +struct tty3270 *tp =from_tasklet (tp, t, hanglet);tty_port_tty_hangup (&tp->port, true);raw3270_put_view (&tp->view); }
@@ -754,10 +755,8 @@ tty3270_alloc_view(void)tty_port_init (&tp->port);timer_setup (&tp->timer, tty3270_update,0 ); -tasklet_init (&tp->readlet, tty3270_read_tasklet, - (unsigned long ) tp->read); -tasklet_init (&tp->hanglet, tty3270_hangup_tasklet, - (unsigned long ) tp); +tasklet_setup (&tp->readlet, tty3270_read_tasklet); +tasklet_setup (&tp->hanglet, tty3270_hangup_tasklet);INIT_WORK (&tp->resize_work, tty3270_resize_work);return tp;
drivers/s390/cio/qdio.h +3 -3
@@ -359,14 +359,14 @@ int qdio_establish_thinint(struct qdio_irq *irq_ptr);void qdio_shutdown_thinint (struct qdio_irq *irq_ptr);void tiqdio_add_device (struct qdio_irq *irq_ptr);void tiqdio_remove_device (struct qdio_irq *irq_ptr); -void tiqdio_inbound_processing (unsigned long q); +void tiqdio_inbound_processing (struct tasklet_struct *t);int qdio_thinint_init (void );void qdio_thinint_exit (void );int test_nonshared_ind (struct qdio_irq *);/* prototypes for setup */ -void qdio_inbound_processing (unsigned long data); -void qdio_outbound_processing (unsigned long data); +void qdio_inbound_processing (struct tasklet_struct *t); +void qdio_outbound_processing (struct tasklet_struct *t);void qdio_outbound_timer (struct timer_list *t);void qdio_int_handler (struct ccw_device *cdev,unsigned long intparm,struct irb *irb);
drivers/s390/cio/qdio_main.c +6 -6
@@ -634,9 +634,9 @@ static void __qdio_inbound_processing(struct qdio_q *q) } } -void qdio_inbound_processing (unsigned long data) +void qdio_inbound_processing (struct tasklet_struct *t) { -struct qdio_q *q = (struct qdio_q *)data; +struct qdio_q *q =from_tasklet (q, t, tasklet);__qdio_inbound_processing (q); }
@@ -801,9 +801,9 @@ static void __qdio_outbound_processing(struct qdio_q *q) }/* outbound tasklet */ -void qdio_outbound_processing (unsigned long data) +void qdio_outbound_processing (struct tasklet_struct *t) { -struct qdio_q *q = (struct qdio_q *)data; +struct qdio_q *q =from_tasklet (q, t, tasklet);__qdio_outbound_processing (q); }
@@ -827,9 +827,9 @@ static inline void qdio_check_outbound_pci_queues(struct qdio_irq *irq)qdio_tasklet_schedule (out); } -void tiqdio_inbound_processing (unsigned long data) +void tiqdio_inbound_processing (struct tasklet_struct *t) { -struct qdio_q *q = (struct qdio_q *)data; +struct qdio_q *q =from_tasklet (q, t, tasklet);if (need_siga_sync (q) &&need_siga_sync_after_ai (q))qdio_sync_queues (q);
drivers/s390/cio/qdio_setup.c +3 -6
@@ -259,11 +259,9 @@ static void setup_queues(struct qdio_irq *irq_ptr, qdio_init->input_sbal_addr_array[i], i);if (is_thinint_irq (irq_ptr)) { -tasklet_init (&q->tasklet, tiqdio_inbound_processing, - (unsigned long ) q); +tasklet_setup (&q->tasklet, tiqdio_inbound_processing); }else { -tasklet_init (&q->tasklet, qdio_inbound_processing, - (unsigned long ) q); +tasklet_setup (&q->tasklet, qdio_inbound_processing); } }
@@ -278,8 +276,7 @@ static void setup_queues(struct qdio_irq *irq_ptr,setup_storage_lists (q, irq_ptr, qdio_init->output_sbal_addr_array[i], i); -tasklet_init (&q->tasklet, qdio_outbound_processing, - (unsigned long ) q); +tasklet_setup (&q->tasklet, qdio_outbound_processing);timer_setup (&q->u.out.timer, qdio_outbound_timer,0 ); } }
drivers/s390/net/ctcm_main.c +3 -5
@@ -1165,8 +1165,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv)free_netdev (dev);return NULL ; } -tasklet_init (&grp->mpc_tasklet2, - mpc_group_ready, (unsigned long )dev); +tasklet_setup (&grp->mpc_tasklet2, mpc_group_ready); dev->mtu =MPC_BUFSIZE_DEFAULT -TH_HEADER_LENGTH -PDU_HEADER_LENGTH ;
@@ -1366,10 +1365,9 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, goto nomem_return; ch->discontact_th->th_blk_flag =TH_DISCONTACT ; -tasklet_init (&ch->ch_disc_tasklet, - mpc_action_send_discontact, (unsigned long )ch); +tasklet_setup (&ch->ch_disc_tasklet, mpc_action_send_discontact); -tasklet_init (&ch->ch_tasklet, ctcmpc_bh, (unsigned long )ch); +tasklet_setup (&ch->ch_tasklet, ctcmpc_bh); ch->max_bufsize = (MPC_BUFSIZE_DEFAULT -35 ); ccw_num =17 ; }else
drivers/s390/net/ctcm_mpc.c +8 -8
@@ -870,11 +870,11 @@ static void mpc_action_go_ready(fsm_instance *fsm, int event, void *arg)* helper of ctcm_init_netdevice * CTCM_PROTO_MPC only */ -void mpc_group_ready (unsigned long adev) +void mpc_group_ready (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *)adev; -struct ctcm_priv *priv = dev->ml_priv; -struct mpc_group *grp = priv->mpcg; +struct mpc_group *grp =from_tasklet (grp, t, mpc_tasklet2); +struct ctcm_priv *priv =container_of (grp,typeof (*priv), mpcg); +struct net_device *dev =container_of (priv,typeof (*dev), ml_priv);struct channel *ch =NULL ;if (grp ==NULL ) {
@@ -1233,9 +1233,9 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb)* Throttling back channel can result in excessive * channel inactivity and system deact of channel */ -void ctcmpc_bh (unsigned long thischan) +void ctcmpc_bh (struct tasklet_struct *t) { -struct channel *ch = (struct channel *)thischan; +struct channel *ch =from_tasklet (ch, t, ch_tasklet);struct sk_buff *skb;struct net_device *dev = ch->netdev;struct ctcm_priv *priv = dev->ml_priv;
@@ -1516,10 +1516,10 @@ void mpc_action_discontact(fsm_instance *fi, int event, void *arg)* CTCM_PROTO_MPC only * called from add_channel in ctcm_main.c */ -void mpc_action_send_discontact (unsigned long thischan) +void mpc_action_send_discontact (struct tasklet_struct *t) {int rc; -struct channel *ch = (struct channel *)thischan; +struct channel *ch =from_tasklet (ch, t, ch_disc_tasklet);unsigned long saveflags =0 ;spin_lock_irqsave (get_ccwdev_lock (ch->cdev), saveflags);
drivers/s390/net/ctcm_mpc.h +3 -3
@@ -230,10 +230,10 @@ static inline void ctcmpc_dump32(char *buf, int len)int ctcmpc_open (struct net_device *);void ctcm_ccw_check_rc (struct channel *,int ,char *); -void mpc_group_ready (unsigned long adev); +void mpc_group_ready (struct tasklet_struct *t);void mpc_channel_action (struct channel *ch,int direction,int action); -void mpc_action_send_discontact (unsigned long thischan); +void mpc_action_send_discontact (struct tasklet_struct *t);void mpc_action_discontact (fsm_instance *fi,int event,void *arg); -void ctcmpc_bh (unsigned long thischan); +void ctcmpc_bh (struct tasklet_struct *t);#endif /* --- This is the END my friend --- */
Signature · 1 line
2.17.1
PATCH 1/1 drivers: vme: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/vme/bridges/vme_fake.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/vme/bridges/vme_fake.c +4 -5
@@ -90,13 +90,13 @@ static struct device *vme_root;/* * Calling VME bus interrupt callback if provided. */ -static void fake_VIRQ_tasklet (unsigned long data) +static void fake_VIRQ_tasklet (struct tasklet_struct *t) {struct vme_bridge *fake_bridge;struct fake_driver *bridge; - fake_bridge = (struct vme_bridge *) data; - bridge = fake_bridge->driver_priv; + bridge =from_tasklet (bridge, t, int_tasklet); + fake_bridge = bridge->parent;vme_irq_handler (fake_bridge, bridge->int_level, bridge->int_statid); }
@@ -1098,8 +1098,7 @@ static int __init fake_init(void)/* Initialize wait queues & mutual exclusion flags */ mutex_init (&fake_device->vme_int);mutex_init (&fake_bridge->irq_mtx); -tasklet_init (&fake_device->int_tasklet, fake_VIRQ_tasklet, - (unsigned long ) fake_bridge); +tasklet_setup (&fake_device->int_tasklet, fake_VIRQ_tasklet);strcpy (fake_bridge->name, driver_name);
Signature · 1 line
2.17.1
PATCH 1/1 drm: i915: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly and remove the .data field.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 31 ++++++++++--------- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 8 +++-- 2 files changed, 22 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +17 -14
@@ -3130,9 +3130,10 @@ static bool preempt_timeout(const struct intel_engine_cs *const engine)* Check the unread Context Status Buffers and manage the submission of new * contexts to the ELSP accordingly. */ -static void execlists_submission_tasklet (unsigned long data) +static void execlists_submission_tasklet (struct tasklet_struct *t) { -struct intel_engine_cs *const engine = (struct intel_engine_cs *)data; +struct intel_engine_cs *const engine =from_tasklet (engine, t, + execlists.tasklet);bool timeout =preempt_timeout (engine);process_csb (engine);
@@ -4306,9 +4307,10 @@ static void execlists_reset_rewind(struct intel_engine_cs *engine, bool stalled)spin_unlock_irqrestore (&engine->active.lock, flags); } -static void nop_submission_tasklet (unsigned long data) +static void nop_submission_tasklet (struct tasklet_struct *t) { -struct intel_engine_cs *const engine = (struct intel_engine_cs *)data; +struct intel_engine_cs *const engine =from_tasklet (engine, t, + execlists.tasklet);/* The driver is wedged; don't process any more events. */ WRITE_ONCE (engine->execlists.queue_priority_hint,INT_MIN );
@@ -4391,7 +4393,8 @@ static void execlists_reset_cancel(struct intel_engine_cs *engine) execlists->queue =RB_ROOT_CACHED ;GEM_BUG_ON (__tasklet_is_enabled (&execlists->tasklet)); - execlists->tasklet.func = nop_submission_tasklet; + execlists->tasklet.func = (void (*)(unsigned long )) + nop_submission_tasklet;spin_unlock_irqrestore (&engine->active.lock, flags); }
@@ -4986,7 +4989,8 @@ void intel_execlists_set_default_submission(struct intel_engine_cs *engine) { engine->submit_request = execlists_submit_request; engine->schedule = i915_schedule; - engine->execlists.tasklet.func = execlists_submission_tasklet; + engine->execlists.tasklet.func = (void (*)(unsigned long )) + execlists_submission_tasklet; engine->reset.prepare = execlists_reset_prepare; engine->reset.rewind = execlists_reset_rewind;
@@ -5113,8 +5117,7 @@ int intel_execlists_submission_setup(struct intel_engine_cs *engine)struct intel_uncore *uncore = engine->uncore;u32 base = engine->mmio_base; -tasklet_init (&engine->execlists.tasklet, - execlists_submission_tasklet, (unsigned long )engine); +tasklet_setup (&engine->execlists.tasklet, execlists_submission_tasklet);timer_setup (&engine->execlists.timer, execlists_timeslice,0 );timer_setup (&engine->execlists.preempt, execlists_preempt,0 );
@@ -5509,9 +5512,10 @@ static intel_engine_mask_t virtual_submission_mask(struct virtual_engine *ve)return mask; } -static void virtual_submission_tasklet (unsigned long data) +static void virtual_submission_tasklet (struct tasklet_struct *t) { -struct virtual_engine *const ve = (struct virtual_engine *)data; +struct virtual_engine * ve =from_tasklet (ve, t, + base.execlists.tasklet);const int prio =READ_ONCE (ve->base.execlists.queue_priority_hint);intel_engine_mask_t mask;unsigned int n;
@@ -5724,9 +5728,8 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings,INIT_LIST_HEAD (virtual_queue (ve)); ve->base.execlists.queue_priority_hint =INT_MIN ; -tasklet_init (&ve->base.execlists.tasklet, - virtual_submission_tasklet, - (unsigned long )ve); +tasklet_setup (&ve->base.execlists.tasklet, + virtual_submission_tasklet);intel_context_init (&ve->context, &ve->base);
@@ -5748,7 +5751,7 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings,* layering if we handle cloning of the requests and * submitting a copy into each backend. */ -if (sibling->execlists.tasklet.func != +if (sibling->execlists.tasklet.func != (void (*)(unsigned long )) execlists_submission_tasklet) { err = -ENODEV ; goto err_put;
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +5 -3
@@ -344,9 +344,10 @@ static void __guc_dequeue(struct intel_engine_cs *engine) execlists->active = execlists->inflight; } -static void guc_submission_tasklet (unsigned long data) +static void guc_submission_tasklet (struct tasklet_struct *t) { -struct intel_engine_cs *const engine = (struct intel_engine_cs *)data; +struct intel_engine_cs *const engine =from_tasklet (engine, t, + execlists.tasklet);struct intel_engine_execlists *const execlists = &engine->execlists;struct i915_request **port, *rq;unsigned long flags;
@@ -591,7 +592,8 @@ static void guc_set_default_submission(struct intel_engine_cs *engine)*/ intel_execlists_set_default_submission (engine); - engine->execlists.tasklet.func = guc_submission_tasklet; + engine->execlists.tasklet.func = + (void (*)(unsigned long ))guc_submission_tasklet;/* do not use execlists park/unpark */ engine->park = engine->unpark =NULL ;
Signature · 1 line
2.17.1
PATCH 1/1 firewire: ohci: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/firewire/ohci.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/firewire/ohci.c +8 -8
@@ -921,9 +921,9 @@ static void ar_recycle_buffers(struct ar_context *ctx, unsigned int end_buffer) } } -static void ar_context_tasklet (unsigned long data) +static void ar_context_tasklet (struct tasklet_struct *t) { -struct ar_context *ctx = (struct ar_context *)data; +struct ar_context *ctx =from_tasklet (ctx, t, tasklet);unsigned int end_buffer_index, end_buffer_offset;void *p, *end;
@@ -977,7 +977,7 @@ static int ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, ctx->regs = regs; ctx->ohci = ohci; -tasklet_init (&ctx->tasklet, ar_context_tasklet, (unsigned long )ctx); +tasklet_setup (&ctx->tasklet, ar_context_tasklet);for (i =0 ; i <AR_BUFFERS ; i++) { ctx->pages[i] =alloc_page (GFP_KERNEL |GFP_DMA32 );
@@ -1049,9 +1049,9 @@ static struct descriptor *find_branch_descriptor(struct descriptor *d, int z)return d + z -1 ; } -static void context_tasklet (unsigned long data) +static void context_tasklet (struct tasklet_struct *t) { -struct context *ctx = (struct context *) data; +struct context *ctx =from_tasklet (ctx, t, tasklet);struct descriptor *d, *last;u32 address;int z;
@@ -1145,7 +1145,7 @@ static int context_init(struct context *ctx, struct fw_ohci *ohci, ctx->buffer_tail =list_entry (ctx->buffer_list.next, struct descriptor_buffer, list); -tasklet_init (&ctx->tasklet, context_tasklet, (unsigned long )ctx); +tasklet_setup (&ctx->tasklet, context_tasklet); ctx->callback = callback;/*
@@ -1420,7 +1420,7 @@ static void at_context_flush(struct context *ctx)tasklet_disable (&ctx->tasklet); ctx->flushing = true; -context_tasklet ((unsigned long )ctx); +context_tasklet (&ctx->tasklet); ctx->flushing = false;tasklet_enable (&ctx->tasklet);
@@ -3472,7 +3472,7 @@ static int ohci_flush_iso_completions(struct fw_iso_context *base)tasklet_disable (&ctx->context.tasklet);if (!test_and_set_bit_lock (0 , &ctx->flushing_completions)) { -context_tasklet ((unsigned long )&ctx->context); +context_tasklet (&ctx->context.tasklet);switch (base->type) {case FW_ISO_CONTEXT_TRANSMIT :
Signature · 1 line
2.17.1
PATCH 1/2 hsi: nokia-modem: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/hsi/clients/nokia-modem.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/hsi/clients/nokia-modem.c +5 -4
@@ -36,9 +36,10 @@ struct nokia_modem_device {struct hsi_client *cmt_speech; }; -static void do_nokia_modem_rst_ind_tasklet (unsigned long data) +static void do_nokia_modem_rst_ind_tasklet (struct tasklet_struct *t) { -struct nokia_modem_device *modem = (struct nokia_modem_device *)data; +struct nokia_modem_device *modem =from_tasklet (modem, t, + nokia_modem_rst_ind_tasklet);if (!modem)return ;
@@ -155,8 +156,8 @@ static int nokia_modem_probe(struct device *dev) modem->nokia_modem_rst_ind_irq = irq; pflags =irq_get_trigger_type (irq); -tasklet_init (&modem->nokia_modem_rst_ind_tasklet, - do_nokia_modem_rst_ind_tasklet, (unsigned long )modem); +tasklet_setup (&modem->nokia_modem_rst_ind_tasklet, + do_nokia_modem_rst_ind_tasklet); err =devm_request_irq (dev, irq, nokia_modem_rst_ind_isr, pflags,"modem_rst_ind" , modem);if (err <0 ) {
Signature · 1 line
2.17.1
PATCH 1/1 input: serio: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/input/serio/hp_sdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/serio/hp_sdc.c +2 -2
@@ -301,7 +301,7 @@ static irqreturn_t hp_sdc_nmisr(int irq, void *dev_id)unsigned long hp_sdc_put (void ); -static void hp_sdc_tasklet (unsigned long foo) +static void hp_sdc_tasklet (struct tasklet_struct *unused) {write_lock_irq (&hp_sdc.rtq_lock);
@@ -890,7 +890,7 @@ static int __init hp_sdc_init(void)hp_sdc_status_in8 ();hp_sdc_data_in8 (); -tasklet_init (&hp_sdc.task, hp_sdc_tasklet,0 ); +tasklet_setup (&hp_sdc.task, hp_sdc_tasklet,0 );/* Sync the output buffer registers, thus scheduling hp_sdc_tasklet. */ t_sync.actidx =0 ;
Signature · 1 line
2.17.1
PATCH 1/2 mailbox: bcm: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/mailbox/bcm-pdc-mailbox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mailbox/bcm-pdc-mailbox.c +3 -3
@@ -962,9 +962,9 @@ static irqreturn_t pdc_irq_handler(int irq, void *data)* a DMA receive interrupt. Reenables the receive interrupt. * @data: PDC state structure */ -static void pdc_tasklet_cb (unsigned long data) +static void pdc_tasklet_cb (struct tasklet_struct *t) { -struct pdc_state *pdcs = (struct pdc_state *)data; +struct pdc_state *pdcs =from_tasklet (pdcs, t, rx_tasklet);pdc_receive (pdcs);
@@ -1589,7 +1589,7 @@ static int pdc_probe(struct platform_device *pdev)pdc_hw_init (pdcs);/* Init tasklet for deferred DMA rx processing */ -tasklet_init (&pdcs->rx_tasklet, pdc_tasklet_cb, (unsigned long )pdcs); +tasklet_setup (&pdcs->rx_tasklet, pdc_tasklet_cb); err =pdc_interrupts_init (pdcs);if (err)
Signature · 1 line
2.17.1
PATCH 1/2 memstick: jmb38x: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/memstick/host/jmb38x_ms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/memstick/host/jmb38x_ms.c +4 -4
@@ -603,10 +603,10 @@ static void jmb38x_ms_abort(struct timer_list *t)spin_unlock_irqrestore (&host->lock, flags); } -static void jmb38x_ms_req_tasklet (unsigned long data) +static void jmb38x_ms_req_tasklet (struct tasklet_struct *t) { -struct memstick_host *msh = (struct memstick_host *)data; -struct jmb38x_ms_host *host =memstick_priv (msh); +struct jmb38x_ms_host *host =from_tasklet (host, t, notify); +struct memstick_host *msh = host->msh;unsigned long flags;int rc;
@@ -868,7 +868,7 @@ static struct memstick_host *jmb38x_ms_alloc_host(struct jmb38x_ms *jm, int cnt) host->irq = jm->pdev->irq; host->timeout_jiffies =msecs_to_jiffies (1000 ); -tasklet_init (&host->notify, jmb38x_ms_req_tasklet, (unsigned long )msh); +tasklet_setup (&host->notify, jmb38x_ms_req_tasklet); msh->request = jmb38x_ms_submit_req; msh->set_param = jmb38x_ms_set_param;
Signature · 1 line
2.17.1
PATCH 1/2 misc: ibmvmc: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/misc/ibmvmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/misc/ibmvmc.c +4 -4
@@ -2064,10 +2064,10 @@ static void ibmvmc_handle_crq(struct ibmvmc_crq_msg *crq, } } -static void ibmvmc_task (unsigned long data) +static void ibmvmc_task (struct tasklet_struct *t) { -struct crq_server_adapter *adapter = - (struct crq_server_adapter *)data; +struct crq_server_adapter *adapter =from_tasklet (adapter, t, + work_task);struct vio_dev *vdev =to_vio_dev (adapter->dev);struct ibmvmc_crq_msg *crq;int done =0 ;
@@ -2150,7 +2150,7 @@ static int ibmvmc_init_crq_queue(struct crq_server_adapter *adapter) queue->cur =0 ;spin_lock_init (&queue->lock); -tasklet_init (&adapter->work_task, ibmvmc_task, (unsigned long )adapter); +tasklet_setup (&adapter->work_task, ibmvmc_task); if (request_irq(vdev->irq, ibmvmc_handle_event,
Signature · 1 line
2.17.1
PATCH 1/1 net: atm: convert tasklets callbacks to use from_tasklet()
In reply to Allen PaisFrom: Allen Pais <[email protected]>
Update all the callbacks of all tasklets by usingfrom_tasklet() and remove .data field.
--- net/atm/pppoatm.c | 1 - 1 file changed, 1 deletion(-)
net/atm/pppoatm.c +0 -1
@@ -416,7 +416,6 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg) pvcc->chan.mtu = atmvcc->qos.txtp.max_sdu -PPP_HDRLEN - (be.encaps == e_vc ?0 :LLC_LEN ); pvcc->wakeup_tasklet = tasklet_proto; - pvcc->wakeup_tasklet.data = (unsigned long ) &pvcc->chan; err =ppp_register_channel (&pvcc->chan);if (err !=0 ) {kfree (pvcc);
Signature · 1 line
2.17.1
PATCH 1/1 platform: goldfish: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisFrom: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.
--- drivers/platform/goldfish/goldfish_pipe.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/platform/goldfish/goldfish_pipe.c +3 -4
@@ -577,10 +577,10 @@ static struct goldfish_pipe *signalled_pipes_pop_front(return pipe; } -static void goldfish_interrupt_task (unsigned long dev_addr) +static void goldfish_interrupt_task (struct tasklet_struct *t) {/* Iterate over the signalled pipes and wake them one by one */ -struct goldfish_pipe_dev *dev = (struct goldfish_pipe_dev *)dev_addr; +struct goldfish_pipe_dev *dev =from_tasklet (dev, t, irq_tasklet);struct goldfish_pipe *pipe;int wakes;
@@ -811,8 +811,7 @@ static int goldfish_pipe_device_init(struct platform_device *pdev, {int err; -tasklet_init (&dev->irq_tasklet, &goldfish_interrupt_task, - (unsigned long )dev); +tasklet_setup (&dev->irq_tasklet, &goldfish_interrupt_task); err = devm_request_irq(&pdev->dev, dev->irq, goldfish_pipe_interrupt,
Signature · 1 line
2.17.1
Re: [PATCH] char: ipmi: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisQuoted 9 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Signed-off-by Romain Perier <[email protected]>Signed-off-by Allen Pais <[email protected]>
This looks good to me.
Are you planning to push this, or do you want me to take it? If you want me to take it, what is the urgency?
-corey
Quoted 54 lines
--- drivers/char/ipmi/ipmi_msghandler.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)drivers/char/ipmi/ipmi_msghandler.c +6
-7@@ -39,7 +39,7 @@static struct ipmi_recv_msg *ipmi_alloc_recv_msg (void );static int ipmi_init_msghandler (void ); -static void smi_recv_tasklet (unsigned long ); +static void smi_recv_tasklet (struct tasklet_struct *t);static void handle_new_recv_msgs (struct ipmi_smi *intf);static void need_waiter (struct ipmi_smi *intf); static int handle_one_recv_msg(struct ipmi_smi *intf,@@ -3430,9 +3430,8 @@ int ipmi_add_smi(struct module *owner, intf->curr_seq =0 ;spin_lock_init (&intf->waiting_rcv_msgs_lock);INIT_LIST_HEAD (&intf->waiting_rcv_msgs); -tasklet_init (&intf->recv_tasklet, - smi_recv_tasklet, - (unsigned long ) intf); +tasklet_setup (&intf->recv_tasklet, + smi_recv_tasklet);atomic_set (&intf->watchdog_pretimeouts_to_deliver,0 );spin_lock_init (&intf->xmit_msgs_lock);INIT_LIST_HEAD (&intf->xmit_msgs);@@ -4467,10 +4466,10 @@ static void handle_new_recv_msgs(struct ipmi_smi *intf) } } -static void smi_recv_tasklet (unsigned long val) +static void smi_recv_tasklet (struct tasklet_struct *t) {unsigned long flags =0 ;/* keep us warning-free. */ -struct ipmi_smi *intf = (struct ipmi_smi *) val; +struct ipmi_smi *intf =from_tasklet (intf, t, recv_tasklet);int run_to_completion = intf->run_to_completion;struct ipmi_smi_msg *newmsg =NULL ;@@ -4542,7 +4541,7 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,spin_unlock_irqrestore (&intf->xmit_msgs_lock, flags);if (run_to_completion) -smi_recv_tasklet ((unsigned long ) intf); +smi_recv_tasklet (&intf->recv_tasklet);else tasklet_schedule (&intf->recv_tasklet); }Signature · 1 line
2.17.1
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Jens Axboe
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisQuoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.
Who came up with the idea to add a macro 'from_tasklet' that is just container_of? container_of in the code would be _much_ more readable, and not leave anyone guessing wtf from_tasklet is doing.
I'd fix that up now before everything else goes in...
Signature · 1 line
Jens Axboe
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 8 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.
Quoted 5 lines
Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the timer_struct conversion did (added a container_of wrapper) to avoid the ever-repeating use of typeof(), long lines, etc.
Signature · 1 line
Kees Cook
Jens Axboe
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 13 lines · Kees Cook
Quoted 12 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.
Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.
But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the container_of() redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.
Signature · 1 line
Jens Axboe
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 21 lines · Jens Axboe
Quoted 13 lines · Kees Cook
Quoted 12 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.
Quoted 5 lines
But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.
I'm open to suggestions, but as things stand, these kinds of treewide changes end up getting whole-release delays because of the need to have the API in place for everyone before patches to do the changes can be sent to multiple maintainers, etc.
Signature · 1 line
Kees Cook
Jens Axboe
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 22 lines · Kees Cook
Quoted 21 lines · Jens Axboe
Quoted 19 lines · Kees Cook
Quoted 8 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Quoted 5 lines
Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.
Quoted 7 lines
Quoted 5 lines
But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands, from_tasklet() is totally generic which is why I objected to it. from_member()? Not great with naming... But I can see this going further and then we'll suddenly have tons of these. It's not good for readability.
Quoted 3 lines
changes end up getting whole-release delays because of the need to have the API in place for everyone before patches to do the changes can be sent to multiple maintainers, etc.
Sure, that's always true of treewide changes like that.
Signature · 1 line
Jens Axboe
Re: [PATCH] char: ipmi: convert tasklets to use new tasklet_setup() API
In reply to Corey MinyardQuoted 10 lines
Quoted 3 lines
Signed-off-by Romain Perier <[email protected]>Signed-off-by Allen Pais <[email protected]>This looks good to me.
Reviewed-by Corey Minyard <[email protected]>Are you planning to push this, or do you want me to take it? If you want me to take it, what is the urgency?
Thanks. Well, not hurry, as long as it goes into 5.9 with all other
changes.
Quoted 57 lines
-corey
Quoted 54 lines
--- drivers/char/ipmi/ipmi_msghandler.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)drivers/char/ipmi/ipmi_msghandler.c +6
-8@@ -39,7 +39,7 @@static struct ipmi_recv_msg *ipmi_alloc_recv_msg (void );static int ipmi_init_msghandler (void ); -static void smi_recv_tasklet (unsigned long ); +static void smi_recv_tasklet (struct tasklet_struct *t);static void handle_new_recv_msgs (struct ipmi_smi *intf);static void need_waiter (struct ipmi_smi *intf); static int handle_one_recv_msg(struct ipmi_smi *intf,@@ -3430,9 +3430,8 @@ int ipmi_add_smi(struct module *owner, intf->curr_seq =0 ;spin_lock_init (&intf->waiting_rcv_msgs_lock);INIT_LIST_HEAD (&intf->waiting_rcv_msgs); -tasklet_init (&intf->recv_tasklet, - smi_recv_tasklet, - (unsigned long ) intf); +tasklet_setup (&intf->recv_tasklet, + smi_recv_tasklet);atomic_set (&intf->watchdog_pretimeouts_to_deliver,0 );spin_lock_init (&intf->xmit_msgs_lock);INIT_LIST_HEAD (&intf->xmit_msgs);@@ -4467,10 +4466,10 @@ static void handle_new_recv_msgs(struct ipmi_smi *intf) } } -static void smi_recv_tasklet (unsigned long val) +static void smi_recv_tasklet (struct tasklet_struct *t) {unsigned long flags =0 ;/* keep us warning-free. */ -struct ipmi_smi *intf = (struct ipmi_smi *) val; +struct ipmi_smi *intf =from_tasklet (intf, t, recv_tasklet);int run_to_completion = intf->run_to_completion;struct ipmi_smi_msg *newmsg =NULL ;@@ -4542,7 +4541,7 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,spin_unlock_irqrestore (&intf->xmit_msgs_lock, flags);if (run_to_completion) -smi_recv_tasklet ((unsigned long ) intf); +smi_recv_tasklet (&intf->recv_tasklet);else tasklet_schedule (&intf->recv_tasklet); } --2.17.1
Signature · 6 lines
- Allen _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Re: [PATCH] char: ipmi: convert tasklets to use new tasklet_setup() API
Quoted 6 lines · Allen
Quoted 6 lines
Quoted 3 lines
Signed-off-by Romain Perier <[email protected]>Signed-off-by Allen Pais <[email protected]>This looks good to me.
Quoted 7 lines
Quoted 4 lines
Reviewed-by Corey Minyard <[email protected]>Are you planning to push this, or do you want me to take it? If you want me to take it, what is the urgency?
Thanks. Well, not hurry, as long as it goes into 5.9 with all other
changes.
Ok, this is queued in my for-next branch.
-corey
Quoted 64 lines
Quoted 59 lines
-corey
Quoted 54 lines
--- drivers/char/ipmi/ipmi_msghandler.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)drivers/char/ipmi/ipmi_msghandler.c +6
-8@@ -39,7 +39,7 @@static struct ipmi_recv_msg *ipmi_alloc_recv_msg (void );static int ipmi_init_msghandler (void ); -static void smi_recv_tasklet (unsigned long ); +static void smi_recv_tasklet (struct tasklet_struct *t);static void handle_new_recv_msgs (struct ipmi_smi *intf);static void need_waiter (struct ipmi_smi *intf); static int handle_one_recv_msg(struct ipmi_smi *intf,@@ -3430,9 +3430,8 @@ int ipmi_add_smi(struct module *owner, intf->curr_seq =0 ;spin_lock_init (&intf->waiting_rcv_msgs_lock);INIT_LIST_HEAD (&intf->waiting_rcv_msgs); -tasklet_init (&intf->recv_tasklet, - smi_recv_tasklet, - (unsigned long ) intf); +tasklet_setup (&intf->recv_tasklet, + smi_recv_tasklet);atomic_set (&intf->watchdog_pretimeouts_to_deliver,0 );spin_lock_init (&intf->xmit_msgs_lock);INIT_LIST_HEAD (&intf->xmit_msgs);@@ -4467,10 +4466,10 @@ static void handle_new_recv_msgs(struct ipmi_smi *intf) } } -static void smi_recv_tasklet (unsigned long val) +static void smi_recv_tasklet (struct tasklet_struct *t) {unsigned long flags =0 ;/* keep us warning-free. */ -struct ipmi_smi *intf = (struct ipmi_smi *) val; +struct ipmi_smi *intf =from_tasklet (intf, t, recv_tasklet);int run_to_completion = intf->run_to_completion;struct ipmi_smi_msg *newmsg =NULL ;@@ -4542,7 +4541,7 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,spin_unlock_irqrestore (&intf->xmit_msgs_lock, flags);if (run_to_completion) -smi_recv_tasklet ((unsigned long ) intf); +smi_recv_tasklet (&intf->recv_tasklet);else tasklet_schedule (&intf->recv_tasklet); } --2.17.1
Signature · 1 line
- Allen
James Bottomley
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
In reply to Jens AxboeQuoted 31 lines · Jens Axboe
Quoted 30 lines · Kees Cook
Quoted 28 lines · Jens Axboe
Quoted 14 lines · Kees Cook
Quoted 13 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.
Quoted 7 lines
Quoted 2 lines
I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands,
from_tasklet()is totally generic which is why I objected to it.from_member()? Not great with naming... But I can see this going further and then we'll suddenly have tons of these. It's not good for readability.
Since both threads seem to have petered out, let me suggest in kernel.h:
#define cast_out(ptr, container, member) \
container_of(ptr, typeof(*container), member)
It does what you want, the argument order is the same as container_of with the only difference being you name the containing structure instead of having to specify its type.
James
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 43 lines · James Bottomley
Quoted 31 lines · Jens Axboe
Quoted 30 lines · Kees Cook
Quoted 28 lines · Jens Axboe
Quoted 14 lines · Kees Cook
Quoted 13 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.Quoted 7 lines
Quoted 2 lines
I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands,
from_tasklet()is totally generic which is why I objected to it.from_member()? Not great with naming... But I can see this going further and then we'll suddenly have tons of these. It's not good for readability.Since both threads seem to have petered out, let me suggest in
kernel.h:
Quoted 6 lines
#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.
I like this! Shall I send this to Linus to see if this can land in -rc2 for use going forward?
Signature · 1 line
Kees Cook
James Bottomley
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 56 lines · Kees Cook
Quoted 55 lines · James Bottomley
Quoted 39 lines · Jens Axboe
Quoted 38 lines · Kees Cook
Quoted 36 lines · Jens Axboe
Quoted 16 lines · Kees Cook
Quoted 15 lines · Jens Axboe
Quoted 7 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that
is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 8 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things
much more readable. It's the same thing that thetimer_struct
conversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.But then it should use a generic name, instead of each sub- system
using some random name that makes people look up exactly what it
does. I'm not huge fan of thecontainer_of()redundancy, but adding private variants of this doesn't seem like the best way
forward. Let's have a generic helper that does this, and use it
everywhere.Quoted 8 lines
Quoted 2 lines
I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands,
from_tasklet()is totally generic which is why I objected to it.from_member()? Not great with naming... But I can see this going further and then we'll
suddenly have tons of these. It's not good for readability.Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)
Quoted 6 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.I like this! Shall I send this to Linus to see if this can land in -rc2 for use going forward?
Sure ... he's probably been lurking on this thread anyway ... it's about time he got off his arse^Wthe fence and made an executive decision ...
James
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
In reply to Kees CookQuoted 39 lines
Quoted 39 lines
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.Quoted 7 lines
Quoted 2 lines
I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands,
from_tasklet()is totally generic which is why I objected to it.from_member()? Not great with naming... But I can see this going further and then we'll suddenly have tons of these. It's not good for readability.Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)
Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.I like this! Shall I send this to Linus to see if this can land in -rc2 for use going forward?
Cool, I shall wait for it to be accepted and then spin out V2 with cast_out()
Signature · 6 lines
- Allen _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Jens Axboe
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
In reply to James BottomleyQuoted 43 lines · James Bottomley
Quoted 31 lines · Jens Axboe
Quoted 30 lines · Kees Cook
Quoted 28 lines · Jens Axboe
Quoted 14 lines · Kees Cook
Quoted 13 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.Quoted 7 lines
Quoted 2 lines
I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands,
from_tasklet()is totally generic which is why I objected to it.from_member()? Not great with naming... But I can see this going further and then we'll suddenly have tons of these. It's not good for readability.Since both threads seem to have petered out, let me suggest in
kernel.h:
Quoted 6 lines
#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.
Not to incessantly bike shed on the naming, but I don't like cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.
FWIW, I like the from_ part of the original naming, as it has some clues as to what is being done here. Why not just from_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.
Signature · 1 line
Jens Axboe
Greg KH
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 47 lines · Jens Axboe
Quoted 46 lines · James Bottomley
Quoted 31 lines · Jens Axboe
Quoted 30 lines · Kees Cook
Quoted 28 lines · Jens Axboe
Quoted 14 lines · Kees Cook
Quoted 13 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.Quoted 7 lines
Quoted 2 lines
I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands,
from_tasklet()is totally generic which is why I objected to it.from_member()? Not great with naming... But I can see this going further and then we'll suddenly have tons of these. It's not good for readability.Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)
Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.
I agree, if we want to bike shed, I don't like this color either.
Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.
Why are people hating on the well-known and used container_of()?
If you really hate to type the type and want a new macro, what about 'container_from()'? (noun/verb is nicer to sort symbols by...)
But really, why is this even needed?
thanks,
greg k-h
Jens Axboe
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 64 lines · Greg KH
Quoted 47 lines · Jens Axboe
Quoted 46 lines · James Bottomley
Quoted 31 lines · Jens Axboe
Quoted 30 lines · Kees Cook
Quoted 28 lines · Jens Axboe
Quoted 14 lines · Kees Cook
Quoted 13 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.Quoted 7 lines
Quoted 2 lines
I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands,
from_tasklet()is totally generic which is why I objected to it.from_member()? Not great with naming... But I can see this going further and then we'll suddenly have tons of these. It's not good for readability.Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.I agree, if we want to bike shed, I don't like this color either.
Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.
Quoted 6 lines
Why are people hating on the well-known and used
container_of()?If you really hate to type the type and want a new macro, what about '
container_from()'? (noun/verb is nicer to sort symbols by...)But really, why is this even needed?
container_from() or from_container(), either works just fine for me in terms of naming.
I think people are hating on it because it makes for _really_ long lines, and it's arguably cleaner/simpler to just pass in the pointer type instead. Then you end up with lines like this:
struct request_queue *q = container_of(work, struct request_queue, requeue_work.work);
But I'm not the one that started this addition of from_tasklet(), my objection was adding a private macro for something that should be generic functionality. Hence I think we either need to provide that, or tell the from_tasklet() folks that they should just use container_of().
Signature · 1 line
Jens Axboe
Greg KH
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 79 lines · Jens Axboe
Quoted 64 lines · Greg KH
Quoted 47 lines · Jens Axboe
Quoted 46 lines · James Bottomley
Quoted 31 lines · Jens Axboe
Quoted 30 lines · Kees Cook
Quoted 28 lines · Jens Axboe
Quoted 14 lines · Kees Cook
Quoted 13 lines · Jens Axboe
Quoted 6 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Who came up with the idea to add a macro '
from_tasklet' that is justcontainer_of?container_ofin the code would be _much_ more readable, and not leave anyone guessing wtffrom_taskletis doing.Quoted 6 lines
Quoted 1 line
I'd fix that up now before everything else goes in...
As I mentioned in the other thread, I think this makes things much more readable. It's the same thing that the
timer_structconversion did (added acontainer_ofwrapper) to avoid the ever-repeating use oftypeof(), long lines, etc.But then it should use a generic name, instead of each sub-system using some random name that makes people look up exactly what it does. I'm not huge fan of the
container_of()redundancy, but adding private variants of this doesn't seem like the best way forward. Let's have a generic helper that does this, and use it everywhere.Quoted 7 lines
Quoted 2 lines
I'm open to suggestions, but as things stand, these kinds of treewide
On naming? Implementation is just as it stands,
from_tasklet()is totally generic which is why I objected to it.from_member()? Not great with naming... But I can see this going further and then we'll suddenly have tons of these. It's not good for readability.Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.I agree, if we want to bike shed, I don't like this color either.
Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.Quoted 6 lines
Why are people hating on the well-known and used
container_of()?If you really hate to type the type and want a new macro, what about '
container_from()'? (noun/verb is nicer to sort symbols by...)But really, why is this even needed?
container_from()orfrom_container(), either works just fine for me in terms of naming.I think people are hating on it because it makes for _really_ long lines, and it's arguably cleaner/simpler to just pass in the pointer type instead. Then you end up with lines like this:
Quoted 6 lines
struct request_queue *q = container_of(work, struct request_queue, requeue_work.work);But I'm not the one that started this addition of
from_tasklet(), my objection was adding a private macro for something that should be generic functionality.
Agreed.
Quoted 2 lines
Hence I think we either need to provide that, or
tell thefrom_tasklet()folks that they should just usecontainer_of().
Also agreed, thanks.
greg k-h
James Bottomley
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
In reply to Jens AxboeQuoted 1 line · Jens Axboe
On 8/18/20 1:00 PM, James Bottomley wrote:
[...]
Quoted 6 lines
Quoted 6 lines
Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)
Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.
Um, I thought it was exactly descriptive: you're casting to the outer container. I thought about following the C++ dynamic casting style, so out_cast(), but that seemed a bit pejorative. What about outer_cast()?
Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.
I'm not opposed to container_from() but it seems a little less descriptive than outer_cast() but I don't really care. I always have to look up container_of() when I'm using it so this would just be another macro of that type ...
James
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 25 lines
[...]
Quoted 6 lines
Quoted 6 lines
Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.Um, I thought it was exactly descriptive: you're casting to the outer container. I thought about following the C++ dynamic casting style, so
out_cast(), but that seemed a bit pejorative. What aboutouter_cast()?Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.
Quoted 5 lines
I'm not opposed to
container_from()but it seems a little less descriptive thanouter_cast()but I don't really care. I always have to look upcontainer_of()when I'm using it so this would just be another macro of that type ...
So far we have a few which have been suggested as replacement
for from_tasklet()
- out_cast() or outer_cast()
- from_member().
- container_from() or from_container()
from_container() sounds fine, would trimming it a bit work? like from_cont().
Signature · 6 lines
- Allen _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Jens Axboe
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 31 lines · Allen
Quoted 25 lines
[...]
Quoted 6 lines
Quoted 6 lines
Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.Um, I thought it was exactly descriptive: you're casting to the outer container. I thought about following the C++ dynamic casting style, so
out_cast(), but that seemed a bit pejorative. What aboutouter_cast()?Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.Quoted 5 lines
I'm not opposed to
container_from()but it seems a little less descriptive thanouter_cast()but I don't really care. I always have to look upcontainer_of()when I'm using it so this would just be another macro of that type ...
Quoted 8 lines
So far we have a few which have been suggested as replacement
forfrom_tasklet()-
out_cast()orouter_cast()
-from_member().
-container_from()orfrom_container()
from_container()sounds fine, would trimming it a bit work? likefrom_cont().
I like container_from() the most, since it's the closest to contain_of() which is a well known idiom for years. The lines will already be shorter without the need to specify the struct, so don't like the idea of squeezing container into cont for any of them. For most people, cont is usually short for continue, not container.
Signature · 1 line
Jens Axboe
James Bottomley
maintainerRe: [PATCH] block: convert tasklets to use new tasklet_setup() API
In reply to AllenQuoted 35 lines · Allen
Quoted 26 lines
[...]
Quoted 6 lines
Quoted 6 lines
Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.Um, I thought it was exactly descriptive: you're casting to the outer container. I thought about following the C++ dynamic casting style, so
out_cast(), but that seemed a bit pejorative. What aboutouter_cast()?Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.Quoted 5 lines
I'm not opposed to
container_from()but it seems a little less descriptive thanouter_cast()but I don't really care. I always have to look upcontainer_of()when I'm using it so this would just be another macro of that type ...So far we have a few which have been suggested as replacement
forfrom_tasklet()
Quoted 6 lines
-
out_cast()orouter_cast()
-from_member().
-container_from()orfrom_container()
from_container()sounds fine, would trimming it a bit work? likefrom_cont().
I'm fine with container_from(). It's the same form as container_of() and I think we need urgent agreement to not stall everything else so the most innocuous name is likely to get the widest acceptance.
James
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 41 lines · James Bottomley
Quoted 39 lines · Allen
Quoted 26 lines
[...]
Quoted 6 lines
Quoted 6 lines
Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.Um, I thought it was exactly descriptive: you're casting to the outer container. I thought about following the C++ dynamic casting style, so
out_cast(), but that seemed a bit pejorative. What aboutouter_cast()?Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.Quoted 5 lines
I'm not opposed to
container_from()but it seems a little less descriptive thanouter_cast()but I don't really care. I always have to look upcontainer_of()when I'm using it so this would just be another macro of that type ...So far we have a few which have been suggested as replacement
forfrom_tasklet()-
out_cast()orouter_cast()
-from_member().
-container_from()orfrom_container()
Quoted 6 lines
Quoted 2 lines
from_container()sounds fine, would trimming it a bit work? likefrom_cont().I'm fine with
container_from(). It's the same form ascontainer_of()and I think we need urgent agreement to not stall everything else so the most innocuous name is likely to get the widest acceptance.
Kees,
Will you be sending the newly proposed API to Linus? I have V2
which uses container_from()
ready to be sent out.
Thanks.
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 50 lines · Allen Pais
Quoted 41 lines · James Bottomley
Quoted 39 lines · Allen
Quoted 26 lines
[...]
Quoted 6 lines
Quoted 6 lines
Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.Um, I thought it was exactly descriptive: you're casting to the outer container. I thought about following the C++ dynamic casting style, so
out_cast(), but that seemed a bit pejorative. What aboutouter_cast()?Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.Quoted 5 lines
I'm not opposed to
container_from()but it seems a little less descriptive thanouter_cast()but I don't really care. I always have to look upcontainer_of()when I'm using it so this would just be another macro of that type ...So far we have a few which have been suggested as replacement
forfrom_tasklet()-
out_cast()orouter_cast()
-from_member().
-container_from()orfrom_container()Quoted 6 lines
Quoted 2 lines
from_container()sounds fine, would trimming it a bit work? likefrom_cont().I'm fine with
container_from(). It's the same form ascontainer_of()and I think we need urgent agreement to not stall everything else so the most innocuous name is likely to get the widest acceptance.
Quoted 5 lines
Kees,
Will you be sending the newly proposed API to Linus? I have V2
which usescontainer_from()
ready to be sent out.
I liked that James swapped the first two arguments so that it matches container_of(). Plus it's nice that when you have:
struct whatever *foo = container_from(ptr, foo, member);
Then it means that "ptr == &foo->member".
regards,
dan carpenter
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 57 lines · Dan Carpenter
Quoted 50 lines · Allen Pais
Quoted 41 lines · James Bottomley
Quoted 39 lines · Allen
Quoted 26 lines
[...]
Quoted 6 lines
Quoted 6 lines
Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.Um, I thought it was exactly descriptive: you're casting to the outer container. I thought about following the C++ dynamic casting style, so
out_cast(), but that seemed a bit pejorative. What aboutouter_cast()?Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.Quoted 5 lines
I'm not opposed to
container_from()but it seems a little less descriptive thanouter_cast()but I don't really care. I always have to look upcontainer_of()when I'm using it so this would just be another macro of that type ...So far we have a few which have been suggested as replacement
forfrom_tasklet()-
out_cast()orouter_cast()
-from_member().
-container_from()orfrom_container()Quoted 6 lines
Quoted 2 lines
from_container()sounds fine, would trimming it a bit work? likefrom_cont().I'm fine with
container_from(). It's the same form ascontainer_of()and I think we need urgent agreement to not stall everything else so the most innocuous name is likely to get the widest acceptance.Quoted 5 lines
Kees,
Will you be sending the newly proposed API to Linus? I have V2
which usescontainer_from()
ready to be sent out.
Quoted 6 lines
I liked that James swapped the first two arguments so that it matches
container_of(). Plus it's nice that when you have:struct whatever *foo = container_from(ptr, foo, member);Then it means that "ptr ==
&foo->member".
I'm a bit stalled right now -- the merge window was keeping me busy, and this week is the Linux Plumbers Conference. This is on my list, but I haven't gotten back around to it. If you want, feel free to send the container_from() patch; you might be able to unblock this faster than me right now. :)
-Kees
Signature · 1 line
Kees Cook
Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
Quoted 64 lines · Kees Cook
Quoted 62 lines · Dan Carpenter
Quoted 50 lines · Allen Pais
Quoted 41 lines · James Bottomley
Quoted 39 lines · Allen
Quoted 26 lines
[...]
Quoted 6 lines
Quoted 6 lines
Since both threads seem to have petered out, let me suggest in
kernel.h:#define
cast_out(ptr, container, member)\
container_of(ptr, typeof(*container), member)Quoted 7 lines
Quoted 3 lines
It does what you want, the argument order is the same as
container_ofwith the only difference being you name the containing structure instead of having to specify its type.Not to incessantly bike shed on the naming, but I don't like
cast_out, it's not very descriptive. And it has connotations of getting rid of something, which isn't really true.Um, I thought it was exactly descriptive: you're casting to the outer container. I thought about following the C++ dynamic casting style, so
out_cast(), but that seemed a bit pejorative. What aboutouter_cast()?Quoted 5 lines
FWIW, I like the
from_part of the original naming, as it has some clues as to what is being done here. Why not justfrom_container()? That should immediately tell people what it does without having to look up the implementation, even before this becomes a part of the accepted coding norm.Quoted 5 lines
I'm not opposed to
container_from()but it seems a little less descriptive thanouter_cast()but I don't really care. I always have to look upcontainer_of()when I'm using it so this would just be another macro of that type ...So far we have a few which have been suggested as replacement
forfrom_tasklet()-
out_cast()orouter_cast()
-from_member().
-container_from()orfrom_container()Quoted 6 lines
Quoted 2 lines
from_container()sounds fine, would trimming it a bit work? likefrom_cont().I'm fine with
container_from(). It's the same form ascontainer_of()and I think we need urgent agreement to not stall everything else so the most innocuous name is likely to get the widest acceptance.Quoted 5 lines
Kees,
Will you be sending the newly proposed API to Linus? I have V2
which usescontainer_from()
ready to be sent out.I liked that James swapped the first two arguments so that it matches
container_of(). Plus it's nice that when you have:struct whatever *foo = container_from(ptr, foo, member);
Quoted 8 lines
Quoted 1 line
Then it means that "ptr ==
&foo->member".I'm a bit stalled right now -- the merge window was keeping me busy, and this week is the Linux Plumbers Conference. This is on my list, but I haven't gotten back around to it. If you want, feel free to send the
container_from()patch; you might be able to unblock this faster than me right now. :)
Sure, Thanks.
Signature · 6 lines
- Allen _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Quoted 8 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.
Quoted 5 lines
Signed-off-by Romain Perier <[email protected]>Signed-off-by Allen Pais <[email protected]>--- arch/um/drivers/vector_kern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Anton, can you please review this patch?
Signature · 7 lines
Thanks, //richard _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Quoted 31 lines · Allen Pais
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Signed-off-by Romain Perier <[email protected]>Signed-off-by Allen Pais <[email protected]>--- arch/um/drivers/vector_kern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/um/drivers/vector_kern.c +2
-2@@ -1196,9 +1196,9 @@ static int vector_net_close(struct net_device *dev)/* TX tasklet */ -static void vector_tx_poll (unsigned long data) +static void vector_tx_poll (struct tasklet_struct *t) { -struct vector_private *vp = (struct vector_private *)data; +struct vector_private *vp =from_tasklet (vp, t, tx_poll); vp->estats.tx_kicks++;vector_send (vp->tx_queue);
arch/um/drivers/vector_kern.c static void vector_eth_configure( · line 1635
Quoted 8 lines
arch/um/drivers/vector_kern.c +1
-1@@ -1629,7 +1629,7 @@ static void vector_eth_configure( }); dev->features = dev->hw_features = (NETIF_F_SG |NETIF_F_FRAGLIST ); -tasklet_init (&vp->tx_poll, vector_tx_poll, (unsigned long )vp); +tasklet_setup (&vp->tx_poll, vector_tx_poll);INIT_WORK (&vp->reset_tx, vector_reset_tx);timer_setup (&vp->tl, vector_timer_expire,0 );
Signature · 3 lines
Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/
Anton Ivanov
maintainerQuoted 62 lines · Anton Ivanov
Hi all,
When checking the tasklet patch I noticed that the mm is throwing page in invalid state warnings. This is not related to the tasklet and it something which appeared recently. I think it was not there in 5.9.
[ 721.930000] BUG: Bad page state in process sshd pfn:031f9
[ 721.930000] page:0000000054519316 refcount:0 mapcount:-1024 mapping:0000000000000000 index:0x0 pfn:0x31f9 [ 721.930000] flags: 0x0()
[ 721.930000] raw: 0000000000000000 0000000000000100 0000000000000122 0000000000000000
[ 721.930000] raw: 0000000000000000 000000000000000000000000fffffbff
[ 721.930000] page dumped because: nonzero mapcount
[ 721.930000] Modules linked in:
[ 721.930000] CPU: 0 PID: 201 Comm: sshd Tainted: G B W 5.9.0-11954-gc370f4218465 #66 [ 721.930000] Stack:
[ 721.930000]60307b89604feb3865b4f900dfde3e78
[ 721.930000]6039cd29604feb38dfd2900065b4f9a0
[ 721.930000]65b4f91060308de665b4f950600cd6ed
[ 721.930000] Call Trace:
[ 721.930000] [<60307b89>] ?printk+0x0/0x94
[ 721.930000] [<6001f382>]show_stack+0x13e/0x14d
[ 721.930000] [<60307b89>] ?printk+0x0/0x94
[ 721.930000] [<60308de6>]dump_stack+0x34/0x36
[ 721.930000] [<600cd6ed>]bad_page+0x13a/0x162
[ 721.930000] [<600cde98>] ?__free_one_page+0x97/0x19d
[ 721.930000] [<600cd750>]check_free_page+0x3b/0x44
[ 721.930000] [<600ce274>]free_pcppages_bulk+0xb9/0x1c1
[ 721.930000] [<600cd7f5>] ?arch_local_irq_save+0x0/0x29
[ 721.930000] [<600ce44b>] ? free_unref_page_commit.isra.133+0x0/0x91
[ 721.930000] [<600cf3a4>]free_unref_page_list+0xeb/0x133
[ 721.930000] [<600a77fa>] ?compound_head+0x0/0x11
[ 721.930000] [<600a7849>] ?test_bit+0x0/0xd
[ 721.930000] [<60035459>] ?set_signals+0x0/0x36
[ 721.930000] [<600a85bc>]release_pages+0x227/0x236
[ 721.930000] [<600d4035>] ?free_swap_cache+0x0/0x66
[ 721.930000] [<60035367>] ?block_signals+0x0/0x11
[ 721.930000] [<600d47e6>]free_pages_and_swap_cache+0x4c/0x55
[ 721.930000] [<600d479a>] ?free_pages_and_swap_cache+0x0/0x55
[ 721.930000] [<600c5681>]tlb_flush_mmu+0x54/0x6e
[ 721.930000] [<600cf089>] ?free_pages+0x0/0x3a
[ 721.930000] [<600c1957>] ?remove_vma+0x0/0x54
[ 721.930000] [<600c5738>]tlb_finish_mmu+0x47/0x76
[ 721.930000] [<600c1957>] ?remove_vma+0x0/0x54
[ 721.930000] [<600c334f>]exit_mmap+0x101/0x186
[ 721.930000] [<6003b765>]__mmput+0x24/0xa7
[ 721.930000] [<6003b7fd>]mmput+0x15/0x17
[ 721.930000] [<600e7acb>]begin_new_exec+0x76c/0xa41
[ 721.930000] [<60035378>] ?unblock_signals+0x0/0xd7
[ 721.930000] [<60137627>]load_elf_binary+0x294/0xcb3
[ 721.930000] [<600ddfb5>] ?set_fs+0x0/0x14
[ 721.930000] [<600de5ae>] ? fsnotify_parent.constprop.52+0x43/0x64
[ 721.930000] [<601357cc>] ?load_elf_phdrs+0x0/0x85
[ 721.930000] [<6021ed63>] ?memcmp+0x0/0x1d
[ 721.930000] [<60087b84>] ?try_module_get+0x0/0x36
[ 721.930000] [<600e6044>]exec_binprm+0xef/0x30a
[ 721.930000] [<600e5618>] ?test_bit+0x0/0xd
[ 721.930000] [<600e6f2f>]bprm_execve+0x1ee/0x2de
[ 721.930000] [<600e5c5b>] ?copy_strings+0x0/0x26f
[ 721.930000] [<600e7184>]do_execveat_common+0x165/0x19e
[ 721.930000] [<600e7dd6>]sys_execve+0x36/0x3d
[ 721.930000] [<60021365>]handle_syscall+0x79/0xa7
[ 721.930000] [<60037ff3>]userspace+0x483/0x510
[ 721.930000] [<6001e1ab>]fork_handler+0x94/0x96
Quoted 1 line
I will try to have a go at that and figure out where it came from.
This happens as a result of:
commit b2b29d6d01194404dfef4eafa026959be301705b (HEAD)
Author: Matthew Wilcox <[email protected]> Date: Tue Oct 13 16:53:22 2020 -0700
mm: account PMD tables like PTE tables
There is however, another bug too.
At some point between 5.9 and this commit slab starts throwing a warning that a page is not a slab page.
I will try to narrow that one down too and send it to the list.
Quoted 39 lines
A.
-------- Forwarded Message --------
Subject: Re: [PATCH] arch: um: convert tasklets to use newtasklet_setup()API
Date: Sun, 18 Oct 2020 23:50:00 +0200
From: Richard Weinberger <[email protected]>
To: Allen Pais <[email protected]>
CC: Ulf Hansson <[email protected]>, [email protected], [email protected], Dave Airlie <[email protected]>, Allen Pais <[email protected]>, [email protected], DRI mailing list <[email protected]>, LKML <[email protected]>, James Bottomley <[email protected]>, K. Y. Srinivasan <[email protected]>, Anton Ivanov <[email protected]>, [email protected], [email protected], [email protected], Maxim Levitsky <[email protected]>, Richard Weinberger <[email protected]>, Helge Deller <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected], Jeff Dike <[email protected]>, Kees Cook <[email protected]>, Alex Dubov <[email protected]>, Sascha Hauer <[email protected]>, [email protected], linux-um <[email protected]>, [email protected], Mark Brown <[email protected]>, [email protected], [email protected], [email protected], Jens Axboe <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected], Sebastian Reichel <[email protected]>, open list:SPI SUBSYSTEM <[email protected]>, [email protected], [email protected], Daniel Vetter <[email protected]>, [email protected], Romain Perier <[email protected]>, Shawn Guo <[email protected]>, David S. Miller <[email protected]>Quoted 7 lines · Allen Pais
From: Allen Pais<[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Quoted 5 lines
Signed-off-by Romain Perier<[email protected]>Signed-off-by Allen Pais<[email protected]>--- arch/um/drivers/vector_kern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)Anton, can you please review this patch?
Signature · 7 lines
Thanks, //richard _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Signature · 8 lines
Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/ _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
[CC'ing willy]
Quoted 129 lines · Anton Ivanov
Quoted 62 lines · Anton Ivanov
Hi all,
When checking the tasklet patch I noticed that the mm is throwing page in invalid state warnings. This is not related to the tasklet and it something which appeared recently. I think it was not there in 5.9.
[ 721.930000] BUG: Bad page state in process sshd pfn:031f9 [ 721.930000] page:0000000054519316 refcount:0 mapcount:-1024 mapping:0000000000000000 index:0x0 pfn:0x31f9 [ 721.930000] flags: 0x0() [ 721.930000] raw: 0000000000000000 0000000000000100 0000000000000122 0000000000000000 [ 721.930000] raw: 0000000000000000 0000000000000000 00000000fffffbff [ 721.930000] page dumped because: nonzero mapcount [ 721.930000] Modules linked in: [ 721.930000] CPU: 0 PID: 201 Comm: sshd Tainted: G B W 5.9.0-11954-gc370f4218465 #66 [ 721.930000] Stack: [ 721.930000] 60307b89 604feb38 65b4f900 dfde3e78 [ 721.930000] 6039cd29 604feb38 dfd29000 65b4f9a0 [ 721.930000] 65b4f910 60308de6 65b4f950 600cd6ed [ 721.930000] Call Trace: [ 721.930000] [<60307b89>] ? printk+0x0/0x94 [ 721.930000] [<6001f382>] show_stack+0x13e/0x14d [ 721.930000] [<60307b89>] ? printk+0x0/0x94 [ 721.930000] [<60308de6>] dump_stack+0x34/0x36 [ 721.930000] [<600cd6ed>] bad_page+0x13a/0x162 [ 721.930000] [<600cde98>] ? __free_one_page+0x97/0x19d [ 721.930000] [<600cd750>] check_free_page+0x3b/0x44 [ 721.930000] [<600ce274>] free_pcppages_bulk+0xb9/0x1c1 [ 721.930000] [<600cd7f5>] ? arch_local_irq_save+0x0/0x29 [ 721.930000] [<600ce44b>] ? free_unref_page_commit.isra.133+0x0/0x91 [ 721.930000] [<600cf3a4>] free_unref_page_list+0xeb/0x133 [ 721.930000] [<600a77fa>] ? compound_head+0x0/0x11 [ 721.930000] [<600a7849>] ? test_bit+0x0/0xd [ 721.930000] [<60035459>] ? set_signals+0x0/0x36 [ 721.930000] [<600a85bc>] release_pages+0x227/0x236 [ 721.930000] [<600d4035>] ? free_swap_cache+0x0/0x66 [ 721.930000] [<60035367>] ? block_signals+0x0/0x11 [ 721.930000] [<600d47e6>] free_pages_and_swap_cache+0x4c/0x55 [ 721.930000] [<600d479a>] ? free_pages_and_swap_cache+0x0/0x55 [ 721.930000] [<600c5681>] tlb_flush_mmu+0x54/0x6e [ 721.930000] [<600cf089>] ? free_pages+0x0/0x3a [ 721.930000] [<600c1957>] ? remove_vma+0x0/0x54 [ 721.930000] [<600c5738>] tlb_finish_mmu+0x47/0x76 [ 721.930000] [<600c1957>] ? remove_vma+0x0/0x54 [ 721.930000] [<600c334f>] exit_mmap+0x101/0x186 [ 721.930000] [<6003b765>] __mmput+0x24/0xa7 [ 721.930000] [<6003b7fd>] mmput+0x15/0x17 [ 721.930000] [<600e7acb>] begin_new_exec+0x76c/0xa41 [ 721.930000] [<60035378>] ? unblock_signals+0x0/0xd7 [ 721.930000] [<60137627>] load_elf_binary+0x294/0xcb3 [ 721.930000] [<600ddfb5>] ? set_fs+0x0/0x14 [ 721.930000] [<600de5ae>] ? fsnotify_parent.constprop.52+0x43/0x64 [ 721.930000] [<601357cc>] ? load_elf_phdrs+0x0/0x85 [ 721.930000] [<6021ed63>] ? memcmp+0x0/0x1d [ 721.930000] [<60087b84>] ? try_module_get+0x0/0x36 [ 721.930000] [<600e6044>] exec_binprm+0xef/0x30a [ 721.930000] [<600e5618>] ? test_bit+0x0/0xd [ 721.930000] [<600e6f2f>] bprm_execve+0x1ee/0x2de [ 721.930000] [<600e5c5b>] ? copy_strings+0x0/0x26f [ 721.930000] [<600e7184>] do_execveat_common+0x165/0x19e [ 721.930000] [<600e7dd6>] sys_execve+0x36/0x3d [ 721.930000] [<60021365>] handle_syscall+0x79/0xa7 [ 721.930000] [<60037ff3>] userspace+0x483/0x510 [ 721.930000] [<6001e1ab>] fork_handler+0x94/0x96Quoted 1 line
I will try to have a go at that and figure out where it came from.
This happens as a result of:
commit
b2b29d6d01194404dfef4eafa026959be301705b(HEAD)Author: Matthew Wilcox <[email protected]> Date: Tue Oct 13 16:53:22 2020 -0700mm: account PMD tables like PTE tables
There is however, another bug too.
At some point between 5.9 and this commit slab starts throwing a warning that a page is not a slab page.
I will try to narrow that one down too and send it to the list.
Quoted 31 lines
A.
-------- Forwarded Message --------
Subject: Re: [PATCH] arch: um: convert tasklets to use new tasklet_setup() API Date: Sun, 18 Oct 2020 23:50:00 +0200 From: Richard Weinberger <[email protected]> To: Allen Pais <[email protected]>CC: Ulf Hansson <[email protected]>, [email protected], [email protected], Dave Airlie <[email protected]>, Allen Pais <[email protected]>, [email protected], DRI mailing list <[email protected]>, LKML <[email protected]>, James Bottomley <[email protected]>, K. Y. Srinivasan <[email protected]>, Anton Ivanov <[email protected]>, [email protected], [email protected], [email protected], Maxim Levitsky <[email protected]>, Richard Weinberger <[email protected]>, Helge Deller <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected], Jeff Dike <[email protected]>, Kees Cook <[email protected]>, Alex Dubov <[email protected]>, Sascha Hauer <[email protected]>, [email protected], linux-um <[email protected]>,
[email protected], Mark Brown <[email protected]>, [email protected], [email protected], [email protected], Jens Axboe <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected], Sebastian Reichel <[email protected]>, open list:SPI SUBSYSTEM <[email protected]>, [email protected], [email protected], Daniel Vetter <[email protected]>, [email protected], Romain Perier <[email protected]>, Shawn Guo <[email protected]>, David S. Miller <[email protected]>Quoted 7 lines · Allen Pais
From: Allen Pais<[email protected]>
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Quoted 5 lines
Signed-off-by Romain Perier<[email protected]>Signed-off-by Allen Pais<[email protected]>--- arch/um/drivers/vector_kern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)Anton, can you please review this patch?
Quoted 9 lines
--
Thanks,
//richard_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um--
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/
Signature · 7 lines
Thanks, //richard _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um