Re: [PATCH] Staging: goldfish: Add DMA support using dma_alloc_coherent
On Tue, 19 Jan 2016, Alan Cox wrote: Yes I will free it using dma_free_coherent. Why should devm_kzalloc be replaced with dma_alloc_coherent ? I was trying to replace _pa() Why keep allocating and freeing a buffer rather than having a single buffer allocated once (as it is in the old driver). Could you please explain how the buffer is being allocated and freed each time ? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC 00/29] De-stage android's sync framework
Hey, Op 15-01-16 om 15:55 schreef Gustavo Padovan: > From: Gustavo Padovan > > This patch series de-stage the sync framework, and in order to accomplish that > a bunch of cleanups/improvements on the sync and fence were made. > > The sync framework contained some abstractions around struct fence and those > were removed in the de-staging process among other changes: > > Userspace visible changes > - > > * The sw_sync file was moved from /dev/sw_sync to /sync/sw_sync. No > other change. > > Kernel API changes > -- > > * struct sync_timeline is now struct fence_timeline > * sync_timeline_ops is now fence_timeline_ops and they now carry struct > fence as parameter instead of struct sync_pt > * a .cleanup() fence op was added to allow sync_fence to run a cleanup when > the fence_timeline is destroyed > * added fence_add_used_data() to pass a private point to struct fence. This > pointer is sent back on the .cleanup op. > * The sync timeline function were moved to be fence_timeline functions: >- sync_timeline_create() -> fence_timeline_create() >- sync_timeline_get() -> fence_timeline_get() >- sync_timeline_put() -> fence_timeline_put() >- sync_timeline_destroy() -> fence_timeline_destroy() >- sync_timeline_signal() -> fence_timeline_signal() > > * sync_pt_create() was replaced be fence_create_on_timeline() > > Internal changes > > > * fence_timeline_ops was removed in favor of direct use fence_ops > * fence default functions were created for fence_ops > * removed structs sync_pt, sw_sync_timeline and sw_sync_pt > > Gustavo Padovan (29): > staging/android: fix sync framework documentation > staging/android: fix checkpatch warning > staging/android: rename sync_fence_release > staging/android: rename 'android_fence' to 'sync_fence' > staging/android: remove not used sync_timeline ops > staging/android: create a 'sync' dir for debugfs information > staging/android: move sw_sync file to debugfs file > staging/android: Remove WARN_ON_ONCE when releasing sync_fence > staging/android: rename struct sync_fence's variables to 'sync_fence' > staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb > dma-buf/fence: move sync_timeline to fence_timeline > staging/android: remove struct sync_pt > dma-buf/fence: create fence_default_enable_signaling() > dma-buf/fence: create fence_default_release() > dma-buf/fence: create fence_default_get_driver_name() > dma-buf/fence: create fence_default_timeline_name() This is misleading. I think timeline_fence prefix would be more appropriate here. I also believe this should be done in multiple series. First series should de-stage the userspace fence framework. The next series should fix up android_fence and maybe rename it to timeline_fence since sync_fence is already used for the userspace fd, which would add more confusion? > dma-buf/fence: store last signaled value on fence timeline > dma-buf/fence: create default .fence_value_str() and > .timeline_value_str() > dma-buf/fence: create fence_default_fill_driver_data() > dma-buf/fence: remove fence_timeline_ops > dma-buf/fence: add fence_create_on_timeline() > staging/android: remove sync_pt_create() > staging/android: remove sw_sync_timeline and sw_sync_pt > dma-buf/fence: add debug to fence timeline > dma-buf/fence: remove unused var from fence_timeline_signal() > dma-buf/fence: remove pointless fence_timeline_signal at destroy phase > dma-buf/fence: add .cleanup() callback > staging/android: use .cleanup() to interrupt any sync_fence waiter > dma-buf/fence: de-stage sync framework > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: use eth_broadcast_addr() in place of memset
From: Hari Prasath Gujulan Elango Replace the memset of array to broadcast address 0xFF by using the eth_broadcast_addr() API Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index a076ede..aec20bb 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -1907,7 +1907,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, memset(param, 0, param_len); param->cmd = IEEE_CMD_SET_ENCRYPTION; - memset(param->sta_addr, 0xff, ETH_ALEN); + eth_broadcast_addr(param->sta_addr); switch (pext->alg) { case IW_ENCODE_ALG_NONE: -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192e: prefer using eth_broadcast_addr()
From: Hari Prasath Gujulan Elango Prefer using the eth_broadcast_addr() instead of memset to broadcast address 0xFF to the array. Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/rtl8192e/rtllib_softmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index d0fedb0..2a57640 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -355,9 +355,9 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee) req->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ); req->header.duration_id = 0; - memset(req->header.addr1, 0xff, ETH_ALEN); + eth_broadcast_addr(req->header.addr1); ether_addr_copy(req->header.addr2, ieee->dev->dev_addr); - memset(req->header.addr3, 0xff, ETH_ALEN); + eth_broadcast_addr(req->header.addr3); tag = (u8 *) skb_put(skb, len + 2 + rate_len); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging:iio:adc:added space around '-'
On Fri, Jan 15, 2016 at 09:15:52PM +0100, Lars-Peter Clausen wrote: > On 01/15/2016 08:42 PM, Bhumika Goyal wrote: > > This patch adds apace around '-' operator.Found using checkpatch.pl > > > > Signed-off-by: Bhumika Goyal > > --- > > drivers/staging/iio/adc/ad7280a.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/iio/adc/ad7280a.c > > b/drivers/staging/iio/adc/ad7280a.c > > index f45ebed..0c73bce 100644 > > --- a/drivers/staging/iio/adc/ad7280a.c > > +++ b/drivers/staging/iio/adc/ad7280a.c > > @@ -744,14 +744,14 @@ out: > > } > > > > static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value, > > - in_voltage-voltage_thresh_low_value, > > + in_voltage - voltage_thresh_low_value, > > Hi, > > Thanks for patch. But when sending cleanup patches like this please make > sure that you a) understand what the code does and how your change affects > it and b) as a bare minimum of testing perform a compile test, if possible > also do functional testing. > > The patch as it is, is neither semantically nor syntactically correct. As an > exercise please make sure you understand why. Ugh! It took me a long time to figure out the bug in this patch... Why does that filename have a mix of dashes and underscores? Too late to fix it now... :/ regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC 00/29] De-stage android's sync framework
2016-01-20 Maarten Lankhorst : > Hey, > > Op 15-01-16 om 15:55 schreef Gustavo Padovan: > > From: Gustavo Padovan > > > > This patch series de-stage the sync framework, and in order to accomplish > > that > > a bunch of cleanups/improvements on the sync and fence were made. > > > > The sync framework contained some abstractions around struct fence and those > > were removed in the de-staging process among other changes: > > > > Userspace visible changes > > - > > > > * The sw_sync file was moved from /dev/sw_sync to /sync/sw_sync. > > No > > other change. > > > > Kernel API changes > > -- > > > > * struct sync_timeline is now struct fence_timeline > > * sync_timeline_ops is now fence_timeline_ops and they now carry struct > > fence as parameter instead of struct sync_pt > > * a .cleanup() fence op was added to allow sync_fence to run a cleanup when > > the fence_timeline is destroyed > > * added fence_add_used_data() to pass a private point to struct fence. This > > pointer is sent back on the .cleanup op. > > * The sync timeline function were moved to be fence_timeline functions: > > - sync_timeline_create() -> fence_timeline_create() > > - sync_timeline_get() -> fence_timeline_get() > > - sync_timeline_put() -> fence_timeline_put() > > - sync_timeline_destroy() -> fence_timeline_destroy() > > - sync_timeline_signal() -> fence_timeline_signal() > > > > * sync_pt_create() was replaced be fence_create_on_timeline() > > > > Internal changes > > > > > > * fence_timeline_ops was removed in favor of direct use fence_ops > > * fence default functions were created for fence_ops > > * removed structs sync_pt, sw_sync_timeline and sw_sync_pt > > > > Gustavo Padovan (29): > > staging/android: fix sync framework documentation > > staging/android: fix checkpatch warning > > staging/android: rename sync_fence_release > > staging/android: rename 'android_fence' to 'sync_fence' > > staging/android: remove not used sync_timeline ops > > staging/android: create a 'sync' dir for debugfs information > > staging/android: move sw_sync file to debugfs file > > staging/android: Remove WARN_ON_ONCE when releasing sync_fence > > staging/android: rename struct sync_fence's variables to 'sync_fence' > > staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb > > dma-buf/fence: move sync_timeline to fence_timeline > > staging/android: remove struct sync_pt > > dma-buf/fence: create fence_default_enable_signaling() > > dma-buf/fence: create fence_default_release() > > dma-buf/fence: create fence_default_get_driver_name() > > dma-buf/fence: create fence_default_timeline_name() > This is misleading. I think timeline_fence prefix would be more appropriate > here. Why? These fence_default_.. functions are fence_ops and not related to fence_timeline in any way. > > I also believe this should be done in multiple series. First series should > de-stage the userspace fence framework. The next series should fix up > android_fence and maybe rename it to timeline_fence since sync_fence is > already used for the userspace fd, which would add more confusion? Sure. I've been thinking on how to split this properly. I'm trying to add a bunch of clean up/renaming first, eg the sync_fence rename to sync_file that Daniel Vetter and I discussed. Next my plan would be move sync_timeline to fence_timeline, add the fence_default.. fence_ops, clean up sw_sync and finally merge fence_context and fence_timeline. Looking at how sync and fence It looks easier to me to de-stage sync_timeline first than userspace fence. Gustavo ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC 00/29] De-stage android's sync framework
Op 20-01-16 om 15:32 schreef Gustavo Padovan: > 2016-01-20 Maarten Lankhorst : > >> Hey, >> >> Op 15-01-16 om 15:55 schreef Gustavo Padovan: >>> From: Gustavo Padovan >>> >>> This patch series de-stage the sync framework, and in order to accomplish >>> that >>> a bunch of cleanups/improvements on the sync and fence were made. >>> >>> The sync framework contained some abstractions around struct fence and those >>> were removed in the de-staging process among other changes: >>> >>> Userspace visible changes >>> - >>> >>> * The sw_sync file was moved from /dev/sw_sync to /sync/sw_sync. >>> No >>> other change. >>> >>> Kernel API changes >>> -- >>> >>> * struct sync_timeline is now struct fence_timeline >>> * sync_timeline_ops is now fence_timeline_ops and they now carry struct >>> fence as parameter instead of struct sync_pt >>> * a .cleanup() fence op was added to allow sync_fence to run a cleanup when >>> the fence_timeline is destroyed >>> * added fence_add_used_data() to pass a private point to struct fence. This >>> pointer is sent back on the .cleanup op. >>> * The sync timeline function were moved to be fence_timeline functions: >>> - sync_timeline_create() -> fence_timeline_create() >>> - sync_timeline_get() -> fence_timeline_get() >>> - sync_timeline_put() -> fence_timeline_put() >>> - sync_timeline_destroy() -> fence_timeline_destroy() >>> - sync_timeline_signal() -> fence_timeline_signal() >>> >>> * sync_pt_create() was replaced be fence_create_on_timeline() >>> >>> Internal changes >>> >>> >>> * fence_timeline_ops was removed in favor of direct use fence_ops >>> * fence default functions were created for fence_ops >>> * removed structs sync_pt, sw_sync_timeline and sw_sync_pt >>> >>> Gustavo Padovan (29): >>> staging/android: fix sync framework documentation >>> staging/android: fix checkpatch warning >>> staging/android: rename sync_fence_release >>> staging/android: rename 'android_fence' to 'sync_fence' >>> staging/android: remove not used sync_timeline ops >>> staging/android: create a 'sync' dir for debugfs information >>> staging/android: move sw_sync file to debugfs file >>> staging/android: Remove WARN_ON_ONCE when releasing sync_fence >>> staging/android: rename struct sync_fence's variables to 'sync_fence' >>> staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb >>> dma-buf/fence: move sync_timeline to fence_timeline >>> staging/android: remove struct sync_pt >>> dma-buf/fence: create fence_default_enable_signaling() >>> dma-buf/fence: create fence_default_release() >>> dma-buf/fence: create fence_default_get_driver_name() >>> dma-buf/fence: create fence_default_timeline_name() >> This is misleading. I think timeline_fence prefix would be more appropriate >> here. > Why? These fence_default_.. functions are fence_ops and not related to > fence_timeline in any way. Because they're using fence_parent, which should probably be renamed to fence_to_timeline() The name makes it sound as if they could apply to all type of fences, I don't think this is the case. >> I also believe this should be done in multiple series. First series should >> de-stage the userspace fence framework. The next series should fix up >> android_fence and maybe rename it to timeline_fence since sync_fence is >> already used for the userspace fd, which would add more confusion? > Sure. I've been thinking on how to split this properly. I'm trying to > add a bunch of clean up/renaming first, eg the sync_fence rename to > sync_file that Daniel Vetter and I discussed. > > Next my plan would be move sync_timeline to fence_timeline, add the > fence_default.. fence_ops, clean up sw_sync and finally merge > fence_context and fence_timeline. > > Looking at how sync and fence It looks easier to me to de-stage sync_timeline > first than userspace > fence. There's already code to add a sync_fence_create_dma export [1][2]. So if you want to de-stage it then there will be users for it. sync_pt otoh has no upstream in-kernel users. It was a wrapper to keep android drivers api compatible with the fence api. [1] https://patchwork.freedesktop.org/patch/67845/ [2] https://patchwork.freedesktop.org/patch/67846/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC 00/29] De-stage android's sync framework
On Wed, Jan 20, 2016 at 04:02:31PM +0100, Maarten Lankhorst wrote: > Op 20-01-16 om 15:32 schreef Gustavo Padovan: > > 2016-01-20 Maarten Lankhorst : > > > >> Hey, > >> > >> Op 15-01-16 om 15:55 schreef Gustavo Padovan: > >>> From: Gustavo Padovan > >>> > >>> This patch series de-stage the sync framework, and in order to accomplish > >>> that > >>> a bunch of cleanups/improvements on the sync and fence were made. > >>> > >>> The sync framework contained some abstractions around struct fence and > >>> those > >>> were removed in the de-staging process among other changes: > >>> > >>> Userspace visible changes > >>> - > >>> > >>> * The sw_sync file was moved from /dev/sw_sync to > >>> /sync/sw_sync. No > >>> other change. > >>> > >>> Kernel API changes > >>> -- > >>> > >>> * struct sync_timeline is now struct fence_timeline > >>> * sync_timeline_ops is now fence_timeline_ops and they now carry struct > >>> fence as parameter instead of struct sync_pt > >>> * a .cleanup() fence op was added to allow sync_fence to run a cleanup > >>> when > >>> the fence_timeline is destroyed > >>> * added fence_add_used_data() to pass a private point to struct fence. > >>> This > >>> pointer is sent back on the .cleanup op. > >>> * The sync timeline function were moved to be fence_timeline functions: > >>>- sync_timeline_create() -> fence_timeline_create() > >>>- sync_timeline_get() -> fence_timeline_get() > >>>- sync_timeline_put() -> fence_timeline_put() > >>>- sync_timeline_destroy() -> fence_timeline_destroy() > >>>- sync_timeline_signal() -> fence_timeline_signal() > >>> > >>> * sync_pt_create() was replaced be fence_create_on_timeline() > >>> > >>> Internal changes > >>> > >>> > >>> * fence_timeline_ops was removed in favor of direct use fence_ops > >>> * fence default functions were created for fence_ops > >>> * removed structs sync_pt, sw_sync_timeline and sw_sync_pt > >>> > >>> Gustavo Padovan (29): > >>> staging/android: fix sync framework documentation > >>> staging/android: fix checkpatch warning > >>> staging/android: rename sync_fence_release > >>> staging/android: rename 'android_fence' to 'sync_fence' > >>> staging/android: remove not used sync_timeline ops > >>> staging/android: create a 'sync' dir for debugfs information > >>> staging/android: move sw_sync file to debugfs file > >>> staging/android: Remove WARN_ON_ONCE when releasing sync_fence > >>> staging/android: rename struct sync_fence's variables to 'sync_fence' > >>> staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb > >>> dma-buf/fence: move sync_timeline to fence_timeline > >>> staging/android: remove struct sync_pt > >>> dma-buf/fence: create fence_default_enable_signaling() > >>> dma-buf/fence: create fence_default_release() > >>> dma-buf/fence: create fence_default_get_driver_name() > >>> dma-buf/fence: create fence_default_timeline_name() > >> This is misleading. I think timeline_fence prefix would be more > >> appropriate here. > > Why? These fence_default_.. functions are fence_ops and not related to > > fence_timeline in any way. > Because they're using fence_parent, which should probably be renamed to > fence_to_timeline() > > The name makes it sound as if they could apply to all type of fences, I don't > think this is the case. > >> I also believe this should be done in multiple series. First series should > >> de-stage the userspace fence framework. The next series should fix up > >> android_fence and maybe rename it to timeline_fence since sync_fence is > >> already used for the userspace fd, which would add more confusion? > > Sure. I've been thinking on how to split this properly. I'm trying to > > add a bunch of clean up/renaming first, eg the sync_fence rename to > > sync_file that Daniel Vetter and I discussed. > > > > Next my plan would be move sync_timeline to fence_timeline, add the > > fence_default.. fence_ops, clean up sw_sync and finally merge > > fence_context and fence_timeline. > > > > Looking at how sync and fence It looks easier to me to de-stage > > sync_timeline first than userspace > > fence. > There's already code to add a sync_fence_create_dma export [1][2]. So if you > want to de-stage it then there will be users for it. > > sync_pt otoh has no upstream in-kernel users. It was a wrapper to keep > android drivers api compatible with the fence api. > > [1] https://patchwork.freedesktop.org/patch/67845/ > [2] https://patchwork.freedesktop.org/patch/67846/ We kinda don't have open-source userspace for this stuf though ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC 00/29] De-stage android's sync framework
2016-01-20 Maarten Lankhorst : > Op 20-01-16 om 15:32 schreef Gustavo Padovan: > > 2016-01-20 Maarten Lankhorst : > > > >> Hey, > >> > >> Op 15-01-16 om 15:55 schreef Gustavo Padovan: > >>> From: Gustavo Padovan > >>> > >>> This patch series de-stage the sync framework, and in order to accomplish > >>> that > >>> a bunch of cleanups/improvements on the sync and fence were made. > >>> > >>> The sync framework contained some abstractions around struct fence and > >>> those > >>> were removed in the de-staging process among other changes: > >>> > >>> Userspace visible changes > >>> - > >>> > >>> * The sw_sync file was moved from /dev/sw_sync to > >>> /sync/sw_sync. No > >>> other change. > >>> > >>> Kernel API changes > >>> -- > >>> > >>> * struct sync_timeline is now struct fence_timeline > >>> * sync_timeline_ops is now fence_timeline_ops and they now carry struct > >>> fence as parameter instead of struct sync_pt > >>> * a .cleanup() fence op was added to allow sync_fence to run a cleanup > >>> when > >>> the fence_timeline is destroyed > >>> * added fence_add_used_data() to pass a private point to struct fence. > >>> This > >>> pointer is sent back on the .cleanup op. > >>> * The sync timeline function were moved to be fence_timeline functions: > >>>- sync_timeline_create() -> fence_timeline_create() > >>>- sync_timeline_get() -> fence_timeline_get() > >>>- sync_timeline_put() -> fence_timeline_put() > >>>- sync_timeline_destroy() -> fence_timeline_destroy() > >>>- sync_timeline_signal() -> fence_timeline_signal() > >>> > >>> * sync_pt_create() was replaced be fence_create_on_timeline() > >>> > >>> Internal changes > >>> > >>> > >>> * fence_timeline_ops was removed in favor of direct use fence_ops > >>> * fence default functions were created for fence_ops > >>> * removed structs sync_pt, sw_sync_timeline and sw_sync_pt > >>> > >>> Gustavo Padovan (29): > >>> staging/android: fix sync framework documentation > >>> staging/android: fix checkpatch warning > >>> staging/android: rename sync_fence_release > >>> staging/android: rename 'android_fence' to 'sync_fence' > >>> staging/android: remove not used sync_timeline ops > >>> staging/android: create a 'sync' dir for debugfs information > >>> staging/android: move sw_sync file to debugfs file > >>> staging/android: Remove WARN_ON_ONCE when releasing sync_fence > >>> staging/android: rename struct sync_fence's variables to 'sync_fence' > >>> staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb > >>> dma-buf/fence: move sync_timeline to fence_timeline > >>> staging/android: remove struct sync_pt > >>> dma-buf/fence: create fence_default_enable_signaling() > >>> dma-buf/fence: create fence_default_release() > >>> dma-buf/fence: create fence_default_get_driver_name() > >>> dma-buf/fence: create fence_default_timeline_name() > >> This is misleading. I think timeline_fence prefix would be more > >> appropriate here. > > Why? These fence_default_.. functions are fence_ops and not related to > > fence_timeline in any way. > Because they're using fence_parent, which should probably be renamed to > fence_to_timeline() > > The name makes it sound as if they could apply to all type of fences, I don't > think this is the case. Fair enough. I can change the naming. Also the final idea is to move fence_ops to be fence_timeline_ops so the naming makes sense. > >> I also believe this should be done in multiple series. First series should > >> de-stage the userspace fence framework. The next series should fix up > >> android_fence and maybe rename it to timeline_fence since sync_fence is > >> already used for the userspace fd, which would add more confusion? > > Sure. I've been thinking on how to split this properly. I'm trying to > > add a bunch of clean up/renaming first, eg the sync_fence rename to > > sync_file that Daniel Vetter and I discussed. > > > > Next my plan would be move sync_timeline to fence_timeline, add the > > fence_default.. fence_ops, clean up sw_sync and finally merge > > fence_context and fence_timeline. > > > > Looking at how sync and fence It looks easier to me to de-stage > > sync_timeline first than userspace > > fence. > There's already code to add a sync_fence_create_dma export [1][2]. So if you > want to de-stage it then there will be users for it. > > sync_pt otoh has no upstream in-kernel users. It was a wrapper to keep > android drivers api compatible with the fence api. One of the first patches of my series is removing struct sync_pt, that means I am also removing sync_fence_create_dma() because sync_fence_create() now accepts struct fence as parameter. I don't sync_pt being useful for any in-kernel driver as it is just a wrapper on top of struct fence. Gustavo ___ devel mailing list de...@linuxd
[PATCH 1/2] Staging:lustre:obdclass:linux:remove unnecessary braces
Fixed 'braces {} are not necessary for single statement blocks' checkpatch.pl warning. Signed-off-by: Bhumika Goyal --- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index a055cbb..9663ae3 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -144,9 +144,8 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg) offset += cfs_size_round(data->ioc_inllen3); } - if (data->ioc_inllen4) { + if (data->ioc_inllen4) data->ioc_inlbuf4 = &data->ioc_bulk[0] + offset; - } return 0; @@ -250,9 +249,8 @@ static ssize_t health_show(struct kobject *kobj, struct attribute *attr, class_incref(obd, __func__, current); read_unlock(&obd_dev_lock); - if (obd_health_check(NULL, obd)) { + if (obd_health_check(NULL, obd)) healthy = false; - } class_decref(obd, __func__, current); read_lock(&obd_dev_lock); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2]Staging:lustre:obdclass:linux:fix checkpatch.pl warnings
This patch series addresses checkpatch.pl warnings in lustre driver. Bhumika Goyal (2): Staging:lustre:obdclass:linux:remove unnecessary braces Staging:lustre:obdclass:linux:simplify NULL comparison drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] Staging:lustre:obdclass:linux:simplify NULL comparison
Remove explicit NULL comparision and replace it with a simpier form. Detected using checkpatch.pl. Signed-off-by: Bhumika Goyal --- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 9663ae3..11fe6cb 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -239,7 +239,7 @@ static ssize_t health_show(struct kobject *kobj, struct attribute *attr, struct obd_device *obd; obd = class_num2obd(i); - if (obd == NULL || !obd->obd_attached || !obd->obd_set_up) + if (!obd || !obd->obd_attached || !obd->obd_set_up) continue; LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC); @@ -358,7 +358,7 @@ static int obd_device_list_seq_show(struct seq_file *p, void *v) struct obd_device *obd = class_num2obd((int)index); char *status; - if (obd == NULL) + if (!obd) return 0; LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC); @@ -422,7 +422,7 @@ int class_procfs_init(void) struct dentry *file; lustre_kobj = kobject_create_and_add("lustre", fs_kobj); - if (lustre_kobj == NULL) + if (!lustre_kobj) goto out; /* Create the files associated with this kobject */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Can you be trusted
Good Day Friend, With all due respect to your person, as we have not met in anywhere before, please permit me in drawing your attention to this proposal. Despite the fact that we have not met or done anything before, I want to assure you that this proposal will definitely benefit both of us. So I pray that you give this proposal good attention. I am Mr.Robert phillip, A senior officer with Barclays Capital Plc, I have been with the bank for 16 years now and I am the account manager to Late E. Blundell, who died with his children in Lebanon during the Isreali and Hizbollah war. he has a total deposit of $14.6million (Fourteen Million Six Hundred Thousand United States Dollars) before his untimely demise with his family. Since the death of Blundell and his family, his account has been dormant without no next of kin as his wife and child whom he named the next of kin are both dead alongside with him and no one else will ever come for the fund. Therefore, I contact you this day to give me your full trust and sincerity so that this fund will be beneficial to both of us. The interesting development here is that you are not at any risk whatsoever because I have worked out all the arrangements and have successfully withdrawn the whole funds with my official capacity and it's now packaged in cash and kept at the secured private storage place and what is left to do is give you details of the storage and you open contact with them and claim the fund's packages, I informed the storage management that I am safe-keeping for a foreign friend, but didn't disclose any name and you must understand that I didn't store the packages on my name for security reasons, so they won't be any traces whatsoever. I am assuring you that you shall not be subjected to any form of risk,it is 100% free deal all that is important now is the true and exact understanding, this deal shall remain a top secret between me and you for the sake of my job and reputation. so do not betray me after taking possession of the funds, we shall discuss the sharing formula when you get back to me. I hope to further strengthen my business relationship with you after the execution of this transaction. Regardless of the fact that we have not done business before, I strongly believe that for the sake of God, you will exhibit a trust worthy character when you receive the fund. Thank you in anticipation of your cooperation. Yours truly, MY CONTACT EMAIL:robertphillip...@gmail.com… Mr.Robert Phillip. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] Staging:lustre:obdclass:linux:remove unnecessary braces
On Thu, 2016-01-21 at 00:17 +0530, Bhumika Goyal wrote: > Fixed 'braces {} are not necessary for single statement blocks' > checkpatch.pl warning. [] > diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c > b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c [] > @@ -144,9 +144,8 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg) > offset += cfs_size_round(data->ioc_inllen3); > } > > - if (data->ioc_inllen4) { > + if (data->ioc_inllen4) > data->ioc_inlbuf4 = &data->ioc_bulk[0] + offset; You might also consider converting uses of &foo[0] to foo ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:lustre:obdclass:linux:convert &foo[0] to foo
Replace &foo[0] with foo,to follow Linux coding style. Signed-off-by: Bhumika Goyal --- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 11fe6cb..ecc2897 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -130,22 +130,22 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg) } if (data->ioc_inllen1) { - data->ioc_inlbuf1 = &data->ioc_bulk[0]; + data->ioc_inlbuf1 = data->ioc_bulk; offset += cfs_size_round(data->ioc_inllen1); } if (data->ioc_inllen2) { - data->ioc_inlbuf2 = &data->ioc_bulk[0] + offset; + data->ioc_inlbuf2 = data->ioc_bulk + offset; offset += cfs_size_round(data->ioc_inllen2); } if (data->ioc_inllen3) { - data->ioc_inlbuf3 = &data->ioc_bulk[0] + offset; + data->ioc_inlbuf3 = data->ioc_bulk + offset; offset += cfs_size_round(data->ioc_inllen3); } if (data->ioc_inllen4) - data->ioc_inlbuf4 = &data->ioc_bulk[0] + offset; + data->ioc_inlbuf4 = data->ioc_bulk + offset; return 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] Staging: goldfish: goldfish_nand: Add DMA Support using dmam_alloc_coherent
Function nand_setup_cmd_params has 2 goals- -Initialize the cmd_params field so that it can be used to send and read commands from the device. -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke --- Changes in v2- Updated commit message, used dmam_alloc_coherent,added cast to dma_handle drivers/staging/goldfish/goldfish_nand.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c index 623353db5..f223b3a 100644 --- a/drivers/staging/goldfish/goldfish_nand.c +++ b/drivers/staging/goldfish/goldfish_nand.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "goldfish_nand_reg.h" @@ -284,17 +285,18 @@ invalid_arg: static int nand_setup_cmd_params(struct platform_device *pdev, struct goldfish_nand *nand) { - u64 paddr; + dma_addr_t dma_handle; unsigned char __iomem *base = nand->base; - nand->cmd_params = devm_kzalloc(&pdev->dev, - sizeof(struct cmd_params), GFP_KERNEL); - if (!nand->cmd_params) - return -1; - - paddr = __pa(nand->cmd_params); - writel((u32)(paddr >> 32), base + NAND_CMD_PARAMS_ADDR_HIGH); - writel((u32)paddr, base + NAND_CMD_PARAMS_ADDR_LOW); + nand->cmd_params = dmam_alloc_coherent(&pdev->dev, + sizeof(struct cmd_params), + &dma_handle, GFP_KERNEL); + if (!nand->cmd_params) { + dev_err(&pdev->dev, "allocate buffer failed\n"); + return -ENOMEM; + } + writel((u32)((u64)dma_handle >> 32), base + NAND_CMD_PARAMS_ADDR_HIGH); + writel((u32)dma_handle, base + NAND_CMD_PARAMS_ADDR_LOW); return 0; } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: panel: Fix sparse warnings (line length, space after a cast) in panel.c
This patch fixes 'Lines longer than 80 columns' and 'No space is necessary after a cast' warnings in /drivers/staging/panel/panel.c. Signed-off-by: Arthur Marble --- drivers/staging/panel/panel.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index 79ac192..04d86f3 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c @@ -947,7 +947,8 @@ static void lcd_clear_fast_s(void) lcd_send_serial(0x5F); /* R/W=W, RS=1 */ lcd_send_serial(' ' & 0x0F); lcd_send_serial((' ' >> 4) & 0x0F); - usleep_range(40, 100); /* the shortest data takes at least 40 us */ + /* the shortest data takes at least 40 us */ + usleep_range(40, 100); } spin_unlock_irq(&pprt_lock); @@ -1788,7 +1789,7 @@ static void phys_scan_contacts(void) gndmask = PNL_PINPUT(r_str(pprt)) & scan_mask_i; /* grounded inputs are signals 40-44 */ - phys_read |= (pmask_t) gndmask << 40; + phys_read |= (pmask_t)gndmask << 40; if (bitmask != gndmask) { /* @@ -1804,7 +1805,7 @@ static void phys_scan_contacts(void) w_dtr(pprt, oldval & ~bitval); /* enable this output */ bitmask = PNL_PINPUT(r_str(pprt)) & ~gndmask; - phys_read |= (pmask_t) bitmask << (5 * bit); + phys_read |= (pmask_t)bitmask << (5 * bit); } w_dtr(pprt, oldval);/* disable all outputs */ } -- 2.7.0.rc3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: panel: Fix sparse warnings (line length, space after a cast) in panel.c
Hello Arthur, On Wed, Jan 20, 2016 at 03:09:20PM -0600, Arthur Marble wrote: > This patch fixes 'Lines longer than 80 columns' and 'No space is necessary > after > a cast' warnings in /drivers/staging/panel/panel.c. Thank you but this one has already been proposed twice and I think the last one was queued with a few more changes as well recently. I guess some time is needed to move that queue to mainline, I don't know more unfortunately :-/ Thanks, Willy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: panel: Fix sparse warnings (line length, space after a cast) in panel.c
On Wed, Jan 20, 2016 at 11:23:33PM +0100, Willy Tarreau wrote: > Hello Arthur, > > On Wed, Jan 20, 2016 at 03:09:20PM -0600, Arthur Marble wrote: > > This patch fixes 'Lines longer than 80 columns' and 'No space is necessary > > after > > a cast' warnings in /drivers/staging/panel/panel.c. > > Thank you but this one has already been proposed twice and I think the > last one was queued with a few more changes as well recently. I guess > some time is needed to move that queue to mainline, I don't know more > unfortunately :-/ > > Thanks, > Willy > Hello Willy, I appreciate that you looked at my patch and responded quickly. I understand and I look forward to seeing the other patch land in mainline. Regards, --Arthur Marble ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: comedi: s626: Remove unnecessary cast on void pointer
The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Lucas Tanure --- drivers/staging/comedi/drivers/s626.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 35f0f67..13259f0 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -1476,7 +1476,7 @@ static bool s626_handle_eos_interrupt(struct comedi_device *dev) * first uint16_t in the buffer because it contains junk data * from the final ADC of the previous poll list scan. */ - uint32_t *readaddr = (uint32_t *)devpriv->ana_buf.logical_base + 1; + uint32_t *readaddr = devpriv->ana_buf.logical_base + 1; int i; /* get the data and hand it over to comedi */ @@ -1567,7 +1567,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl) s626_mc_disable(dev, S626_MC1_ERPS1, S626_P_MC1); /* Set starting logical address to write RPS commands. */ - rps = (uint32_t *)devpriv->rps_buf.logical_base; + rps = devpriv->rps_buf.logical_base; /* Initialize RPS instruction pointer */ writel((uint32_t)devpriv->rps_buf.physical_base, @@ -1772,7 +1772,7 @@ static int s626_ai_rinsn(struct comedi_device *dev, * first uint16_t in the buffer because it contains junk data from * the final ADC of the previous poll list scan. */ - readaddr = (uint32_t *)devpriv->ana_buf.logical_base + 1; + readaddr = devpriv->ana_buf.logical_base + 1; /* * Convert ADC data to 16-bit integer values and @@ -2643,7 +2643,7 @@ static int s626_initialize(struct comedi_device *dev) * Cache Audio2's output DMA buffer logical address. This is * where DAC data is buffered for A2 output DMA transfers. */ - devpriv->dac_wbuf = (uint32_t *)devpriv->ana_buf.logical_base + + devpriv->dac_wbuf = devpriv->ana_buf.logical_base + S626_DAC_WDMABUF_OS; /* -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/27] staging: wilc1000: rename struct __Message_struct
This patch renames typedef from struct __Message_struct and renames it to struct message. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 10 +- drivers/staging/wilc1000/wilc_msgqueue.h | 8 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index abc780c..9b78fcd 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -38,7 +38,7 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle) } while (pHandle->pstrMessageList) { - Message *pstrMessge = pHandle->pstrMessageList->pstrNext; + struct message *pstrMessge = pHandle->pstrMessageList->pstrNext; kfree(pHandle->pstrMessageList); pHandle->pstrMessageList = pstrMessge; @@ -57,7 +57,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, const void *pvSendBuffer, u32 u32SendBufferSize) { unsigned long flags; - Message *pstrMessage = NULL; + struct message *pstrMessage = NULL; if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) { PRINT_ER("pHandle or pvSendBuffer is null\n"); @@ -70,7 +70,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, } /* construct a new message */ - pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); + pstrMessage = kmalloc(sizeof(struct message), GFP_ATOMIC); if (!pstrMessage) return -ENOMEM; @@ -89,7 +89,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, if (!pHandle->pstrMessageList) { pHandle->pstrMessageList = pstrMessage; } else { - Message *pstrTailMsg = pHandle->pstrMessageList; + struct message *pstrTailMsg = pHandle->pstrMessageList; while (pstrTailMsg->pstrNext) pstrTailMsg = pstrTailMsg->pstrNext; @@ -114,7 +114,7 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, void *pvRecvBuffer, u32 u32RecvBufferSize, u32 *pu32ReceivedLength) { - Message *pstrMessage; + struct message *pstrMessage; unsigned long flags; if ((!pHandle) || (u32RecvBufferSize == 0) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index d7e0328..1a7c652 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -13,18 +13,18 @@ #include /* Message Queue type is a structure */ -typedef struct __Message_struct { +struct message { void *pvBuffer; u32 u32Length; - struct __Message_struct *pstrNext; -} Message; + struct message *pstrNext; +}; typedef struct __MessageQueue_struct { struct semaphore hSem; spinlock_t strCriticalSection; bool bExiting; u32 u32ReceiversCount; - Message *pstrMessageList; + struct message *pstrMessageList; } WILC_MsgQueueHandle; /*! -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/27] staging: wilc1000: rename pstrNext in struct message
This patch renames pstrNext to next to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 12 ++-- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 0e66a64..4d79a31 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -38,7 +38,7 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle) } while (pHandle->pstrMessageList) { - struct message *pstrMessge = pHandle->pstrMessageList->pstrNext; + struct message *pstrMessge = pHandle->pstrMessageList->next; kfree(pHandle->pstrMessageList); pHandle->pstrMessageList = pstrMessge; @@ -75,7 +75,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, return -ENOMEM; pstrMessage->len = u32SendBufferSize; - pstrMessage->pstrNext = NULL; + pstrMessage->next = NULL; pstrMessage->buf = kmemdup(pvSendBuffer, u32SendBufferSize, GFP_ATOMIC); if (!pstrMessage->buf) { @@ -91,10 +91,10 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, } else { struct message *pstrTailMsg = pHandle->pstrMessageList; - while (pstrTailMsg->pstrNext) - pstrTailMsg = pstrTailMsg->pstrNext; + while (pstrTailMsg->next) + pstrTailMsg = pstrTailMsg->next; - pstrTailMsg->pstrNext = pstrMessage; + pstrTailMsg->next = pstrMessage; } spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); @@ -154,7 +154,7 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len); *pu32ReceivedLength = pstrMessage->len; - pHandle->pstrMessageList = pstrMessage->pstrNext; + pHandle->pstrMessageList = pstrMessage->next; kfree(pstrMessage->buf); kfree(pstrMessage); diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index b0ccd1d..ec503c3 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -16,7 +16,7 @@ struct message { void *buf; u32 len; - struct message *pstrNext; + struct message *next; }; typedef struct __MessageQueue_struct { -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/27] staging: wilc1000: rename pvBuffer in struct message
This patch renames pvBuffer to buf to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 10 +- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 9b78fcd..a4e612d 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -76,9 +76,9 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, pstrMessage->u32Length = u32SendBufferSize; pstrMessage->pstrNext = NULL; - pstrMessage->pvBuffer = kmemdup(pvSendBuffer, u32SendBufferSize, - GFP_ATOMIC); - if (!pstrMessage->pvBuffer) { + pstrMessage->buf = kmemdup(pvSendBuffer, u32SendBufferSize, + GFP_ATOMIC); + if (!pstrMessage->buf) { kfree(pstrMessage); return -ENOMEM; } @@ -151,12 +151,12 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, /* consume the message */ pHandle->u32ReceiversCount--; - memcpy(pvRecvBuffer, pstrMessage->pvBuffer, pstrMessage->u32Length); + memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->u32Length); *pu32ReceivedLength = pstrMessage->u32Length; pHandle->pstrMessageList = pstrMessage->pstrNext; - kfree(pstrMessage->pvBuffer); + kfree(pstrMessage->buf); kfree(pstrMessage); spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 1a7c652..848ed82 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -14,7 +14,7 @@ /* Message Queue type is a structure */ struct message { - void *pvBuffer; + void *buf; u32 u32Length; struct message *pstrNext; }; -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/27] staging: wilc1000: rename struct WILC_MsgQueueHandle
This patch removes typedef from struct WILC_MsgQueueHandle and renames it to struct message_queue. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/wilc_msgqueue.c | 14 +++--- drivers/staging/wilc1000/wilc_msgqueue.h | 18 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 5fac516..98627a6 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -229,7 +229,7 @@ struct host_if_drv *terminated_handle; bool wilc_optaining_ip; static u8 P2P_LISTEN_STATE; static struct task_struct *hif_thread_handler; -static WILC_MsgQueueHandle hif_msg_q; +static struct message_queue hif_msg_q; static struct semaphore hif_sema_thread; static struct semaphore hif_sema_driver; static struct semaphore hif_sema_wait_response; diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 4d79a31..907bae1 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -11,7 +11,7 @@ * @note copied from FLO glue implementatuion * @version 1.0 */ -int wilc_mq_create(WILC_MsgQueueHandle *pHandle) +int wilc_mq_create(struct message_queue *pHandle) { spin_lock_init(&pHandle->strCriticalSection); sema_init(&pHandle->hSem, 0); @@ -27,7 +27,7 @@ int wilc_mq_create(WILC_MsgQueueHandle *pHandle) * @note copied from FLO glue implementatuion * @version 1.0 */ -int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle) +int wilc_mq_destroy(struct message_queue *pHandle) { pHandle->bExiting = true; @@ -53,8 +53,8 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle) * @note copied from FLO glue implementatuion * @version 1.0 */ -int wilc_mq_send(WILC_MsgQueueHandle *pHandle, -const void *pvSendBuffer, u32 u32SendBufferSize) +int wilc_mq_send(struct message_queue *pHandle, +const void *pvSendBuffer, u32 u32SendBufferSize) { unsigned long flags; struct message *pstrMessage = NULL; @@ -110,9 +110,9 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, * @note copied from FLO glue implementatuion * @version 1.0 */ -int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, -void *pvRecvBuffer, u32 u32RecvBufferSize, -u32 *pu32ReceivedLength) +int wilc_mq_recv(struct message_queue *pHandle, +void *pvRecvBuffer, u32 u32RecvBufferSize, +u32 *pu32ReceivedLength) { struct message *pstrMessage; unsigned long flags; diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index ec503c3..111be46 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -19,13 +19,13 @@ struct message { struct message *next; }; -typedef struct __MessageQueue_struct { +struct message_queue { struct semaphore hSem; spinlock_t strCriticalSection; bool bExiting; u32 u32ReceiversCount; struct message *pstrMessageList; -} WILC_MsgQueueHandle; +}; /*! * @brief Creates a new Message queue @@ -40,7 +40,7 @@ typedef struct __MessageQueue_struct { * @date 30 Aug 2010 * @version 1.0 */ -int wilc_mq_create(WILC_MsgQueueHandle *pHandle); +int wilc_mq_create(struct message_queue *pHandle); /*! * @brief Sends a message @@ -57,8 +57,8 @@ int wilc_mq_create(WILC_MsgQueueHandle *pHandle); * @date 30 Aug 2010 * @version 1.0 */ -int wilc_mq_send(WILC_MsgQueueHandle *pHandle, -const void *pvSendBuffer, u32 u32SendBufferSize); +int wilc_mq_send(struct message_queue *pHandle, +const void *pvSendBuffer, u32 u32SendBufferSize); /*! * @brief Receives a message @@ -76,9 +76,9 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, * @date 30 Aug 2010 * @version 1.0 */ -int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, -void *pvRecvBuffer, u32 u32RecvBufferSize, -u32 *pu32ReceivedLength); +int wilc_mq_recv(struct message_queue *pHandle, +void *pvRecvBuffer, u32 u32RecvBufferSize, +u32 *pu32ReceivedLength); /*! * @brief Destroys an existing Message queue @@ -89,6 +89,6 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, * @date 30 Aug 2010 * @version 1.0 */ -int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle); +int wilc_mq_destroy(struct message_queue *pHandle); #endif -- 2.6.4 ___ devel mailing
[PATCH 06/27] staging: wilc1000: rename hSem in struct message_queue
This patch renames hSem to sem to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 10 +- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 907bae1..b996c47 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -14,7 +14,7 @@ int wilc_mq_create(struct message_queue *pHandle) { spin_lock_init(&pHandle->strCriticalSection); - sema_init(&pHandle->hSem, 0); + sema_init(&pHandle->sem, 0); pHandle->pstrMessageList = NULL; pHandle->u32ReceiversCount = 0; pHandle->bExiting = false; @@ -33,7 +33,7 @@ int wilc_mq_destroy(struct message_queue *pHandle) /* Release any waiting receiver thread. */ while (pHandle->u32ReceiversCount > 0) { - up(&pHandle->hSem); + up(&pHandle->sem); pHandle->u32ReceiversCount--; } @@ -99,7 +99,7 @@ int wilc_mq_send(struct message_queue *pHandle, spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); - up(&pHandle->hSem); + up(&pHandle->sem); return 0; } @@ -132,7 +132,7 @@ int wilc_mq_recv(struct message_queue *pHandle, pHandle->u32ReceiversCount++; spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); - down(&pHandle->hSem); + down(&pHandle->sem); spin_lock_irqsave(&pHandle->strCriticalSection, flags); pstrMessage = pHandle->pstrMessageList; @@ -144,7 +144,7 @@ int wilc_mq_recv(struct message_queue *pHandle, /* check buffer size */ if (u32RecvBufferSize < pstrMessage->len) { spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); - up(&pHandle->hSem); + up(&pHandle->sem); PRINT_ER("u32RecvBufferSize overflow\n"); return -EOVERFLOW; } diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 111be46..3ea4068 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -20,7 +20,7 @@ struct message { }; struct message_queue { - struct semaphore hSem; + struct semaphore sem; spinlock_t strCriticalSection; bool bExiting; u32 u32ReceiversCount; -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/27] staging: wilc1000: rename pHandle in wilc_mq_create
This patch renames pHandle to mq to avoid camelcase Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 12 ++-- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index d13c9a7..453fa19 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -11,13 +11,13 @@ * @note copied from FLO glue implementatuion * @version 1.0 */ -int wilc_mq_create(struct message_queue *pHandle) +int wilc_mq_create(struct message_queue *mq) { - spin_lock_init(&pHandle->lock); - sema_init(&pHandle->sem, 0); - pHandle->msg_list = NULL; - pHandle->recv_count = 0; - pHandle->exiting = false; + spin_lock_init(&mq->lock); + sema_init(&mq->sem, 0); + mq->msg_list = NULL; + mq->recv_count = 0; + mq->exiting = false; return 0; } diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 7e7ec06..bfd2347 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -40,7 +40,7 @@ struct message_queue { * @date 30 Aug 2010 * @version 1.0 */ -int wilc_mq_create(struct message_queue *pHandle); +int wilc_mq_create(struct message_queue *mq); /*! * @brief Sends a message -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/27] staging: wilc1000: rename pvSendBuffer in wilc_mq_send
This patch renames pvSendBuffer to send_buf to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 8 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 71ce1f5..5feb87c 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -54,13 +54,13 @@ int wilc_mq_destroy(struct message_queue *mq) * @version 1.0 */ int wilc_mq_send(struct message_queue *mq, -const void *pvSendBuffer, u32 u32SendBufferSize) +const void *send_buf, u32 u32SendBufferSize) { unsigned long flags; struct message *pstrMessage = NULL; - if ((!mq) || (u32SendBufferSize == 0) || (!pvSendBuffer)) { - PRINT_ER("mq or pvSendBuffer is null\n"); + if ((!mq) || (u32SendBufferSize == 0) || (!send_buf)) { + PRINT_ER("mq or send_buf is null\n"); return -EFAULT; } @@ -76,7 +76,7 @@ int wilc_mq_send(struct message_queue *mq, pstrMessage->len = u32SendBufferSize; pstrMessage->next = NULL; - pstrMessage->buf = kmemdup(pvSendBuffer, u32SendBufferSize, + pstrMessage->buf = kmemdup(send_buf, u32SendBufferSize, GFP_ATOMIC); if (!pstrMessage->buf) { kfree(pstrMessage); diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index e6cdc10..3adee90 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -58,7 +58,7 @@ int wilc_mq_create(struct message_queue *mq); * @version 1.0 */ int wilc_mq_send(struct message_queue *mq, -const void *pvSendBuffer, u32 u32SendBufferSize); +const void *send_buf, u32 u32SendBufferSize); /*! * @brief Receives a message -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/27] staging: wilc1000: fix coding style of kmalloc usage
This patch fixes coding style of kmalloc usage found by checkpatch. CHECK: Prefer kmalloc(sizeof(*new_msg)...) over kmalloc(sizeof(struct message)...) Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 7107715..c7a60f4 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -70,7 +70,7 @@ int wilc_mq_send(struct message_queue *mq, } /* construct a new message */ - new_msg = kmalloc(sizeof(struct message), GFP_ATOMIC); + new_msg = kmalloc(sizeof(*new_msg), GFP_ATOMIC); if (!new_msg) return -ENOMEM; -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/27] staging: wilc1000: rename u32Length in struct message
This patch renames u32Length to len to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 8 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index a4e612d..0e66a64 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -74,7 +74,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, if (!pstrMessage) return -ENOMEM; - pstrMessage->u32Length = u32SendBufferSize; + pstrMessage->len = u32SendBufferSize; pstrMessage->pstrNext = NULL; pstrMessage->buf = kmemdup(pvSendBuffer, u32SendBufferSize, GFP_ATOMIC); @@ -142,7 +142,7 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, return -EFAULT; } /* check buffer size */ - if (u32RecvBufferSize < pstrMessage->u32Length) { + if (u32RecvBufferSize < pstrMessage->len) { spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); up(&pHandle->hSem); PRINT_ER("u32RecvBufferSize overflow\n"); @@ -151,8 +151,8 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, /* consume the message */ pHandle->u32ReceiversCount--; - memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->u32Length); - *pu32ReceivedLength = pstrMessage->u32Length; + memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len); + *pu32ReceivedLength = pstrMessage->len; pHandle->pstrMessageList = pstrMessage->pstrNext; diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 848ed82..b0ccd1d 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -15,7 +15,7 @@ /* Message Queue type is a structure */ struct message { void *buf; - u32 u32Length; + u32 len; struct message *pstrNext; }; -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/27] staging: wilc1000: rename strCriticalSection in struct message_queue
This patch renames strCriticalSection to lock to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 18 +- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index b996c47..67bf147 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -13,7 +13,7 @@ */ int wilc_mq_create(struct message_queue *pHandle) { - spin_lock_init(&pHandle->strCriticalSection); + spin_lock_init(&pHandle->lock); sema_init(&pHandle->sem, 0); pHandle->pstrMessageList = NULL; pHandle->u32ReceiversCount = 0; @@ -83,7 +83,7 @@ int wilc_mq_send(struct message_queue *pHandle, return -ENOMEM; } - spin_lock_irqsave(&pHandle->strCriticalSection, flags); + spin_lock_irqsave(&pHandle->lock, flags); /* add it to the message queue */ if (!pHandle->pstrMessageList) { @@ -97,7 +97,7 @@ int wilc_mq_send(struct message_queue *pHandle, pstrTailMsg->next = pstrMessage; } - spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); + spin_unlock_irqrestore(&pHandle->lock, flags); up(&pHandle->sem); @@ -128,22 +128,22 @@ int wilc_mq_recv(struct message_queue *pHandle, return -EFAULT; } - spin_lock_irqsave(&pHandle->strCriticalSection, flags); + spin_lock_irqsave(&pHandle->lock, flags); pHandle->u32ReceiversCount++; - spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); + spin_unlock_irqrestore(&pHandle->lock, flags); down(&pHandle->sem); - spin_lock_irqsave(&pHandle->strCriticalSection, flags); + spin_lock_irqsave(&pHandle->lock, flags); pstrMessage = pHandle->pstrMessageList; if (!pstrMessage) { - spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); + spin_unlock_irqrestore(&pHandle->lock, flags); PRINT_ER("pstrMessage is null\n"); return -EFAULT; } /* check buffer size */ if (u32RecvBufferSize < pstrMessage->len) { - spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); + spin_unlock_irqrestore(&pHandle->lock, flags); up(&pHandle->sem); PRINT_ER("u32RecvBufferSize overflow\n"); return -EOVERFLOW; @@ -159,7 +159,7 @@ int wilc_mq_recv(struct message_queue *pHandle, kfree(pstrMessage->buf); kfree(pstrMessage); - spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); + spin_unlock_irqrestore(&pHandle->lock, flags); return 0; } diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 3ea4068..6cdebbf 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -21,7 +21,7 @@ struct message { struct message_queue { struct semaphore sem; - spinlock_t strCriticalSection; + spinlock_t lock; bool bExiting; u32 u32ReceiversCount; struct message *pstrMessageList; -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/27] staging: wilc1000: rename pHandle in wilc_mq_destroy
This patch renames pHandle to mq to avoid camelcase Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 18 +- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 453fa19..103fcfd 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -27,21 +27,21 @@ int wilc_mq_create(struct message_queue *mq) * @note copied from FLO glue implementatuion * @version 1.0 */ -int wilc_mq_destroy(struct message_queue *pHandle) +int wilc_mq_destroy(struct message_queue *mq) { - pHandle->exiting = true; + mq->exiting = true; /* Release any waiting receiver thread. */ - while (pHandle->recv_count > 0) { - up(&pHandle->sem); - pHandle->recv_count--; + while (mq->recv_count > 0) { + up(&mq->sem); + mq->recv_count--; } - while (pHandle->msg_list) { - struct message *pstrMessge = pHandle->msg_list->next; + while (mq->msg_list) { + struct message *pstrMessge = mq->msg_list->next; - kfree(pHandle->msg_list); - pHandle->msg_list = pstrMessge; + kfree(mq->msg_list); + mq->msg_list = pstrMessge; } return 0; diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index bfd2347..b91822e 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -89,6 +89,6 @@ int wilc_mq_recv(struct message_queue *pHandle, * @date 30 Aug 2010 * @version 1.0 */ -int wilc_mq_destroy(struct message_queue *pHandle); +int wilc_mq_destroy(struct message_queue *mq); #endif -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/27] staging: wilc1000: rename u32SendBufferSize in wilc_mq_send
This patch renames u32SendBufferSize to send_buf_size to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 8 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 5feb87c..8e37cff0 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -54,12 +54,12 @@ int wilc_mq_destroy(struct message_queue *mq) * @version 1.0 */ int wilc_mq_send(struct message_queue *mq, -const void *send_buf, u32 u32SendBufferSize) +const void *send_buf, u32 send_buf_size) { unsigned long flags; struct message *pstrMessage = NULL; - if ((!mq) || (u32SendBufferSize == 0) || (!send_buf)) { + if ((!mq) || (send_buf_size == 0) || (!send_buf)) { PRINT_ER("mq or send_buf is null\n"); return -EFAULT; } @@ -74,9 +74,9 @@ int wilc_mq_send(struct message_queue *mq, if (!pstrMessage) return -ENOMEM; - pstrMessage->len = u32SendBufferSize; + pstrMessage->len = send_buf_size; pstrMessage->next = NULL; - pstrMessage->buf = kmemdup(send_buf, u32SendBufferSize, + pstrMessage->buf = kmemdup(send_buf, send_buf_size, GFP_ATOMIC); if (!pstrMessage->buf) { kfree(pstrMessage); diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 3adee90..70e1be1 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -58,7 +58,7 @@ int wilc_mq_create(struct message_queue *mq); * @version 1.0 */ int wilc_mq_send(struct message_queue *mq, -const void *send_buf, u32 u32SendBufferSize); +const void *send_buf, u32 send_buf_size); /*! * @brief Receives a message -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/27] staging: wilc1000: rename pstrMessageList in struct message_queue
This patch renames pstrMessageList to msg_list to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 20 ++-- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 363e003..d13c9a7 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -15,7 +15,7 @@ int wilc_mq_create(struct message_queue *pHandle) { spin_lock_init(&pHandle->lock); sema_init(&pHandle->sem, 0); - pHandle->pstrMessageList = NULL; + pHandle->msg_list = NULL; pHandle->recv_count = 0; pHandle->exiting = false; return 0; @@ -37,11 +37,11 @@ int wilc_mq_destroy(struct message_queue *pHandle) pHandle->recv_count--; } - while (pHandle->pstrMessageList) { - struct message *pstrMessge = pHandle->pstrMessageList->next; + while (pHandle->msg_list) { + struct message *pstrMessge = pHandle->msg_list->next; - kfree(pHandle->pstrMessageList); - pHandle->pstrMessageList = pstrMessge; + kfree(pHandle->msg_list); + pHandle->msg_list = pstrMessge; } return 0; @@ -86,10 +86,10 @@ int wilc_mq_send(struct message_queue *pHandle, spin_lock_irqsave(&pHandle->lock, flags); /* add it to the message queue */ - if (!pHandle->pstrMessageList) { - pHandle->pstrMessageList = pstrMessage; + if (!pHandle->msg_list) { + pHandle->msg_list = pstrMessage; } else { - struct message *pstrTailMsg = pHandle->pstrMessageList; + struct message *pstrTailMsg = pHandle->msg_list; while (pstrTailMsg->next) pstrTailMsg = pstrTailMsg->next; @@ -135,7 +135,7 @@ int wilc_mq_recv(struct message_queue *pHandle, down(&pHandle->sem); spin_lock_irqsave(&pHandle->lock, flags); - pstrMessage = pHandle->pstrMessageList; + pstrMessage = pHandle->msg_list; if (!pstrMessage) { spin_unlock_irqrestore(&pHandle->lock, flags); PRINT_ER("pstrMessage is null\n"); @@ -154,7 +154,7 @@ int wilc_mq_recv(struct message_queue *pHandle, memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len); *pu32ReceivedLength = pstrMessage->len; - pHandle->pstrMessageList = pstrMessage->next; + pHandle->msg_list = pstrMessage->next; kfree(pstrMessage->buf); kfree(pstrMessage); diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index dcf54ea..7e7ec06 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -24,7 +24,7 @@ struct message_queue { spinlock_t lock; bool exiting; u32 recv_count; - struct message *pstrMessageList; + struct message *msg_list; }; /*! -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/27] staging: wilc1000: rename bExiting in struct message_queue
This patch renames bExiting to exiting to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 8 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 67bf147..47ba256 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -17,7 +17,7 @@ int wilc_mq_create(struct message_queue *pHandle) sema_init(&pHandle->sem, 0); pHandle->pstrMessageList = NULL; pHandle->u32ReceiversCount = 0; - pHandle->bExiting = false; + pHandle->exiting = false; return 0; } @@ -29,7 +29,7 @@ int wilc_mq_create(struct message_queue *pHandle) */ int wilc_mq_destroy(struct message_queue *pHandle) { - pHandle->bExiting = true; + pHandle->exiting = true; /* Release any waiting receiver thread. */ while (pHandle->u32ReceiversCount > 0) { @@ -64,7 +64,7 @@ int wilc_mq_send(struct message_queue *pHandle, return -EFAULT; } - if (pHandle->bExiting) { + if (pHandle->exiting) { PRINT_ER("pHandle fail\n"); return -EFAULT; } @@ -123,7 +123,7 @@ int wilc_mq_recv(struct message_queue *pHandle, return -EINVAL; } - if (pHandle->bExiting) { + if (pHandle->exiting) { PRINT_ER("pHandle fail\n"); return -EFAULT; } diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 6cdebbf..2c21b3e 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -22,7 +22,7 @@ struct message { struct message_queue { struct semaphore sem; spinlock_t lock; - bool bExiting; + bool exiting; u32 u32ReceiversCount; struct message *pstrMessageList; }; -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/27] staging: wilc1000: rename u32ReceiversCount in struct message_queue
This patch renames u32ReceiversCount to recv_count to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 10 +- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 47ba256..363e003 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -16,7 +16,7 @@ int wilc_mq_create(struct message_queue *pHandle) spin_lock_init(&pHandle->lock); sema_init(&pHandle->sem, 0); pHandle->pstrMessageList = NULL; - pHandle->u32ReceiversCount = 0; + pHandle->recv_count = 0; pHandle->exiting = false; return 0; } @@ -32,9 +32,9 @@ int wilc_mq_destroy(struct message_queue *pHandle) pHandle->exiting = true; /* Release any waiting receiver thread. */ - while (pHandle->u32ReceiversCount > 0) { + while (pHandle->recv_count > 0) { up(&pHandle->sem); - pHandle->u32ReceiversCount--; + pHandle->recv_count--; } while (pHandle->pstrMessageList) { @@ -129,7 +129,7 @@ int wilc_mq_recv(struct message_queue *pHandle, } spin_lock_irqsave(&pHandle->lock, flags); - pHandle->u32ReceiversCount++; + pHandle->recv_count++; spin_unlock_irqrestore(&pHandle->lock, flags); down(&pHandle->sem); @@ -150,7 +150,7 @@ int wilc_mq_recv(struct message_queue *pHandle, } /* consume the message */ - pHandle->u32ReceiversCount--; + pHandle->recv_count--; memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len); *pu32ReceivedLength = pstrMessage->len; diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 2c21b3e..dcf54ea 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -23,7 +23,7 @@ struct message_queue { struct semaphore sem; spinlock_t lock; bool exiting; - u32 u32ReceiversCount; + u32 recv_count; struct message *pstrMessageList; }; -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/27] staging: wilc1000: fix logical continuations
This patch fixes logical continuations found by checkpatch CHECK: Logical continuations should be on the previous line Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index c7a60f4..4493ca9 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -115,8 +115,7 @@ int wilc_mq_recv(struct message_queue *mq, struct message *msg; unsigned long flags; - if ((!mq) || (recv_buf_size == 0) - || (!recv_buf) || (!recv_len)) { + if ((!mq) || (recv_buf_size == 0) || (!recv_buf) || (!recv_len)) { PRINT_ER("mq or recv_buf is null\n"); return -EINVAL; } -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/27] staging: wilc1000: rename pHandle in wilc_mq_recv
This patch renames pHandle to mq to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 34 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 361ca8f..d2df179 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -109,56 +109,56 @@ int wilc_mq_send(struct message_queue *mq, * @note copied from FLO glue implementatuion * @version 1.0 */ -int wilc_mq_recv(struct message_queue *pHandle, +int wilc_mq_recv(struct message_queue *mq, void *pvRecvBuffer, u32 u32RecvBufferSize, u32 *pu32ReceivedLength) { struct message *pstrMessage; unsigned long flags; - if ((!pHandle) || (u32RecvBufferSize == 0) + if ((!mq) || (u32RecvBufferSize == 0) || (!pvRecvBuffer) || (!pu32ReceivedLength)) { - PRINT_ER("pHandle or pvRecvBuffer is null\n"); + PRINT_ER("mq or pvRecvBuffer is null\n"); return -EINVAL; } - if (pHandle->exiting) { - PRINT_ER("pHandle fail\n"); + if (mq->exiting) { + PRINT_ER("mq fail\n"); return -EFAULT; } - spin_lock_irqsave(&pHandle->lock, flags); - pHandle->recv_count++; - spin_unlock_irqrestore(&pHandle->lock, flags); + spin_lock_irqsave(&mq->lock, flags); + mq->recv_count++; + spin_unlock_irqrestore(&mq->lock, flags); - down(&pHandle->sem); - spin_lock_irqsave(&pHandle->lock, flags); + down(&mq->sem); + spin_lock_irqsave(&mq->lock, flags); - pstrMessage = pHandle->msg_list; + pstrMessage = mq->msg_list; if (!pstrMessage) { - spin_unlock_irqrestore(&pHandle->lock, flags); + spin_unlock_irqrestore(&mq->lock, flags); PRINT_ER("pstrMessage is null\n"); return -EFAULT; } /* check buffer size */ if (u32RecvBufferSize < pstrMessage->len) { - spin_unlock_irqrestore(&pHandle->lock, flags); - up(&pHandle->sem); + spin_unlock_irqrestore(&mq->lock, flags); + up(&mq->sem); PRINT_ER("u32RecvBufferSize overflow\n"); return -EOVERFLOW; } /* consume the message */ - pHandle->recv_count--; + mq->recv_count--; memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len); *pu32ReceivedLength = pstrMessage->len; - pHandle->msg_list = pstrMessage->next; + mq->msg_list = pstrMessage->next; kfree(pstrMessage->buf); kfree(pstrMessage); - spin_unlock_irqrestore(&pHandle->lock, flags); + spin_unlock_irqrestore(&mq->lock, flags); return 0; } diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 70e1be1..0c1eead 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -76,7 +76,7 @@ int wilc_mq_send(struct message_queue *mq, * @date 30 Aug 2010 * @version 1.0 */ -int wilc_mq_recv(struct message_queue *pHandle, +int wilc_mq_recv(struct message_queue *mq, void *pvRecvBuffer, u32 u32RecvBufferSize, u32 *pu32ReceivedLength); -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/27] staging: wilc1000: fix return error code
Three argument are checked at the beginning of wilc_mq_send whether they are valid arguments or not. It is correct to use return error code as -EINVAL, not -EFAULT. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 764723f..361ca8f 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -61,7 +61,7 @@ int wilc_mq_send(struct message_queue *mq, if ((!mq) || (send_buf_size == 0) || (!send_buf)) { PRINT_ER("mq or send_buf is null\n"); - return -EFAULT; + return -EINVAL; } if (mq->exiting) { -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/27] staging: wilc1000: rename pstrMessage in wilc_mq_send
This patch renames pstrMessage to new_msg to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 8e37cff0..9a80fe6 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -57,7 +57,7 @@ int wilc_mq_send(struct message_queue *mq, const void *send_buf, u32 send_buf_size) { unsigned long flags; - struct message *pstrMessage = NULL; + struct message *new_msg = NULL; if ((!mq) || (send_buf_size == 0) || (!send_buf)) { PRINT_ER("mq or send_buf is null\n"); @@ -70,16 +70,15 @@ int wilc_mq_send(struct message_queue *mq, } /* construct a new message */ - pstrMessage = kmalloc(sizeof(struct message), GFP_ATOMIC); - if (!pstrMessage) + new_msg = kmalloc(sizeof(struct message), GFP_ATOMIC); + if (!new_msg) return -ENOMEM; - pstrMessage->len = send_buf_size; - pstrMessage->next = NULL; - pstrMessage->buf = kmemdup(send_buf, send_buf_size, - GFP_ATOMIC); - if (!pstrMessage->buf) { - kfree(pstrMessage); + new_msg->len = send_buf_size; + new_msg->next = NULL; + new_msg->buf = kmemdup(send_buf, send_buf_size, GFP_ATOMIC); + if (!new_msg->buf) { + kfree(new_msg); return -ENOMEM; } @@ -87,14 +86,14 @@ int wilc_mq_send(struct message_queue *mq, /* add it to the message queue */ if (!mq->msg_list) { - mq->msg_list = pstrMessage; + mq->msg_list = new_msg; } else { struct message *pstrTailMsg = mq->msg_list; while (pstrTailMsg->next) pstrTailMsg = pstrTailMsg->next; - pstrTailMsg->next = pstrMessage; + pstrTailMsg->next = new_msg; } spin_unlock_irqrestore(&mq->lock, flags); -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/27] staging: wilc1000: rename pHandle in wilc_mq_send
This patch renames pHandle to mq to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 22 +++--- drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index a01420a..71ce1f5 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -53,19 +53,19 @@ int wilc_mq_destroy(struct message_queue *mq) * @note copied from FLO glue implementatuion * @version 1.0 */ -int wilc_mq_send(struct message_queue *pHandle, +int wilc_mq_send(struct message_queue *mq, const void *pvSendBuffer, u32 u32SendBufferSize) { unsigned long flags; struct message *pstrMessage = NULL; - if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) { - PRINT_ER("pHandle or pvSendBuffer is null\n"); + if ((!mq) || (u32SendBufferSize == 0) || (!pvSendBuffer)) { + PRINT_ER("mq or pvSendBuffer is null\n"); return -EFAULT; } - if (pHandle->exiting) { - PRINT_ER("pHandle fail\n"); + if (mq->exiting) { + PRINT_ER("mq fail\n"); return -EFAULT; } @@ -83,13 +83,13 @@ int wilc_mq_send(struct message_queue *pHandle, return -ENOMEM; } - spin_lock_irqsave(&pHandle->lock, flags); + spin_lock_irqsave(&mq->lock, flags); /* add it to the message queue */ - if (!pHandle->msg_list) { - pHandle->msg_list = pstrMessage; + if (!mq->msg_list) { + mq->msg_list = pstrMessage; } else { - struct message *pstrTailMsg = pHandle->msg_list; + struct message *pstrTailMsg = mq->msg_list; while (pstrTailMsg->next) pstrTailMsg = pstrTailMsg->next; @@ -97,9 +97,9 @@ int wilc_mq_send(struct message_queue *pHandle, pstrTailMsg->next = pstrMessage; } - spin_unlock_irqrestore(&pHandle->lock, flags); + spin_unlock_irqrestore(&mq->lock, flags); - up(&pHandle->sem); + up(&mq->sem); return 0; } diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index b91822e..e6cdc10 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -57,7 +57,7 @@ int wilc_mq_create(struct message_queue *mq); * @date 30 Aug 2010 * @version 1.0 */ -int wilc_mq_send(struct message_queue *pHandle, +int wilc_mq_send(struct message_queue *mq, const void *pvSendBuffer, u32 u32SendBufferSize); /*! -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/27] staging: wilc1000: rename pstrMessge in wilc_mq_destroy
This patch renames pstrMessge to msg to avoid camelcase. Signed-off-by: Chaehyun Lim --- 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 103fcfd..a01420a 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -38,10 +38,10 @@ int wilc_mq_destroy(struct message_queue *mq) } while (mq->msg_list) { - struct message *pstrMessge = mq->msg_list->next; + struct message *msg = mq->msg_list->next; kfree(mq->msg_list); - mq->msg_list = pstrMessge; + mq->msg_list = msg; } return 0; -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/27] staging: wilc1000: remove over-commenting
There are over-commenting in wilc_msgqueue.h file. This comment is not explain exactly what codes do and make checkpatch warning about "line over 80 charcters". If necessary, comment will be added later with preferred coding style. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.h | 66 1 file changed, 66 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 4f79ead..ddd09843 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -1,18 +1,8 @@ #ifndef __WILC_MSG_QUEUE_H__ #define __WILC_MSG_QUEUE_H__ -/*! - * @file wilc_msgqueue.h - * @brief Message Queue OS wrapper functionality - * @authorsyounan - * @sawilc_oswrapper.h top level OS wrapper file - * @date 30 Aug 2010 - * @version 1.0 - */ - #include -/* Message Queue type is a structure */ struct message { void *buf; u32 len; @@ -27,67 +17,11 @@ struct message_queue { struct message *msg_list; }; -/*! - * @brief Creates a new Message queue - * @details Creates a new Message queue, if the feature - * CONFIG_WILC_MSG_QUEUE_IPC_NAME is enabled and pstrAttrs->pcName - * is not Null, then this message queue can be used for IPC with - * any other message queue having the same name in the system - * @param[in,out] pHandle handle to the message queue object - * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating success/failure - * @authorsyounan - * @date 30 Aug 2010 - * @version 1.0 - */ int wilc_mq_create(struct message_queue *mq); - -/*! - * @brief Sends a message - * @details Sends a message, this API will block until the message is - * actually sent or until it is timedout (as long as the feature - * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout - * is not set to WILC_OS_INFINITY), zero timeout is a valid value - * @param[in] pHandle handle to the message queue object - * @param[in] pvSendBuffer pointer to the data to send - * @param[in] u32SendBufferSize the size of the data to send - * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating success/failure - * @authorsyounan - * @date 30 Aug 2010 - * @version 1.0 - */ int wilc_mq_send(struct message_queue *mq, const void *send_buf, u32 send_buf_size); - -/*! - * @brief Receives a message - * @details Receives a message, this API will block until a message is - * received or until it is timedout (as long as the feature - * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout - * is not set to WILC_OS_INFINITY), zero timeout is a valid value - * @param[in] pHandle handle to the message queue object - * @param[out]pvRecvBuffer pointer to a buffer to fill with the received message - * @param[in] u32RecvBufferSize the size of the receive buffer - * @param[out]pu32ReceivedLength the length of received data - * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating success/failure - * @authorsyounan - * @date 30 Aug 2010 - * @version 1.0 - */ int wilc_mq_recv(struct message_queue *mq, void *recv_buf, u32 recv_buf_size, u32 *recv_len); - -/*! - * @brief Destroys an existing Message queue - * @param[in] pHandle handle to the message queue object - * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating success/failure - * @authorsyounan - * @date 30 Aug 2010 - * @version 1.0 - */ int wilc_mq_destroy(struct message_queue *mq); #endif -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/27] staging: wilc1000: rename pvRecvBuffer in wilc_mq_recv
This patch renames pvRecvBuffer to recv_buf to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 8 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index d2df179..b836b2e 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -110,15 +110,15 @@ int wilc_mq_send(struct message_queue *mq, * @version 1.0 */ int wilc_mq_recv(struct message_queue *mq, -void *pvRecvBuffer, u32 u32RecvBufferSize, +void *recv_buf, u32 u32RecvBufferSize, u32 *pu32ReceivedLength) { struct message *pstrMessage; unsigned long flags; if ((!mq) || (u32RecvBufferSize == 0) - || (!pvRecvBuffer) || (!pu32ReceivedLength)) { - PRINT_ER("mq or pvRecvBuffer is null\n"); + || (!recv_buf) || (!pu32ReceivedLength)) { + PRINT_ER("mq or recv_buf is null\n"); return -EINVAL; } @@ -150,7 +150,7 @@ int wilc_mq_recv(struct message_queue *mq, /* consume the message */ mq->recv_count--; - memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len); + memcpy(recv_buf, pstrMessage->buf, pstrMessage->len); *pu32ReceivedLength = pstrMessage->len; mq->msg_list = pstrMessage->next; diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 0c1eead..81b51dd 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -77,7 +77,7 @@ int wilc_mq_send(struct message_queue *mq, * @version 1.0 */ int wilc_mq_recv(struct message_queue *mq, -void *pvRecvBuffer, u32 u32RecvBufferSize, +void *recv_buf, u32 u32RecvBufferSize, u32 *pu32ReceivedLength); /*! -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/27] staging: wilc1000: rename u32RecvBufferSize in wilc_mq_recv
This patch renames u32RecvBufferSize to recv_buf_size to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 8 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index b836b2e..c86bd7c 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -110,13 +110,13 @@ int wilc_mq_send(struct message_queue *mq, * @version 1.0 */ int wilc_mq_recv(struct message_queue *mq, -void *recv_buf, u32 u32RecvBufferSize, +void *recv_buf, u32 recv_buf_size, u32 *pu32ReceivedLength) { struct message *pstrMessage; unsigned long flags; - if ((!mq) || (u32RecvBufferSize == 0) + if ((!mq) || (recv_buf_size == 0) || (!recv_buf) || (!pu32ReceivedLength)) { PRINT_ER("mq or recv_buf is null\n"); return -EINVAL; @@ -141,10 +141,10 @@ int wilc_mq_recv(struct message_queue *mq, return -EFAULT; } /* check buffer size */ - if (u32RecvBufferSize < pstrMessage->len) { + if (recv_buf_size < pstrMessage->len) { spin_unlock_irqrestore(&mq->lock, flags); up(&mq->sem); - PRINT_ER("u32RecvBufferSize overflow\n"); + PRINT_ER("recv_buf_size overflow\n"); return -EOVERFLOW; } diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 81b51dd..3804b3b 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -77,7 +77,7 @@ int wilc_mq_send(struct message_queue *mq, * @version 1.0 */ int wilc_mq_recv(struct message_queue *mq, -void *recv_buf, u32 u32RecvBufferSize, +void *recv_buf, u32 recv_buf_size, u32 *pu32ReceivedLength); /*! -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/27] staging: wilc1000: rename tail_msg in wilc_mq_send
This patch renames pstrTailMsg to tail_msg to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 9a80fe6..764723f 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -88,12 +88,12 @@ int wilc_mq_send(struct message_queue *mq, if (!mq->msg_list) { mq->msg_list = new_msg; } else { - struct message *pstrTailMsg = mq->msg_list; + struct message *tail_msg = mq->msg_list; - while (pstrTailMsg->next) - pstrTailMsg = pstrTailMsg->next; + while (tail_msg->next) + tail_msg = tail_msg->next; - pstrTailMsg->next = new_msg; + tail_msg->next = new_msg; } spin_unlock_irqrestore(&mq->lock, flags); -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/27] staging: wilc1000: rename pstrMessage in wilc_mq_recv
This patch renames pstrMessage to msg to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 5601de8..7107715 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -112,7 +112,7 @@ int wilc_mq_send(struct message_queue *mq, int wilc_mq_recv(struct message_queue *mq, void *recv_buf, u32 recv_buf_size, u32 *recv_len) { - struct message *pstrMessage; + struct message *msg; unsigned long flags; if ((!mq) || (recv_buf_size == 0) @@ -133,14 +133,14 @@ int wilc_mq_recv(struct message_queue *mq, down(&mq->sem); spin_lock_irqsave(&mq->lock, flags); - pstrMessage = mq->msg_list; - if (!pstrMessage) { + msg = mq->msg_list; + if (!msg) { spin_unlock_irqrestore(&mq->lock, flags); - PRINT_ER("pstrMessage is null\n"); + PRINT_ER("msg is null\n"); return -EFAULT; } /* check buffer size */ - if (recv_buf_size < pstrMessage->len) { + if (recv_buf_size < msg->len) { spin_unlock_irqrestore(&mq->lock, flags); up(&mq->sem); PRINT_ER("recv_buf_size overflow\n"); @@ -149,13 +149,13 @@ int wilc_mq_recv(struct message_queue *mq, /* consume the message */ mq->recv_count--; - memcpy(recv_buf, pstrMessage->buf, pstrMessage->len); - *recv_len = pstrMessage->len; + memcpy(recv_buf, msg->buf, msg->len); + *recv_len = msg->len; - mq->msg_list = pstrMessage->next; + mq->msg_list = msg->next; - kfree(pstrMessage->buf); - kfree(pstrMessage); + kfree(msg->buf); + kfree(msg); spin_unlock_irqrestore(&mq->lock, flags); -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/27] staging: wilc1000: rename pu32ReceivedLength in wilc_mq_recv
This patch renames pu32ReceivedLength to recv_len to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 7 +++ drivers/staging/wilc1000/wilc_msgqueue.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index c86bd7c..5601de8 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -110,14 +110,13 @@ int wilc_mq_send(struct message_queue *mq, * @version 1.0 */ int wilc_mq_recv(struct message_queue *mq, -void *recv_buf, u32 recv_buf_size, -u32 *pu32ReceivedLength) +void *recv_buf, u32 recv_buf_size, u32 *recv_len) { struct message *pstrMessage; unsigned long flags; if ((!mq) || (recv_buf_size == 0) - || (!recv_buf) || (!pu32ReceivedLength)) { + || (!recv_buf) || (!recv_len)) { PRINT_ER("mq or recv_buf is null\n"); return -EINVAL; } @@ -151,7 +150,7 @@ int wilc_mq_recv(struct message_queue *mq, /* consume the message */ mq->recv_count--; memcpy(recv_buf, pstrMessage->buf, pstrMessage->len); - *pu32ReceivedLength = pstrMessage->len; + *recv_len = pstrMessage->len; mq->msg_list = pstrMessage->next; diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 3804b3b..4f79ead 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -77,8 +77,7 @@ int wilc_mq_send(struct message_queue *mq, * @version 1.0 */ int wilc_mq_recv(struct message_queue *mq, -void *recv_buf, u32 recv_buf_size, -u32 *pu32ReceivedLength); +void *recv_buf, u32 recv_buf_size, u32 *recv_len); /*! * @brief Destroys an existing Message queue -- 2.6.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] rtlwifi: rtl8821ae: Fix 5G failure when EEPROM is incorrectly encoded
Recently, it has been reported that D-Link DWA-582 cards, which use an RTL8812AE chip are not able to scan for 5G networks. The problems started with kernel 4.2, which is the first version that had commit d10101a60372 ("rtlwifi: rtl8821ae: Fix problem with regulatory information"). With this patch, the driver went from setting a default channel plan to using the value derived from EEPROM. Bug reports at https://bugzilla.kernel.org/show_bug.cgi?id=111031 and https://bugzilla.redhat.com/show_bug.cgi?id=1279653 are examples of this problem. The problem was solved once I learned that the internal country code was resulting in a regulatory set with only 2.4 GHz channels. With the RTL8821AE chips available to me, the country code was such that both 2.4 and 5 GHz channels are allowed. The fix is to allow both bands even when the EEPROM is incorrectly encoded. Fixes: d10101a60372 ("rtlwifi: rtl8821ae: Fix problem with regulatory information") Signed-off-by: Larry Finger Cc: littlesmart...@gmail.com Cc: g...@codehaus.org Cc: Stable [v4.2+] --- drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/regd.c b/drivers/net/wireless/realtek/rtlwifi/regd.c index a62bf0a..5be3411 100644 --- a/drivers/net/wireless/realtek/rtlwifi/regd.c +++ b/drivers/net/wireless/realtek/rtlwifi/regd.c @@ -351,7 +351,6 @@ static const struct ieee80211_regdomain *_rtl_regdomain_select( case COUNTRY_CODE_SPAIN: case COUNTRY_CODE_FRANCE: case COUNTRY_CODE_ISRAEL: - case COUNTRY_CODE_WORLD_WIDE_13: return &rtl_regdom_12_13; case COUNTRY_CODE_MKK: case COUNTRY_CODE_MKK1: @@ -360,6 +359,7 @@ static const struct ieee80211_regdomain *_rtl_regdomain_select( return &rtl_regdom_14_60_64; case COUNTRY_CODE_GLOBAL_DOMAIN: return &rtl_regdom_14; + case COUNTRY_CODE_WORLD_WIDE_13: case COUNTRY_CODE_WORLD_WIDE_13_5G_ALL: return &rtl_regdom_12_13_5g_all; default: -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel