[PATCH 2/5] staging: fsl-mc: abstract test for whether a dprc is a root dprc
From: Itai Katz Instead of relying on assumptions about fields in data structures, abstract the test for whether a dprc is a root dprc into a function. Signed-off-by: Itai Katz --- drivers/staging/fsl-mc/bus/mc-bus.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c index 2aaeb3a..6a6c5a6 100644 --- a/drivers/staging/fsl-mc/bus/mc-bus.c +++ b/drivers/staging/fsl-mc/bus/mc-bus.c @@ -22,6 +22,8 @@ static struct kmem_cache *mc_dev_cache; +static bool fsl_mc_is_root_dprc(struct device *dev); + /** * fsl_mc_bus_match - device to driver matching callback * @dev: the MC object device structure to match against @@ -50,7 +52,7 @@ static int fsl_mc_bus_match(struct device *dev, struct device_driver *drv) * Only exception is the root DPRC, which is a special case. */ if ((mc_dev->obj_desc.state & DPRC_OBJ_STATE_PLUGGED) == 0 && - &mc_dev->dev != fsl_mc_bus_type.dev_root) + !fsl_mc_is_root_dprc(&mc_dev->dev)) goto out; /* @@ -215,6 +217,14 @@ bool fsl_mc_bus_exists(void) } EXPORT_SYMBOL_GPL(fsl_mc_bus_exists); +/** + * fsl_mc_is_root_dprc - function to check if a given device is a root dprc + */ +static bool fsl_mc_is_root_dprc(struct device *dev) +{ + return dev == fsl_mc_bus_type.dev_root; +} + static int get_dprc_icid(struct fsl_mc_io *mc_io, int container_id, u16 *icid) { @@ -500,7 +510,7 @@ void fsl_mc_device_remove(struct fsl_mc_device *mc_dev) mc_dev->mc_io = NULL; } - if (&mc_dev->dev == fsl_mc_bus_type.dev_root) + if (fsl_mc_is_root_dprc(&mc_dev->dev)) fsl_mc_bus_type.dev_root = NULL; } @@ -726,7 +736,7 @@ static int fsl_mc_bus_remove(struct platform_device *pdev) { struct fsl_mc *mc = platform_get_drvdata(pdev); - if (WARN_ON(&mc->root_mc_bus_dev->dev != fsl_mc_bus_type.dev_root)) + if (WARN_ON(!fsl_mc_is_root_dprc(&mc->root_mc_bus_dev->dev))) return -EINVAL; fsl_mc_device_remove(mc->root_mc_bus_dev); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging: fsl-mc: abstract test for existence of fsl-mc bus
From: Itai Katz Add function to test for existence of an fsl-mc bus instance instead of doing this by looking directly at a field in the bus type struct. Signed-off-by: Itai Katz --- drivers/staging/fsl-mc/bus/mc-bus.c | 13 +++-- drivers/staging/fsl-mc/include/mc.h |2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c index 92e0702..2aaeb3a 100644 --- a/drivers/staging/fsl-mc/bus/mc-bus.c +++ b/drivers/staging/fsl-mc/bus/mc-bus.c @@ -39,7 +39,7 @@ static int fsl_mc_bus_match(struct device *dev, struct device_driver *drv) bool major_version_mismatch = false; bool minor_version_mismatch = false; - if (WARN_ON(!fsl_mc_bus_type.dev_root)) + if (WARN_ON(!fsl_mc_bus_exists())) goto out; if (!mc_drv->match_id_table) @@ -206,6 +206,15 @@ void fsl_mc_driver_unregister(struct fsl_mc_driver *mc_driver) } EXPORT_SYMBOL_GPL(fsl_mc_driver_unregister); +/** + * fsl_mc_bus_exists - check if a root dprc exists + */ +bool fsl_mc_bus_exists(void) +{ + return fsl_mc_bus_type.dev_root; +} +EXPORT_SYMBOL_GPL(fsl_mc_bus_exists); + static int get_dprc_icid(struct fsl_mc_io *mc_io, int container_id, u16 *icid) { @@ -407,7 +416,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, mc_io2 = mc_io; - if (!fsl_mc_bus_type.dev_root) + if (!fsl_mc_bus_exists()) fsl_mc_bus_type.dev_root = &mc_dev->dev; } diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h index 860bf26..a933291 100644 --- a/drivers/staging/fsl-mc/include/mc.h +++ b/drivers/staging/fsl-mc/include/mc.h @@ -182,6 +182,8 @@ int __must_check __fsl_mc_driver_register(struct fsl_mc_driver *fsl_mc_driver, void fsl_mc_driver_unregister(struct fsl_mc_driver *driver); +bool fsl_mc_bus_exists(void); + int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, u16 mc_io_flags, struct fsl_mc_io **new_mc_io); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/5] staging: fsl-mc: multiple root DPRCs
From: Itai Katz This patch series adds support for supporting multiple root DPRCs, which is an item on the TODO list. (This situation can is possible when assigning multiple DPRCs to KVM virtual machines.) Patch 1 abstracts the test for existence of an fsl-mc bus instance into a function. Patch 2 abstracts the test for whether a dprc is a root dprc into a function. Patch 3 replaces use of the dev_root field in the bus type struct to identify the root dprc with a more flexible pointer traversal mechanism. Patch 4 adds a counter to track the number of root dprcs. Patch 5 removes all references to the now unused dev_root Itai Katz (5): staging: fsl-mc: abstract test for existence of fsl-mc bus staging: fsl-mc: abstract test for whether a dprc is a root dprc staging: fsl-mc: add function to return pointer to root dprc staging: fsl-mc: add counter to track number of root DPRCs staging: fsl-mc: remove references to dev_root drivers/staging/fsl-mc/bus/mc-bus.c | 74 ++- drivers/staging/fsl-mc/include/mc.h |2 + 2 files changed, 66 insertions(+), 10 deletions(-) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging: fsl-mc: add function to return pointer to root dprc
From: Itai Katz To support multiple root dprcs, instead of relying on the dev_root field of the bus type struct, instead create a function to traverse to the root dprc and return a pointer to the device struct Signed-off-by: Itai Katz --- drivers/staging/fsl-mc/bus/mc-bus.c | 38 +++ 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c index 6a6c5a6..37f51f3 100644 --- a/drivers/staging/fsl-mc/bus/mc-bus.c +++ b/drivers/staging/fsl-mc/bus/mc-bus.c @@ -218,11 +218,34 @@ bool fsl_mc_bus_exists(void) EXPORT_SYMBOL_GPL(fsl_mc_bus_exists); /** +* fsl_mc_get_root_dprc - function to traverse to the root dprc +*/ +static void fsl_mc_get_root_dprc(struct device *dev, +struct device **root_dprc_dev) +{ + if (WARN_ON(!dev)) { + *root_dprc_dev = NULL; + } else if (WARN_ON(dev->bus != &fsl_mc_bus_type)) { + *root_dprc_dev = NULL; + } else { + *root_dprc_dev = dev; + while ((*root_dprc_dev)->parent->bus == &fsl_mc_bus_type) + *root_dprc_dev = (*root_dprc_dev)->parent; + } +} + +/** * fsl_mc_is_root_dprc - function to check if a given device is a root dprc */ static bool fsl_mc_is_root_dprc(struct device *dev) { - return dev == fsl_mc_bus_type.dev_root; + struct device *root_dprc_dev; + + fsl_mc_get_root_dprc(dev, &root_dprc_dev); + if (!root_dprc_dev) + return false; + else + return dev == root_dprc_dev; } static int get_dprc_icid(struct fsl_mc_io *mc_io, @@ -253,11 +276,18 @@ common_cleanup: return error; } -static int translate_mc_addr(enum dprc_region_type mc_region_type, +static int translate_mc_addr(struct fsl_mc_device *mc_dev, +enum dprc_region_type mc_region_type, u64 mc_offset, phys_addr_t *phys_addr) { int i; - struct fsl_mc *mc = dev_get_drvdata(fsl_mc_bus_type.dev_root->parent); + struct device *root_dprc_dev; + struct fsl_mc *mc; + + fsl_mc_get_root_dprc(&mc_dev->dev, &root_dprc_dev); + if (WARN_ON(!root_dprc_dev)) + return -EINVAL; + mc = dev_get_drvdata(root_dprc_dev->parent); if (mc->num_translation_ranges == 0) { /* @@ -328,7 +358,7 @@ static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, } WARN_ON(region_desc.size == 0); - error = translate_mc_addr(mc_region_type, + error = translate_mc_addr(mc_dev, mc_region_type, region_desc.base_offset, ®ions[i].start); if (error < 0) { -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging: fsl-mc: remove references to dev_root
From: Itai Katz The dev_root field in the bus type struct has been replaced by a new mechanism to identify the root dprc. Remove all references to dev_root. Signed-off-by: Itai Katz --- drivers/staging/fsl-mc/bus/mc-bus.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c index 8a2b99c..fd13053 100644 --- a/drivers/staging/fsl-mc/bus/mc-bus.c +++ b/drivers/staging/fsl-mc/bus/mc-bus.c @@ -458,9 +458,6 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, mc_io2 = mc_io; - if (!fsl_mc_bus_exists()) - fsl_mc_bus_type.dev_root = &mc_dev->dev; - atomic_inc(&root_dprc_count); } @@ -545,7 +542,6 @@ void fsl_mc_device_remove(struct fsl_mc_device *mc_dev) } if (fsl_mc_is_root_dprc(&mc_dev->dev)) { - fsl_mc_bus_type.dev_root = NULL; if (atomic_read(&root_dprc_count) > 0) atomic_dec(&root_dprc_count); else -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] staging: fsl-mc: add counter to track number of root DPRCs
From: Itai Katz Add a counter to track the number of root DPRCs. When this counter is greater then 0 it means that at least one root DPRC device exists. Signed-off-by: Itai Katz --- drivers/staging/fsl-mc/bus/mc-bus.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c index 37f51f3..8a2b99c 100644 --- a/drivers/staging/fsl-mc/bus/mc-bus.c +++ b/drivers/staging/fsl-mc/bus/mc-bus.c @@ -109,6 +109,8 @@ struct bus_type fsl_mc_bus_type = { }; EXPORT_SYMBOL_GPL(fsl_mc_bus_type); +static atomic_t root_dprc_count = ATOMIC_INIT(0); + static int fsl_mc_driver_probe(struct device *dev) { struct fsl_mc_driver *mc_drv; @@ -213,7 +215,7 @@ EXPORT_SYMBOL_GPL(fsl_mc_driver_unregister); */ bool fsl_mc_bus_exists(void) { - return fsl_mc_bus_type.dev_root; + return atomic_read(&root_dprc_count) > 0; } EXPORT_SYMBOL_GPL(fsl_mc_bus_exists); @@ -458,6 +460,8 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, if (!fsl_mc_bus_exists()) fsl_mc_bus_type.dev_root = &mc_dev->dev; + + atomic_inc(&root_dprc_count); } error = get_dprc_icid(mc_io2, obj_desc->id, &mc_dev->icid); @@ -540,8 +544,13 @@ void fsl_mc_device_remove(struct fsl_mc_device *mc_dev) mc_dev->mc_io = NULL; } - if (fsl_mc_is_root_dprc(&mc_dev->dev)) + if (fsl_mc_is_root_dprc(&mc_dev->dev)) { fsl_mc_bus_type.dev_root = NULL; + if (atomic_read(&root_dprc_count) > 0) + atomic_dec(&root_dprc_count); + else + WARN_ON(1); + } } if (mc_bus) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rdma: Fix braces around if/else
On Sun, Oct 04, 2015 at 09:47:52AM +0300, Or Gerlitz wrote: > On 10/3/2015 11:55 PM, Martin Kletzander wrote: > >Get rid of all ELSE_AFTER_BRACE type errors reported by checkpatch.pl. > > Hi Greg, > > Is there a way to signal people/tools that a certain driver parks in staging > on their way **out** of the kernel > and not the other way around? I guess you (nor Doug) don't want to spend > time on fixing such drivers, right? I'm not spending the time :) But no, there isn't a way to really show that that I know of, and it's fine, we end up getting a number of "cleanup" patches for a kernel release or two before the drivers get deleted. It gets people involved in kernel development which is the key thing here, it's not like they are actually using these drivers... So it's fine, I take the patches, the people writing the patches are happy, and the code gets a bit nicer and feels better about itself before we kick it out the door. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 02/11] staging: dgnc: remove multiple blank lines
On Sat, Oct 03, 2015 at 08:52:40PM +0530, Sudip Mukherjee wrote: > checkpatch warns us about multiple blank lines which are not needed. > Remove them. > > Signed-off-by: Sudip Mukherjee > --- > drivers/staging/dgnc/dgnc_driver.c | 10 > drivers/staging/dgnc/dgnc_mgmt.c | 5 > drivers/staging/dgnc/dgnc_neo.c| 37 --- > drivers/staging/dgnc/dgnc_sysfs.c | 37 --- > drivers/staging/dgnc/dgnc_tty.c| 51 > -- > 5 files changed, 140 deletions(-) Due to other patches sent before your series, this, and some of the other patches in this series does not apply. Please rebase and resend the remaining patches. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 04/10] staging: wilc1000: replace PRINT_ER with pr_err
On Fri, Oct 02, 2015 at 09:44:50PM +0900, Chaehyun Lim wrote: > This patch replaces PRINT_ER with pr_err. > It would be better to use netdev_err, but it cannot use it in this > function, so just use pr_err. > > Signed-off-by: Chaehyun Lim > --- > drivers/staging/wilc1000/host_interface.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c > index 566e618..802d87a 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -5322,7 +5322,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, > u8 u8ChNum) > struct host_if_msg msg; > > if (!pstrWFIDrv) { > - PRINT_ER("driver is null\n"); > + pr_err("driver is null\n"); > return -EFAULT; > } I don't see how this check will ever trigger, do you? If not, it should just be removed. > > @@ -5334,7 +5334,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, > u8 u8ChNum) > > result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); > if (result) { > - PRINT_ER("wilc mq send fail\n"); > + pr_err("wilc mq send fail\n"); You should have a network device pointer somewhere here, dig around, it should be possible to use netdev_err(). thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 06/10] staging: wilc1000: rename hWFIDrv of host_int_set_mac_chnl_num
On Fri, Oct 02, 2015 at 09:44:52PM +0900, Chaehyun Lim wrote: > This patch replaces hWFIDrv with wfi_drv that is first argument of > host_int_set_mac_chnl_num to avoid camelcase. > > Signed-off-by: Chaehyun Lim > --- > drivers/staging/wilc1000/host_interface.c | 6 +++--- > drivers/staging/wilc1000/host_interface.h | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c > index 133bb2d..d23d2dd 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -5315,10 +5315,10 @@ s32 host_int_get_rx_power_level(tstrWILC_WFIDrv > *hWFIDrv, u8 *pu8RxPowerLevel, > * @date8 March 2012 > * @version 1.0 > */ > -int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 channel) > +int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel) > { > int result = 0; > - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; > + tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)wfi_drv; Not the issue here, but in the future, why is this cast needed? Heck, why is this local variable even needed, why not just use wifi_drv everywhere in this function? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/10] staging: wilc1000: use pr_err in host_int_wait_msg_queue_idle
On Fri, Oct 02, 2015 at 09:44:55PM +0900, Chaehyun Lim wrote: > This patch changes PRINT_ER by pr_err. > It would be better to use netdev_err, but it cannot use it in this > function, so just use pr_err. > > Signed-off-by: Chaehyun Lim > --- > drivers/staging/wilc1000/host_interface.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c > index 69a4e79..79014ab 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -5354,7 +5354,7 @@ int host_int_wait_msg_queue_idle(void) > msg.id = HOST_IF_MSG_Q_IDLE; > result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); > if (result) { > - PRINT_ER("wilc mq send fail\n"); > + pr_err("wilc mq send fail\n"); Same as before, you should be able to get to a network device, please use netdev_err(). ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] drivers: staging: wilc1000: Move spin lock to the start of critical section
On Sat, Oct 03, 2015 at 02:57:29PM +0530, Chandra S Gorentla wrote: > The spin_lock_irqsave is moved to just beginning of critical section. > This change moves a couple of return statements out of the lock. > > Signed-off-by: Chandra S Gorentla > --- > drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c > b/drivers/staging/wilc1000/wilc_msgqueue.c > index d5ebd6d..284a3f5 100644 > --- a/drivers/staging/wilc1000/wilc_msgqueue.c > +++ b/drivers/staging/wilc1000/wilc_msgqueue.c > @@ -72,8 +72,6 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, > goto ERRORHANDLER; > } > > - spin_lock_irqsave(&pHandle->strCriticalSection, flags); > - > /* construct a new message */ > pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); As you have moved the lock, can you also change this to GFP_KERNEL as well because we do not have a lock held? And how have you tested that this is ok? What is this lock trying to protect? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] drivers: staging: wilc1000: Call kfree only for error cases
On Sat, Oct 03, 2015 at 02:57:30PM +0530, Chandra S Gorentla wrote: > - kfree is being called for the members of the queue without >de-queuing them; they are just inserted within this function; >they are supposed to be de-queued and freed in a function >for receiving the queue items > - goto statements are removed > - After kfree correction, there is no need for target block >of goto statement; hence it is removed > > Signed-off-by: Chandra S Gorentla > --- > drivers/staging/wilc1000/wilc_msgqueue.c | 22 ++ > 1 file changed, 6 insertions(+), 16 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c > b/drivers/staging/wilc1000/wilc_msgqueue.c > index 284a3f5..eae90be 100644 > --- a/drivers/staging/wilc1000/wilc_msgqueue.c > +++ b/drivers/staging/wilc1000/wilc_msgqueue.c > @@ -56,32 +56,30 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle) > int wilc_mq_send(WILC_MsgQueueHandle *pHandle, >const void *pvSendBuffer, u32 u32SendBufferSize) > { > - int result = 0; > unsigned long flags; > Message *pstrMessage = NULL; > > if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) { > PRINT_ER("pHandle or pvSendBuffer is null\n"); > - result = -EFAULT; > - goto ERRORHANDLER; > + return -EFAULT; > } > > if (pHandle->bExiting) { > PRINT_ER("pHandle fail\n"); > - result = -EFAULT; > - goto ERRORHANDLER; > + return -EFAULT; > } > > /* construct a new message */ > pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); > if (!pstrMessage) > return -ENOMEM; > + > pstrMessage->u32Length = u32SendBufferSize; > pstrMessage->pstrNext = NULL; > pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC); > if (!pstrMessage->pvBuffer) { > - result = -ENOMEM; > - goto ERRORHANDLER; > + kfree(pstrMessage); > + return -ENOMEM; > } > memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize); > > @@ -102,15 +100,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, > spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); > > up(&pHandle->hSem); > - > -ERRORHANDLER: > - /* error occured, free any allocations */ > - if (pstrMessage) { > - kfree(pstrMessage->pvBuffer); > - kfree(pstrMessage); > - } > - > - return result; > + return 0; Aren't you now leaking memory as you aren't freeing pstrMessage and the buffer on the "normal" return path? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: Fix Sparse errors in rtl8723a_cmd.c
On Fri, Oct 02, 2015 at 08:36:28PM -0400, Jacob Kiefer wrote: > From: Jacob Kiefer > > This patch fixes the following sparse errors: > > > CHECK drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > ... > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25: warning: incorrect type > in assignment (different base types) > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25:expected unsigned int > [unsigned] [usertype] > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25:got restricted __le32 > [usertype] > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:130:14: warning: incorrect type > in assignment (different base types) > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:130:14:expected unsigned int > [unsigned] [usertype] mask > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:130:14:got restricted __le32 > [usertype] > CC [M] drivers/staging/rtl8723au/hal/rtl8723a_cmd.o > > Signed-off-by: Jacob Kiefer > --- > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > index 9733aa6..111a24d 100644 > --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > @@ -115,9 +115,11 @@ exit: > > int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param) > { > - *((u32 *)param) = cpu_to_le32(*((u32 *)param)); > + __le32 leparam; Why __le32? Does this variable go across the user/kernel boundry somehow? If not, just use le32. > > - FillH2CCmd(padapter, RSSI_SETTING_EID, 3, param); > + leparam = cpu_to_le32(*((u32 *)param)); > + > + FillH2CCmd(padapter, RSSI_SETTING_EID, 3, (u8 *)&leparam); At first glance, you aren't doing ths same logic in this function as the original did, please look at this very closely again and verify that you are doing this correctly. Don't just blindly quiet tools like sparse, it is warning for a reason, but be careful about your fix. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] Staging: rtl8192u: remove ieee80211_ccmp_null()
On Sat, Oct 03, 2015 at 01:09:56PM -0800, mike dupuis wrote: > This is a patch to remove the function ieee80211_ccmp_null(). > This function does nothing and can therefore be safely removed. > > Signed-off-by: Mike Dupuis > --- > drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c > b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c > index 61edd57..af22ee5 100644 > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c > @@ -175,9 +175,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) > ieee->last_packet_time[i] = 0; > } > > -/* These function were added to load crypte module autoly */ > - ieee80211_ccmp_null(); > - You didn't remove the function, only the call to it. And I think you just broke the "autoload" logic that these "call a null function" function calls were trying to solve, which isn't good at all. Have you verified that everything correctly auto-loads when the device is plugged into the system? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 04/11] staging: unisys: visorinput: add INPUT to dependent driver list
On Fri, Oct 02, 2015 at 01:19:18PM -0400, Benjamin Romer wrote: > From: Tim Sell > > Add the renamed driver to the Kconfig. That changelog comment doesn't match up with what you are doing here :( > > Signed-off-by: Tim Sell > Signed-off-by: Benjamin Romer > --- > drivers/staging/unisys/visorinput/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/unisys/visorinput/Kconfig > b/drivers/staging/unisys/visorinput/Kconfig > index d83deb4..6baba27 100644 > --- a/drivers/staging/unisys/visorinput/Kconfig > +++ b/drivers/staging/unisys/visorinput/Kconfig > @@ -4,7 +4,7 @@ > > config UNISYS_VISORINPUT > tristate "Unisys visorinput driver" > - depends on UNISYSSPAR && UNISYS_VISORBUS && FB > + depends on UNISYSSPAR && UNISYS_VISORBUS && FB && INPUT Also, why is an input driver dependant on CONFIG_FB? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rdma: Fix braces around if/else
On Sun, Oct 04, 2015 at 08:20:09AM +0100, Greg Kroah-Hartman wrote: On Sun, Oct 04, 2015 at 09:47:52AM +0300, Or Gerlitz wrote: On 10/3/2015 11:55 PM, Martin Kletzander wrote: >Get rid of all ELSE_AFTER_BRACE type errors reported by checkpatch.pl. Hi Greg, Is there a way to signal people/tools that a certain driver parks in staging on their way **out** of the kernel and not the other way around? I guess you (nor Doug) don't want to spend time on fixing such drivers, right? I'm not spending the time :) But no, there isn't a way to really show that that I know of, and it's fine, we end up getting a number of "cleanup" patches for a kernel release or two before the drivers get deleted. It gets people involved in kernel development which is the key thing here, it's not like they are actually using these drivers... So it's fine, I take the patches, the people writing the patches are happy, and the code gets a bit nicer and feels better about itself before we kick it out the door. I didn't mean to waste anyone's time on this. I'm just trying to get more familiar with the patch submission process into the kernel. And I'm doing this in my free time despite the address used. I probably should've noted that below to commit message. Martin signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] drivers: staging: wilc1000: Call kfree only for error cases
On Sun, Oct 04, 2015 at 09:44:57AM +0100, Greg KH wrote: > Aren't you now leaking memory as you aren't freeing pstrMessage and the > buffer on the "normal" return path? It's supposed to. It's a bug fix. I explained to him in the first version that his changelog sucks. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[staging:staging-testing 1167/1169] drivers/staging/lustre/lustre/obdclass/genops.c:1107:14: warning: 'obd_export_nid2str' defined but not used
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing head: fa9df8e31addd4ae26d8317f166bc09921b3629d commit: 63e9a7485d7a7d7a216f32f9db0b4cc444decab4 [1167/1169] Staging: lustre: obdclass: genops: Declare as static config: i386-randconfig-n0-201540 (attached as .config) reproduce: git checkout 63e9a7485d7a7d7a216f32f9db0b4cc444decab4 # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): >> drivers/staging/lustre/lustre/obdclass/genops.c:1107:14: warning: >> 'obd_export_nid2str' defined but not used [-Wunused-function] static char *obd_export_nid2str(struct obd_export *exp) ^ vim +/obd_export_nid2str +1107 drivers/staging/lustre/lustre/obdclass/genops.c 1091 class_export_get(exp); 1092 1093 /* Most callers into obd_disconnect are removing their own reference 1094 * (request, for example) in addition to the one from the hash table. 1095 * We don't have such a reference here, so make one. */ 1096 class_export_get(exp); 1097 rc = obd_disconnect(exp); 1098 if (rc) 1099 CERROR("disconnecting export %p failed: %d\n", exp, rc); 1100 else 1101 CDEBUG(D_HA, "disconnected export %p/%s\n", 1102 exp, exp->exp_client_uuid.uuid); 1103 class_export_put(exp); 1104 } 1105 EXPORT_SYMBOL(class_fail_export); 1106 > 1107 static char *obd_export_nid2str(struct obd_export *exp) 1108 { 1109 if (exp->exp_connection != NULL) 1110 return libcfs_nid2str(exp->exp_connection->c_peer.nid); 1112 return "(no nid)"; 1113 } 1114 1115 #if LUSTRE_TRACKS_LOCK_EXP_REFS --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] drivers: staging: wilc1000: Move spin lock to the start of critical section
On Sun, Oct 04, 2015 at 09:43:35AM +0100, Greg KH wrote: > On Sat, Oct 03, 2015 at 02:57:29PM +0530, Chandra S Gorentla wrote: > > The spin_lock_irqsave is moved to just beginning of critical section. > > This change moves a couple of return statements out of the lock. > > > > Signed-off-by: Chandra S Gorentla > > --- > > drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c > > b/drivers/staging/wilc1000/wilc_msgqueue.c > > index d5ebd6d..284a3f5 100644 > > --- a/drivers/staging/wilc1000/wilc_msgqueue.c > > +++ b/drivers/staging/wilc1000/wilc_msgqueue.c > > @@ -72,8 +72,6 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, > > goto ERRORHANDLER; > > } > > > > - spin_lock_irqsave(&pHandle->strCriticalSection, flags); > > - > > /* construct a new message */ > > pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); > > As you have moved the lock, can you also change this to GFP_KERNEL as > well because we do not have a lock held? Can 'the change to GFP_KERNEL' be done in a separate patch? The lock is to protect linked list manipulations; in this function items are added to the list. > > And how have you tested that this is ok? What is this lock trying to > protect? I load this module on a notebook computer. I added some code to wilc_debugfs.c to invoke the functions in the file wilc_msgqueue.c > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] drivers: staging: wilc1000: Call kfree only for error cases
On Sun, Oct 04, 2015 at 12:16:31PM +0300, Dan Carpenter wrote: > On Sun, Oct 04, 2015 at 09:44:57AM +0100, Greg KH wrote: > > Aren't you now leaking memory as you aren't freeing pstrMessage and the > > buffer on the "normal" return path? > > It's supposed to. It's a bug fix. I explained to him in the first > version that his changelog sucks. Ok, well, it still sucks :) And it's out of my queue, so I'll wait for the next spin of this series... greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rdma: Fix braces around if/else
On Sun, Oct 04, 2015 at 11:05:50AM +0200, Martin Kletzander wrote: > On Sun, Oct 04, 2015 at 08:20:09AM +0100, Greg Kroah-Hartman wrote: > >On Sun, Oct 04, 2015 at 09:47:52AM +0300, Or Gerlitz wrote: > >>On 10/3/2015 11:55 PM, Martin Kletzander wrote: > >>>Get rid of all ELSE_AFTER_BRACE type errors reported by checkpatch.pl. > >> > >>Hi Greg, > >> > >>Is there a way to signal people/tools that a certain driver parks in staging > >>on their way **out** of the kernel > >>and not the other way around? I guess you (nor Doug) don't want to spend > >>time on fixing such drivers, right? > > > >I'm not spending the time :) > > > >But no, there isn't a way to really show that that I know of, and it's > >fine, we end up getting a number of "cleanup" patches for a kernel > >release or two before the drivers get deleted. It gets people involved > >in kernel development which is the key thing here, it's not like they > >are actually using these drivers... > > > >So it's fine, I take the patches, the people writing the patches are > >happy, and the code gets a bit nicer and feels better about itself > >before we kick it out the door. > > > > I didn't mean to waste anyone's time on this. I'm just trying to get > more familiar with the patch submission process into the kernel. And > I'm doing this in my free time despite the address used. I probably > should've noted that below to commit message. No need to say _why_ you are sending kernel patches, I don't care :) And this is a great way to get familiar with the process, it's why there are so many things in the drivers/staging/ tree to fix up. If we really wanted to get the code "correct", I would just take a few days and fix it all up myself, but that's not the goal here. Keep it up, you are doing just fine. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] drivers: staging: wilc1000: Move spin lock to the start of critical section
On Sun, Oct 04, 2015 at 03:37:13PM +0530, Chandra Gorentla wrote: > On Sun, Oct 04, 2015 at 09:43:35AM +0100, Greg KH wrote: > > On Sat, Oct 03, 2015 at 02:57:29PM +0530, Chandra S Gorentla wrote: > > > The spin_lock_irqsave is moved to just beginning of critical section. > > > This change moves a couple of return statements out of the lock. > > > > > > Signed-off-by: Chandra S Gorentla > > > --- > > > drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c > > > b/drivers/staging/wilc1000/wilc_msgqueue.c > > > index d5ebd6d..284a3f5 100644 > > > --- a/drivers/staging/wilc1000/wilc_msgqueue.c > > > +++ b/drivers/staging/wilc1000/wilc_msgqueue.c > > > @@ -72,8 +72,6 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, > > > goto ERRORHANDLER; > > > } > > > > > > - spin_lock_irqsave(&pHandle->strCriticalSection, flags); > > > - > > > /* construct a new message */ > > > pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); > > > > As you have moved the lock, can you also change this to GFP_KERNEL as > > well because we do not have a lock held? > Can 'the change to GFP_KERNEL' be done in a separate patch? Yes. > The lock is to protect linked list manipulations; in this function items > are added to the list. Ok, please add that description to the patch so we know what is going on, and that you know what is going on as well :) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] drivers: staging: wilc1000: Call kfree only for error cases
On Sun, Oct 04, 2015 at 09:44:57AM +0100, Greg KH wrote: > On Sat, Oct 03, 2015 at 02:57:30PM +0530, Chandra S Gorentla wrote: > > - kfree is being called for the members of the queue without > >de-queuing them; they are just inserted within this function; > >they are supposed to be de-queued and freed in a function > >for receiving the queue items > > - goto statements are removed > > - After kfree correction, there is no need for target block > >of goto statement; hence it is removed > > > > Signed-off-by: Chandra S Gorentla > > --- > > drivers/staging/wilc1000/wilc_msgqueue.c | 22 ++ > > 1 file changed, 6 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c > > b/drivers/staging/wilc1000/wilc_msgqueue.c > > index 284a3f5..eae90be 100644 > > --- a/drivers/staging/wilc1000/wilc_msgqueue.c > > +++ b/drivers/staging/wilc1000/wilc_msgqueue.c > > @@ -56,32 +56,30 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle) > > int wilc_mq_send(WILC_MsgQueueHandle *pHandle, > > const void *pvSendBuffer, u32 u32SendBufferSize) > > { > > - int result = 0; > > unsigned long flags; > > Message *pstrMessage = NULL; > > > > if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) { > > PRINT_ER("pHandle or pvSendBuffer is null\n"); > > - result = -EFAULT; > > - goto ERRORHANDLER; > > + return -EFAULT; > > } > > > > if (pHandle->bExiting) { > > PRINT_ER("pHandle fail\n"); > > - result = -EFAULT; > > - goto ERRORHANDLER; > > + return -EFAULT; > > } > > > > /* construct a new message */ > > pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); > > if (!pstrMessage) > > return -ENOMEM; > > + > > pstrMessage->u32Length = u32SendBufferSize; > > pstrMessage->pstrNext = NULL; > > pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC); > > if (!pstrMessage->pvBuffer) { > > - result = -ENOMEM; > > - goto ERRORHANDLER; > > + kfree(pstrMessage); > > + return -ENOMEM; > > } > > memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize); > > > > @@ -102,15 +100,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, > > spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); > > > > up(&pHandle->hSem); > > - > > -ERRORHANDLER: > > - /* error occured, free any allocations */ > > - if (pstrMessage) { > > - kfree(pstrMessage->pvBuffer); > > - kfree(pstrMessage); > > - } > > - > > - return result; > > + return 0; > > Aren't you now leaking memory as you aren't freeing pstrMessage and the > buffer on the "normal" return path? In the normal path kfree is called in a separate (wilc_mq_recv) function. The purpose of the currently modified function (wilc_mq_send) is to post a message to a queue by allocating memory for the message. The receiver function is supposed to remove the message from the queue and free the memory. > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: iio: adc: fix comment block coding style issue
On 10/03/2015 08:32 PM, Hugo Camboulive wrote: > This patch to ad7746.c makes the comment block end with a */ > on a separate line. > > Signed-off-by: Hugo Camboulive > --- > drivers/staging/iio/cdc/ad7746.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/cdc/ad7746.c > b/drivers/staging/iio/cdc/ad7746.c > index 10fa372..8445ddd 100644 > --- a/drivers/staging/iio/cdc/ad7746.c > +++ b/drivers/staging/iio/cdc/ad7746.c > @@ -531,7 +531,7 @@ static int ad7746_write_raw(struct iio_dev *indio_dev, > /* CAPDAC Scale = 21pF_typ / 127 >* CIN Scale = 8.192pF / 2^24 >* Offset Scale = CAPDAC Scale / CIN Scale = 338646 > - * */ > + */ Looks good, but while you are at it please also fix the beginning of the comment. Kernel style multi-line comments look like /* * text * more text */ So the line with the /* should have any text. Bonus points if you can also fix all other occurrences of this style error in the same file. - Lars ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [dgnc] Remove dgnc_ports_state_show
On Wed, Jul 29, 2015 at 02:55:30PM +0100, Salah Triki wrote: > dgnc_ports_state_show exposes ports status which help an adversary to > plan an attack. Thus, the function is removed. > > Signed-off-by: Salah Triki > --- > drivers/staging/dgnc/dgnc_sysfs.c | 20 > 1 file changed, 20 deletions(-) > > diff --git a/drivers/staging/dgnc/dgnc_sysfs.c > b/drivers/staging/dgnc/dgnc_sysfs.c > index 44db870..d616065 100644 > --- a/drivers/staging/dgnc/dgnc_sysfs.c > +++ b/drivers/staging/dgnc/dgnc_sysfs.c > @@ -145,26 +145,6 @@ static ssize_t dgnc_serial_number_show(struct device *p, > } > static DEVICE_ATTR(serial_number, S_IRUSR, dgnc_serial_number_show, NULL); > > - > -static ssize_t dgnc_ports_state_show(struct device *p, > - struct device_attribute *attr, char *buf) > -{ > - struct dgnc_board *bd; > - int count = 0; > - int i = 0; > - > - DGNC_VERIFY_BOARD(p, bd); > - > - for (i = 0; i < bd->nasync; i++) { > - count += snprintf(buf + count, PAGE_SIZE - count, > - "%d %s\n", bd->channels[i]->ch_portnum, > - bd->channels[i]->ch_open_count ? "Open" : "Closed"); > - } > - return count; > -} > -static DEVICE_ATTR(ports_state, S_IRUSR, dgnc_ports_state_show, NULL); > - > - This patch breaks the build, always properly test your patches :( greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND 0/6] staging: dgnc: checkpatch cleanups
Resending after rebasing on current staging-testing tree. Few patches of the original series are already applied only these checkpatch related patches did not apply due to other changes. regards sudip Sudip Mukherjee (6): staging: dgnc: remove multiple blank lines staging: dgnc: remove blankline before brace staging: dgnc: remove blankline after brace staging: dgnc: remove space after cast staging: dgnc: alignment style staging: dgnc: remove parenthesis drivers/staging/dgnc/dgnc_cls.c| 31 -- drivers/staging/dgnc/dgnc_driver.c | 23 ++-- drivers/staging/dgnc/dgnc_mgmt.c | 13 +--- drivers/staging/dgnc/dgnc_neo.c| 65 +++- drivers/staging/dgnc/dgnc_sysfs.c | 86 --- drivers/staging/dgnc/dgnc_tty.c| 118 - 6 files changed, 75 insertions(+), 261 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND 2/6] staging: dgnc: remove blankline before brace
Blank lines are not needed before closing braces. checkpatch was giving warning about this. Signed-off-by: Sudip Mukherjee --- drivers/staging/dgnc/dgnc_cls.c| 7 --- drivers/staging/dgnc/dgnc_driver.c | 2 -- drivers/staging/dgnc/dgnc_mgmt.c | 1 - drivers/staging/dgnc/dgnc_neo.c| 1 - drivers/staging/dgnc/dgnc_sysfs.c | 1 - drivers/staging/dgnc/dgnc_tty.c| 4 6 files changed, 16 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 944982a..e7c946e 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -115,7 +115,6 @@ static inline void cls_set_cts_flow_control(struct channel_t *ch) &ch->ch_cls_uart->isr_fcr); ch->ch_t_tlevel = 16; - } static inline void cls_set_ixon_flow_control(struct channel_t *ch) @@ -161,7 +160,6 @@ static inline void cls_set_ixon_flow_control(struct channel_t *ch) writeb((UART_FCR_ENABLE_FIFO | UART_16654_FCR_RXTRIGGER_16 | UART_16654_FCR_TXTRIGGER_16 | UART_FCR_CLEAR_RCVR), &ch->ch_cls_uart->isr_fcr); - } static inline void cls_set_no_output_flow_control(struct channel_t *ch) @@ -205,7 +203,6 @@ static inline void cls_set_no_output_flow_control(struct channel_t *ch) ch->ch_r_watermark = 0; ch->ch_t_tlevel = 16; ch->ch_r_tlevel = 16; - } static inline void cls_set_rts_flow_control(struct channel_t *ch) @@ -244,7 +241,6 @@ static inline void cls_set_rts_flow_control(struct channel_t *ch) ch->ch_r_watermark = 4; ch->ch_r_tlevel = 8; - } static inline void cls_set_ixoff_flow_control(struct channel_t *ch) @@ -286,7 +282,6 @@ static inline void cls_set_ixoff_flow_control(struct channel_t *ch) writeb((UART_FCR_ENABLE_FIFO | UART_16654_FCR_RXTRIGGER_16 | UART_16654_FCR_TXTRIGGER_16 | UART_FCR_CLEAR_RCVR), &ch->ch_cls_uart->isr_fcr); - } static inline void cls_set_no_input_flow_control(struct channel_t *ch) @@ -325,7 +320,6 @@ static inline void cls_set_no_input_flow_control(struct channel_t *ch) ch->ch_t_tlevel = 16; ch->ch_r_tlevel = 16; - } /* @@ -746,7 +740,6 @@ static void cls_tasklet(unsigned long data) } spin_unlock_irqrestore(&bd->bd_intr_lock, flags); - } /* diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 926808b..4bb3e6f 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -529,7 +529,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) dev_err(&brd->pdev->dev, "Didn't find any compatible Neo/Classic PCI boards.\n"); return -ENXIO; - } /* @@ -581,7 +580,6 @@ failed: brd->dpastatus = BD_NOFEP; return -ENXIO; - } static int dgnc_finalize_board_init(struct dgnc_board *brd) diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c index 81f0da2..e8aaf35 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.c +++ b/drivers/staging/dgnc/dgnc_mgmt.c @@ -251,7 +251,6 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; } - } return 0; diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 09d3de7..fb95282 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -901,7 +901,6 @@ static void neo_tasklet(unsigned long data) /* Allow interrupt routine to access the interrupt register again */ spin_unlock_irqrestore(&bd->bd_intr_lock, flags); - } /* diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c index c8a6c28..dffb4af 100644 --- a/drivers/staging/dgnc/dgnc_sysfs.c +++ b/drivers/staging/dgnc/dgnc_sysfs.c @@ -695,7 +695,6 @@ void dgnc_create_tty_sysfs(struct un_t *un, struct device *c) } dev_set_drvdata(c, un); - } void dgnc_remove_tty_sysfs(struct device *c) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 497e1f4..ddf0e41 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -374,7 +374,6 @@ int dgnc_tty_init(struct dgnc_board *brd) ch->ch_pun.un_sysfs = classp; dgnc_create_tty_sysfs(&ch->ch_pun, classp); } - } return 0; @@ -1368,7 +1367,6 @@ static void dgnc_tty_hangup(struct tty_struct *tty) /* flush the transmit queues */ dgnc_tty_flush_buffer(tty); - } /* @@ -1981,7 +1979,6 @@ static int dgnc_tty_send_break(struct tty_struct *tty, int msec) spin_unlock_irqrestore(&ch->ch_lock, flags); return 0; - } /* @@ -2744,7 +2741,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ~(UN_LOW|UN_EMPTY);
[PATCH RESEND 1/6] staging: dgnc: remove multiple blank lines
checkpatch warns us about multiple blank lines which are not needed. Remove them. Signed-off-by: Sudip Mukherjee --- drivers/staging/dgnc/dgnc_driver.c | 10 drivers/staging/dgnc/dgnc_mgmt.c | 5 drivers/staging/dgnc/dgnc_neo.c| 37 --- drivers/staging/dgnc/dgnc_sysfs.c | 37 --- drivers/staging/dgnc/dgnc_tty.c| 51 -- 5 files changed, 140 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index ce2d1c7..926808b 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -13,7 +13,6 @@ * PURPOSE. See the GNU General Public License for more details. */ - #include #include #include @@ -56,7 +55,6 @@ static const struct file_operations dgnc_BoardFops = { .release= dgnc_mgmt_close }; - /* * Globals */ @@ -79,7 +77,6 @@ static ulong dgnc_poll_time; /* Time of next poll */ static uintdgnc_poll_stop; /* Used to tell poller to stop */ static struct timer_list dgnc_poll_timer; - static const struct pci_device_id dgnc_pci_tbl[] = { {PCI_DEVICE(DIGI_VID, PCI_DEVICE_CLASSIC_4_DID), .driver_data = 0}, {PCI_DEVICE(DIGI_VID, PCI_DEVICE_CLASSIC_4_422_DID), .driver_data = 1}, @@ -354,13 +351,11 @@ static void dgnc_cleanup_board(struct dgnc_board *brd) } } - dgnc_Board[brd->boardnum] = NULL; kfree(brd); } - /* * dgnc_found_board() * @@ -421,7 +416,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) pci_irq = pdev->irq; brd->irq = pci_irq; - switch (brd->device) { case PCI_DEVICE_CLASSIC_4_DID: @@ -441,7 +435,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) * 4Memory Mapped UARTs and Status */ - /* get the PCI Base Address Registers */ brd->membase = pci_resource_start(pdev, 4); @@ -482,7 +475,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) break; - case PCI_DEVICE_NEO_4_DID: case PCI_DEVICE_NEO_8_DID: case PCI_DEVICE_NEO_2DB9_DID: @@ -592,7 +584,6 @@ failed: } - static int dgnc_finalize_board_init(struct dgnc_board *brd) { int rc = 0; @@ -627,7 +618,6 @@ static void dgnc_do_remap(struct dgnc_board *brd) brd->re_map_membase = ioremap(brd->membase, 0x1000); } - /* * * Function: diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c index 81c793a..81f0da2 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.c +++ b/drivers/staging/dgnc/dgnc_mgmt.c @@ -32,11 +32,9 @@ #include "dgnc_pci.h" #include "dgnc_mgmt.h" - /* Our "in use" variables, to enforce 1 open only */ static int dgnc_mgmt_in_use[MAXMGMTDEVICES]; - /* * dgnc_mgmt_open() * @@ -67,7 +65,6 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file) return 0; } - /* * dgnc_mgmt_close() * @@ -90,7 +87,6 @@ int dgnc_mgmt_close(struct inode *inode, struct file *file) return 0; } - /* * dgnc_mgmt_ioctl() * @@ -256,7 +252,6 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; } - } return 0; diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 900e3ae..09d3de7 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -13,7 +13,6 @@ * PURPOSE. See the GNU General Public License for more details. */ - #include #include/* For jiffies, task states */ #include /* For tasklet and interrupt structs/defines */ @@ -57,7 +56,6 @@ static uint neo_get_uart_bytes_left(struct channel_t *ch); static void neo_send_immediate_char(struct channel_t *ch, unsigned char c); static irqreturn_t neo_intr(int irq, void *voidbrd); - struct board_ops dgnc_neo_ops = { .tasklet = neo_tasklet, .intr = neo_intr, @@ -81,7 +79,6 @@ struct board_ops dgnc_neo_ops = { static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; - /* * This function allows calls to ensure that all outstanding * PCI writes have been completed, by doing a PCI read against @@ -100,7 +97,6 @@ static inline void neo_set_cts_flow_control(struct channel_t *ch) unsigned char ier = readb(&ch->ch_neo_uart->ier); unsigned char efr = readb(&ch->ch_neo_uart->efr); - /* Turn on auto CTS flow control */ #if 1 ier |= UART_17158_IER_CTSDSR; @@ -131,7 +127,6 @@ static inline void neo_set_cts_flow_control(struct channel_t *ch) neo_pci_posting_flush(ch->ch_bd); } - static inline void neo_set_rts_flow_control(struct channel_t *ch) { unsigned char
[PATCH RESEND 6/6] staging: dgnc: remove parenthesis
checkpatch was warning us about extra unneeded parenthesis. Signed-off-by: Sudip Mukherjee --- drivers/staging/dgnc/dgnc_neo.c | 2 +- drivers/staging/dgnc/dgnc_sysfs.c | 48 +++ drivers/staging/dgnc/dgnc_tty.c | 14 ++-- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 99287bb..8106f52 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1792,6 +1792,6 @@ static void neo_vpd(struct dgnc_board *brd) /* Search for the serial number */ for (i = 0; i < NEO_VPD_IMAGEBYTES - 3; i++) if (brd->vpd[i] == 'S' && brd->vpd[i + 1] == 'N') - strncpy(brd->serial_num, &(brd->vpd[i + 3]), 9); + strncpy(brd->serial_num, &brd->vpd[i + 3], 9); } } diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c index dffb4af..74a0725 100644 --- a/drivers/staging/dgnc/dgnc_sysfs.c +++ b/drivers/staging/dgnc/dgnc_sysfs.c @@ -343,18 +343,18 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd) int rc = 0; dev_set_drvdata(&bd->pdev->dev, bd); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_state); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_baud); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_msignals); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_iflag); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_cflag); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_oflag); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_lflag); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_rxcount); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_txcount); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_vpd); - rc |= device_create_file(&(bd->pdev->dev), &dev_attr_serial_number); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_state); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_baud); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_msignals); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_iflag); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_cflag); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_oflag); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_lflag); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_digi_flag); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_rxcount); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_txcount); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_vpd); + rc |= device_create_file(&bd->pdev->dev, &dev_attr_serial_number); if (rc) dev_err(&bd->pdev->dev, "dgnc: sysfs device_create_file failed!\n"); } @@ -362,18 +362,18 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd) /* removes all the sys files created for that port */ void dgnc_remove_ports_sysfiles(struct dgnc_board *bd) { - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_state); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_baud); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_msignals); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_iflag); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_cflag); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_oflag); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_lflag); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_rxcount); - device_remove_file(&(bd->pdev->dev), &dev_attr_ports_txcount); - device_remove_file(&(bd->pdev->dev), &dev_attr_vpd); - device_remove_file(&(bd->pdev->dev), &dev_attr_serial_number); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_state); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_baud); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_msignals); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_iflag); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_cflag); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_oflag); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_lflag); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_digi_flag); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_rxcount); + device_remove_file(&bd->pdev->dev, &dev_attr_ports_txcount); + device_remove_file(&bd->pdev->dev, &dev_attr_vpd); + device_remove_file(&bd->pdev->dev, &dev_attr_serial_number); }
[PATCH RESEND 5/6] staging: dgnc: alignment style
checkpatch was warning us that the alignment should match the open parenthesis. Signed-off-by: Sudip Mukherjee --- drivers/staging/dgnc/dgnc_cls.c| 14 +++--- drivers/staging/dgnc/dgnc_driver.c | 2 +- drivers/staging/dgnc/dgnc_neo.c| 2 +- drivers/staging/dgnc/dgnc_tty.c| 26 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 50fe22b..75040da 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -518,7 +518,7 @@ static void cls_param(struct tty_struct *tty) * unit is NOT open */ if (!(ch->ch_tun.un_flags & UN_ISOPEN) && -(un->un_type == DGNC_PRINT)) + (un->un_type == DGNC_PRINT)) baud = C_BAUD(ch->ch_pun.un_tty) & 0xff; else baud = C_BAUD(ch->ch_tun.un_tty) & 0xff; @@ -532,7 +532,7 @@ static void cls_param(struct tty_struct *tty) jindex = baud; if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) && - (jindex < 16)) { + (jindex < 16)) { baud = bauds[iindex][jindex]; } else { baud = 0; @@ -641,7 +641,7 @@ static void cls_param(struct tty_struct *tty) * disable flow control */ if ((ch->ch_startc == _POSIX_VDISABLE) || -(ch->ch_stopc == _POSIX_VDISABLE)) + (ch->ch_stopc == _POSIX_VDISABLE)) cls_set_no_output_flow_control(ch); else cls_set_ixon_flow_control(ch); @@ -657,7 +657,7 @@ static void cls_param(struct tty_struct *tty) * flow control */ if ((ch->ch_startc == _POSIX_VDISABLE) || - (ch->ch_stopc == _POSIX_VDISABLE)) + (ch->ch_stopc == _POSIX_VDISABLE)) cls_set_no_input_flow_control(ch); else cls_set_ixoff_flow_control(ch); @@ -933,7 +933,7 @@ static void cls_flush_uart_write(struct channel_t *ch) return; writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT), - &ch->ch_cls_uart->isr_fcr); + &ch->ch_cls_uart->isr_fcr); udelay(10); ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); @@ -979,7 +979,7 @@ static void cls_copy_data_from_queue_to_uart(struct channel_t *ch) /* If port is "stopped", don't send any data to the UART */ if ((ch->ch_flags & CH_FORCED_STOP) || -(ch->ch_flags & CH_BREAK_SENDING)) + (ch->ch_flags & CH_BREAK_SENDING)) goto exit_unlock; if (!(ch->ch_flags & (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM))) @@ -1169,7 +1169,7 @@ static void cls_uart_init(struct channel_t *ch) readb(&ch->ch_cls_uart->txrx); writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT), -&ch->ch_cls_uart->isr_fcr); + &ch->ch_cls_uart->isr_fcr); udelay(10); ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 033..619baa9 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -237,7 +237,7 @@ static int dgnc_start(void) } dev = device_create(dgnc_class, NULL, - MKDEV(dgnc_Major, 0), + MKDEV(dgnc_Major, 0), NULL, "dgnc_mgmt"); if (IS_ERR(dev)) { rc = PTR_ERR(dev); diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 0d7ba53..99287bb 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1390,7 +1390,7 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) /* If port is "stopped", don't send any data to the UART */ if ((ch->ch_flags & CH_FORCED_STOP) || -(ch->ch_flags & CH_BREAK_SENDING)) + (ch->ch_flags & CH_BREAK_SENDING)) goto exit_unlock; /* diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 6c71a2f..18f0dae 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -365,12 +365,12 @@ int dgnc_tty_init(struct dgnc_board *brd) struct device *classp; classp = tty_register_device(&brd->SerialDriver, i, - &(ch->ch_bd->pdev->dev)); +
[PATCH RESEND 3/6] staging: dgnc: remove blankline after brace
Blank lines are not needed after opening braces. checkpatch was giving us warnings about this. Signed-off-by: Sudip Mukherjee --- drivers/staging/dgnc/dgnc_cls.c| 4 drivers/staging/dgnc/dgnc_driver.c | 3 --- drivers/staging/dgnc/dgnc_mgmt.c | 1 - drivers/staging/dgnc/dgnc_neo.c| 11 --- drivers/staging/dgnc/dgnc_tty.c| 11 --- 5 files changed, 30 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index e7c946e..5a35808 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -378,7 +378,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) /* Here we try to figure out what caused the interrupt to happen */ while (1) { - isr = readb(&ch->ch_cls_uart->isr_fcr); /* Bail if no pending interrupt on port */ @@ -472,7 +471,6 @@ static void cls_param(struct tty_struct *tty) ch->ch_old_baud = 0; return; } else if (ch->ch_custom_speed) { - baud = ch->ch_custom_speed; /* Handle transition from B0 */ if (ch->ch_flags & CH_BAUD0) { @@ -704,7 +702,6 @@ static void cls_tasklet(unsigned long data) * If board is ready, parse deeper to see if there is anything to do. */ if ((state == BOARD_READY) && (ports > 0)) { - /* Loop on each port */ for (i = 0; i < ports; i++) { ch = bd->channels[i]; @@ -999,7 +996,6 @@ static void cls_copy_data_from_queue_to_uart(struct channel_t *ch) n = min(n, qlen); while (n > 0) { - /* * If RTS Toggle mode is on, turn on RTS now if not already set, * and make sure we get an event when the data transfer has diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 4bb3e6f..fc3eff9 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -417,7 +417,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) brd->irq = pci_irq; switch (brd->device) { - case PCI_DEVICE_CLASSIC_4_DID: case PCI_DEVICE_CLASSIC_8_DID: case PCI_DEVICE_CLASSIC_4_422_DID: @@ -516,7 +515,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) dgnc_do_remap(brd); if (brd->re_map_membase) { - /* Read and store the dvid after remapping */ brd->dvid = readb(brd->re_map_membase + 0x8D); @@ -609,7 +607,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd) */ static void dgnc_do_remap(struct dgnc_board *brd) { - if (!brd || brd->magic != DGNC_BOARD_MAGIC) return; diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c index e8aaf35..5f46e69 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.c +++ b/drivers/staging/dgnc/dgnc_mgmt.c @@ -99,7 +99,6 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) void __user *uarg = (void __user *) arg; switch (cmd) { - case DIGI_GETDD: { /* diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index fb95282..3dd7342 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -320,7 +320,6 @@ static inline void neo_set_no_output_flow_control(struct channel_t *ch) /* change UARTs start/stop chars */ static inline void neo_set_new_start_stop_chars(struct channel_t *ch) { - /* if hardware flow control is set, then skip this whole thing */ if (ch->ch_digi.digi_flags & (CTSPACE | RTSPACE) || ch->ch_c_cflag & CRTSCTS) return; @@ -387,7 +386,6 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port) /* Here we try to figure out what caused the interrupt to happen */ while (1) { - isr = readb(&ch->ch_neo_uart->isr_fcr); /* Bail if no pending interrupt */ @@ -626,7 +624,6 @@ static void neo_param(struct tty_struct *tty) return; } else if (ch->ch_custom_speed) { - baud = ch->ch_custom_speed; /* Handle transition from B0 */ if (ch->ch_flags & CH_BAUD0) { @@ -954,7 +951,6 @@ static irqreturn_t neo_intr(int irq, void *voidbrd) /* Loop on each port */ while ((uart_poll & 0xff) != 0) { - tmp = uart_poll; /* Check current port to see if it has interrupt pending */ @@ -977,7 +973,6 @@ static irqreturn_t neo_intr(int irq, void *voidbrd) /* Switch on type of interrupt we have */ switch (type) { - case UART_17158_RXRDY_TIMEOUT: /* * RXRDY Time-out is cleared by reading data in the @@ -1141
[PATCH RESEND 4/6] staging: dgnc: remove space after cast
Space is not necessary after typecast. Signed-off-by: Sudip Mukherjee --- drivers/staging/dgnc/dgnc_cls.c| 6 +++--- drivers/staging/dgnc/dgnc_driver.c | 6 +++--- drivers/staging/dgnc/dgnc_mgmt.c | 6 +++--- drivers/staging/dgnc/dgnc_neo.c| 12 ++-- drivers/staging/dgnc/dgnc_tty.c| 24 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 5a35808..50fe22b 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -438,7 +438,7 @@ static void cls_param(struct tty_struct *tty) if (!tty || tty->magic != TTY_MAGIC) return; - un = (struct un_t *) tty->driver_data; + un = (struct un_t *)tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) return; @@ -676,7 +676,7 @@ static void cls_param(struct tty_struct *tty) */ static void cls_tasklet(unsigned long data) { - struct dgnc_board *bd = (struct dgnc_board *) data; + struct dgnc_board *bd = (struct dgnc_board *)data; struct channel_t *ch; unsigned long flags; int i; @@ -904,7 +904,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds) if (!tty || tty->magic != TTY_MAGIC) return -ENXIO; - un = (struct un_t *) tty->driver_data; + un = (struct un_t *)tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) return -ENXIO; diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index fc3eff9..033 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -452,7 +452,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) brd->iobase = pci_resource_start(pdev, 1); brd->iobase_end = pci_resource_end(pdev, 1); - brd->iobase = ((unsigned int) (brd->iobase)) & 0xFFFE; + brd->iobase = ((unsigned int)(brd->iobase)) & 0xFFFE; /* Assign the board_ops struct */ brd->bd_ops = &dgnc_cls_ops; @@ -559,7 +559,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) /* init our poll helper tasklet */ tasklet_init(&brd->helper_tasklet, brd->bd_ops->tasklet, -(unsigned long) brd); +(unsigned long)brd); spin_lock_irqsave(&dgnc_global_lock, flags); brd->msgbuf = NULL; @@ -672,7 +672,7 @@ static void dgnc_poll_handler(ulong dummy) new_time = dgnc_poll_time - jiffies; - if ((ulong) new_time >= 2 * dgnc_poll_tick) + if ((ulong)new_time >= 2 * dgnc_poll_tick) dgnc_poll_time = jiffies + dgnc_jiffies_from_ms(dgnc_poll_tick); setup_timer(&dgnc_poll_timer, dgnc_poll_handler, 0); diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c index 5f46e69..9ec3efe 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.c +++ b/drivers/staging/dgnc/dgnc_mgmt.c @@ -96,7 +96,7 @@ int dgnc_mgmt_close(struct inode *inode, struct file *file) long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { unsigned long flags; - void __user *uarg = (void __user *) arg; + void __user *uarg = (void __user *)arg; switch (cmd) { case DIGI_GETDD: @@ -142,8 +142,8 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) di.info_bdtype = dgnc_Board[brd]->dpatype; di.info_bdstate = dgnc_Board[brd]->dpastatus; di.info_ioport = 0; - di.info_physaddr = (ulong) dgnc_Board[brd]->membase; - di.info_physsize = (ulong) dgnc_Board[brd]->membase + di.info_physaddr = (ulong)dgnc_Board[brd]->membase; + di.info_physsize = (ulong)dgnc_Board[brd]->membase - dgnc_Board[brd]->membase_end; if (dgnc_Board[brd]->state != BOARD_FAILED) di.info_nports = dgnc_Board[brd]->nasync; diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 3dd7342..0d7ba53 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -590,7 +590,7 @@ static void neo_param(struct tty_struct *tty) if (!tty || tty->magic != TTY_MAGIC) return; - un = (struct un_t *) tty->driver_data; + un = (struct un_t *)tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) return; @@ -828,7 +828,7 @@ static void neo_param(struct tty_struct *tty) */ static void neo_tasklet(unsigned long data) { - struct dgnc_board *bd = (struct dgnc_board *) data; + struct dgnc_board *bd = (struct dgnc_board *)data; struct channel_t *ch; unsigned long flags; int i; @@ -1151,7 +1151,7 @@ static void neo_copy_data_from_ua
[PATCH v2] staging: iio: adc: fix comment block coding style issue
This patch to ad7746.c makes the comment blocks end with a */ on a separate line, and start with a /* on an empty line. Signed-off-by: Hugo Camboulive --- drivers/staging/iio/cdc/ad7746.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c index 10fa372..e8eab25 100644 --- a/drivers/staging/iio/cdc/ad7746.c +++ b/drivers/staging/iio/cdc/ad7746.c @@ -528,10 +528,11 @@ static int ad7746_write_raw(struct iio_dev *indio_dev, goto out; } - /* CAPDAC Scale = 21pF_typ / 127 + /* +* CAPDAC Scale = 21pF_typ / 127 * CIN Scale = 8.192pF / 2^24 * Offset Scale = CAPDAC Scale / CIN Scale = 338646 -* */ +*/ val /= 338646; @@ -600,7 +601,8 @@ static int ad7746_read_raw(struct iio_dev *indio_dev, switch (chan->type) { case IIO_TEMP: - /* temperature in milli degrees Celsius + /* +* temperature in milli degrees Celsius * T = ((*val / 2048) - 4096) * 1000 */ *val = (*val * 125) / 256; -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: iio: adc: fix comment block coding style issue
On 04/10/15 17:30, Hugo Camboulive wrote: > This patch to ad7746.c makes the comment blocks end with a */ > on a separate line, and start with a /* on an empty line. > > Signed-off-by: Hugo Camboulive Thanks. Applied to the togreg branch of iio.git - initially pushed out as staging for the automated build testing to check it. (obviously not really going to do much with this patch!) Probably a good few more of these in the staging drivers if you want to clear out a few more! If not, take a look at the review I did of this driver the other day for other bits that could do with cleaning up. http://marc.info/?l=linux-iio&m=144277958123939&w=2 > --- > drivers/staging/iio/cdc/ad7746.c | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/cdc/ad7746.c > b/drivers/staging/iio/cdc/ad7746.c > index 10fa372..e8eab25 100644 > --- a/drivers/staging/iio/cdc/ad7746.c > +++ b/drivers/staging/iio/cdc/ad7746.c > @@ -528,10 +528,11 @@ static int ad7746_write_raw(struct iio_dev *indio_dev, > goto out; > } > > - /* CAPDAC Scale = 21pF_typ / 127 > + /* > + * CAPDAC Scale = 21pF_typ / 127 >* CIN Scale = 8.192pF / 2^24 >* Offset Scale = CAPDAC Scale / CIN Scale = 338646 > - * */ > + */ > > val /= 338646; > > @@ -600,7 +601,8 @@ static int ad7746_read_raw(struct iio_dev *indio_dev, > > switch (chan->type) { > case IIO_TEMP: > - /* temperature in milli degrees Celsius > + /* > + * temperature in milli degrees Celsius >* T = ((*val / 2048) - 4096) * 1000 >*/ > *val = (*val * 125) / 256; > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgap: remove unused configuration
The IO configuration was not used to configure the board. It was only read from the configuration file. Stop reading it and also remove the other related variables defined for it. Signed-off-by: Sudip Mukherjee --- drivers/staging/dgap/dgap.c | 21 - drivers/staging/dgap/dgap.h | 4 2 files changed, 25 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 64f6149..aa3aa72 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -248,7 +248,6 @@ static struct toklist dgap_tlist[] = { { BEGIN,"config_begin" }, { END, "config_end" }, { BOARD,"board" }, - { IO, "io" }, { PCIINFO, "pciinfo" }, { LINE, "line" }, { CONC, "conc" }, @@ -662,25 +661,6 @@ static int dgap_parsefile(char **in) break; - case IO:/* i/o port */ - if (p->type != BNODE) { - pr_err("IO port only valid for boards"); - return -1; - } - s = dgap_getword(in); - if (!s) { - pr_err("unexpected end of file"); - return -1; - } - kfree(p->u.board.portstr); - p->u.board.portstr = kstrdup(s, GFP_KERNEL); - if (kstrtol(s, 0, &p->u.board.port)) { - pr_err("bad number for IO port"); - return -1; - } - p->u.board.v_port = 1; - break; - case MEM: /* memory address */ if (p->type != BNODE) { pr_err("memory address only valid for boards"); @@ -1296,7 +1276,6 @@ static void dgap_cleanup_nodes(void) switch (p->type) { case BNODE: - kfree(p->u.board.portstr); kfree(p->u.board.addrstr); kfree(p->u.board.pcibusstr); kfree(p->u.board.pcislotstr); diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h index e707ed5..c84dbf2 100644 --- a/drivers/staging/dgap/dgap.h +++ b/drivers/staging/dgap/dgap.h @@ -409,7 +409,6 @@ #defineID 76 #define CABLE 77 #define CONNECT78 -#defineIO 79 #defineMEM 80 #define DPSZ 81 @@ -1152,8 +1151,6 @@ struct cnode { union { struct { char type; /* Board Type */ - long port; /* I/O Address */ - char *portstr; /* I/O Address in string */ long addr; /* Memory Address */ char *addrstr; /* Memory Address in string */ long pcibus; /* PCI BUS */ @@ -1164,7 +1161,6 @@ struct cnode { char *id; /* tty id */ long start;/* start of tty counting */ char *method; /* Install method */ - char v_port; char v_addr; char v_pcibus; char v_pcislot; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: Fix Sparse errors in rtl8723a_cmd.c
Hi Greg, Thanks for the response! It's always good to get notes on a patch. Some responses to your points: > Why __le32? Does this variable go across the user/kernel boundry > somehow? If not, just use le32. Good point, this should probably have been le32. > At first glance, you aren't doing ths same logic in this function as the > original did, please look at this very closely again and verify that you > are doing this correctly. > > Don't just blindly quiet tools like sparse, it is warning for a reason, > but be careful about your fix. On a second, closer look at the code I am not doing this correctly: the buffer I am converting to le32 needs to persist (which a local variable would not). On my first glance at this code I saw the same buffer being used for both little- and big-endian storage of the same data -- it's correct, but a little ugly. I am going to leave this code as is, since it was functioning properly before my patch. Thanks, Jake ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] Staging: rtl8192u: remove ieee80211_ccmp_null()
On Sun, Oct 04, 2015 at 10:46:05AM -0800, Mike Dupuis wrote: > > And I think you just broke the "autoload" logic that these "call a null > > function" function calls were trying to solve, which isn't good at all. > > I guess this bit is lost on me-- how does calling a function from a > previously unused object affect the state of a driver or kernel module? It forces the module where that function is to be loaded into memory before this function can be called. That is if we have multiple modules here, I haven't looked at the code in a long time to verify it, but note, you are totally ignoring the comment put there in the code that says this. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
HAPPY TIME
THIS IS TO INFORM YOU THAT YOU HAVE WON A PRIZE MONEY OF (ONE MILLION EUROS ) FOR THIS YEARLY EL GORDO PRIMITIVA AWARD PROMO 2015 ALSO ENSURE TO KEEP YOUR WINNING DETAILS CONFIDENTIAL CONTACT YOUR CLAIMS DEPARTMENT WITH THIS INFORMATION'S. NAME:ANGEL LOPEZ EMAIL: cdepar...@aim.com EL GORDO PRIMITIVA ® INC SATISFACTION IS GUARANTEED. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv4 1/2] staging: rtl8192u: r8192U_core: add temporary variables to keep lines under 80 characters
Add some temporary variables to reduce line length under the maximum of 80 characters, as per the kernel code style. Signed-off-by: Raphaël Beamonte --- drivers/staging/rtl8192u/r8192U_core.c | 130 ++--- 1 file changed, 88 insertions(+), 42 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 28b54ba..e67be02 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -171,6 +171,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv) { int i, max_chan = -1, min_chan = -1; struct ieee80211_device *ieee = priv->ieee80211; + struct CHANNEL_LIST *cl; switch (channel_plan) { case COUNTRY_CODE_FCC: @@ -194,15 +195,18 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv) "unknown rf chip, can't set channel map in function:%s()\n", __func__); } - if (ChannelPlan[channel_plan].Len != 0) { + cl = &ChannelPlan[channel_plan]; + if (cl->Len != 0) { /* Clear old channel map */ memset(GET_DOT11D_INFO(ieee)->channel_map, 0, sizeof(GET_DOT11D_INFO(ieee)->channel_map)); /* Set new channel map */ - for (i = 0; i < ChannelPlan[channel_plan].Len; i++) { - if (ChannelPlan[channel_plan].Channel[i] < min_chan || ChannelPlan[channel_plan].Channel[i] > max_chan) + for (i = 0; i < cl->Len; i++) { + u8 chan = cl->Channel[i]; + + if (chan < min_chan || chan > max_chan) break; - GET_DOT11D_INFO(ieee)->channel_map[ChannelPlan[channel_plan].Channel[i]] = 1; + GET_DOT11D_INFO(ieee)->channel_map[chan] = 1; } } break; @@ -1649,9 +1653,11 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) &zero, 0, tx_zero_isr, dev); status = usb_submit_urb(tx_urb_zero, GFP_ATOMIC); if (status) { + int idx = tcb_desc->queue_index; + RT_TRACE(COMP_ERR, "Error TX URB for zero byte %d, error %d", - atomic_read(&priv->tx_pending[tcb_desc->queue_index]), +atomic_read(&priv->tx_pending[idx]), status); return -1; } @@ -1863,7 +1869,9 @@ static void rtl8192_qos_activate(struct work_struct *work) */ for (i = 0; i < QOS_QUEUE_NUM; i++) { /* Mode G/A: slotTimeTimer = 9; Mode B: 20 */ - u1bAIFS = qos_parameters->aifs[i] * ((mode & (IEEE_G | IEEE_N_24G)) ? 9 : 20) + aSifsTime; + int slotTimeTimer = ((mode & (IEEE_G | IEEE_N_24G)) ? 9 : 20); + + u1bAIFS = qos_parameters->aifs[i] * slotTimeTimer + aSifsTime; u1bAIFS <<= AC_PARAM_AIFS_OFFSET; op_limit = (u32)le16_to_cpu(qos_parameters->tx_op_limit[i]); op_limit <<= AC_PARAM_TXOP_LIMIT_OFFSET; @@ -2071,10 +2079,12 @@ static bool GetNmodeSupportBySecCfg8192(struct net_device *dev) return false; } else if ((wpa_ie_len != 0)) { /* parse pairwise key type */ - if (((ieee->wpa_ie[0] == 0xdd) && (!memcmp(&(ieee->wpa_ie[14]), ccmp_ie, 4))) || ((ieee->wpa_ie[0] == 0x30) && (!memcmp(&ieee->wpa_ie[10], ccmp_rsn_ie, 4 - return true; - else - return false; + bool wpaie_dd = (ieee->wpa_ie[0] == 0xdd && +!memcmp(&ieee->wpa_ie[14], ccmp_ie, 4)); + bool wpaie_30 = (ieee->wpa_ie[0] == 0x30 && +!memcmp(&ieee->wpa_ie[10], ccmp_rsn_ie, 4)); + + return (wpaie_dd || wpaie_30); } else { return true; } @@ -2420,9 +2430,9 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) int i; for (i = 0; i < 6; i += 2) { - u16 tmp = 0; + u16 tmp = ((EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1); - tmp = eprom_read(dev, (u16)((EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1)); + tmp = eprom_read(dev, tmp); *(u16 *)(&dev->dev_addr[i]) = tmp; } } else { @@ -2952,9 +2962,11 @@ static bool rtl8192_adapter_start(st
[PATCHv4 2/2] staging: rtl8192u: r8192U_core: reuse local temporary variables to keep lines under 80 characters
Reuse some local temporary variables to reduce line length under the maximum of 80 characters, as per the kernel code style. Signed-off-by: Raphaël Beamonte --- drivers/staging/rtl8192u/r8192U_core.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index e67be02..35f7d0e 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1704,8 +1704,9 @@ static short rtl8192_usb_initendpoints(struct net_device *dev) oldaddr = priv->oldaddr; align = ((long)oldaddr) & 3; if (align) { - newaddr = oldaddr + 4 - align; - priv->rx_urb[16]->transfer_buffer_length = 16 - 4 + align; + align = 4 - align; + newaddr = oldaddr + align; + priv->rx_urb[16]->transfer_buffer_length = 16 - align; } else { newaddr = oldaddr; priv->rx_urb[16]->transfer_buffer_length = 16; @@ -5198,7 +5199,8 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, } else { /* Key Material */ if (KeyContent != NULL) { - write_nic_dword(dev, WCAMI, (u32)(*(KeyContent + i - 2))); + TargetContent = (u32)(*(KeyContent + i - 2)); + write_nic_dword(dev, WCAMI, TargetContent); write_nic_dword(dev, RWCAM, TargetCommand); } } -- 2.5.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 03/10] staging: wilc1000: rename s32Error in host_int_set_mac_chnl_num
Hi Chaehyun, On Fri, Oct 2, 2015 at 10:44 PM, Chaehyun Lim wrote: > This patch replaces s32Error with result to avoid camelcase. > > Signed-off-by: Chaehyun Lim > --- > drivers/staging/wilc1000/host_interface.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c > index 65bd325..566e618 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -5317,7 +5317,7 @@ s32 host_int_get_rx_power_level(tstrWILC_WFIDrv > *hWFIDrv, u8 *pu8RxPowerLevel, > */ > int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum) > { > - int s32Error = 0; > + int result = 0; > tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; > struct host_if_msg msg; > > @@ -5332,13 +5332,13 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv > *hWFIDrv, u8 u8ChNum) > msg.body.channel_info.u8SetChan = u8ChNum; > msg.drvHandler = hWFIDrv; > > - s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct > host_if_msg)); > - if (s32Error) { > + result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); > + if (result) { > PRINT_ER("wilc mq send fail\n"); > - s32Error = -EINVAL; > + result = -EINVAL; Why not just have return -EINVAL; here? > } > > - return s32Error; > + return result; and return 0; here? Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/10] staging: wilc1000: rename s32Error in host_int_wait_msg_queue_idle
Hi Chaehyun, On Fri, Oct 2, 2015 at 10:44 PM, Chaehyun Lim wrote: > This patch replaces s32Error with result to avoid camelcase. > > Signed-off-by: Chaehyun Lim > --- > drivers/staging/wilc1000/host_interface.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c > index e5b7689..69a4e79 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -5344,7 +5344,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, > u8 channel) > > int host_int_wait_msg_queue_idle(void) > { > - int s32Error = 0; > + int result = 0; > > struct host_if_msg msg; > > @@ -5352,16 +5352,16 @@ int host_int_wait_msg_queue_idle(void) > > memset(&msg, 0, sizeof(struct host_if_msg)); > msg.id = HOST_IF_MSG_Q_IDLE; > - s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct > host_if_msg)); > - if (s32Error) { > + result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); > + if (result) { > PRINT_ER("wilc mq send fail\n"); > - s32Error = -EINVAL; > + result = -EINVAL; Same comments here: Why not return -EINVAL; > } > > /* wait untill MSG Q is empty */ > down(&hWaitResponse); > > - return s32Error; > + return result; and return 0; Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle
There is no need to pass the error code to the variable 'result'. Just return the error directly when error occurs. Return 0 at the end of this function when error is not happened. Suggested-by: Julian Calaby Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b1aa7dd..427fbaa 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -5343,7 +5343,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel) int host_int_wait_msg_queue_idle(void) { - int result = 0; + int result; struct host_if_msg msg; @@ -5354,13 +5354,13 @@ int host_int_wait_msg_queue_idle(void) result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); if (result) { PRINT_ER("wilc mq send fail\n"); - result = -EINVAL; + return -EINVAL; } /* wait untill MSG Q is empty */ down(&hWaitResponse); - return result; + return 0; } s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address) -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: wilc1000: return error code directly in host_int_set_mac_chnl_num
There is no need to pass the error code to the variable 'result'. Just return the error directly when error occurs. Return 0 at the end of this function when error is not happened. Suggested-by: Julian Calaby Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 47ccaa8..b1aa7dd 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -5317,7 +5317,7 @@ s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel, */ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel) { - int result = 0; + int result; struct host_if_msg msg; if (!wfi_drv) { @@ -5334,10 +5334,10 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel) result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); if (result) { PRINT_ER("wilc mq send fail\n"); - result = -EINVAL; + return -EINVAL; } - return result; + return 0; } -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: wilc1000: remove pstrWFIDrv in host_int_set_mac_chnl_num
This patch removes pstrWFIDrv variable in host_int_set_mac_chnl_num function. There is no need to make another variable to check if first arugment is NULL or not. It is able to use wfi_drv directly that is first argument of this function. Suggested-by: Greg Kroah-Hartman Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 39d72ac..47ccaa8 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -5318,10 +5318,9 @@ s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel, int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel) { int result = 0; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)wfi_drv; struct host_if_msg msg; - if (!pstrWFIDrv) { + if (!wfi_drv) { PRINT_ER("driver is null\n"); return -EFAULT; } -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle
Hi Chaehyun, On Mon, Oct 5, 2015 at 1:07 PM, Chaehyun Lim wrote: > There is no need to pass the error code to the variable 'result'. > Just return the error directly when error occurs. > Return 0 at the end of this function when error is not happened. We can't do this. > Suggested-by: Julian Calaby > Signed-off-by: Chaehyun Lim > --- > drivers/staging/wilc1000/host_interface.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c > index b1aa7dd..427fbaa 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -5343,7 +5343,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, > u8 channel) > > int host_int_wait_msg_queue_idle(void) > { > - int result = 0; > + int result; > > struct host_if_msg msg; > > @@ -5354,13 +5354,13 @@ int host_int_wait_msg_queue_idle(void) > result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); > if (result) { > PRINT_ER("wilc mq send fail\n"); > - result = -EINVAL; > + return -EINVAL; Returning here means that we don't call down: > } > > /* wait untill MSG Q is empty */ > down(&hWaitResponse); here. Sorry for the confusion. Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle
On Mon, Oct 5, 2015 at 11:41 AM, Julian Calaby wrote: > Hi Chaehyun, > > On Mon, Oct 5, 2015 at 1:07 PM, Chaehyun Lim wrote: >> There is no need to pass the error code to the variable 'result'. >> Just return the error directly when error occurs. >> Return 0 at the end of this function when error is not happened. > > We can't do this. > >> Suggested-by: Julian Calaby >> Signed-off-by: Chaehyun Lim >> --- >> drivers/staging/wilc1000/host_interface.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/staging/wilc1000/host_interface.c >> b/drivers/staging/wilc1000/host_interface.c >> index b1aa7dd..427fbaa 100644 >> --- a/drivers/staging/wilc1000/host_interface.c >> +++ b/drivers/staging/wilc1000/host_interface.c >> @@ -5343,7 +5343,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv >> *wfi_drv, u8 channel) >> >> int host_int_wait_msg_queue_idle(void) >> { >> - int result = 0; >> + int result; >> >> struct host_if_msg msg; >> >> @@ -5354,13 +5354,13 @@ int host_int_wait_msg_queue_idle(void) >> result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct >> host_if_msg)); >> if (result) { >> PRINT_ER("wilc mq send fail\n"); >> - result = -EINVAL; >> + return -EINVAL; > > Returning here means that we don't call down: > >> } >> >> /* wait untill MSG Q is empty */ >> down(&hWaitResponse); > > here. > > Sorry for the confusion. > > Thanks, > Thank you for your comment. I also did not see what you're indicating. regards Chaehyun Lim > -- > Julian Calaby > > Email: julian.cal...@gmail.com > Profile: http://www.google.com/profiles/julian.calaby/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle
Dear Greg Please ignore this patch. Thanks Chaehyun Lim On Mon, Oct 5, 2015 at 11:48 AM, Chaehyun Lim wrote: > On Mon, Oct 5, 2015 at 11:41 AM, Julian Calaby > wrote: >> Hi Chaehyun, >> >> On Mon, Oct 5, 2015 at 1:07 PM, Chaehyun Lim wrote: >>> There is no need to pass the error code to the variable 'result'. >>> Just return the error directly when error occurs. >>> Return 0 at the end of this function when error is not happened. >> >> We can't do this. >> >>> Suggested-by: Julian Calaby >>> Signed-off-by: Chaehyun Lim >>> --- >>> drivers/staging/wilc1000/host_interface.c | 6 +++--- >>> 1 file changed, 3 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/staging/wilc1000/host_interface.c >>> b/drivers/staging/wilc1000/host_interface.c >>> index b1aa7dd..427fbaa 100644 >>> --- a/drivers/staging/wilc1000/host_interface.c >>> +++ b/drivers/staging/wilc1000/host_interface.c >>> @@ -5343,7 +5343,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv >>> *wfi_drv, u8 channel) >>> >>> int host_int_wait_msg_queue_idle(void) >>> { >>> - int result = 0; >>> + int result; >>> >>> struct host_if_msg msg; >>> >>> @@ -5354,13 +5354,13 @@ int host_int_wait_msg_queue_idle(void) >>> result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct >>> host_if_msg)); >>> if (result) { >>> PRINT_ER("wilc mq send fail\n"); >>> - result = -EINVAL; >>> + return -EINVAL; >> >> Returning here means that we don't call down: >> >>> } >>> >>> /* wait untill MSG Q is empty */ >>> down(&hWaitResponse); >> >> here. >> >> Sorry for the confusion. >> >> Thanks, >> > > Thank you for your comment. I also did not see what you're indicating. > > regards > Chaehyun Lim >> -- >> Julian Calaby >> >> Email: julian.cal...@gmail.com >> Profile: http://www.google.com/profiles/julian.calaby/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] drivers: staging: wilc1000: Call kfree only for error cases
On 2015년 10월 04일 19:28, Chandra Gorentla wrote: On Sun, Oct 04, 2015 at 09:44:57AM +0100, Greg KH wrote: On Sat, Oct 03, 2015 at 02:57:30PM +0530, Chandra S Gorentla wrote: - kfree is being called for the members of the queue without de-queuing them; they are just inserted within this function; they are supposed to be de-queued and freed in a function for receiving the queue items - goto statements are removed - After kfree correction, there is no need for target block of goto statement; hence it is removed Signed-off-by: Chandra S Gorentla --- drivers/staging/wilc1000/wilc_msgqueue.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 284a3f5..eae90be 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -56,32 +56,30 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle) int wilc_mq_send(WILC_MsgQueueHandle *pHandle, const void *pvSendBuffer, u32 u32SendBufferSize) { - int result = 0; unsigned long flags; Message *pstrMessage = NULL; if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) { PRINT_ER("pHandle or pvSendBuffer is null\n"); - result = -EFAULT; - goto ERRORHANDLER; + return -EFAULT; } if (pHandle->bExiting) { PRINT_ER("pHandle fail\n"); - result = -EFAULT; - goto ERRORHANDLER; + return -EFAULT; } /* construct a new message */ pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); if (!pstrMessage) return -ENOMEM; + pstrMessage->u32Length = u32SendBufferSize; pstrMessage->pstrNext = NULL; pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC); if (!pstrMessage->pvBuffer) { - result = -ENOMEM; - goto ERRORHANDLER; + kfree(pstrMessage); + return -ENOMEM; } memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize); @@ -102,15 +100,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); up(&pHandle->hSem); - -ERRORHANDLER: - /* error occured, free any allocations */ - if (pstrMessage) { - kfree(pstrMessage->pvBuffer); - kfree(pstrMessage); - } - - return result; + return 0; Aren't you now leaking memory as you aren't freeing pstrMessage and the buffer on the "normal" return path? In the normal path kfree is called in a separate (wilc_mq_recv) function. The purpose of the currently modified function (wilc_mq_send) is to post a message to a queue by allocating memory for the message. The receiver function is supposed to remove the message from the queue and free the memory. This patch is reasonable and normal free is done in recv function as Chandra said. Thanks, Tony. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] drivers: staging: wilc1000: Move spin lock to the start of critical section
On 2015년 10월 04일 17:43, Greg KH wrote: On Sat, Oct 03, 2015 at 02:57:29PM +0530, Chandra S Gorentla wrote: The spin_lock_irqsave is moved to just beginning of critical section. This change moves a couple of return statements out of the lock. Signed-off-by: Chandra S Gorentla --- drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index d5ebd6d..284a3f5 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -72,8 +72,6 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, goto ERRORHANDLER; } - spin_lock_irqsave(&pHandle->strCriticalSection, flags); - /* construct a new message */ pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); As you have moved the lock, can you also change this to GFP_KERNEL as well because we do not have a lock held? And how have you tested that this is ok? What is this lock trying to protect? This function is called even in interrupt context, so GFP_ATOMIC should be called. The spinlock also should protect pstrMessage from allocating the memory, so we don't place it to the beginning of critical section as Chandra said. Thanks, Tony. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] vme: tsi148: silence uninitialized variable warning
The warning is a false positive. drivers/vme/bridges/vme_tsi148.c: In function 'tsi148_master_write': drivers/vme/bridges/vme_tsi148.c:1358:31: warning: 'handler' may be used uninitialized in this function [-Wmaybe-uninitialized] vme_unregister_error_handler(handler); ^ drivers/vme/bridges/vme_tsi148.c: In function 'tsi148_master_read': drivers/vme/bridges/vme_tsi148.c:1260:31: warning: 'handler' may be used uninitialized in this function [-Wmaybe-uninitialized] vme_unregister_error_handler(handler); ^ Fixes: 0b0496625715 ("vme: change bus error handling scheme") Signed-off-by: Dmitry Kalinkin --- drivers/vme/bridges/vme_tsi148.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c index d1e383b..6052483 100644 --- a/drivers/vme/bridges/vme_tsi148.c +++ b/drivers/vme/bridges/vme_tsi148.c @@ -1186,7 +1186,7 @@ static ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf, int retval, enabled; unsigned long long vme_base, size; u32 aspace, cycle, dwidth; - struct vme_error_handler *handler; + struct vme_error_handler *handler = NULL; struct vme_bridge *tsi148_bridge; void __iomem *addr = image->kern_base + offset; unsigned int done = 0; @@ -1276,7 +1276,7 @@ static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf, unsigned int done = 0; unsigned int count32; - struct vme_error_handler *handler; + struct vme_error_handler *handler = NULL; struct vme_bridge *tsi148_bridge; struct tsi148_driver *bridge; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 2/3] staging: wilc1000: rename pUserData
This patch renames pUserData to data to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- V2: rename strHostIfRegisterFrame to reg_frame instead of reg_f because it is ambiguous --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index dd65edb..10d4d9f 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -386,7 +386,7 @@ union message_body { struct ba_session_info session_info; struct remain_ch remain_on_ch; struct reg_frame reg_frame; - char *pUserData; + char *data; struct del_all_sta strHostIFDelAllSta; }; @@ -4105,7 +4105,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_GET_STATISTICS: - Handle_GetStatistics(msg.drvHandler, (tstrStatistics *)msg.body.pUserData); + Handle_GetStatistics(msg.drvHandler, (tstrStatistics *)msg.body.data); break; case HOST_IF_MSG_GET_CHNL: @@ -5682,7 +5682,7 @@ s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatis memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_GET_STATISTICS; - msg.body.pUserData = (char *)pstrStatistics; + msg.body.data = (char *)pstrStatistics; msg.drvHandler = hWFIDrv; /* send the message */ s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 3/3] staging: wilc1000: rename strHostIFDelAllSta
This patch renames strHostIFDelAllSta to del_all_sta_info to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- V2: rename strHostIfRegisterFrame to reg_frame instead of reg_f because it is ambiguous --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 10d4d9f..9f715cf 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -387,7 +387,7 @@ union message_body { struct remain_ch remain_on_ch; struct reg_frame reg_frame; char *data; - struct del_all_sta strHostIFDelAllSta; + struct del_all_sta del_all_sta_info; }; /*! @@ -4206,7 +4206,7 @@ static int hostIFthread(void *pvArg) break; case HOST_IF_MSG_DEL_ALL_STA: - Handle_DelAllSta(msg.drvHandler, &msg.body.strHostIFDelAllSta); + Handle_DelAllSta(msg.drvHandler, &msg.body.del_all_sta_info); break; default: @@ -6719,7 +6719,7 @@ s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]) s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; struct host_if_msg msg; - struct del_all_sta *pstrDelAllStationMsg = &msg.body.strHostIFDelAllSta; + struct del_all_sta *pstrDelAllStationMsg = &msg.body.del_all_sta_info; u8 au8Zero_Buff[ETH_ALEN] = {0}; u32 i; u8 u8AssocNumb = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 1/3] staging: wilc1000: rename strHostIfRegisterFrame
This patch renames strHostIfRegisterFrame to reg_frame to avoid CamelCase naming convention. Signed-off-by: Tony Cho --- V2: rename strHostIfRegisterFrame to reg_frame instead of reg_f because it is ambiguous --- drivers/staging/wilc1000/host_interface.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 39d72ac..dd65edb 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -385,7 +385,7 @@ union message_body { struct get_mac_addr get_mac_info; struct ba_session_info session_info; struct remain_ch remain_on_ch; - struct reg_frame strHostIfRegisterFrame; + struct reg_frame reg_frame; char *pUserData; struct del_all_sta strHostIFDelAllSta; }; @@ -4185,7 +4185,7 @@ static int hostIFthread(void *pvArg) case HOST_IF_MSG_REGISTER_FRAME: PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_REGISTER_FRAME\n"); - Handle_RegisterFrame(msg.drvHandler, &msg.body.strHostIfRegisterFrame); + Handle_RegisterFrame(msg.drvHandler, &msg.body.reg_frame); break; case HOST_IF_MSG_LISTEN_TIMER_FIRED: @@ -6482,20 +6482,20 @@ s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bRe switch (u16FrameType) { case ACTION: PRINT_D(HOSTINF_DBG, "ACTION\n"); - msg.body.strHostIfRegisterFrame.u8Regid = ACTION_FRM_IDX; + msg.body.reg_frame.u8Regid = ACTION_FRM_IDX; break; case PROBE_REQ: PRINT_D(HOSTINF_DBG, "PROBE REQ\n"); - msg.body.strHostIfRegisterFrame.u8Regid = PROBE_REQ_IDX; + msg.body.reg_frame.u8Regid = PROBE_REQ_IDX; break; default: PRINT_D(HOSTINF_DBG, "Not valid frame type\n"); break; } - msg.body.strHostIfRegisterFrame.u16FrameType = u16FrameType; - msg.body.strHostIfRegisterFrame.bReg = bReg; + msg.body.reg_frame.u16FrameType = u16FrameType; + msg.body.reg_frame.bReg = bReg; msg.drvHandler = hWFIDrv; s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: i20: Added a blank line after declaration
On Sat, Oct 03, 2015 at 10:47:47AM +0530, Anjali Menon wrote: > Added a blank line after declaration to fix the coding style > warning detected by checkpatch.pl > > WARNING: Missing a blank line after declarations > > Signed-off-by: Anjali Menon > --- > drivers/staging/i2o/pci.c | 1 + > 1 file changed, 1 insertion(+) How did you get this? i2o was removed from staging in May 2015. Which tree are you using? regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/18] staging: wilc1000: remove typedef from tuniHostIFkeyAttr
From: Leo Kim This patch remove typedef from the union tuniHostIFkeyAttr. And rename it to host_if_key_attr. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2e71505..f4c5ec3 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -116,7 +116,7 @@ typedef struct _tstrHostIFwepAttr { } tstrHostIFwepAttr; /*! - * @struct tuniHostIFkeyAttr + * @struct host_if_key_attr * @brief Structure to hold Host IF Scan Attributes * @details * @todo @@ -125,11 +125,11 @@ typedef struct _tstrHostIFwepAttr { * @date 25 March 2012 * @version 1.0 */ -typedef union _tuniHostIFkeyAttr { +union host_if_key_attr { tstrHostIFwepAttr strHostIFwepAttr; tstrHostIFwpaAttr strHostIFwpaAttr; tstrHostIFpmkidAttr strHostIFpmkidAttr; -} tuniHostIFkeyAttr; +}; /*! * @struct key_attr @@ -144,7 +144,7 @@ typedef union _tuniHostIFkeyAttr { struct key_attr { enum KEY_TYPE enuKeyType; u8 u8KeyAction; - tuniHostIFkeyAttr uniHostIFkeyAttr; + union host_if_key_attr uniHostIFkeyAttr; }; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/18] staging: wilc1000: rename tWILCpfScanResult
From: Leo Kim This patch renames tWILCpfScanResult to wilc_scan_result. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 9f715cf..86fa968 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -167,7 +167,7 @@ struct scan_attr { u8 u8ChnlListLen; u8 *pu8IEs; size_t IEsLen; - tWILCpfScanResult pfScanResult; + wilc_scan_result pfScanResult; void *pvUserArg; tstrHiddenNetwork strHiddenNetwork; }; @@ -5715,7 +5715,7 @@ s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatis s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource, u8 u8ScanType, u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs, - size_t IEsLen, tWILCpfScanResult ScanResult, + size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork) { s32 s32Error = 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index bc8acde..c9ea34e 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -181,7 +181,7 @@ typedef enum { /*Scan callBack function definition*/ -typedef void (*tWILCpfScanResult)(tenuScanEvent, tstrNetworkInfo *, void *, void *); +typedef void (*wilc_scan_result)(tenuScanEvent, tstrNetworkInfo *, void *, void *); /*Connect callBack function definition*/ typedef void (*tWILCpfConnectResult)(tenuConnDisconnEvent, @@ -228,7 +228,7 @@ typedef struct _tstrHiddenNetwork { typedef struct { /* Scan user call back function */ - tWILCpfScanResult pfUserScanResult; + wilc_scan_result pfUserScanResult; /* User specific parameter to be delivered through the Scan User Callback function */ void *u32UserScanPvoid; @@ -872,7 +872,7 @@ s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd); s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource, u8 u8ScanType, u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs, - size_t IEsLen, tWILCpfScanResult ScanResult, + size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork); /** * @brief sets configuration wids values -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/18] staging: wilc1000: rename tWILCpfConnectResult
From: Leo Kim This patch renames tWILCpfConnectResult to wilc_connect_result. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b9b57ca..2e2a7819 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -189,7 +189,7 @@ struct connect_attr { u8 *pu8IEs; size_t IEsLen; u8 u8security; - tWILCpfConnectResult pfConnectResult; + wilc_connect_result pfConnectResult; void *pvUserArg; AUTHTYPE_T tenuAuth_type; u8 u8channel; @@ -4999,7 +4999,7 @@ s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource) s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid, const u8 *pu8ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, - tWILCpfConnectResult pfConnectResult, void *pvUserArg, + wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, AUTHTYPE_T tenuAuth_type, u8 u8channel, void *pJoinParams) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 458b1e1..bed8f98 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -184,7 +184,7 @@ typedef enum { typedef void (*wilc_scan_result)(tenuScanEvent, tstrNetworkInfo *, void *, void *); /*Connect callBack function definition*/ -typedef void (*tWILCpfConnectResult)(tenuConnDisconnEvent, +typedef void (*wilc_connect_result)(tenuConnDisconnEvent, tstrConnectInfo *, u8, tstrDisconnectNotifInfo *, @@ -245,7 +245,7 @@ typedef struct { u8 *pu8ConnReqIEs; size_t ConnReqIEsLen; /* Connect user call back function */ - tWILCpfConnectResult pfUserConnectResult; + wilc_connect_result pfUserConnectResult; bool IsHTCapable; /* User specific parameter to be delivered through the Connect User Callback function */ void *u32UserConnectPvoid; @@ -698,7 +698,7 @@ s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource); s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid, const u8 *pu8ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, - tWILCpfConnectResult pfConnectResult, void *pvUserArg, + wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, AUTHTYPE_T tenuAuth_type, u8 u8channel, void *pJoinParams); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/18] staging: wilc1000: remove typedef from tenuKeyType
From: Leo Kim This patch remove typedef from the enum tenuKeyType. And rename it to KEY_TYPE. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/host_interface.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index bcfbb91..2e71505 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -142,7 +142,7 @@ typedef union _tuniHostIFkeyAttr { * @version 1.0 */ struct key_attr { - tenuKeyType enuKeyType; + enum KEY_TYPE enuKeyType; u8 u8KeyAction; tuniHostIFkeyAttr uniHostIFkeyAttr; }; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 779ff99..856cab0 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -172,12 +172,12 @@ typedef enum { CONN_DISCONN_EVENT_FORCE_32BIT = 0x } tenuConnDisconnEvent; -typedef enum { +enum KEY_TYPE { WEP, WPARxGtk, WPAPtk, PMKSA, -} tenuKeyType; +}; /*Scan callBack function definition*/ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/18] staging: wilc1000: remove typedef from tstrHostIFwepAttr
From: Leo Kim This patch removes typedef from the struct tstrHostIFwepAttr. And rename it to host_if_wep_attr. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index f4c5ec3..87866c4 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -97,7 +97,7 @@ typedef struct _tstrHostIFwpaAttr { /*! - * @struct tstrHostIFwepAttr + * @struct host_if_wep_attr * @brief Structure to hold Host IF Scan Attributes * @details * @todo @@ -106,14 +106,13 @@ typedef struct _tstrHostIFwpaAttr { * @date 25 March 2012 * @version 1.0 */ -typedef struct _tstrHostIFwepAttr { +struct host_if_wep_attr { u8 *pu8WepKey; u8 u8WepKeylen; u8 u8Wepidx; u8 u8mode; enum AUTHTYPE tenuAuth_type; - -} tstrHostIFwepAttr; +}; /*! * @struct host_if_key_attr @@ -126,7 +125,7 @@ typedef struct _tstrHostIFwepAttr { * @version 1.0 */ union host_if_key_attr { - tstrHostIFwepAttr strHostIFwepAttr; + struct host_if_wep_attr strHostIFwepAttr; tstrHostIFwpaAttr strHostIFwpaAttr; tstrHostIFpmkidAttr strHostIFpmkidAttr; }; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/18] staging: wilc1000: remove typedef from tstrHiddenNetwork
From: Leo Kim This patch removes typedef from the struct tstrHiddenNetwork. And, rename it to hidden_network. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 5 +++-- drivers/staging/wilc1000/host_interface.h | 8 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 86fa968..b9b57ca 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -169,7 +169,7 @@ struct scan_attr { size_t IEsLen; wilc_scan_result pfScanResult; void *pvUserArg; - tstrHiddenNetwork strHiddenNetwork; + struct hidden_network strHiddenNetwork; }; /*! @@ -5716,7 +5716,8 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource, u8 u8ScanType, u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs, size_t IEsLen, wilc_scan_result ScanResult, - void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork) + void *pvUserArg, + struct hidden_network *pstrHiddenNetwork) { s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index c9ea34e..458b1e1 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -219,12 +219,11 @@ typedef struct _tstrHiddenNetworkInfo { } tstrHiddenNetworkInfo; -typedef struct _tstrHiddenNetwork { +struct hidden_network { /* MAX_SSID_LEN */ tstrHiddenNetworkInfo *pstrHiddenNetworkInfo; u8 u8ssidnum; - -} tstrHiddenNetwork; +}; typedef struct { /* Scan user call back function */ @@ -873,7 +872,8 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource, u8 u8ScanType, u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs, size_t IEsLen, wilc_scan_result ScanResult, - void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork); + void *pvUserArg, + struct hidden_network *pstrHiddenNetwork); /** * @brief sets configuration wids values * @details diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 04838f1..f3720e7 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -698,7 +698,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) u32 i; s32 s32Error = 0; u8 au8ScanChanList[MAX_NUM_SCANNED_NETWORKS]; - tstrHiddenNetwork strHiddenNetwork; + struct hidden_network strHiddenNetwork; priv = wiphy_priv(wiphy); @@ -727,7 +727,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) if (request->n_ssids >= 1) { - strHiddenNetwork.pstrHiddenNetworkInfo = kmalloc(request->n_ssids * sizeof(tstrHiddenNetwork), GFP_KERNEL); + strHiddenNetwork.pstrHiddenNetworkInfo = kmalloc(request->n_ssids * sizeof(struct hidden_network), GFP_KERNEL); strHiddenNetwork.u8ssidnum = request->n_ssids; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/18] staging: wilc1000: remove typedef from AUTHTYPE_T
From: Leo Kim This patch removes typedef from the enum AUTHTYPE_T. And, rename it to AUTHTYPE. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 8 drivers/staging/wilc1000/host_interface.h | 6 +++--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++-- drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2e2a7819..bcfbb91 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -111,7 +111,7 @@ typedef struct _tstrHostIFwepAttr { u8 u8WepKeylen; u8 u8Wepidx; u8 u8mode; - AUTHTYPE_T tenuAuth_type; + enum AUTHTYPE tenuAuth_type; } tstrHostIFwepAttr; @@ -191,7 +191,7 @@ struct connect_attr { u8 u8security; wilc_connect_result pfConnectResult; void *pvUserArg; - AUTHTYPE_T tenuAuth_type; + enum AUTHTYPE tenuAuth_type; u8 u8channel; void *pJoinParams; }; @@ -4455,7 +4455,7 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, * @date 28 FEB 2013 * @version 1.0 */ -s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type) +s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, enum AUTHTYPE tenuAuth_type) { s32 s32Error = 0; @@ -5000,7 +5000,7 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid, const u8 *pu8ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, - u8 u8security, AUTHTYPE_T tenuAuth_type, + u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams) { diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index bed8f98..779ff99 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -240,7 +240,7 @@ typedef struct { u8 *pu8bssid; u8 *pu8ssid; u8 u8security; - AUTHTYPE_T tenuAuth_type; + enum AUTHTYPE tenuAuth_type; size_t ssidLen; u8 *pu8ConnReqIEs; size_t ConnReqIEsLen; @@ -455,7 +455,7 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, * @date 28 Feb 2013 * @version 1.0 */ -s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type); +s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, enum AUTHTYPE tenuAuth_type); /** * @brief adds ptk Key @@ -699,7 +699,7 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid, const u8 *pu8ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, - u8 u8security, AUTHTYPE_T tenuAuth_type, + u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index f3720e7..788cfaa 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -786,7 +786,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, s32 s32Error = 0; u32 i; u8 u8security = NO_ENCRYPT; - AUTHTYPE_T tenuAuth_type = ANY; + enum AUTHTYPE tenuAuth_type = ANY; char *pcgroup_encrypt_val = NULL; char *pccipher_group = NULL; char *pcwpa_version = NULL; @@ -1085,7 +1085,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, u8 u8mode = NO_ENCRYPT; u8 u8gmode = NO_ENCRYPT; u8 u8pmode = NO_ENCRYPT; - AUTHTYPE_T tenuAuth_type = ANY; + enum AUTHTYPE tenuAuth_type = ANY; priv = wiphy_priv(wiphy); diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 327ea03..b5b5c67 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -219,12 +219,12 @@ typedef enum { WPA2_AE
[PATCH 09/18] staging: wilc1000: remove typedef from tstrHostIFpmkidAttr
From: Leo Kim This patch removes typedef from the struct tstrHostIFpmkidAttr. And rename it to host_if_pmkid_attr. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 6 +++--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b5de66a..adc81cd 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -127,7 +127,7 @@ struct host_if_wep_attr { union host_if_key_attr { struct host_if_wep_attr strHostIFwepAttr; struct host_if_wpa_attr strHostIFwpaAttr; - tstrHostIFpmkidAttr strHostIFpmkidAttr; + struct host_if_pmkid_attr strHostIFpmkidAttr; }; /*! @@ -4725,7 +4725,7 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe * @date 8 March 2012 * @version 1.0 */ -s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray) +s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, struct host_if_pmkid_attr *pu8PmkidInfoArray) { s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 856cab0..e9a9715 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -88,10 +88,10 @@ typedef struct _tstrHostIFpmkid { u8 pmkid[PMKID_LEN]; } tstrHostIFpmkid; -typedef struct _tstrHostIFpmkidAttr { +struct host_if_pmkid_attr { u8 numpmkid; tstrHostIFpmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; -} tstrHostIFpmkidAttr; +}; typedef enum { AUTORATE= 0, @@ -550,7 +550,7 @@ s32 host_int_add_tx_gtk(tstrWILC_WFIDrv *hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 * @version 1.0 */ -s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray); +s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, struct host_if_pmkid_attr *pu8PmkidInfoArray); /** * @brief gets the cached the pmkid info * @detailsvalid only in BSS STA mode if External Supplicant diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 788cfaa..eac77ce3 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1924,7 +1924,7 @@ static int flush_pmksa(struct wiphy *wiphy, struct net_device *netdev) PRINT_D(CFG80211_DBG, "Flushing PMKID key values\n"); /*Get cashed Pmkids and set all with zeros*/ - memset(&priv->pmkid_list, 0, sizeof(tstrHostIFpmkidAttr)); + memset(&priv->pmkid_list, 0, sizeof(struct host_if_pmkid_attr)); return 0; } diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index d25092d..cb21968 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -122,7 +122,7 @@ struct wilc_priv { struct net_device *dev; struct napi_struct napi; tstrWILC_WFIDrv *hWILCWFIDrv; - tstrHostIFpmkidAttr pmkid_list; + struct host_if_pmkid_attr pmkid_list; struct WILC_WFI_stats netstats; u8 WILC_WFI_wep_default; u8 WILC_WFI_wep_key[4][WLAN_KEY_LEN_WEP104]; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/18] staging: wilc1000: remove typedef from tstrHostIFpmkid
From: Leo Kim This patch removes typedef from the struct tstrHostIFpmkid. And rename it to host_if_pmkid. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.h | 6 +++--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index e9a9715..460c73b 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -83,14 +83,14 @@ typedef enum { HOST_IF_FORCE_32BIT = 0x } tenuHostIFstate; -typedef struct _tstrHostIFpmkid { +struct host_if_pmkid { u8 bssid[ETH_ALEN]; u8 pmkid[PMKID_LEN]; -} tstrHostIFpmkid; +}; struct host_if_pmkid_attr { u8 numpmkid; - tstrHostIFpmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; + struct host_if_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; }; typedef enum { diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index eac77ce3..8068a7e 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1885,7 +1885,7 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev, ETH_ALEN)) { /*If bssid is found, reset the values*/ PRINT_D(CFG80211_DBG, "Reseting PMKID values\n"); - memset(&priv->pmkid_list.pmkidlist[i], 0, sizeof(tstrHostIFpmkid)); + memset(&priv->pmkid_list.pmkidlist[i], 0, sizeof(struct host_if_pmkid)); flag = PMKID_FOUND; break; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/18] staging: wilc1000: remove typedef from SITE_SURVEY_T
From: Leo Kim This patch remove typedef from the enum SITE_SURVEY_T. And rename it to SITESURVEY. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.h | 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 69c5a94..1ed21a2 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -125,7 +125,7 @@ struct cfg_param_val { u8 txop_prot_disabled; u16 beacon_interval; u16 dtim_period; - SITE_SURVEY_T site_survey_enabled; + enum SITESURVEY site_survey_enabled; u16 site_survey_scan_time; u8 scan_source; u16 active_scan_time; diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index b5b5c67..8fec64d 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -226,11 +226,11 @@ enum AUTHTYPE { IEEE8021= 5 }; -typedef enum { +enum SITESURVEY { SITE_SURVEY_1CH = 0, SITE_SURVEY_ALL_CH = 1, SITE_SURVEY_OFF = 2 -} SITE_SURVEY_T; +}; typedef enum { NORMAL_ACK = 0, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/18] staging: wilc1000: rename tWILCpfRemainOnChanReady
From: Leo Kim This patch renames tWILCpfRemainOnChanReady to wilc_remain_on_chan_ready. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/host_interface.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c929b06..dd444d1 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -6384,7 +6384,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length) * @date * @version 1.0 */ -s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg) +s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, wilc_remain_on_chan_ready RemainOnChanReady, void *pvUserArg) { s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index d33e4ee..7c2846e 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -191,7 +191,7 @@ typedef void (*wilc_connect_result)(tenuConnDisconnEvent, void *); typedef void (*wilc_remain_on_chan_expired)(void *, u32); /*Remain on channel expiration callback function*/ -typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback function*/ +typedef void (*wilc_remain_on_chan_ready)(void *); /*Remain on channel callback function*/ /* typedef u32 WILC_WFIDrvHandle; */ typedef struct { @@ -278,7 +278,7 @@ struct remain_ch { u16 u16Channel; u32 u32duration; wilc_remain_on_chan_expired pRemainOnChanExpired; - tWILCpfRemainOnChanReady pRemainOnChanReady; + wilc_remain_on_chan_ready pRemainOnChanReady; void *pVoid; u32 u32ListenSessionID; }; @@ -1149,7 +1149,7 @@ s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx); * @date * @version 1.0 */ -s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg); +s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, wilc_remain_on_chan_ready RemainOnChanReady, void *pvUserArg); /** * @brief host_int_ListenStateExpired -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/18] staging: wilc1000: remove typedef from tstrCfgParamVal
From: Leo Kim This patch removes typedef from the struct tstrCfgParamVal. And rename it to cfg_param_val. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 8 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index adc81cd..073a724 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -72,7 +72,7 @@ extern u8 g_wilc_initialized; * @version 1.0 */ struct cfg_param_attr { - tstrCfgParamVal pstrCfgParamVal; + struct cfg_param_val pstrCfgParamVal; }; /*! @@ -5783,7 +5783,7 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource, * @date 8 March 2012 * @version 1.0 */ -s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal) +s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal) { s32 s32Error = 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 460c73b..69c5a94 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -109,7 +109,7 @@ typedef enum { MBPS_54 = 54 } CURRENT_TX_RATE_T; -typedef struct { +struct cfg_param_val { u32 u32SetCfgFlag; u8 ht_enable; u8 bss_type; @@ -132,7 +132,7 @@ typedef struct { u16 passive_scan_time; CURRENT_TX_RATE_T curr_tx_rate; -} tstrCfgParamVal; +}; typedef enum { RETRY_SHORT = BIT(0), @@ -319,7 +319,7 @@ typedef struct { tenuHostIFstate enuHostIFstate; u8 au8AssociatedBSSID[ETH_ALEN]; - tstrCfgParamVal strCfgValues; + struct cfg_param_val strCfgValues; /* semaphores */ struct semaphore gtOsCfgValuesSem; struct semaphore hSemTestKeyBlock; @@ -885,7 +885,7 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource, * @date 8 March 2012 * @version 1.0 */ -s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal); +s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal); /** * @brief gets configuration wids values diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 8068a7e..5905040 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1742,7 +1742,7 @@ static int WILC_WFI_disassoc(struct wiphy *wiphy, struct net_device *dev, static int set_wiphy_params(struct wiphy *wiphy, u32 changed) { s32 s32Error = 0; - tstrCfgParamVal pstrCfgParamVal; + struct cfg_param_val pstrCfgParamVal; struct wilc_priv *priv; priv = wiphy_priv(wiphy); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/18] staging: wilc1000: rename tWILCpfRemainOnChanExpired
From: Leo Kim This patch renames tWILCpfRemainOnChanExpired to wilc_remain_on_chan_expired. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/host_interface.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4dbb970..c929b06 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -6384,7 +6384,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length) * @date * @version 1.0 */ -s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg) +s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg) { s32 s32Error = 0; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 5993cd8..d33e4ee 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -190,7 +190,7 @@ typedef void (*wilc_connect_result)(tenuConnDisconnEvent, tstrDisconnectNotifInfo *, void *); -typedef void (*tWILCpfRemainOnChanExpired)(void *, u32); /*Remain on channel expiration callback function*/ +typedef void (*wilc_remain_on_chan_expired)(void *, u32); /*Remain on channel expiration callback function*/ typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback function*/ /* typedef u32 WILC_WFIDrvHandle; */ @@ -277,7 +277,7 @@ struct ba_session_info { struct remain_ch { u16 u16Channel; u32 u32duration; - tWILCpfRemainOnChanExpired pRemainOnChanExpired; + wilc_remain_on_chan_expired pRemainOnChanExpired; tWILCpfRemainOnChanReady pRemainOnChanReady; void *pVoid; u32 u32ListenSessionID; @@ -1149,7 +1149,7 @@ s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx); * @date * @version 1.0 */ -s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg); +s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, wilc_remain_on_chan_expired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg); /** * @brief host_int_ListenStateExpired -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/18] staging: wilc1000: remove typedef from tstrHostIFwpaAttr
From: Leo Kim This patch removes typedef from the struct tstrHostIFwpaAttr. And rename it to host_if_wpa_attr. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 87866c4..b5de66a 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -76,7 +76,7 @@ struct cfg_param_attr { }; /*! - * @struct tstrHostIFwpaAttr + * @struct host_if_wpa_attr * @brief Structure to hold Host IF Scan Attributes * @details * @todo @@ -85,7 +85,7 @@ struct cfg_param_attr { * @date 25 March 2012 * @version 1.0 */ -typedef struct _tstrHostIFwpaAttr { +struct host_if_wpa_attr { u8 *pu8key; const u8 *pu8macaddr; u8 *pu8seq; @@ -93,7 +93,7 @@ typedef struct _tstrHostIFwpaAttr { u8 u8keyidx; u8 u8Keylen; u8 u8Ciphermode; -} tstrHostIFwpaAttr; +}; /*! @@ -126,7 +126,7 @@ struct host_if_wep_attr { */ union host_if_key_attr { struct host_if_wep_attr strHostIFwepAttr; - tstrHostIFwpaAttr strHostIFwpaAttr; + struct host_if_wpa_attr strHostIFwpaAttr; tstrHostIFpmkidAttr strHostIFpmkidAttr; }; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/18] staging: wilc1000: wilc_wfi_cfgoperations.c : remove unused functions
From: Leo Kim This patch removes unused functions from the wilc_wfi_cfgoperations.c. - WILC_WFI_dump_survey - WILC_WFI_auth - WILC_WFI_assoc - WILC_WFI_deauth - WILC_WFI_disassoc - WILC_WFI_set_bitrate_mask Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 109 -- 1 file changed, 109 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 5905040..2f67546 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1533,31 +1533,6 @@ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 ke } /** - * @brief WILC_WFI_dump_survey - * @detailsGet site survey information - * @param[in] - * @return int : Return 0 on Success. - * @authormdaftedar - * @date 01 MAR 2012 - * @version 1.0 - */ -static int WILC_WFI_dump_survey(struct wiphy *wiphy, struct net_device *netdev, - int idx, struct survey_info *info) -{ - s32 s32Error = 0; - - - if (idx != 0) { - s32Error = -ENOENT; - PRINT_ER("Error Idx value doesn't equal zero: Error(%d)\n", s32Error); - - } - - return s32Error; -} - - -/** * @brief get_station * @detailsGet station information for the station identified by @mac * @param[in] NONE @@ -1666,70 +1641,6 @@ static int change_bss(struct wiphy *wiphy, struct net_device *dev, } /** - * @brief WILC_WFI_auth - * @detailsRequest to authenticate with the specified peer - * @param[in] - * @return int : Return 0 on Success. - * @authormdaftedar - * @date 01 MAR 2012 - * @version 1.0 - */ -static int WILC_WFI_auth(struct wiphy *wiphy, struct net_device *dev, -struct cfg80211_auth_request *req) -{ - PRINT_D(CFG80211_DBG, "In Authentication Function\n"); - return 0; -} - -/** - * @brief WILC_WFI_assoc - * @detailsRequest to (re)associate with the specified peer - * @param[in] - * @return int : Return 0 on Success. - * @authormdaftedar - * @date 01 MAR 2012 - * @version 1.0 - */ -static int WILC_WFI_assoc(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_assoc_request *req) -{ - PRINT_D(CFG80211_DBG, "In Association Function\n"); - return 0; -} - -/** - * @brief WILC_WFI_deauth - * @detailsRequest to deauthenticate from the specified peer - * @param[in] - * @return int : Return 0 on Success. - * @authormdaftedar - * @date 01 MAR 2012 - * @version 1.0 - */ -static int WILC_WFI_deauth(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_deauth_request *req, void *cookie) -{ - PRINT_D(CFG80211_DBG, "In De-authentication Function\n"); - return 0; -} - -/** - * @brief WILC_WFI_disassoc - * @detailsRequest to disassociate from the specified peer - * @param[in] - * @return int : Return 0 on Success - * @authormdaftedar - * @date 01 MAR 2012 - * @version 1.0 - */ -static int WILC_WFI_disassoc(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_disassoc_request *req, void *cookie) -{ - PRINT_D(CFG80211_DBG, "In Disassociation Function\n"); - return 0; -} - -/** * @brief set_wiphy_params * @detailsNotify that wiphy parameters have changed; * @param[in] Changed bitfield (see &enum wiphy_params_flags) describes which values @@ -1788,26 +1699,6 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 changed) } /** - * @brief WILC_WFI_set_bitrate_mask - * @detailsset the bitrate mask configuration - * @param[in] - * @return int : Return 0 on Success - * @authormdaftedar - * @date 01 MAR 2012 - * @version 1.0 - */ -static int WILC_WFI_set_bitrate_mask(struct wiphy *wiphy, -struct net_device *dev, const u8 *peer, -const struct cfg80211_bitrate_mask *mask) -{ - s32 s32Error = 0; - - PRINT_D(CFG80211_DBG, "Setting Bitrate mask function\n"); - return s32Error; - -} - -/** * @brief set_pmksa * @detailsCache a PMKID for a BSSID. This is mostly useful for fullmac * devices running firmwares capable of generating the (re) association -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/18] staging: wilc1000: remove typedef from CURRENT_TX_RATE_T
From: Leo Kim This patch remove typedef from the enum CURRENT_TX_RATE_T. And rename it to CURRENT_TXRATE. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/host_interface.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 073a724..4dbb970 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1155,7 +1155,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, u8WidCnt++; } if (strHostIFCfgParamAttr->pstrCfgParamVal.u32SetCfgFlag & CURRENT_TX_RATE) { - CURRENT_TX_RATE_T curr_tx_rate = strHostIFCfgParamAttr->pstrCfgParamVal.curr_tx_rate; + enum CURRENT_TXRATE curr_tx_rate = strHostIFCfgParamAttr->pstrCfgParamVal.curr_tx_rate; /*--*/ /*Rates:1 2 5.5 11 6 9 12 18 24 36 48 54 Auto */ /*InputValues: 1 2 34 5 6 7 8 9 10 11 12 0 */ diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 1ed21a2..5993cd8 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -93,7 +93,7 @@ struct host_if_pmkid_attr { struct host_if_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; }; -typedef enum { +enum CURRENT_TXRATE { AUTORATE= 0, MBPS_1 = 1, MBPS_2 = 2, @@ -107,7 +107,7 @@ typedef enum { MBPS_36 = 36, MBPS_48 = 48, MBPS_54 = 54 -} CURRENT_TX_RATE_T; +}; struct cfg_param_val { u32 u32SetCfgFlag; @@ -130,7 +130,7 @@ struct cfg_param_val { u8 scan_source; u16 active_scan_time; u16 passive_scan_time; - CURRENT_TX_RATE_T curr_tx_rate; + enum CURRENT_TXRATE curr_tx_rate; }; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/18] staging: wilc1000: remove unused functions
From: Leo Kim This patch removes unused functions. - drivers/staging/wilc1000/linux_mon.c : WILC_WFI_mon_setup - drivers/staging/wilc1000/wilc_sdio.o : sdio_set_func0_csa_address_byte0 Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/linux_mon.c | 26 -- drivers/staging/wilc1000/wilc_sdio.c | 22 -- 2 files changed, 48 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index a943b23..bde4095 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -311,32 +311,6 @@ static const struct net_device_ops wilc_wfi_netdev_ops = { }; /** - * @brief WILC_WFI_mon_setup - * @details - * @param[in] - * @return int : Return 0 on Success - * @authormdaftedar - * @date 12 JUL 2012 - * @version 1.0 - */ -static void WILC_WFI_mon_setup(struct net_device *dev) -{ - - dev->netdev_ops = &wilc_wfi_netdev_ops; - PRINT_INFO(CORECONFIG_DBG, "In Ethernet setup function\n"); - ether_setup(dev); - dev->priv_flags |= IFF_NO_QUEUE; - dev->type = ARPHRD_IEEE80211_RADIOTAP; - eth_zero_addr(dev->dev_addr); - - { - unsigned char mac_add[] = {0x00, 0x50, 0xc2, 0x5e, 0x10, 0x8f}; - memcpy(dev->dev_addr, mac_add, ETH_ALEN); - } - -} - -/** * @brief WILC_WFI_init_mon_interface * @details * @param[in] diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 6e28ca0..300c571 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -75,28 +75,6 @@ _fail_: return 0; } -static int sdio_set_func0_csa_address_byte0(u32 adr) -{ - sdio_cmd52_t cmd; - - /** -* Review: BIG ENDIAN -**/ - cmd.read_write = 1; - cmd.function = 0; - cmd.raw = 0; - cmd.address = 0x10c; - cmd.data = (u8)adr; - if (!g_sdio.sdio_cmd52(&cmd)) { - g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10c data...\n"); - goto _fail_; - } - - return 1; -_fail_: - return 0; -} - static int sdio_set_func0_block_size(u32 block_size) { sdio_cmd52_t cmd; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/18] staging: wilc1000: host_interface.c : remove unused functions
From: Leo Kim This patch removes unused functions from the host_interface.c(h). - Switch_Log_Terminal - Handle_DelBASession - host_int_addBASession This patch includes the removal of the comment for host_int_addBASession as well. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 143 -- drivers/staging/wilc1000/host_interface.h | 4 - 2 files changed, 147 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index dd444d1..dbaebad 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -2260,7 +2260,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, /* open a BA session if possible */ /* if(pstrWFIDrv->strWILC_UsrConnReq.IsHTCapable) */ - /* host_int_addBASession(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid,0, */ /* BA_SESSION_DEFAULT_BUFFER_SIZE,BA_SESSION_DEFAULT_TIMEOUT); */ } else { PRINT_D(HOSTINF_DBG, "MAC status : %d and Connect Status : %d\n", u8MacStatus, strConnectInfo.u16ConnectStatus); @@ -2884,34 +2883,6 @@ void resolve_disconnect_aberration(tstrWILC_WFIDrv *drvHandler) host_int_disconnect(pstrWFIDrv, 1); } } -static s32 Switch_Log_Terminal(tstrWILC_WFIDrv *drvHandler) -{ - - - s32 s32Error = 0; - tstrWID strWID; - static char dummy = 9; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; - - strWID.u16WIDid = (u16)WID_LOGTerminal_Switch; - strWID.enuWIDtype = WID_CHAR; - strWID.ps8WidVal = &dummy; - strWID.s32ValueSize = sizeof(char); - - s32Error = send_config_pkt(SET_CFG, &strWID, 1, true, - get_id_from_handler(pstrWFIDrv)); - - - if (s32Error) { - PRINT_D(HOSTINF_DBG, "Failed to switch log terminal\n"); - PRINT_ER("Failed to switch log terminal\n"); - return -EINVAL; - } - - PRINT_INFO(HOSTINF_DBG, "MAC address set ::\n"); - - return s32Error; -} /** * @brief Handle_GetChnl @@ -3870,79 +3841,6 @@ static s32 Handle_AddBASession(tstrWILC_WFIDrv *drvHandler, } - -/** - * @brief Handle_DelBASession - * @detailsDelete block ack session - * @param[in] tstrHostIFSetMulti* strHostIfSetMulti - * @return NONE - * @authorAmr Abdel-Moghny - * @date Feb. 2013 - * @version 9.0 - */ -static s32 Handle_DelBASession(tstrWILC_WFIDrv *drvHandler, - struct ba_session_info *strHostIfBASessionInfo) -{ - s32 s32Error = 0; - tstrWID strWID; - char *ptr = NULL; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; - - PRINT_D(GENERIC_DBG, "Delete Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\n", - strHostIfBASessionInfo->au8Bssid[0], - strHostIfBASessionInfo->au8Bssid[1], - strHostIfBASessionInfo->au8Bssid[2], - strHostIfBASessionInfo->u8Ted); - - strWID.u16WIDid = (u16)WID_11E_P_ACTION_REQ; - strWID.enuWIDtype = WID_STR; - strWID.ps8WidVal = kmalloc(BLOCK_ACK_REQ_SIZE, GFP_KERNEL); - strWID.s32ValueSize = BLOCK_ACK_REQ_SIZE; - ptr = strWID.ps8WidVal; - /* *ptr++ = 0x14; */ - *ptr++ = 0x14; - *ptr++ = 0x3; - *ptr++ = 0x2; - memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN); - ptr += ETH_ALEN; - *ptr++ = strHostIfBASessionInfo->u8Ted; - /* BA direction = recipent*/ - *ptr++ = 0; - /* Delba Reason */ - *ptr++ = 32; /* Unspecific QOS reason */ - - s32Error = send_config_pkt(SET_CFG, &strWID, 1, true, - get_id_from_handler(pstrWFIDrv)); - if (s32Error) - PRINT_D(HOSTINF_DBG, "Couldn't delete BA Session\n"); - - - strWID.u16WIDid = (u16)WID_11E_P_ACTION_REQ; - strWID.enuWIDtype = WID_STR; - strWID.s32ValueSize = 15; - ptr = strWID.ps8WidVal; - /* *ptr++ = 0x14; */ - *ptr++ = 15; - *ptr++ = 7; - *ptr++ = 0x3; - memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN); - ptr += ETH_ALEN; - /* TID*/ - *ptr++ = strHostIfBASessionInfo->u8Ted; - - s32Error = send_config_pkt(SET_CFG, &strWID, 1, true, - get_id_from_handler(pstrWFIDrv)); - - if (strWID.ps8WidVal != NULL) - kfree(strWID.ps8WidVal); - - up(&hWaitResponse); - - return s32Error; - -} - - /** * @brief Handle_DelAllRxBASessions * @detailsDelete all Rx BA sessions @@ -7097,47 +6995,6 @@ void host_int_freeJoin