[PATCH v2 1/1] staging: coding style cleanups for staging/iio/light/tsl2583 driver
This patch fixes following coding style warning reported by check patch script, in tsl2583 driver: - Block comments use a trailing */ on a separate line Signed-off-by: Bijosh Thykkoottathil --- drivers/staging/iio/light/tsl2583.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 3100d96..9159298 100644 --- a/drivers/staging/iio/light/tsl2583.c +++ b/drivers/staging/iio/light/tsl2583.c @@ -241,7 +241,8 @@ static int taos_get_lux(struct iio_dev *indio_dev) } /* clear status, really interrupt status (interrupts are off), but -* we use the bit anyway - don't forget 0x80 - this is a command*/ +* we use the bit anyway - don't forget 0x80 - this is a command +*/ ret = i2c_smbus_write_byte(chip->client, (TSL258X_CMD_REG | TSL258X_CMD_SPL_FN | TSL258X_CMD_ALS_INT_CLR)); @@ -430,7 +431,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) chip->als_time_scale = (als_time + 25) / 50; /* TSL258x Specific power-on / adc enable sequence -* Power on the device 1st. */ +* Power on the device 1st. +*/ utmp = TSL258X_CNTL_PWR_ON; ret = i2c_smbus_write_byte_data(chip->client, TSL258X_CMD_REG | TSL258X_CNTRL, utmp); @@ -440,7 +442,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) } /* Use the following shadow copy for our delay before enabling ADC. -* Write all the registers. */ +* Write all the registers. +*/ for (i = 0, uP = chip->taos_config; i < TSL258X_REG_MAX; i++) { ret = i2c_smbus_write_byte_data(chip->client, TSL258X_CMD_REG + i, @@ -454,7 +457,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) usleep_range(3000, 3500); /* NOW enable the ADC -* initialize the desired mode of operation */ +* initialize the desired mode of operation +*/ utmp = TSL258X_CNTL_PWR_ON | TSL258X_CNTL_ADC_ENBL; ret = i2c_smbus_write_byte_data(chip->client, TSL258X_CMD_REG | TSL258X_CNTRL, @@ -696,7 +700,8 @@ static ssize_t taos_luxtable_show(struct device *dev, taos_device_lux[i].ch1); if (taos_device_lux[i].ratio == 0) { /* We just printed the first "0" entry. -* Now get rid of the extra "," and break. */ +* Now get rid of the extra "," and break. +*/ offset--; break; } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RFC] staging: unisys: visorbus: visorchipset: Remove create_singlethread_workqueue()
With concurrency managed workqueues, use of dedicated workqueues can be replaced by using system_wq. Drop periodic_controlvm_workqueue by using system_wq. Since there is only one work item periodic_controlvm_work and different periodic_controlvm_works do not need to be ordered, increase of concurrency level by switching to system_wq should not break anything. cancel_delayed_work_sync() is used to ensure that work is not pending or executing on any CPU. Signed-off-by: Amitoj Kaur Chawla Acked-by: Tejun Heo --- Only compile tested. drivers/staging/unisys/visorbus/visorchipset.c | 23 --- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index b75b063..c4c71c6 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -102,7 +102,6 @@ struct parser_context { }; static struct delayed_work periodic_controlvm_work; -static struct workqueue_struct *periodic_controlvm_workqueue; static DEFINE_SEMAPHORE(notifier_lock); static struct cdev file_cdev; @@ -1913,8 +1912,7 @@ cleanup: poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; } - queue_delayed_work(periodic_controlvm_workqueue, - &periodic_controlvm_work, poll_jiffies); + schedule_delayed_work(&periodic_controlvm_work, poll_jiffies); } static void @@ -2011,8 +2009,7 @@ cleanup: poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW; - queue_delayed_work(periodic_controlvm_workqueue, - &periodic_controlvm_work, poll_jiffies); + schedule_delayed_work(&periodic_controlvm_work, poll_jiffies); } static void @@ -2299,19 +2296,10 @@ visorchipset_init(struct acpi_device *acpi_device) else INIT_DELAYED_WORK(&periodic_controlvm_work, controlvm_periodic_work); - periodic_controlvm_workqueue = - create_singlethread_workqueue("visorchipset_controlvm"); - if (!periodic_controlvm_workqueue) { - POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC, -DIAG_SEVERITY_ERR); - rc = -ENOMEM; - goto cleanup; - } most_recent_message_jiffies = jiffies; poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; - queue_delayed_work(periodic_controlvm_workqueue, - &periodic_controlvm_work, poll_jiffies); + schedule_delayed_work(&periodic_controlvm_work, poll_jiffies); visorchipset_platform_device.dev.devt = major_dev; if (platform_device_register(&visorchipset_platform_device) < 0) { @@ -2346,10 +2334,7 @@ visorchipset_exit(struct acpi_device *acpi_device) visorbus_exit(); - cancel_delayed_work(&periodic_controlvm_work); - flush_workqueue(periodic_controlvm_workqueue); - destroy_workqueue(periodic_controlvm_workqueue); - periodic_controlvm_workqueue = NULL; + cancel_delayed_work_sync(&periodic_controlvm_work); destroy_controlvm_payload_info(&controlvm_payload_info); memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RFC] staging: unisys: visornic: Remove create_singlethread_workqueue()
With concurrency managed workqueues, use of dedicated workqueues can be replaced by using system_wq. Drop visornic_timeout_reset_workqueue by using system_wq. Since there is only one work item per devdata and different devdatas do not need to be ordered, increase of concurrency level by switching to system_wq should not break anything. cancel_work_sync() is used to ensure that work is not pending or executing on any CPU. Signed-off-by: Amitoj Kaur Chawla Acked-by: Tejun Heo --- Only compile tested. drivers/staging/unisys/visornic/visornic_main.c | 21 ++--- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index df4f688..6749c4e 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -59,8 +59,6 @@ static const struct file_operations debugfs_enable_ints_fops = { .write = enable_ints_write, }; -static struct workqueue_struct *visornic_timeout_reset_workqueue; - /* GUIDS for director channel type supported by this driver. */ static struct visor_channeltype_descriptor visornic_channel_types[] = { /* Note that the only channel type we expect to be reported by the @@ -1070,7 +1068,7 @@ visornic_xmit_timeout(struct net_device *netdev) spin_unlock_irqrestore(&devdata->priv_lock, flags); return; } - queue_work(visornic_timeout_reset_workqueue, &devdata->timeout_reset); + schedule_work(&devdata->timeout_reset); spin_unlock_irqrestore(&devdata->priv_lock, flags); } @@ -1998,7 +1996,7 @@ static void visornic_remove(struct visor_device *dev) } /* going_away prevents new items being added to the workqueues */ - flush_workqueue(visornic_timeout_reset_workqueue); + cancel_work_sync(&devdata->timeout_reset); debugfs_remove_recursive(devdata->eth_debugfs_dir); @@ -2117,21 +2115,10 @@ static int visornic_init(void) if (!ret) goto cleanup_debugfs; - /* create workqueue for tx timeout reset */ - visornic_timeout_reset_workqueue = - create_singlethread_workqueue("visornic_timeout_reset"); - if (!visornic_timeout_reset_workqueue) - goto cleanup_workqueue; - err = visorbus_register_visor_driver(&visornic_driver); if (!err) return 0; -cleanup_workqueue: - if (visornic_timeout_reset_workqueue) { - flush_workqueue(visornic_timeout_reset_workqueue); - destroy_workqueue(visornic_timeout_reset_workqueue); - } cleanup_debugfs: debugfs_remove_recursive(visornic_debugfs_dir); @@ -2147,10 +2134,6 @@ static void visornic_cleanup(void) { visorbus_unregister_visor_driver(&visornic_driver); - if (visornic_timeout_reset_workqueue) { - flush_workqueue(visornic_timeout_reset_workqueue); - destroy_workqueue(visornic_timeout_reset_workqueue); - } debugfs_remove_recursive(visornic_debugfs_dir); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: octeon: Convert create_singlethread_workqueue()
Hello, On Sat, Feb 27, 2016 at 11:21:47PM +0530, Bhaktipriya Shridhar wrote: > With conccurency managed workqueues, use of dedicated workqueues can > be replaced by system_wq. Drop cvm_oct_poll_queue by using system_wq. > > There are multiple work items per cvm_oct_poll_queue (viz. > cvm_oct_rx_refill_work, port_periodic_work) and different > cvm_oct_poll_queues need not be be ordered. Hence, concurrency > can be increased by switching to system_wq. > > All work items are sync canceled in cvm_oct_remove() so it > is guaranteed that no work is in flight by the time exit path runs. > > Signed-off-by: Bhaktipriya Shridhar For the workqueue part, Acked-by: Tejun Heo Thanks. -- tejun ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RFC] staging: gdm724x: gdm_usb: Remove create_workqueue()
With concurrency managed workqueues, use of dedicated workqueues can be replaced by using system_wq. Drop usb_tx_wq and usb_rx_wq by using system_wq. Since there are multiple work items per udev but different udevs do not need to be ordered, increase of concurrency level by switching to system_wq should not break anything. cancel_work_sync() is used to ensure that work is not pending or executing on any CPU. Lastly, since all devices are suspended, which shutdowns the work items before the driver can be unregistered, it is guaranteed that no work item is pending or executing by the time exit path runs. Signed-off-by: Amitoj Kaur Chawla Acked-by: Tejun Heo --- Only compile tested. drivers/staging/gdm724x/gdm_usb.c | 34 -- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c index 92ea1a1..9db9b90 100644 --- a/drivers/staging/gdm724x/gdm_usb.c +++ b/drivers/staging/gdm724x/gdm_usb.c @@ -55,9 +55,6 @@ static const struct usb_device_id id_table[] = { MODULE_DEVICE_TABLE(usb, id_table); -static struct workqueue_struct *usb_tx_wq; -static struct workqueue_struct *usb_rx_wq; - static void do_tx(struct work_struct *work); static void do_rx(struct work_struct *work); @@ -476,7 +473,7 @@ static void gdm_usb_rcv_complete(struct urb *urb) if (!urb->status && r->callback) { spin_lock_irqsave(&rx->to_host_lock, flags); list_add_tail(&r->to_host_list, &rx->to_host_list); - queue_work(usb_rx_wq, &udev->work_rx.work); + schedule_work(&udev->work_rx.work); spin_unlock_irqrestore(&rx->to_host_lock, flags); } else { if (urb->status && udev->usb_state == PM_NORMAL) @@ -568,7 +565,7 @@ static void gdm_usb_send_complete(struct urb *urb) spin_lock_irqsave(&tx->lock, flags); udev->send_complete = 1; - queue_work(usb_tx_wq, &udev->work_tx.work); + schedule_work(&udev->work_tx.work); spin_unlock_irqrestore(&tx->lock, flags); } @@ -759,7 +756,7 @@ static int gdm_usb_sdu_send(void *priv_dev, void *data, int len, spin_lock_irqsave(&tx->lock, flags); list_add_tail(&t_sdu->list, &tx->sdu_list); - queue_work(usb_tx_wq, &udev->work_tx.work); + schedule_work(&udev->work_tx.work); spin_unlock_irqrestore(&tx->lock, flags); if (no_spc) @@ -796,7 +793,7 @@ static int gdm_usb_hci_send(void *priv_dev, void *data, int len, spin_lock_irqsave(&tx->lock, flags); list_add_tail(&t->list, &tx->hci_list); - queue_work(usb_tx_wq, &udev->work_tx.work); + schedule_work(&udev->work_tx.work); spin_unlock_irqrestore(&tx->lock, flags); return 0; @@ -944,6 +941,9 @@ static int gdm_usb_suspend(struct usb_interface *intf, pm_message_t pm_msg) } spin_unlock_irqrestore(&rx->submit_lock, flags); + cancel_work_sync(&udev->work_tx.work); + cancel_work_sync(&udev->work_rx.work); + return 0; } @@ -981,7 +981,7 @@ static int gdm_usb_resume(struct usb_interface *intf) tx = &udev->tx; spin_lock_irqsave(&tx->lock, flags); - queue_work(usb_tx_wq, &udev->work_tx.work); + schedule_work(&udev->work_tx.work); spin_unlock_irqrestore(&tx->lock, flags); return 0; @@ -1005,14 +1005,6 @@ static int __init gdm_usb_lte_init(void) return -1; } - usb_tx_wq = create_workqueue("usb_tx_wq"); - if (!usb_tx_wq) - return -1; - - usb_rx_wq = create_workqueue("usb_rx_wq"); - if (!usb_rx_wq) - return -1; - return usb_register(&gdm_usb_lte_driver); } @@ -1021,16 +1013,6 @@ static void __exit gdm_usb_lte_exit(void) gdm_lte_event_exit(); usb_deregister(&gdm_usb_lte_driver); - - if (usb_tx_wq) { - flush_workqueue(usb_tx_wq); - destroy_workqueue(usb_tx_wq); - } - - if (usb_rx_wq) { - flush_workqueue(usb_rx_wq); - destroy_workqueue(usb_rx_wq); - } } module_init(gdm_usb_lte_init); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192e: rtllib_softmac.c: Remove multiple blank lines
Fixed blank lines issues reported by checkpatch.pl Signed-off-by: Tapan Prakash T --- drivers/staging/rtl8192e/rtllib_softmac.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 25b5b5e..b40298b 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -13,7 +13,6 @@ * released under the GPL */ - #include "rtllib.h" #include @@ -25,7 +24,6 @@ static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl); - static short rtllib_is_54g(struct rtllib_network *net) { return (net->rates_ex_len > 0) || (net->rates_len > 4); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/1] staging: coding style cleanups for staging/iio/light/tsl2583 driver
On 28/02/16 08:28, Bijosh Thykkoottathil wrote: > This patch fixes following coding style warning reported by check patch > script, in tsl2583 driver: > - Block comments use a trailing */ on a separate line > > Signed-off-by: Bijosh Thykkoottathil Hi Bijosh, When issuing new revisions of a patch it is best to put a brief summary of what the changes were from the previous version (under the --- normally) I haven't even tried to figure out what the difference is between the 3 revisions you sent this morning. If you are sending a revision without any changes (usually due to a formatting error or similar - please reply to the original thread with a quick notes saying what was wrong and that you are going to send a new version - that way we don't accidentally review the previous version) Also, if cleaning up comment style like this, please read the style guide as the start of these comments are all wrong as well and should be fixed in the same patch. Thanks, Jonathan > --- > drivers/staging/iio/light/tsl2583.c | 15 ++- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/iio/light/tsl2583.c > b/drivers/staging/iio/light/tsl2583.c > index 3100d96..9159298 100644 > --- a/drivers/staging/iio/light/tsl2583.c > +++ b/drivers/staging/iio/light/tsl2583.c > @@ -241,7 +241,8 @@ static int taos_get_lux(struct iio_dev *indio_dev) > } > > /* clear status, really interrupt status (interrupts are off), but > - * we use the bit anyway - don't forget 0x80 - this is a command*/ > + * we use the bit anyway - don't forget 0x80 - this is a command > + */ > ret = i2c_smbus_write_byte(chip->client, > (TSL258X_CMD_REG | TSL258X_CMD_SPL_FN | > TSL258X_CMD_ALS_INT_CLR)); > @@ -430,7 +431,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) > chip->als_time_scale = (als_time + 25) / 50; > > /* TSL258x Specific power-on / adc enable sequence > - * Power on the device 1st. */ > + * Power on the device 1st. > + */ > utmp = TSL258X_CNTL_PWR_ON; > ret = i2c_smbus_write_byte_data(chip->client, > TSL258X_CMD_REG | TSL258X_CNTRL, utmp); > @@ -440,7 +442,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) > } > > /* Use the following shadow copy for our delay before enabling ADC. > - * Write all the registers. */ > + * Write all the registers. > + */ > for (i = 0, uP = chip->taos_config; i < TSL258X_REG_MAX; i++) { > ret = i2c_smbus_write_byte_data(chip->client, > TSL258X_CMD_REG + i, > @@ -454,7 +457,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) > > usleep_range(3000, 3500); > /* NOW enable the ADC > - * initialize the desired mode of operation */ > + * initialize the desired mode of operation > + */ > utmp = TSL258X_CNTL_PWR_ON | TSL258X_CNTL_ADC_ENBL; > ret = i2c_smbus_write_byte_data(chip->client, > TSL258X_CMD_REG | TSL258X_CNTRL, > @@ -696,7 +700,8 @@ static ssize_t taos_luxtable_show(struct device *dev, > taos_device_lux[i].ch1); > if (taos_device_lux[i].ratio == 0) { > /* We just printed the first "0" entry. > - * Now get rid of the extra "," and break. */ > + * Now get rid of the extra "," and break. > + */ > offset--; > break; > } > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192e: rtllib_softmac.c: Remove multiple blank lines
Fixed multiple blank lines issues reported by checkpatch.pl Signed-off-by: Tapan Prakash T --- drivers/staging/rtl8192e/rtllib_softmac.c | 62 --- 1 file changed, 62 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 25b5b5e..cf2258e 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -142,7 +142,6 @@ static void enqueue_mgmt(struct rtllib_device *ieee, struct sk_buff *skb) */ ieee->mgmt_queue_head = nh; ieee->mgmt_queue_ring[nh] = skb; - } static void init_mgmt_queue(struct rtllib_device *ieee) @@ -150,7 +149,6 @@ static void init_mgmt_queue(struct rtllib_device *ieee) ieee->mgmt_queue_tail = ieee->mgmt_queue_head = 0; } - u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) { @@ -158,7 +156,6 @@ MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) u8 QueryRate = 0; u8 BasicRate; - for (i = 0; i < ieee->current_network.rates_len; i++) { BasicRate = ieee->current_network.rates[i]&0x7F; if (!rtllib_is_cck_rate(BasicRate)) { @@ -289,7 +286,6 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, type = WLAN_FC_GET_TYPE(fc); stype = WLAN_FC_GET_STYPE(fc); - if (stype != RTLLIB_STYPE_PSPOLL) tcb_desc->queue_index = MGNT_QUEUE; else @@ -298,7 +294,6 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, if (ieee->disable_mgnt_queue) tcb_desc->queue_index = HIGH_QUEUE; - tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); tcb_desc->RATRIndex = 7; tcb_desc->bTxDisableRateFallBack = 1; @@ -311,7 +306,6 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, ieee->seq_ctrl[0] = 0; else ieee->seq_ctrl[0]++; - } /* avoid watchdog triggers */ ieee->softmac_data_hard_start_xmit(skb, ieee->dev, @@ -327,7 +321,6 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, ieee->seq_ctrl[0]++; } ieee->softmac_hard_start_xmit(skb, ieee->dev); - } } @@ -392,7 +385,6 @@ static void rtllib_send_beacon(struct rtllib_device *ieee) (msecs_to_jiffies(ieee->current_network.beacon_interval - 5))); } - static void rtllib_send_beacon_cb(unsigned long _ieee) { struct rtllib_device *ieee = @@ -415,7 +407,6 @@ void rtllib_EnableNetMonitorMode(struct net_device *dev, ieee->AllowAllDestAddrHandler(dev, true, !bInitState); } - /* Disables network monitor mode. Only packets destinated to * us will be received. */ @@ -429,7 +420,6 @@ void rtllib_DisableNetMonitorMode(struct net_device *dev, ieee->AllowAllDestAddrHandler(dev, false, !bInitState); } - /* Enables the specialized promiscuous mode required by Intel. * In this mode, Intel intends to hear traffics from/to other STAs in the * same BSS. Therefore we don't have to disable checking BSSID and we only need @@ -453,7 +443,6 @@ void rtllib_EnableIntelPromiscuousMode(struct net_device *dev, } EXPORT_SYMBOL(rtllib_EnableIntelPromiscuousMode); - /* Disables the specialized promiscuous mode required by Intel. * See MgntEnableIntelPromiscuousMode for detail. */ @@ -485,7 +474,6 @@ static void rtllib_send_probe(struct rtllib_device *ieee, u8 is_mesh) } } - static void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh) { if (ieee->active_scan && (ieee->softmac_features & @@ -633,8 +621,6 @@ out1: up(&ieee->scan_sem); } - - static void rtllib_beacons_start(struct rtllib_device *ieee) { unsigned long flags; @@ -657,10 +643,8 @@ static void rtllib_beacons_stop(struct rtllib_device *ieee) del_timer_sync(&ieee->beacon_timer); spin_unlock_irqrestore(&ieee->beacon_lock, flags); - } - void rtllib_stop_send_beacons(struct rtllib_device *ieee) { if (ieee->stop_send_beacons) @@ -670,7 +654,6 @@ void rtllib_stop_send_beacons(struct rtllib_device *ieee) } EXPORT_SYMBOL(rtllib_stop_send_beacons); - void rtllib_start_send_beacons(struct rtllib_device *ieee) { if (ieee->start_send_beacons) @@ -680,7 +663,6 @@ void rtllib_start_send_beacons(struct rtllib_device *ieee) } EXPORT_SYMBOL(rtllib_start_send_beacons); - static void rtllib_softmac_stop_scan(struct rtllib_device *ieee) { down(&ieee->scan_sem); @@ -912,7 +894,6 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, if (encrypt) beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); - beacon_buf->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_RESP); beacon_buf->info_element[0].id = MFIE_TYPE_SSID; beaco
[PATCH] staging: rtl8192e: rtllib_softmac.c: Add necessary blank lines
Fixed blank lines related issues reported by checkpatch.pl Signed-off-by: Tapan Prakash T --- drivers/staging/rtl8192e/rtllib_softmac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 25b5b5e..ac46861 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1521,6 +1521,7 @@ static void rtllib_associate_complete_wq(void *data) struct rtllib_device, associate_complete_wq); struct rt_pwr_save_ctrl *pPSC = &(ieee->PowerSaveControl); + netdev_info(ieee->dev, "Associated successfully\n"); if (!ieee->is_silent_reset) { netdev_info(ieee->dev, "normal associate\n"); @@ -2755,6 +2756,7 @@ static void rtllib_link_change_wq(void *data) struct rtllib_device, link_change_wq); ieee->link_change(ieee->dev); } + /* called only in userspace context */ void rtllib_disassociate(struct rtllib_device *ieee) { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/1] staging: coding style cleanups for staging/iio/light/tsl2583 driver
On 28/02/16 17:12, Bijosh Thykkoottathil wrote: > Hi Jonathan, > > Thanks for your feed back. There was some typos in the previous commit > messages and corrected them in new version. > I will modify start of all these comments and resubmit the patch. Sometimes if the issue is minor you are better off replying to your original patch noting it and saying it will be fixed in the next version. Its not unheard of for people to get irritated by lots of versions of a patch turning up before they have had a chance to look at the first one. We all make mistakes like this and it's common to find just this sort of reply to a patch from the original author. Jonathan > > Regards, > -Bijosh. > >> Subject: Re: [PATCH v3 1/1] staging: coding style cleanups for >> staging/iio/light/tsl2583 driver >> To: bijos...@hotmail.com; gre...@linuxfoundation.org; knaac...@gmx.de; >> l...@metafoo.de; pme...@pmeerw.net >> CC: mahfouz.saif.elya...@gmail.com; de...@driverdev.osuosl.org; >> linux-...@vger.kernel.org; linux-ker...@vger.kernel.org >> From: ji...@kernel.org >> Date: Sun, 28 Feb 2016 16:38:14 + >> >> On 28/02/16 08:28, Bijosh Thykkoottathil wrote: >>> This patch fixes following coding style warning reported by check patch >>> script, in tsl2583 driver: >>> - Block comments use a trailing */ on a separate line >>> >>> Signed-off-by: Bijosh Thykkoottathil >> Hi Bijosh, >> >> When issuing new revisions of a patch it is best to put a brief >> summary of what the changes were from the previous version (under the --- >> normally) I haven't even tried to figure out what the difference is between >> the >> 3 revisions you sent this morning. If you are sending a revision without any >> changes (usually due to a formatting error or similar - please reply to the >> original >> thread with a quick notes saying what was wrong and that you are going to >> send a new >> version - that way we don't accidentally review the previous version) >> >> Also, if cleaning up comment style like this, please read the style guide as >> the >> start of these comments are all wrong as well and should be fixed in the >> same patch. >> >> Thanks, >> >> Jonathan >>> --- >>> drivers/staging/iio/light/tsl2583.c | 15 ++- >>> 1 file changed, 10 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/staging/iio/light/tsl2583.c >>> b/drivers/staging/iio/light/tsl2583.c >>> index 3100d96..9159298 100644 >>> --- a/drivers/staging/iio/light/tsl2583.c >>> +++ b/drivers/staging/iio/light/tsl2583.c >>> @@ -241,7 +241,8 @@ static int taos_get_lux(struct iio_dev *indio_dev) >>> } >>> >>> /* clear status, really interrupt status (interrupts are off), but >>> - * we use the bit anyway - don't forget 0x80 - this is a command*/ >>> + * we use the bit anyway - don't forget 0x80 - this is a command >>> + */ >>> ret = i2c_smbus_write_byte(chip->client, >>> (TSL258X_CMD_REG | TSL258X_CMD_SPL_FN | >>> TSL258X_CMD_ALS_INT_CLR)); >>> @@ -430,7 +431,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) >>> chip->als_time_scale = (als_time + 25) / 50; >>> >>> /* TSL258x Specific power-on / adc enable sequence >>> - * Power on the device 1st. */ >>> + * Power on the device 1st. >>> + */ >>> utmp = TSL258X_CNTL_PWR_ON; >>> ret = i2c_smbus_write_byte_data(chip->client, >>> TSL258X_CMD_REG | TSL258X_CNTRL, utmp); >>> @@ -440,7 +442,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) >>> } >>> >>> /* Use the following shadow copy for our delay before enabling ADC. >>> - * Write all the registers. */ >>> + * Write all the registers. >>> + */ >>> for (i = 0, uP = chip->taos_config; i < TSL258X_REG_MAX; i++) { >>> ret = i2c_smbus_write_byte_data(chip->client, >>> TSL258X_CMD_REG + i, >>> @@ -454,7 +457,8 @@ static int taos_chip_on(struct iio_dev *indio_dev) >>> >>> usleep_range(3000, 3500); >>> /* NOW enable the ADC >>> - * initialize the desired mode of operation */ >>> + * initialize the desired mode of operation >>> + */ >>> utmp = TSL258X_CNTL_PWR_ON | TSL258X_CNTL_ADC_ENBL; >>> ret = i2c_smbus_write_byte_data(chip->client, >>> TSL258X_CMD_REG | TSL258X_CNTRL, >>> @@ -696,7 +700,8 @@ static ssize_t taos_luxtable_show(struct device *dev, >>> taos_device_lux[i].ch1); >>> if (taos_device_lux[i].ratio == 0) { >>> /* We just printed the first "0" entry. >>> - * Now get rid of the extra "," and break. */ >>> + * Now get rid of the extra "," and break. >>> + */ >>> offset--; >>> break; >>> } >>> >> > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4 1/1] staging: coding style cleanups for staging/iio/light/tsl2583 driver
On 28 February 2016 17:31:11 GMT+00:00, Bijosh Thykkoottathil wrote: >This patch fixes following coding style warning reported by check patch >script, in tsl2583 driver: >- Block comments use a trailing */ on a separate line > >Signed-off-by: Bijosh Thykkoottathil Excellent. I have a pull request out at the moment, so may be a few days before I apply this. Jonathan >--- >drivers/staging/iio/light/tsl2583.c | 30 -- > 1 file changed, 20 insertions(+), 10 deletions(-) > >diff --git a/drivers/staging/iio/light/tsl2583.c >b/drivers/staging/iio/light/tsl2583.c >index 3100d96..8c9e304 100644 >--- a/drivers/staging/iio/light/tsl2583.c >+++ b/drivers/staging/iio/light/tsl2583.c >@@ -240,8 +240,10 @@ static int taos_get_lux(struct iio_dev *indio_dev) > } > } > >- /* clear status, really interrupt status (interrupts are off), but >- * we use the bit anyway - don't forget 0x80 - this is a command*/ >+ /* >+ * Clear status, really interrupt status (interrupts are off), but >+ * we use the bit anyway - don't forget 0x80 - this is a command >+ */ > ret = i2c_smbus_write_byte(chip->client, > (TSL258X_CMD_REG | TSL258X_CMD_SPL_FN | > TSL258X_CMD_ALS_INT_CLR)); >@@ -429,8 +431,10 @@ static int taos_chip_on(struct iio_dev *indio_dev) > chip->als_saturation = als_count * 922; /* 90% of full scale */ > chip->als_time_scale = (als_time + 25) / 50; > >- /* TSL258x Specific power-on / adc enable sequence >- * Power on the device 1st. */ >+ /* >+ * TSL258x Specific power-on / adc enable sequence >+ * Power on the device 1st. >+ */ > utmp = TSL258X_CNTL_PWR_ON; > ret = i2c_smbus_write_byte_data(chip->client, > TSL258X_CMD_REG | TSL258X_CNTRL, utmp); >@@ -439,8 +443,10 @@ static int taos_chip_on(struct iio_dev *indio_dev) > return ret; > } > >- /* Use the following shadow copy for our delay before enabling ADC. >- * Write all the registers. */ >+ /* >+ * Use the following shadow copy for our delay before enabling ADC. >+ * Write all the registers. >+ */ > for (i = 0, uP = chip->taos_config; i < TSL258X_REG_MAX; i++) { > ret = i2c_smbus_write_byte_data(chip->client, > TSL258X_CMD_REG + i, >@@ -453,8 +459,10 @@ static int taos_chip_on(struct iio_dev *indio_dev) > } > > usleep_range(3000, 3500); >- /* NOW enable the ADC >- * initialize the desired mode of operation */ >+ /* >+ * NOW enable the ADC >+ * initialize the desired mode of operation >+ */ > utmp = TSL258X_CNTL_PWR_ON | TSL258X_CNTL_ADC_ENBL; > ret = i2c_smbus_write_byte_data(chip->client, > TSL258X_CMD_REG | TSL258X_CNTRL, >@@ -695,8 +703,10 @@ static ssize_t taos_luxtable_show(struct device >*dev, > taos_device_lux[i].ch0, > taos_device_lux[i].ch1); > if (taos_device_lux[i].ratio == 0) { >- /* We just printed the first "0" entry. >- * Now get rid of the extra "," and break. */ >+ /* >+ * We just printed the first "0" entry. >+ * Now get rid of the extra "," and break. >+ */ > offset--; > break; > } -- Sent from my Android device with K-9 Mail. Please excuse my brevity. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [RFC] staging: unisys: visorbus: visorchipset: Remove create_singlethread_workqueue()
> -Original Message- > From: Amitoj Kaur Chawla [mailto:amitoj1...@gmail.com] > Sent: Sunday, February 28, 2016 7:44 AM > To: Romer, Benjamin M ; > jes.soren...@redhat.com; Arfvidson, Erik ; > Kershner, David A ; j...@redhat.com; Sell, > Timothy C ; Thompson, Bryan E. > ; dzic...@redhat.com; > kenneth.de...@unisys.com; gre...@linuxfoundation.org; *S-Par- > Maintainer ; de...@driverdev.osuosl.org; > linux-ker...@vger.kernel.org > Cc: t...@kernel.org; outreachy-ker...@googlegroups.com > Subject: [RFC] staging: unisys: visorbus: visorchipset: Remove > create_singlethread_workqueue() > > With concurrency managed workqueues, use of dedicated workqueues > can be replaced by using system_wq. Drop periodic_controlvm_workqueue > by using system_wq. > > Since there is only one work item periodic_controlvm_work and > different periodic_controlvm_works do not need to be ordered, increase > of concurrency level by switching to system_wq should not break anything. > > cancel_delayed_work_sync() is used to ensure that work is not pending > or executing on any CPU. > > Signed-off-by: Amitoj Kaur Chawla > Acked-by: Tejun Heo Tested on s-Par system, no issues found. Tested-by: David Kershner > --- > Only compile tested. > > drivers/staging/unisys/visorbus/visorchipset.c | 23 --- > 1 file changed, 4 insertions(+), 19 deletions(-) > > diff --git a/drivers/staging/unisys/visorbus/visorchipset.c > b/drivers/staging/unisys/visorbus/visorchipset.c > index b75b063..c4c71c6 100644 > --- a/drivers/staging/unisys/visorbus/visorchipset.c > +++ b/drivers/staging/unisys/visorbus/visorchipset.c > @@ -102,7 +102,6 @@ struct parser_context { > }; > > static struct delayed_work periodic_controlvm_work; > -static struct workqueue_struct *periodic_controlvm_workqueue; > static DEFINE_SEMAPHORE(notifier_lock); > > static struct cdev file_cdev; > @@ -1913,8 +1912,7 @@ cleanup: > poll_jiffies = > POLLJIFFIES_CONTROLVMCHANNEL_FAST; > } > > - queue_delayed_work(periodic_controlvm_workqueue, > -&periodic_controlvm_work, poll_jiffies); > + schedule_delayed_work(&periodic_controlvm_work, poll_jiffies); > } > > static void > @@ -2011,8 +2009,7 @@ cleanup: > > poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW; > > - queue_delayed_work(periodic_controlvm_workqueue, > -&periodic_controlvm_work, poll_jiffies); > + schedule_delayed_work(&periodic_controlvm_work, poll_jiffies); > } > > static void > @@ -2299,19 +2296,10 @@ visorchipset_init(struct acpi_device > *acpi_device) > else > INIT_DELAYED_WORK(&periodic_controlvm_work, > controlvm_periodic_work); > - periodic_controlvm_workqueue = > - create_singlethread_workqueue("visorchipset_controlvm"); > > - if (!periodic_controlvm_workqueue) { > - POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC, > - DIAG_SEVERITY_ERR); > - rc = -ENOMEM; > - goto cleanup; > - } > most_recent_message_jiffies = jiffies; > poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; > - queue_delayed_work(periodic_controlvm_workqueue, > -&periodic_controlvm_work, poll_jiffies); > + schedule_delayed_work(&periodic_controlvm_work, poll_jiffies); > > visorchipset_platform_device.dev.devt = major_dev; > if (platform_device_register(&visorchipset_platform_device) < 0) { > @@ -2346,10 +2334,7 @@ visorchipset_exit(struct acpi_device *acpi_device) > > visorbus_exit(); > > - cancel_delayed_work(&periodic_controlvm_work); > - flush_workqueue(periodic_controlvm_workqueue); > - destroy_workqueue(periodic_controlvm_workqueue); > - periodic_controlvm_workqueue = NULL; > + cancel_delayed_work_sync(&periodic_controlvm_work); > destroy_controlvm_payload_info(&controlvm_payload_info); > > memset(&g_chipset_msg_hdr, 0, sizeof(struct > controlvm_message_header)); > -- > 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [RFC] staging: unisys: visornic: Remove create_singlethread_workqueue()
> -Original Message- > From: Amitoj Kaur Chawla [mailto:amitoj1...@gmail.com] > Sent: Sunday, February 28, 2016 7:57 AM > To: Romer, Benjamin M ; > jes.soren...@redhat.com; Arfvidson, Erik ; > Kershner, David A ; j...@redhat.com; Sell, > Timothy C ; Thompson, Bryan E. > ; dzic...@redhat.com; > gre...@linuxfoundation.org; *S-Par-Maintainer > ; de...@driverdev.osuosl.org; linux- > ker...@vger.kernel.org > Cc: t...@kernel.org; outreachy-ker...@googlegroups.com > Subject: [RFC] staging: unisys: visornic: Remove > create_singlethread_workqueue() > > With concurrency managed workqueues, use of dedicated workqueues > can be replaced by using system_wq. > Drop visornic_timeout_reset_workqueue by using system_wq. > > Since there is only one work item per devdata and different > devdatas do not need to be ordered, increase of concurrency > level by switching to system_wq should not break anything. > > cancel_work_sync() is used to ensure that work is not pending or > executing on any CPU. > > Signed-off-by: Amitoj Kaur Chawla > Acked-by: Tejun Heo Tested on s-Par system, no issues found. Tested-by: David Kershner > --- > Only compile tested. > > drivers/staging/unisys/visornic/visornic_main.c | 21 ++--- > 1 file changed, 2 insertions(+), 19 deletions(-) > > diff --git a/drivers/staging/unisys/visornic/visornic_main.c > b/drivers/staging/unisys/visornic/visornic_main.c > index df4f688..6749c4e 100644 > --- a/drivers/staging/unisys/visornic/visornic_main.c > +++ b/drivers/staging/unisys/visornic/visornic_main.c > @@ -59,8 +59,6 @@ static const struct file_operations > debugfs_enable_ints_fops = { > .write = enable_ints_write, > }; > > -static struct workqueue_struct *visornic_timeout_reset_workqueue; > - > /* GUIDS for director channel type supported by this driver. */ > static struct visor_channeltype_descriptor visornic_channel_types[] = { > /* Note that the only channel type we expect to be reported by the > @@ -1070,7 +1068,7 @@ visornic_xmit_timeout(struct net_device *netdev) > spin_unlock_irqrestore(&devdata->priv_lock, flags); > return; > } > - queue_work(visornic_timeout_reset_workqueue, &devdata- > >timeout_reset); > + schedule_work(&devdata->timeout_reset); > spin_unlock_irqrestore(&devdata->priv_lock, flags); > } > > @@ -1998,7 +1996,7 @@ static void visornic_remove(struct visor_device > *dev) > } > > /* going_away prevents new items being added to the workqueues > */ > - flush_workqueue(visornic_timeout_reset_workqueue); > + cancel_work_sync(&devdata->timeout_reset); > > debugfs_remove_recursive(devdata->eth_debugfs_dir); > > @@ -2117,21 +2115,10 @@ static int visornic_init(void) > if (!ret) > goto cleanup_debugfs; > > - /* create workqueue for tx timeout reset */ > - visornic_timeout_reset_workqueue = > - create_singlethread_workqueue("visornic_timeout_reset"); > - if (!visornic_timeout_reset_workqueue) > - goto cleanup_workqueue; > - > err = visorbus_register_visor_driver(&visornic_driver); > if (!err) > return 0; > > -cleanup_workqueue: > - if (visornic_timeout_reset_workqueue) { > - flush_workqueue(visornic_timeout_reset_workqueue); > - destroy_workqueue(visornic_timeout_reset_workqueue); > - } > cleanup_debugfs: > debugfs_remove_recursive(visornic_debugfs_dir); > > @@ -2147,10 +2134,6 @@ static void visornic_cleanup(void) > { > visorbus_unregister_visor_driver(&visornic_driver); > > - if (visornic_timeout_reset_workqueue) { > - flush_workqueue(visornic_timeout_reset_workqueue); > - destroy_workqueue(visornic_timeout_reset_workqueue); > - } > debugfs_remove_recursive(visornic_debugfs_dir); > } > > -- > 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: dgnc: use pointer type of tty_struct
>From 70f8703b3bd73fa56f4ea91e98967b8925550aa6 Mon Sep 17 00:00:00 2001 From: Daeseok Youn Date: Thu, 25 Feb 2016 14:53:37 +0900 Subject: [PATCH 1/2] staging: dgnc: use pointer type of tty_struct For using tty_alloc_driver, SerialDriver has to be pointer type. It also has checkpatch.pl warning about Camelcase, so SerialDriver is changed to serial_driver. Signed-off-by: Daeseok Youn --- drivers/staging/dgnc/dgnc_driver.h | 4 +- drivers/staging/dgnc/dgnc_tty.c| 118 ++--- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index ce7cd9b..1c7a8fa 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -205,9 +205,9 @@ struct dgnc_board { * to our channels. */ - struct tty_driver SerialDriver; + struct tty_driver *serial_driver; charSerialName[200]; - struct tty_driver PrintDriver; + struct tty_driver *print_driver; charPrintName[200]; booldgnc_Major_Serial_Registered; diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 8b1ba65..01a0018 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -178,20 +178,20 @@ int dgnc_tty_register(struct dgnc_board *brd) { int rc = 0; - brd->SerialDriver.magic = TTY_DRIVER_MAGIC; + brd->serial_driver->magic = TTY_DRIVER_MAGIC; snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgnc_%d_", brd->boardnum); - brd->SerialDriver.name = brd->SerialName; - brd->SerialDriver.name_base = 0; - brd->SerialDriver.major = 0; - brd->SerialDriver.minor_start = 0; - brd->SerialDriver.num = brd->maxports; - brd->SerialDriver.type = TTY_DRIVER_TYPE_SERIAL; - brd->SerialDriver.subtype = SERIAL_TYPE_NORMAL; - brd->SerialDriver.init_termios = DgncDefaultTermios; - brd->SerialDriver.driver_name = DRVSTR; - brd->SerialDriver.flags = (TTY_DRIVER_REAL_RAW | + brd->serial_driver->name = brd->SerialName; + brd->serial_driver->name_base = 0; + brd->serial_driver->major = 0; + brd->serial_driver->minor_start = 0; + brd->serial_driver->num = brd->maxports; + brd->serial_driver->type = TTY_DRIVER_TYPE_SERIAL; + brd->serial_driver->subtype = SERIAL_TYPE_NORMAL; + brd->serial_driver->init_termios = DgncDefaultTermios; + brd->serial_driver->driver_name = DRVSTR; + brd->serial_driver->flags = (TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_HARDWARE_BREAK); @@ -199,28 +199,28 @@ int dgnc_tty_register(struct dgnc_board *brd) * The kernel wants space to store pointers to * tty_struct's and termios's. */ - brd->SerialDriver.ttys = kcalloc(brd->maxports, -sizeof(*brd->SerialDriver.ttys), + brd->serial_driver->ttys = kcalloc(brd->maxports, +sizeof(*brd->serial_driver->ttys), GFP_KERNEL); - if (!brd->SerialDriver.ttys) + if (!brd->serial_driver->ttys) return -ENOMEM; - kref_init(&brd->SerialDriver.kref); - brd->SerialDriver.termios = kcalloc(brd->maxports, - sizeof(*brd->SerialDriver.termios), + kref_init(&brd->serial_driver->kref); + brd->serial_driver->termios = kcalloc(brd->maxports, + sizeof(*brd->serial_driver->termios), GFP_KERNEL); - if (!brd->SerialDriver.termios) + if (!brd->serial_driver->termios) return -ENOMEM; /* * Entry points for driver. Called by the kernel from * tty_io.c and n_tty.c. */ - tty_set_operations(&brd->SerialDriver, &dgnc_tty_ops); + tty_set_operations(brd->serial_driver, &dgnc_tty_ops); if (!brd->dgnc_Major_Serial_Registered) { /* Register tty devices */ - rc = tty_register_driver(&brd->SerialDriver); + rc = tty_register_driver(brd->serial_driver); if (rc < 0) { dev_dbg(&brd->pdev->dev, "Can't register tty device (%d)\n", rc); @@ -234,19 +234,19 @@ int dgnc_tty_register(struct dgnc_board *brd) * again, separately so we don't get the LD confused about what major * we are when we get into the dgnc_tty_open() routine. */ - brd->PrintDriver.magic = TTY_DRIVER_MAGIC; + brd->print_driver->magic = TTY_DRIVER_MAGIC; snprintf(brd->PrintName, MAXTTYNAMELEN, "pr_dgnc_%d
[PATCH 2/2] staging: dgap: use tty_alloc_driver instead of kcalloc
>From 60b1e6e5d9401f10f584928d4feeb8a3b72b46a9 Mon Sep 17 00:00:00 2001 From: Daeseok Youn Date: Mon, 29 Feb 2016 11:04:02 +0900 Subject: [PATCH 2/2] staging: dgap: use tty_alloc_driver instead of kcalloc the tty_alloc_driver() can allocate memory for ttys and termios. And also it can release allocated memory easly with using put_tty_driver(). Signed-off-by: Daeseok Youn --- drivers/staging/dgnc/dgnc_tty.c | 86 +++-- 1 file changed, 31 insertions(+), 55 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 01a0018..da5cba7 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -176,9 +176,15 @@ int dgnc_tty_preinit(void) */ int dgnc_tty_register(struct dgnc_board *brd) { - int rc = 0; + int rc; + + brd->serial_driver = tty_alloc_driver(brd->maxports, + TTY_DRIVER_REAL_RAW | + TTY_DRIVER_DYNAMIC_DEV | + TTY_DRIVER_HARDWARE_BREAK); - brd->serial_driver->magic = TTY_DRIVER_MAGIC; + if (IS_ERR(brd->serial_driver)) + return PTR_ERR(brd->serial_driver); snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgnc_%d_", brd->boardnum); @@ -186,31 +192,10 @@ int dgnc_tty_register(struct dgnc_board *brd) brd->serial_driver->name_base = 0; brd->serial_driver->major = 0; brd->serial_driver->minor_start = 0; - brd->serial_driver->num = brd->maxports; brd->serial_driver->type = TTY_DRIVER_TYPE_SERIAL; brd->serial_driver->subtype = SERIAL_TYPE_NORMAL; brd->serial_driver->init_termios = DgncDefaultTermios; brd->serial_driver->driver_name = DRVSTR; - brd->serial_driver->flags = (TTY_DRIVER_REAL_RAW | - TTY_DRIVER_DYNAMIC_DEV | - TTY_DRIVER_HARDWARE_BREAK); - - /* -* The kernel wants space to store pointers to -* tty_struct's and termios's. -*/ - brd->serial_driver->ttys = kcalloc(brd->maxports, -sizeof(*brd->serial_driver->ttys), -GFP_KERNEL); - if (!brd->serial_driver->ttys) - return -ENOMEM; - - kref_init(&brd->serial_driver->kref); - brd->serial_driver->termios = kcalloc(brd->maxports, - sizeof(*brd->serial_driver->termios), - GFP_KERNEL); - if (!brd->serial_driver->termios) - return -ENOMEM; /* * Entry points for driver. Called by the kernel from @@ -224,7 +209,7 @@ int dgnc_tty_register(struct dgnc_board *brd) if (rc < 0) { dev_dbg(&brd->pdev->dev, "Can't register tty device (%d)\n", rc); - return rc; + goto free_serial_driver; } brd->dgnc_Major_Serial_Registered = true; } @@ -234,38 +219,26 @@ int dgnc_tty_register(struct dgnc_board *brd) * again, separately so we don't get the LD confused about what major * we are when we get into the dgnc_tty_open() routine. */ - brd->print_driver->magic = TTY_DRIVER_MAGIC; + brd->print_driver = tty_alloc_driver(brd->maxports, +TTY_DRIVER_REAL_RAW | +TTY_DRIVER_DYNAMIC_DEV | +TTY_DRIVER_HARDWARE_BREAK); + + if (IS_ERR(brd->print_driver)) { + rc = PTR_ERR(brd->print_driver); + goto unregister_serial_driver; + } + snprintf(brd->PrintName, MAXTTYNAMELEN, "pr_dgnc_%d_", brd->boardnum); brd->print_driver->name = brd->PrintName; brd->print_driver->name_base = 0; brd->print_driver->major = brd->serial_driver->major; brd->print_driver->minor_start = 0x80; - brd->print_driver->num = brd->maxports; brd->print_driver->type = TTY_DRIVER_TYPE_SERIAL; brd->print_driver->subtype = SERIAL_TYPE_NORMAL; brd->print_driver->init_termios = DgncDefaultTermios; brd->print_driver->driver_name = DRVSTR; - brd->print_driver->flags = (TTY_DRIVER_REAL_RAW | - TTY_DRIVER_DYNAMIC_DEV | - TTY_DRIVER_HARDWARE_BREAK); - - /* -* The kernel wants space to store pointers to -* tty_struct's and termios's. Must be separated from -* the Serial Driver so we don't get confused -*/ - brd->print_driver->ttys = kcalloc(brd->maxports, - sizeof(*brd->print_driver->ttys), - GFP_KERNEL); - if (!brd->p
THE INTERPOL HAVE CONFIRM THE TRUTH ABOUT YOUR FUND !!!!
THE INTERPOL HAVE CONFIRM THE TRUTH ABOUT YOUR FUND Dearest, I am INSPECTOR SCOTT STEVE Firstly i will introduce this commission (INTERPOL) International Police. We fight cyber crime, internet fraud, scam and money laundering in Africa, London, United State and Asian region. Our commission has been in existences since 2005 and our duty is to stop internet fraud. We have over 11,500 fraudsters in our Central prisons around UK, Asia and we are still on the lookout for more. We are aware that a lot of foreigners have been deceived and huge amounts of money have been lost to them. The Leaders of the UN Crime Fighters, have come together to inform the world what is going on and we have recovered over $ 422 Million Dollars (Four Hundred and Twenty two Million Dollars) from the people we have apprehended. Your reference (Email id) was given to us by one of the fraudsters in our detention room after serious investigation and our aim is to refund all lost funds to its legitimate owners. The UN(UNITED NATION)in collaboration with JP MORGAN CHASE BANK USA and OCBC BANK OF ASIA has approved a total of Five Hundred Thousand US Dollars only (US $ 500,000.00), as compensation to the loss that you incurred as this was a ceiling rate. Some suffered more while others suffered less and the idea is to restore back to the position that you would have been if not defrauded. In addition to the compensation amount approved in your favor is One Million US Dollars only (US $1,000.000,00), making it a total of One Million, Five Hundred Thousand US Dollars. This will be paid to you in the next few days. We still seek for others who feel they are wise and hope that you will be of assistance by giving us more information as per clue in apprehending them. The UN has issued instructions that foreign payment should be via ATM Visa prepaid Card only and no representative(s) will be accepted in order to avoid diversion of beneficiary's funds into their private account. We do hereby ask you to contact this office immediately with your personal data such as, Full name.. Address country Origin Company's name and position ... (if any) Present occupation... Mobile/phone number... for easer communication for ratification and to redeem your compensation. Regards INSPECTOR SCOTT STEVE INTERPOL & SCAM VICTIMS EMAIL :inspectorsco...@googlemail.com NB: (confidential) if this email is received accidentally and you are not a scam victim, please Ignore and do not respond ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
THE INTERPOL HAVE CONFIRM THE TRUTH ABOUT YOUR FUND !!!!
THE INTERPOL HAVE CONFIRM THE TRUTH ABOUT YOUR FUND Dearest, I am INSPECTOR SCOTT STEVE Firstly i will introduce this commission (INTERPOL) International Police. We fight cyber crime, internet fraud, scam and money laundering in Africa, London, United State and Asian region. Our commission has been in existences since 2005 and our duty is to stop internet fraud. We have over 11,500 fraudsters in our Central prisons around UK, Asia and we are still on the lookout for more. We are aware that a lot of foreigners have been deceived and huge amounts of money have been lost to them. The Leaders of the UN Crime Fighters, have come together to inform the world what is going on and we have recovered over $ 422 Million Dollars (Four Hundred and Twenty two Million Dollars) from the people we have apprehended. Your reference (Email id) was given to us by one of the fraudsters in our detention room after serious investigation and our aim is to refund all lost funds to its legitimate owners. The UN(UNITED NATION)in collaboration with JP MORGAN CHASE BANK USA and OCBC BANK OF ASIA has approved a total of Five Hundred Thousand US Dollars only (US $ 500,000.00), as compensation to the loss that you incurred as this was a ceiling rate. Some suffered more while others suffered less and the idea is to restore back to the position that you would have been if not defrauded. In addition to the compensation amount approved in your favor is One Million US Dollars only (US $1,000.000,00), making it a total of One Million, Five Hundred Thousand US Dollars. This will be paid to you in the next few days. We still seek for others who feel they are wise and hope that you will be of assistance by giving us more information as per clue in apprehending them. The UN has issued instructions that foreign payment should be via ATM Visa prepaid Card only and no representative(s) will be accepted in order to avoid diversion of beneficiary's funds into their private account. We do hereby ask you to contact this office immediately with your personal data such as, Full name.. Address country Origin Company's name and position ... (if any) Present occupation... Mobile/phone number... for easer communication for ratification and to redeem your compensation. Regards INSPECTOR SCOTT STEVE INTERPOL & SCAM VICTIMS EMAIL :inspectorsco...@googlemail.com NB: (confidential) if this email is received accidentally and you are not a scam victim, please Ignore and do not respond ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
THE INTERPOL HAVE CONFIRM THE TRUTH ABOUT YOUR FUND !!!!
THE INTERPOL HAVE CONFIRM THE TRUTH ABOUT YOUR FUND Dearest, I am INSPECTOR SCOTT STEVE Firstly i will introduce this commission (INTERPOL) International Police. We fight cyber crime, internet fraud, scam and money laundering in Africa, London, United State and Asian region. Our commission has been in existences since 2005 and our duty is to stop internet fraud. We have over 11,500 fraudsters in our Central prisons around UK, Asia and we are still on the lookout for more. We are aware that a lot of foreigners have been deceived and huge amounts of money have been lost to them. The Leaders of the UN Crime Fighters, have come together to inform the world what is going on and we have recovered over $422 Million Dollars (Four Hundred and Twenty two Million Dollars) from the people we have apprehended. Your reference (Email id) was given to us by one of the fraudsters in our detention room after serious investigation and our aim is to refund all lost funds to its legitimate owners. The UN(UNITED NATION)in collaboration with JP MORGAN CHASE BANK USA and OCBC BANK OF ASIA has approved a total of Five Hundred Thousand US Dollars only (US $ 500,000.00), as compensation to the loss that you incurred as this was a ceiling rate. Some suffered more while others suffered less and the idea is to restore back to the position that you would have been if not defrauded. In addition to the compensation amount approved in your favor is One Million US Dollars only (US $1,000.000,00), making it a total of One Million, Five Hundred Thousand US Dollars. This will be paid to you in the next few days. We still seek for others who feel they are wise and hope that you will be of assistance by giving us more information as per clue in apprehending them. The UN has issued instructions that foreign payment should be via ATM Visa prepaid Card only and no representative(s) will be accepted in order to avoid diversion of beneficiary's funds into their private account. We do hereby ask you to contact this office immediately with your personal data such as, Full name.. Address country Origin Company's name and position ... (if any) Present occupation... Mobile/phone number... for easer communication for ratification and to redeem your compensation. Regards INSPECTOR SCOTT STEVE INTERPOL & SCAM VICTIMS EMAIL :inspectorsco...@googlemail.com NB: (confidential) if this email is received accidentally and you are not a scam victim, please Ignore and do not respond ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
THE INTERPOL HAVE CONFIRM THE TRUTH ABOUT YOUR FUND !!!!
THE INTERPOL HAVE CONFIRM THE TRUTH ABOUT YOUR FUND Dearest, I am INSPECTOR SCOTT STEVE Firstly i will introduce this commission (INTERPOL) International Police. We fight cyber crime, internet fraud, scam and money laundering in Africa, London, United State and Asian region. Our commission has been in existences since 2005 and our duty is to stop internet fraud. We have over 11,500 fraudsters in our Central prisons around UK, Asia and we are still on the lookout for more. We are aware that a lot of foreigners have been deceived and huge amounts of money have been lost to them. The Leaders of the UN Crime Fighters, have come together to inform the world what is going on and we have recovered over $422 Million Dollars (Four Hundred and Twenty two Million Dollars) from the people we have apprehended. Your reference (Email id) was given to us by one of the fraudsters in our detention room after serious investigation and our aim is to refund all lost funds to its legitimate owners. The UN(UNITED NATION)in collaboration with JP MORGAN CHASE BANK USA and OCBC BANK OF ASIA has approved a total of Five Hundred Thousand US Dollars only (US $ 500,000.00), as compensation to the loss that you incurred as this was a ceiling rate. Some suffered more while others suffered less and the idea is to restore back to the position that you would have been if not defrauded. In addition to the compensation amount approved in your favor is One Million US Dollars only (US $1,000.000,00), making it a total of One Million, Five Hundred Thousand US Dollars. This will be paid to you in the next few days. We still seek for others who feel they are wise and hope that you will be of assistance by giving us more information as per clue in apprehending them. The UN has issued instructions that foreign payment should be via ATM Visa prepaid Card only and no representative(s) will be accepted in order to avoid diversion of beneficiary's funds into their private account. We do hereby ask you to contact this office immediately with your personal data such as, Full name.. Address country Origin Company's name and position ... (if any) Present occupation... Mobile/phone number... for easer communication for ratification and to redeem your compensation. Regards INSPECTOR SCOTT STEVE INTERPOL & SCAM VICTIMS EMAIL :inspectorsco...@googlemail.com NB: (confidential) if this email is received accidentally and you are not a scam victim, please Ignore and do not respond ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
INFORMAÇÃO IMPORTANTE RE: Consultoria de Investimento em sua Localidade.
Hallo Freund, Unsere Familie ist in die Anlage von Mitteln in Ihrem Ort interessiert . Mehr Informationen für Ihr Interesse . Grüße, Sir Henry Neville Lindley Keswick Vorsitzender von Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family Oi Amigo, INFORMAÇÃO IMPORTANTE Nossa família está interessada em investir fundos em sua localidade. Mais informações para você se interessou. Saudações, Sir Henry Neville Lindley Keswick Presidente da Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family = Hi friend, Our family is interested in investing funds in your locality. More information for you interest . Greetings, Sir Henry Neville Lindley Keswick Chairman of Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
INFORMAÇÃO IMPORTANTE RE: Consultoria de Investimento em sua Localidade.
Hallo Freund, Unsere Familie ist in die Anlage von Mitteln in Ihrem Ort interessiert . Mehr Informationen für Ihr Interesse . Grüße, Sir Henry Neville Lindley Keswick Vorsitzender von Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family Oi Amigo, INFORMAÇÃO IMPORTANTE Nossa família está interessada em investir fundos em sua localidade. Mais informações para você se interessou. Saudações, Sir Henry Neville Lindley Keswick Presidente da Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family = Hi friend, Our family is interested in investing funds in your locality. More information for you interest . Greetings, Sir Henry Neville Lindley Keswick Chairman of Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
INFORMAÇÃO IMPORTANTE RE: Consultoria de Investimento em sua Localidade.
Hallo Freund, Unsere Familie ist in die Anlage von Mitteln in Ihrem Ort interessiert . Mehr Informationen für Ihr Interesse . Grüße, Sir Henry Neville Lindley Keswick Vorsitzender von Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family Oi Amigo, INFORMAÇÃO IMPORTANTE Nossa família está interessada em investir fundos em sua localidade. Mais informações para você se interessou. Saudações, Sir Henry Neville Lindley Keswick Presidente da Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family = Hi friend, Our family is interested in investing funds in your locality. More information for you interest . Greetings, Sir Henry Neville Lindley Keswick Chairman of Jardine Matheson Holdings Ltd https://en.wikipedia.org/wiki/Keswick_family ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4 5/5] staging/android: add flags member to sync ioctl structs
On 27 February 2016 at 15:27, Gustavo Padovan wrote: > Hi Emil, > > 2016-02-27 Emil Velikov : > >> Hi Gustavo, >> >> On 26 February 2016 at 18:31, Gustavo Padovan wrote: >> > From: Gustavo Padovan >> > >> > Play safe and add flags member to all structs. So we don't need to >> > break API or create new IOCTL in the future if new features that requires >> > flags arises. >> > >> > v2: check if flags are valid (zero, in this case) >> > >> > Signed-off-by: Gustavo Padovan >> > --- >> > drivers/staging/android/sync.c | 7 ++- >> > drivers/staging/android/uapi/sync.h | 6 ++ >> > 2 files changed, 12 insertions(+), 1 deletion(-) >> > >> > diff --git a/drivers/staging/android/sync.c >> > b/drivers/staging/android/sync.c >> > index 837cff5..54fd5ab 100644 >> > --- a/drivers/staging/android/sync.c >> > +++ b/drivers/staging/android/sync.c >> > @@ -445,6 +445,11 @@ static long sync_file_ioctl_merge(struct sync_file >> > *sync_file, >> > goto err_put_fd; >> > } >> > >> > + if (data.flags) { >> > + err = -EFAULT; >> -EINVAL ? >> >> > + goto err_put_fd; >> > + } >> > + >> > fence2 = sync_file_fdget(data.fd2); >> > if (!fence2) { >> > err = -ENOENT; >> > @@ -511,7 +516,7 @@ static long sync_file_ioctl_fence_info(struct >> > sync_file *sync_file, >> > if (copy_from_user(&in, (void __user *)arg, sizeof(*info))) >> > return -EFAULT; >> > >> > - if (in.status || strcmp(in.name, "\0")) >> > + if (in.status || in.flags || strcmp(in.name, "\0")) >> > return -EFAULT; >> -EINVAL ? >> >> > >> > if (in.num_fences && !in.sync_fence_info) >> > diff --git a/drivers/staging/android/uapi/sync.h >> > b/drivers/staging/android/uapi/sync.h >> > index 9aad623..f56a6c2 100644 >> > --- a/drivers/staging/android/uapi/sync.h >> > +++ b/drivers/staging/android/uapi/sync.h >> > @@ -19,11 +19,13 @@ >> > * @fd2: file descriptor of second fence >> > * @name: name of new fence >> > * @fence: returns the fd of the new fence to userspace >> > + * @flags: merge_data flags >> > */ >> > struct sync_merge_data { >> > __s32 fd2; >> > charname[32]; >> > __s32 fence; >> > + __u32 flags; >> The overall size of the struct is not multiple of 64bit, so things >> will end up badly if we decide to extend it in the future. Even if >> there's a small chance that update will be needed, we might as well >> pad it now (and check the padding for zero, returning -EINVAL). > > I think name could be the first field here. > Up-to you really. I'm afraid that it doesn't resolve the issue :-( As a test add a u64 value at the end of the struct and check the output of pahole for 32 and 64 bit build. >> >> > }; >> > >> > /** >> > @@ -31,12 +33,14 @@ struct sync_merge_data { >> > * @obj_name: name of parent sync_timeline >> > * @driver_name: name of driver implementing the parent >> > * @status:status of the fence 0:active 1:signaled <0:error >> > + * @flags: fence_info flags >> > * @timestamp_ns: timestamp of status change in nanoseconds >> > */ >> > struct sync_fence_info { >> > charobj_name[32]; >> > chardriver_name[32]; >> > __s32 status; >> > + __u32 flags; >> > __u64 timestamp_ns; >> Should we be doing some form of validation in sync_fill_fence_info() >> of 'flags' ? > > Do you think it is necessary? The kernel allocates a zero'ed buffer to > fill sync_fence_info array. > Good point. Missed out the z in kzalloc :-) -Emil ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel