[PATCH] Staging: rtl8821ae: fix up some spacing issues.
I fixed up some operator spacing issues, and other minor spacing issues. Signed-off-by: Gary Alan Rookard --- On branch staging-next drivers/staging/rtl8821ae/base.c | 138 +++ 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/drivers/staging/rtl8821ae/base.c b/drivers/staging/rtl8821ae/base.c index b5a50d0..7097752 100644 --- a/drivers/staging/rtl8821ae/base.c +++ b/drivers/staging/rtl8821ae/base.c @@ -64,73 +64,73 @@ * */ static struct ieee80211_channel rtl_channeltable_2g[] = { - {.center_freq = 2412,.hw_value = 1,}, - {.center_freq = 2417,.hw_value = 2,}, - {.center_freq = 2422,.hw_value = 3,}, - {.center_freq = 2427,.hw_value = 4,}, - {.center_freq = 2432,.hw_value = 5,}, - {.center_freq = 2437,.hw_value = 6,}, - {.center_freq = 2442,.hw_value = 7,}, - {.center_freq = 2447,.hw_value = 8,}, - {.center_freq = 2452,.hw_value = 9,}, - {.center_freq = 2457,.hw_value = 10,}, - {.center_freq = 2462,.hw_value = 11,}, - {.center_freq = 2467,.hw_value = 12,}, - {.center_freq = 2472,.hw_value = 13,}, - {.center_freq = 2484,.hw_value = 14,}, + {.center_freq = 2412, .hw_value = 1,}, + {.center_freq = 2417, .hw_value = 2,}, + {.center_freq = 2422, .hw_value = 3,}, + {.center_freq = 2427, .hw_value = 4,}, + {.center_freq = 2432, .hw_value = 5,}, + {.center_freq = 2437, .hw_value = 6,}, + {.center_freq = 2442, .hw_value = 7,}, + {.center_freq = 2447, .hw_value = 8,}, + {.center_freq = 2452, .hw_value = 9,}, + {.center_freq = 2457, .hw_value = 10,}, + {.center_freq = 2462, .hw_value = 11,}, + {.center_freq = 2467, .hw_value = 12,}, + {.center_freq = 2472, .hw_value = 13,}, + {.center_freq = 2484, .hw_value = 14,}, }; static struct ieee80211_channel rtl_channeltable_5g[] = { - {.center_freq = 5180,.hw_value = 36,}, - {.center_freq = 5200,.hw_value = 40,}, - {.center_freq = 5220,.hw_value = 44,}, - {.center_freq = 5240,.hw_value = 48,}, - {.center_freq = 5260,.hw_value = 52,}, - {.center_freq = 5280,.hw_value = 56,}, - {.center_freq = 5300,.hw_value = 60,}, - {.center_freq = 5320,.hw_value = 64,}, - {.center_freq = 5500,.hw_value = 100,}, - {.center_freq = 5520,.hw_value = 104,}, - {.center_freq = 5540,.hw_value = 108,}, - {.center_freq = 5560,.hw_value = 112,}, - {.center_freq = 5580,.hw_value = 116,}, - {.center_freq = 5600,.hw_value = 120,}, - {.center_freq = 5620,.hw_value = 124,}, - {.center_freq = 5640,.hw_value = 128,}, - {.center_freq = 5660,.hw_value = 132,}, - {.center_freq = 5680,.hw_value = 136,}, - {.center_freq = 5700,.hw_value = 140,}, - {.center_freq = 5745,.hw_value = 149,}, - {.center_freq = 5765,.hw_value = 153,}, - {.center_freq = 5785,.hw_value = 157,}, - {.center_freq = 5805,.hw_value = 161,}, - {.center_freq = 5825,.hw_value = 165,}, + {.center_freq = 5180, .hw_value = 36,}, + {.center_freq = 5200, .hw_value = 40,}, + {.center_freq = 5220, .hw_value = 44,}, + {.center_freq = 5240, .hw_value = 48,}, + {.center_freq = 5260, .hw_value = 52,}, + {.center_freq = 5280, .hw_value = 56,}, + {.center_freq = 5300, .hw_value = 60,}, + {.center_freq = 5320, .hw_value = 64,}, + {.center_freq = 5500, .hw_value = 100,}, + {.center_freq = 5520, .hw_value = 104,}, + {.center_freq = 5540, .hw_value = 108,}, + {.center_freq = 5560, .hw_value = 112,}, + {.center_freq = 5580, .hw_value = 116,}, + {.center_freq = 5600, .hw_value = 120,}, + {.center_freq = 5620, .hw_value = 124,}, + {.center_freq = 5640, .hw_value = 128,}, + {.center_freq = 5660, .hw_value = 132,}, + {.center_freq = 5680, .hw_value = 136,}, + {.center_freq = 5700, .hw_value = 140,}, + {.center_freq = 5745, .hw_value = 149,}, + {.center_freq = 5765, .hw_value = 153,}, + {.center_freq = 5785, .hw_value = 157,}, + {.center_freq = 5805, .hw_value = 161,}, + {.center_freq = 5825, .hw_value = 165,}, }; static struct ieee80211_rate rtl_ratetable_2g[] = { - {.bitrate = 10,.hw_value = 0x00,}, - {.bitrate = 20,.hw_value = 0x01,}, - {.bitrate = 55,.hw_value = 0x02,}, - {.bitrate = 110,.hw_value = 0x03,}, - {.bitrate = 60,.hw_value = 0x04,}, - {.bitrate = 90,.hw_value = 0x05,}, - {.bitrate = 120,.hw_value = 0x06,}, - {.bitrate = 180,.hw_value = 0x07,}, - {.bitrate = 240,.hw_value = 0x08,}, - {.bitrate = 360,.hw_value = 0x09,}, - {.bitrate = 480,.hw_value = 0x0a,}, - {.bitrate = 540,.hw_value = 0x0b,}, + {.bitrate = 10, .hw_value = 0x00,}, + {.bitrate = 20, .hw_value = 0x01,}, + {.bitrate = 55, .hw_value = 0x02
[PATCH 1/3] Staging: ozwpan: Fix null dereference
If net_dev is NULL memcpy() will Oops. Signed-off-by: Salym Senyonga --- drivers/staging/ozwpan/ozproto.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c index cb06036..5d965cf 100644 --- a/drivers/staging/ozwpan/ozproto.c +++ b/drivers/staging/ozwpan/ozproto.c @@ -668,8 +668,8 @@ void oz_binding_add(const char *net_dev) if (binding) { binding->ptype.type = __constant_htons(OZ_ETHERTYPE); binding->ptype.func = oz_pkt_recv; - memcpy(binding->name, net_dev, OZ_MAX_BINDING_LEN); if (net_dev && *net_dev) { + memcpy(binding->name, net_dev, OZ_MAX_BINDING_LEN); oz_dbg(ON, "Adding binding: %s\n", net_dev); binding->ptype.dev = dev_get_by_name(&init_net, net_dev); @@ -680,6 +680,7 @@ void oz_binding_add(const char *net_dev) } } else { oz_dbg(ON, "Binding to all netcards\n"); + memset(binding->name, 0, OZ_MAX_BINDING_LEN); binding->ptype.dev = NULL; } if (binding) { -- 1.7.5.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] Staging: ozwpan: Change kmalloc() to kzalloc()
changing to kzalloc lets us get rid of some lines. The other concern here is that some members of binding->ptype are still uninitialized at the end of the function. Signed-off-by: Salym Senyonga --- drivers/staging/ozwpan/ozproto.c |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c index c303ae1..e7138ed 100644 --- a/drivers/staging/ozwpan/ozproto.c +++ b/drivers/staging/ozwpan/ozproto.c @@ -664,7 +664,7 @@ void oz_binding_add(const char *net_dev) { struct oz_binding *binding; - binding = kmalloc(sizeof(struct oz_binding), GFP_KERNEL); + binding = kzalloc(sizeof(struct oz_binding), GFP_KERNEL); if (!binding) return; @@ -679,10 +679,6 @@ void oz_binding_add(const char *net_dev) kfree(binding); return; } - } else { - oz_dbg(ON, "Binding to all netcards\n"); - memset(binding->name, 0, OZ_MAX_BINDING_LEN); - binding->ptype.dev = NULL; } dev_add_pack(&binding->ptype); spin_lock_bh(&g_binding_lock); -- 1.7.5.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] Staging: ozwpan: reduce indent levels in oz_binding_add().
When hit error then we can return immediately. This makes the code simpler and lets us remove some indenting. Signed-off-by: Salym Senyonga --- drivers/staging/ozwpan/ozproto.c | 44 ++--- 1 files changed, 21 insertions(+), 23 deletions(-) diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c index 5d965cf..c303ae1 100644 --- a/drivers/staging/ozwpan/ozproto.c +++ b/drivers/staging/ozwpan/ozproto.c @@ -665,31 +665,29 @@ void oz_binding_add(const char *net_dev) struct oz_binding *binding; binding = kmalloc(sizeof(struct oz_binding), GFP_KERNEL); - if (binding) { - binding->ptype.type = __constant_htons(OZ_ETHERTYPE); - binding->ptype.func = oz_pkt_recv; - if (net_dev && *net_dev) { - memcpy(binding->name, net_dev, OZ_MAX_BINDING_LEN); - oz_dbg(ON, "Adding binding: %s\n", net_dev); - binding->ptype.dev = - dev_get_by_name(&init_net, net_dev); - if (binding->ptype.dev == NULL) { - oz_dbg(ON, "Netdev %s not found\n", net_dev); - kfree(binding); - binding = NULL; - } - } else { - oz_dbg(ON, "Binding to all netcards\n"); - memset(binding->name, 0, OZ_MAX_BINDING_LEN); - binding->ptype.dev = NULL; - } - if (binding) { - dev_add_pack(&binding->ptype); - spin_lock_bh(&g_binding_lock); - list_add_tail(&binding->link, &g_binding); - spin_unlock_bh(&g_binding_lock); + if (!binding) + return; + + binding->ptype.type = __constant_htons(OZ_ETHERTYPE); + binding->ptype.func = oz_pkt_recv; + if (net_dev && *net_dev) { + memcpy(binding->name, net_dev, OZ_MAX_BINDING_LEN); + oz_dbg(ON, "Adding binding: %s\n", net_dev); + binding->ptype.dev = dev_get_by_name(&init_net, net_dev); + if (binding->ptype.dev == NULL) { + oz_dbg(ON, "Netdev %s not found\n", net_dev); + kfree(binding); + return; } + } else { + oz_dbg(ON, "Binding to all netcards\n"); + memset(binding->name, 0, OZ_MAX_BINDING_LEN); + binding->ptype.dev = NULL; } + dev_add_pack(&binding->ptype); + spin_lock_bh(&g_binding_lock); + list_add_tail(&binding->link, &g_binding); + spin_unlock_bh(&g_binding_lock); } /* -- 1.7.5.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] drivers: staging: Mark functions as static and remove unused function in bpctl_mod.c
On Fri, Jan 24, 2014 at 04:14:00AM +0530, Rashika Kheria wrote: > Mark functions as static in bpctl_mod.c because they are not used > outside this file. Remove unused function from bpctl_mod.c. > [...] > > Signed-off-by: Rashika Kheria Reviewed-by: Josh Triplett ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Suggestion] drivers: staging: dgrp: dgrp_net_ops.c: 'buf' is used without initialized.
On 01/23/2014 11:16 PM, Dan Carpenter wrote: > On Tue, Dec 10, 2013 at 01:05:46PM +0300, Dan Carpenter wrote: >> On Tue, Dec 10, 2013 at 03:27:55PM +0530, Rashika Kheria wrote: >>> Should I attempt to rectify the code in handle_data_in_packet() ? >> >> Yes, please. >> > > What ever happened with this? > Sorry, I don't known. > It sort of too late now and I think we should just revert b73db5475048 > ('Staging: dgrp: Refactor the function dgrp_receive() in > drrp_net_ops.c') > For me, it is necessary to revert firstly. I have started this 'Suggestion', so if still can not get response from related members, I will/should process it (after revert it, I will analyse it and try to provide a new fix for it). And really sorry, I have no enough time resources to focus on upstream kernel in this month, so I plan to finish it within next month (2014-02-28). BTW: my current related time resources are: 2014-01: make driver, user mode library, and Java demo under android. In Chinese Festival, I have time resource to upstream kernel and qemu. 2014-02: migrate diver, library, and develop an obj-C demo to iphone. Thanks. -- Chen Gang Open, share and attitude like air, water and life which God blessed ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] drivers: staging: lustre: lustre: include: add "__attribute__((packed))" for the related union
On 01/21/2014 06:36 PM, James Hogan wrote: > Hi Dan, > > On 20/01/14 21:13, Dan Carpenter wrote: >> I made a quick and dirty sparse patch to check for this. I don't think >> I will bother trying to send it to sparse upstream, but you can if you >> want to. >> >> It found 289 unions which might need a __packed added. The lustre >> unions were not in my allmodconfig so they're not listed. > > Thanks a lot for this, it seems to be useful. I'm adapting it to reduce > false negatives (e.g. omitting the check if the struct/union is already > packed), and I imagine it could be made to only warn about padded > unpacked structs/unions which are used as nested members of packed > structs/unions. It wouldn't catch everything but would probably catch a > lot of cases that are most likely to be genuine since they would have > been packed at the outer level for a reason. > >> Perhaps there could be a command line option or a pragma so that unions >> will work in the kernel. We don't care about linking to outside >> libraries. > > We still interact with userland via structs and unions, so it would > probably have to exclude anything in uapi/. > Thank all of you firstly. But excuse me, I am still not quit clear that: "what need we do enough to solve this feature issue?" So I guess our current result is: - It is not a good idea to only let kernel to fit with compiler. - It is not a good idea to only let compiler to fit with kernel. - Need let compiler and kernel to fit with each other: - compiler will print related warning, but not break compiling. so metag compiler need be improvement (check and warn for it). - if check alignment explicitly in kernel source code, it need be fixed within kernel: "apply related patches (pack each struct or union), but the related patch comments need be improved". Is what I guess correct? Thanks. -- Chen Gang Open, share and attitude like air, water and life which God blessed ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] drivers: staging: android: ion: ion_dummy_driver: include "linux/io.h"
Hello Maintainers: Please help check this patch when you have time, thanks. On 01/18/2014 05:04 PM, Chen Gang wrote: > Need add "linux/io.h" to pass compiling under metag architecture with > allmodconfig (which use the default 'virt_to_phys'), the related error: > > CC drivers/staging/android/ion/ion_dummy_driver.o > drivers/staging/android/ion/ion_dummy_driver.c: In function > 'ion_dummy_init': > drivers/staging/android/ion/ion_dummy_driver.c:81: error: implicit > declaration of function 'virt_to_phys' > > Signed-off-by: Chen Gang > --- > drivers/staging/android/ion/ion_dummy_driver.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/staging/android/ion/ion_dummy_driver.c > b/drivers/staging/android/ion/ion_dummy_driver.c > index 55b2002..3854df7 100644 > --- a/drivers/staging/android/ion/ion_dummy_driver.c > +++ b/drivers/staging/android/ion/ion_dummy_driver.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include "ion.h" > #include "ion_priv.h" > > Thanks -- Chen Gang Open, share and attitude like air, water and life which God blessed ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] x86, hyperv: bypass the timer_irq_works() check
On 01/25/2014 05:20 AM, H. Peter Anvin wrote: > On 01/23/2014 10:02 PM, Jason Wang wrote: >> This patch bypass the timer_irq_works() check for hyperv guest since: >> >> - It was guaranteed to work. >> - timer_irq_works() may fail sometime due to the lpj calibration were >> inaccurate >> in a hyperv guest or a buggy host. >> >> In the future, we should get the tsc frequency from hypervisor and use preset >> lpj instead. >> >> Cc: K. Y. Srinivasan >> Cc: Haiyang Zhang >> Signed-off-by: Jason Wang > This should be in -stable, right? > > -hpa > > Oh, right. Cc: ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel