[PATCH] Staging: speakup: Fix allyesconfig build on mn10300
mn10300 uses an mmio-driven uart. This is not supported by speakup, so prevent from enabling it. Signed-off-by: Samuel Thibault --- a/drivers/staging/speakup/Kconfig +++ b/drivers/staging/speakup/Kconfig @@ -1,7 +1,7 @@ menu "Speakup console speech" config SPEAKUP - depends on VT + depends on VT && !MN10300 tristate "Speakup core" ---help--- This is the Speakup screen reader. Think of it as a ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/10] staging/android: add flags member to sync ioctl structs
Op 29-01-16 om 22:20 schreef Gustavo Padovan: > From: Gustavo Padovan > > Play safe and add flags member to all structs. So we don't need to > break API or create new IOCTL in the future if new features that requires > flags arises. > This only helps if you reject flags != 0 in the ioctl, else when you extend the abi userspace might initialize it with garbage. ~Maarten ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 06/10] staging/android: turn fence_info into a __64 pointer
Op 29-01-16 om 22:20 schreef Gustavo Padovan: > From: Gustavo Padovan > > Making fence_info a pointer enables us to extend the struct in the future > without breaking the ABI. > > Signed-off-by: Gustavo Padovan > --- > drivers/staging/android/sync.c | 2 +- > drivers/staging/android/uapi/sync.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c > index f7530f0..51d4f47 100644 > --- a/drivers/staging/android/sync.c > +++ b/drivers/staging/android/sync.c > @@ -525,7 +525,7 @@ static long sync_file_ioctl_fence_info(struct sync_file > *sync_file, > if (info->status >= 0) > info->status = !info->status; > > - len = sizeof(struct sync_file_info); > + len = sizeof(struct sync_file_info) - sizeof(__u64 *); > > for (i = 0; i < sync_file->num_fences; ++i) { > struct fence *fence = sync_file->cbs[i].fence; > diff --git a/drivers/staging/android/uapi/sync.h > b/drivers/staging/android/uapi/sync.h > index ed281fc..9f07aa7 100644 > --- a/drivers/staging/android/uapi/sync.h > +++ b/drivers/staging/android/uapi/sync.h > @@ -54,7 +54,7 @@ struct sync_file_info { > charname[32]; > __s32 status; > > - __u8fence_info[0]; > + __u64 *fence_info; > }; > Pointers are awful, it should be a __u64 since it's a pointer type. Userspace should cast it to a uintptr_t in userspace. This structure also won't work on 64-bits systems, there may be a hole between fence_info and status (or num_fences in next patch). It's probably best to move it to the top and ensure the struct is 64-bits aligned. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: xgifb: XGI_main_26.c fixed spacing to match coding style
On Sat, Jan 30, 2016 at 12:52:45PM -0800, Santosh Madiraju wrote: > From: madiraju You do not need this extra From: line here. Even if you need to give it for some reason then the name should match the name as given in your Signed-off-by: name. > > Removed unnecessary spaces to match coding style. > > Signed-off-by: Santosh Madiraju ^ Did you write this Signed-off-by: manually? There is an extra space there, i have marked, which will not be there if git creates the Signed-off-by. > --- > drivers/staging/xgifb/XGI_main_26.c | 22 ++ > 1 file changed, 6 insertions(+), 16 deletions(-) > > diff --git a/drivers/staging/xgifb/XGI_main_26.c > b/drivers/staging/xgifb/XGI_main_26.c > index 89f5b55..4978737 100644 > --- a/drivers/staging/xgifb/XGI_main_26.c > +++ b/drivers/staging/xgifb/XGI_main_26.c > @@ -1989,7 +1989,6 @@ static int xgifb_probe(struct pci_dev *pdev, > &fb_info->var.vsync_len, > &fb_info->var.sync, > &fb_info->var.vmode)) { > - > if ((fb_info->var.vmode & FB_VMODE_MASK) == > FB_VMODE_INTERLACED) { > fb_info->var.yres <<= 1; > @@ -1999,10 +1998,7 @@ static int xgifb_probe(struct pci_dev *pdev, > fb_info->var.pixclock >>= 1; > fb_info->var.yres >>= 1; > fb_info->var.yres_virtual >>= 1; > - } > - > - } > - > + } } :( This does not match coding style. BTW, what error checkpatch showed here? I am not finding anythig here except an extra blank line. > fb_info->flags = FBINFO_FLAG_DEFAULT; > fb_info->screen_base = xgifb_info->video_vbase; > fb_info->fbops = &XGIfb_ops; > @@ -2064,33 +2060,27 @@ static struct pci_driver xgifb_driver = { > .remove = xgifb_remove > }; > > - > - > /*/ > /* MODULE */ > /*/ > > module_param(mode, charp, 0); > -MODULE_PARM_DESC(mode, > - "Selects the desired default display mode in the format XxYxDepth (eg. > 1024x768x16)."); > +MODULE_PARM_DESC(mode, "Selects the desired default display mode in the > format XxYxDepth (eg. 1024x768x16)."); > > module_param(forcecrt2type, charp, 0); > -MODULE_PARM_DESC(forcecrt2type, > - "Force the second display output type. Possible values are NONE, LCD, > TV, VGA, SVIDEO or COMPOSITE."); > +MODULE_PARM_DESC(forcecrt2type, "Force the second display output type. > Possible values are NONE, LCD, TV, VGA, SVIDEO or COMPOSITE."); > > module_param(vesa, int, 0); > -MODULE_PARM_DESC(vesa, > - "Selects the desired default display mode by VESA mode number (eg. > 0x117)."); > +MODULE_PARM_DESC(vesa, "Selects the desired default display mode by VESA > mode number (eg. 0x117)."); > > module_param(filter, int, 0); > -MODULE_PARM_DESC(filter, > - "Selects TV flicker filter type (only for systems with a SiS301 video > bridge). Possible values 0-7. Default: [no filter])."); > +MODULE_PARM_DESC(filter, "Selects TV flicker filter type (only for systems > with a SiS301 video bridge). Possible values 0-7. Default: [no filter])."); > > static int __init xgifb_init(void) > { > char *option = NULL; > > - if (forcecrt2type != NULL) > + if (!forcecrt2type) oops... shouldn't it be: if (forcecrt2type) regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: gs_fpgaboot: fixed coding style issues in gs_fpgaboot.c
On Sun, Jan 31, 2016 at 09:06:31PM +0100, Ben Marsh wrote: > Signed-off-by: Ben Marsh > --- You have not given any commit message. Please mention which coding style issue you have fixed. On first look, you have done multiple types of changes. Please only do one type of change in a single patch. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: goldfish: use div64_s64 instead of do_div
The goldfish nand driver divides a signed 64-bit number (loff_t) in multiple places using the do_div() function. This has always been unreliable but now produces a compiler warning (since 4.5-rc1): goldfish/goldfish_nand.c: In function 'goldfish_nand_erase': goldfish/goldfish_nand.c:107:91: error: comparison of distinct pointer types lacks a cast [-Werror] goldfish/goldfish_nand.c: In function 'goldfish_nand_read_oob': goldfish/goldfish_nand.c:145:91: error: comparison of distinct pointer types lacks a cast [-Werror] This changes the code to the equivalent div_s64{,_rem} that works correctly for negative numbers (which we should never get here). The warning has shown up on ARM allmodconfig builds after the goldfish bus driver has become visible on ARM. Signed-off-by: Arnd Bergmann Fixes: bd2f348db503 ("goldfish: refactor goldfish platform configs") diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c index f223b3a5a428..76d60eed1490 100644 --- a/drivers/staging/goldfish/goldfish_nand.c +++ b/drivers/staging/goldfish/goldfish_nand.c @@ -100,11 +100,11 @@ static int goldfish_nand_erase(struct mtd_info *mtd, struct erase_info *instr) { loff_t ofs = instr->addr; u32 len = instr->len; - u32 rem; + s32 rem; if (ofs + len > mtd->size) goto invalid_arg; - rem = do_div(ofs, mtd->writesize); + ofs = div_s64_rem(ofs, mtd->writesize, &rem); if (rem) goto invalid_arg; ofs *= (mtd->writesize + mtd->oobsize); @@ -133,7 +133,7 @@ invalid_arg: static int goldfish_nand_read_oob(struct mtd_info *mtd, loff_t ofs, struct mtd_oob_ops *ops) { - u32 rem; + s32 rem; if (ofs + ops->len > mtd->size) goto invalid_arg; @@ -142,7 +142,7 @@ static int goldfish_nand_read_oob(struct mtd_info *mtd, loff_t ofs, if (ops->ooblen + ops->ooboffs > mtd->oobsize) goto invalid_arg; - rem = do_div(ofs, mtd->writesize); + ofs = div_s64_rem(ofs, mtd->writesize, &rem); if (rem) goto invalid_arg; ofs *= (mtd->writesize + mtd->oobsize); @@ -165,7 +165,7 @@ invalid_arg: static int goldfish_nand_write_oob(struct mtd_info *mtd, loff_t ofs, struct mtd_oob_ops *ops) { - u32 rem; + s32 rem; if (ofs + ops->len > mtd->size) goto invalid_arg; @@ -174,7 +174,7 @@ static int goldfish_nand_write_oob(struct mtd_info *mtd, loff_t ofs, if (ops->ooblen + ops->ooboffs > mtd->oobsize) goto invalid_arg; - rem = do_div(ofs, mtd->writesize); + ofs = div_s64_rem(ofs, mtd->writesize, &rem); if (rem) goto invalid_arg; ofs *= (mtd->writesize + mtd->oobsize); @@ -197,12 +197,12 @@ invalid_arg: static int goldfish_nand_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) { - u32 rem; + s32 rem; if (from + len > mtd->size) goto invalid_arg; - rem = do_div(from, mtd->writesize); + from = div_s64_rem(from, mtd->writesize, &rem); if (rem) goto invalid_arg; from *= (mtd->writesize + mtd->oobsize); @@ -219,12 +219,12 @@ invalid_arg: static int goldfish_nand_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { - u32 rem; + s32 rem; if (to + len > mtd->size) goto invalid_arg; - rem = do_div(to, mtd->writesize); + to = div_s64_rem(to, mtd->writesize, &rem); if (rem) goto invalid_arg; to *= (mtd->writesize + mtd->oobsize); @@ -240,12 +240,12 @@ invalid_arg: static int goldfish_nand_block_isbad(struct mtd_info *mtd, loff_t ofs) { - u32 rem; + s32 rem; if (ofs >= mtd->size) goto invalid_arg; - rem = do_div(ofs, mtd->erasesize); + ofs = div_s64_rem(ofs, mtd->writesize, &rem); if (rem) goto invalid_arg; ofs *= mtd->erasesize / mtd->writesize; @@ -261,12 +261,12 @@ invalid_arg: static int goldfish_nand_block_markbad(struct mtd_info *mtd, loff_t ofs) { - u32 rem; + s32 rem; if (ofs >= mtd->size) goto invalid_arg; - rem = do_div(ofs, mtd->erasesize); + ofs = div_s64_rem(ofs, mtd->writesize, &rem); if (rem) goto invalid_arg; ofs *= mtd->erasesize / mtd->writesize; @@ -321,7 +321,7 @@ static int goldfish_nand_init_device(struct platform_device *pdev, mtd->oobavail = mtd->oobsize; mtd->erasesize = readl(base + NAND_DEV_ERASE_SIZE) / (mtd->writesize + mtd->oobsize) * mtd->writesize; - do_div(mtd->size, mtd->writesize + mtd->oobsize); + mtd->size = di
[PATCH] Staging: gs_fpgaboot: fix memory allocation in gs_fpgaboot.c
This is a patch for gs_fpgaboot.c that fixes a memory allocation problem identified by checkpatch.pl. Signed-off-by: Ben Marsh --- drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index a3a10f9..4c1d534 100644 --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -291,7 +291,7 @@ static int gs_fpgaboot(void) int err; struct fpgaimage*fimage; - fimage = kmalloc(sizeof(struct fpgaimage), GFP_KERNEL); + fimage = kmalloc(sizeof(*fimage), GFP_KERNEL); if (!fimage) return -ENOMEM; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: gs_fpgaboot: fix data types in gs_fpgaboot.c
This is a patch to gs_fpgaboot.c to convert data types to kernel types as identified by checkpatch.pl. Signed-off-by: Ben Marsh --- drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index 4c1d534..fe3a6bc 100644 --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -34,7 +34,7 @@ #define DEVICE_NAME "device" #define CLASS_NAME "fpgaboot" -static uint8_t bits_magic[] = { +static u8 bits_magic[] = { 0x0, 0x9, 0xf, 0xf0, 0xf, 0xf0, 0xf, 0xf0, 0xf, 0xf0, 0x0, 0x0, 0x1}; @@ -54,7 +54,7 @@ static void read_bitstream(char *bitdata, char *buf, int *offset, int rdsize) static void readinfo_bitstream(char *bitdata, char *buf, int *offset) { char tbuf[64]; - int32_t len; + s32 len; /* read section char */ read_bitstream(bitdata, tbuf, offset, 1); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: Android: fixes a memory allocation issue in ion_page_pool.c
This is a patch to the ion_page_pool.c file that fixes a memory allocation warning foudn by checkpatch.pl. Signed-off-by: Ben Marsh --- drivers/staging/android/ion/ion_page_pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index fd7e23e..1fe8016 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -149,8 +149,8 @@ int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask, struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order) { - struct ion_page_pool *pool = kmalloc(sizeof(struct ion_page_pool), -GFP_KERNEL); + struct ion_page_pool *pool = kmalloc(sizeof(*pool), GFP_KERNEL); + if (!pool) return NULL; pool->high_count = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: Android: fixes a memory allocation issue in ion_page_pool.c
On Mon, Feb 01, 2016 at 12:28:30PM +0100, Ben Marsh wrote: > This is a patch to the ion_page_pool.c file that fixes a memory > allocation warning foudn by checkpatch.pl. > "found". Normally, I don't get too wound up about changelogs but this doesn't "fix" anything, it's just a checkpatch cleanup. "Fix" means it fixes a bug in runtime. The whole description sort of implies there is a bug. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed))
This patch fixes the following checkpatch warning: WARNING: __packed is preferred over __attribute__((packed)) Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index e550027..284dfb0 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -15,14 +15,14 @@ struct wilc_wfi_radiotap_hdr { struct ieee80211_radiotap_header hdr; u8 rate; -} __attribute__((packed)); +} __packed; struct wilc_wfi_radiotap_cb_hdr { struct ieee80211_radiotap_header hdr; u8 rate; u8 dump; u16 tx_flags; -} __attribute__((packed)); +} __packed; static struct net_device *wilc_wfi_mon; /* global monitor netdev */ -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/11] staging: wilc1000: linux_mon: remove blank line before a close brace '}'
This patch removes blank lines before a close brace found by checkpatch.pl CHECK: Blank lines aren't necessary before a close brace '}' Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 73c8113..bd0b17e 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -119,7 +119,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) (1 << IEEE80211_RADIOTAP_RATE); /* | */ PRINT_INFO(HOSTAPD_DBG, "Presentflags %d\n", hdr->hdr.it_present); hdr->rate = 5; /* txrate->bitrate / 5; */ - } @@ -132,8 +131,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) memset(skb->cb, 0, sizeof(skb->cb)); netif_rx(skb); - - } struct tx_complete_mon_data { @@ -183,7 +180,6 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) PRINT_ER("Failed to allocate memory for mgmt_tx buff\n"); kfree(mgmt_tx); return -EFAULT; - } mgmt_tx->size = len; @@ -325,7 +321,6 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi if (!wilc_wfi_mon) { PRINT_ER("failed to allocate memory\n"); return NULL; - } wilc_wfi_mon->type = ARPHRD_IEEE80211_RADIOTAP; @@ -379,5 +374,4 @@ int WILC_WFI_deinit_mon_interface(void) wilc_wfi_mon = NULL; } return 0; - } -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/11] staging: wilc1000: linux_mon: fix error code of kmalloc
This patch fixes error codes as -ENOMEM instead of using -EFAULT if kmalloc is failed. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index a19755e..1443a23 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -166,14 +166,14 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC); if (!mgmt_tx) { PRINT_ER("Failed to allocate memory for mgmt_tx structure\n"); - return -EFAULT; + return -ENOMEM; } mgmt_tx->buff = kmalloc(len, GFP_ATOMIC); if (!mgmt_tx->buff) { PRINT_ER("Failed to allocate memory for mgmt_tx buff\n"); kfree(mgmt_tx); - return -EFAULT; + return -ENOMEM; } mgmt_tx->size = len; -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/11] staging: wilc1000: linux_mon: remove multiple blank lines
This patch removes multiple blank lines found by checkpatch.pl CHECK: Please don't use multiple blank lines Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index bd0b17e..398fdea 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -11,7 +11,6 @@ #include "wilc_wlan_if.h" #include "wilc_wlan.h" - struct wilc_wfi_radiotap_hdr { struct ieee80211_radiotap_header hdr; u8 rate; @@ -121,8 +120,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) hdr->rate = 5; /* txrate->bitrate / 5; */ } - - skb->dev = wilc_wfi_mon; skb_set_mac_header(skb, 0); skb->ip_summed = CHECKSUM_UNNECESSARY; @@ -143,8 +140,6 @@ static void mgmt_tx_complete(void *priv, int status) struct tx_complete_mon_data *pv_data = (struct tx_complete_mon_data *)priv; u8 *buf = pv_data->buff; - - if (status == 1) { if (INFO || buf[0] == 0x10 || buf[0] == 0xb0) PRINT_INFO(HOSTAPD_DBG, "Packet sent successfully - Size = %d - Address = %p.\n", pv_data->size, pv_data->buff); @@ -152,8 +147,6 @@ static void mgmt_tx_complete(void *priv, int status) PRINT_INFO(HOSTAPD_DBG, "Couldn't send packet - Size = %d - Address = %p.\n", pv_data->size, pv_data->buff); } - - /* incase of fully hosting mode, the freeing will be done in response to the cfg packet */ kfree(pv_data->buff); @@ -220,7 +213,6 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, return -EFAULT; } - rtap_len = ieee80211_get_radiotap_len(skb->data); if (skb->len < rtap_len) { PRINT_ER("Error in radiotap header\n"); @@ -273,8 +265,6 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, PRINT_INFO(HOSTAPD_DBG, "Skipping the radiotap header\n"); - - /* actual deliver of data is device-specific, and not shown here */ PRINT_INFO(HOSTAPD_DBG, "SKB netdevice name = %s\n", skb->dev->name); PRINT_INFO(HOSTAPD_DBG, "MONITOR real dev name = %s\n", mon_priv->real_ndev->name); -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/11] staging: wilc1000: linux_mon: add braces on all arms of if statement
This patch adds braces on all arms of if statement found by checkpatch.pl CHECK: braces {} should be used on all arms of this statement Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 53d0caf..255383c 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -278,8 +278,9 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, if (!(memcmp(srcAdd, bssid, 6))) { mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len); dev_kfree_skb(skb); - } else + } else { ret = wilc_mac_xmit(skb, mon_priv->real_ndev); + } return ret; } -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/11] staging: wilc1000: linux_mon: fix coding style of kmalloc usage
This patch fixes coding style of kmalloc usage found by checkpatch.pl CHECK: Prefer kmalloc(sizeof(*mgmt_tx)...) over kmalloc(sizeof(struct tx_complete_mon_data)...) Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 255383c..a19755e 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -163,7 +163,7 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) } netif_stop_queue(dev); - mgmt_tx = kmalloc(sizeof(struct tx_complete_mon_data), GFP_ATOMIC); + mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC); if (!mgmt_tx) { PRINT_ER("Failed to allocate memory for mgmt_tx structure\n"); return -EFAULT; -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/11] staging: wilc1000: linux_mon: remove debug message of kmalloc failure
There is no need to print debug message when kmalloc is failed. This message is redundant. The code already show us that kmalloc is failed. The braces of first if statement is remove as well because if statement has a single statement. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 1443a23..e9bb0ec 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -164,14 +164,11 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) netif_stop_queue(dev); mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC); - if (!mgmt_tx) { - PRINT_ER("Failed to allocate memory for mgmt_tx structure\n"); + if (!mgmt_tx) return -ENOMEM; - } mgmt_tx->buff = kmalloc(len, GFP_ATOMIC); if (!mgmt_tx->buff) { - PRINT_ER("Failed to allocate memory for mgmt_tx buff\n"); kfree(mgmt_tx); return -ENOMEM; } -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/11] staging: wilc1000: linux_mon: fix NULL comparison style
This patch fixes NULL comparsion style found by checkpatch.pl CHECK: Comparison to NULL could be written "!wilc_wfi_mon" CHECK: Comparison to NULL could be written "!skb" CHECK: Comparison to NULL could be written "!skb" CHECK: Comparison to NULL could be written "!dev" CHECK: Comparison to NULL could be written "!mgmt_tx" CHECK: Comparison to NULL could be written "!mgmt_tx->buff" CHECK: Comparison to NULL could be written "!wilc_wfi_mon" CHECK: Comparison to NULL could be written "!mon_priv" CHECK: Comparison to NULL could be written "!priv" CHECK: Comparison to NULL could be written "wilc_wfi_mon" Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 398fdea..7b9cc02 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -54,7 +54,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) PRINT_INFO(HOSTAPD_DBG, "In monitor interface receive function\n"); - if (wilc_wfi_mon == NULL) + if (!wilc_wfi_mon) return; if (!netif_running(wilc_wfi_mon)) { @@ -73,7 +73,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) /* hostapd callback mgmt frame */ skb = dev_alloc_skb(size + sizeof(struct wilc_wfi_radiotap_cb_hdr)); - if (skb == NULL) { + if (!skb) { PRINT_INFO(HOSTAPD_DBG, "Monitor if : No memory to allocate skb"); return; } @@ -103,7 +103,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) } else { skb = dev_alloc_skb(size + sizeof(struct wilc_wfi_radiotap_hdr)); - if (skb == NULL) { + if (!skb) { PRINT_INFO(HOSTAPD_DBG, "Monitor if : No memory to allocate skb"); return; } @@ -156,20 +156,20 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) { struct tx_complete_mon_data *mgmt_tx = NULL; - if (dev == NULL) { + if (!dev) { PRINT_D(HOSTAPD_DBG, "ERROR: dev == NULL\n"); return -EFAULT; } netif_stop_queue(dev); mgmt_tx = kmalloc(sizeof(struct tx_complete_mon_data), GFP_ATOMIC); - if (mgmt_tx == NULL) { + if (!mgmt_tx) { PRINT_ER("Failed to allocate memory for mgmt_tx structure\n"); return -EFAULT; } mgmt_tx->buff = kmalloc(len, GFP_ATOMIC); - if (mgmt_tx->buff == NULL) { + if (!mgmt_tx->buff) { PRINT_ER("Failed to allocate memory for mgmt_tx buff\n"); kfree(mgmt_tx); return -EFAULT; @@ -203,12 +203,12 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, struct sk_buff *skb2; struct wilc_wfi_radiotap_cb_hdr *cb_hdr; - if (wilc_wfi_mon == NULL) + if (!wilc_wfi_mon) return -EFAULT; mon_priv = netdev_priv(wilc_wfi_mon); - if (mon_priv == NULL) { + if (!mon_priv) { PRINT_ER("Monitor interface private structure is NULL\n"); return -EFAULT; } @@ -324,7 +324,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi return NULL; } priv = netdev_priv(wilc_wfi_mon); - if (priv == NULL) { + if (!priv) { PRINT_ER("private structure is NULL\n"); return NULL; } @@ -347,7 +347,7 @@ int WILC_WFI_deinit_mon_interface(void) { bool rollback_lock = false; - if (wilc_wfi_mon != NULL) { + if (wilc_wfi_mon) { PRINT_D(HOSTAPD_DBG, "In Deinit monitor interface\n"); PRINT_D(HOSTAPD_DBG, "RTNL is being locked\n"); if (rtnl_is_locked()) { -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/11] staging: wilc1000: linux_mon: insert blank line after a function
This patch inserts a blank line afer function found by checkpatch.pl CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 0c3dee3..53d0caf 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -152,6 +152,7 @@ static void mgmt_tx_complete(void *priv, int status) kfree(pv_data); } + static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) { struct tx_complete_mon_data *mgmt_tx = NULL; -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/11] staging: wilc1000: linux_mon: remove blank lines after open brace '{'
This patch remove blank lines after open brace found by checkpatch.pl CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 284dfb0..73c8113 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -71,7 +71,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) pkt_offset = GET_PKT_OFFSET(header); if (pkt_offset & IS_MANAGMEMENT_CALLBACK) { - /* hostapd callback mgmt frame */ skb = dev_alloc_skb(size + sizeof(struct wilc_wfi_radiotap_cb_hdr)); @@ -103,7 +102,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) } } else { - skb = dev_alloc_skb(size + sizeof(struct wilc_wfi_radiotap_hdr)); if (skb == NULL) { @@ -145,7 +143,6 @@ struct tx_complete_mon_data { static void mgmt_tx_complete(void *priv, int status) { - struct tx_complete_mon_data *pv_data = (struct tx_complete_mon_data *)priv; u8 *buf = pv_data->buff; @@ -316,8 +313,6 @@ static const struct net_device_ops wilc_wfi_netdev_ops = { */ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev) { - - u32 ret = 0; struct WILC_WFI_mon_priv *priv; -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/11] staging: wilc1000: linux_mon: remove space after a cast
This patch removes space after a type cast found by checkpatch.pl CHECK: No space is necessary after a cast Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 7b9cc02..0c3dee3 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -80,7 +80,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) memcpy(skb_put(skb, size), buff, size); - cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *) skb_push(skb, sizeof(*cb_hdr)); + cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb, sizeof(*cb_hdr)); memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr)); cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ @@ -109,7 +109,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) } memcpy(skb_put(skb, size), buff, size); - hdr = (struct wilc_wfi_radiotap_hdr *) skb_push(skb, sizeof(*hdr)); + hdr = (struct wilc_wfi_radiotap_hdr *)skb_push(skb, sizeof(*hdr)); memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr)); hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ hdr->hdr.it_len = cpu_to_le16(sizeof(struct wilc_wfi_radiotap_hdr)); @@ -236,7 +236,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, memcpy(skb_put(skb2, skb->len), skb->data, skb->len); - cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *) skb_push(skb2, sizeof(*cb_hdr)); + cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb2, sizeof(*cb_hdr)); memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr)); cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ -- 2.7.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] Staging: rtl8723au: core: rtw_ieee80211: Fixed space and brace coding style issue.
Joe Perches writes: > On Sun, 2016-01-31 at 09:36 -0500, Jes Sorensen wrote: >> Rakhi Sharma writes: >> > Fixed the space and brace coding style error. >> > ERROR: space required before that '=' >> > ERROR: that open brace { should be on the previous line. >> > >> > Signed-off-by: Rakhi Sharma >> > --- >> > drivers/staging/rtl8723au/core/rtw_ieee80211.c | 4 ++-- >> > 1 file changed, 2 insertions(+), 2 deletions(-) >> > >> > diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c >> > b/drivers/staging/rtl8723au/core/rtw_ieee80211.c >> > index 3b0d782..0c933e4 100644 >> > --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c >> > +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c >> > @@ -65,8 +65,8 @@ static u8 WIFI_OFDMRATES[] = { >> > >> > int rtw_get_bit_value_from_ieee_value23a(u8 val) >> > { >> > - unsigned char dot11_rate_table[] = >> > - {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; >> > + unsigned char dot11_rate_table[] = { >> > + 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; >> > >> > int i = 0; >> >> This is a great example of checkpatch doing the wrong thing. What you >> did here was to make the code uglier rather than better. >> >> NACK > > Here's the original code: > > int rtw_get_bit_value_from_ieee_value23a(u8 val) > { > unsigned char dot11_rate_table[]= > {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; > > int i = 0; > > while (dot11_rate_table[i] != 0) { > if (dot11_rate_table[i] == val) > return BIT(i); > i++; > } > return 0; > } > > It has several nominal style defects: > > o compares different types (unsigned char to u8) > o uses a while loop and test of a known sized array > o array isn't declared static const > o array initialization is different style from others > in the same file. "type foo[] = { bar, baz };" > o the function argument is tested on the right side > tested on left side is more common. > > So this could be transformed into something like: > > int rtw_get_bit_value_from_ieee_value23a(u8 val) > { > int i; > static const u8 dot11_rate_table[] = { > 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 > }; and per my previous email, the above is worse than than the original. The cleaner way to list it would be: static const char dot11_rate_table[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: Android: memory allocation style change in ion_page_pool.c
This is a patch to ion_page_pool.c that changes a memory allocation style issue as found by checkpatch.pl. Signed-off-by: Ben Marsh --- drivers/staging/android/ion/ion_page_pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index fd7e23e..1fe8016 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -149,8 +149,8 @@ int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask, struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order) { - struct ion_page_pool *pool = kmalloc(sizeof(struct ion_page_pool), -GFP_KERNEL); + struct ion_page_pool *pool = kmalloc(sizeof(*pool), GFP_KERNEL); + if (!pool) return NULL; pool->high_count = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/10] staging/android: add flags member to sync ioctl structs
2016-01-30 Emil Velikov : > Hi Gustavo, > > > @@ -54,6 +59,7 @@ struct sync_file_info { > > __u32 len; > As mentioned previously - can we rework this variable to indicate the > total length (or the number) of fence_info struct instances. It seems > to be the more common approach afaict. Might also want to move it just > above the fence_into? Sure, I think this is a good idea. Gustavo ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/6] staging: lustre: Use ahash
This patch replaces uses of the long obsolete hash interface with ahash. Signed-off-by: Herbert Xu --- drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c | 92 +++--- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c index 079d50e..94c01aa 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c @@ -27,7 +27,7 @@ * Copyright (c) 2012, Intel Corporation. */ -#include +#include #include #include "../../../include/linux/libcfs/libcfs.h" #include "linux-crypto.h" @@ -38,9 +38,11 @@ static int cfs_crypto_hash_speeds[CFS_HASH_ALG_MAX]; static int cfs_crypto_hash_alloc(unsigned char alg_id, const struct cfs_crypto_hash_type **type, -struct hash_desc *desc, unsigned char *key, +struct ahash_request **req, +unsigned char *key, unsigned int key_len) { + struct crypto_ahash *tfm; int err = 0; *type = cfs_crypto_hash_type(alg_id); @@ -50,18 +52,23 @@ static int cfs_crypto_hash_alloc(unsigned char alg_id, alg_id, CFS_HASH_ALG_MAX); return -EINVAL; } - desc->tfm = crypto_alloc_hash((*type)->cht_name, 0, 0); + tfm = crypto_alloc_ahash((*type)->cht_name, 0, CRYPTO_ALG_ASYNC); - if (desc->tfm == NULL) - return -EINVAL; - - if (IS_ERR(desc->tfm)) { + if (IS_ERR(tfm)) { CDEBUG(D_INFO, "Failed to alloc crypto hash %s\n", (*type)->cht_name); - return PTR_ERR(desc->tfm); + return PTR_ERR(tfm); } - desc->flags = 0; + *req = ahash_request_alloc(tfm, GFP_KERNEL); + if (!*req) { + CDEBUG(D_INFO, "Failed to alloc ahash_request for %s\n", + (*type)->cht_name); + crypto_free_ahash(tfm); + return -ENOMEM; + } + + ahash_request_set_callback(*req, 0, NULL, NULL); /** Shash have different logic for initialization then digest * shash: crypto_hash_setkey, crypto_hash_init @@ -70,23 +77,27 @@ static int cfs_crypto_hash_alloc(unsigned char alg_id, * cfs_crypto_hash_alloc. */ if (key != NULL) - err = crypto_hash_setkey(desc->tfm, key, key_len); + err = crypto_ahash_setkey(tfm, key, key_len); else if ((*type)->cht_key != 0) - err = crypto_hash_setkey(desc->tfm, + err = crypto_ahash_setkey(tfm, (unsigned char *)&((*type)->cht_key), (*type)->cht_size); if (err != 0) { - crypto_free_hash(desc->tfm); + crypto_free_ahash(tfm); return err; } CDEBUG(D_INFO, "Using crypto hash: %s (%s) speed %d MB/s\n", - (crypto_hash_tfm(desc->tfm))->__crt_alg->cra_name, - (crypto_hash_tfm(desc->tfm))->__crt_alg->cra_driver_name, + crypto_ahash_alg_name(tfm), crypto_ahash_driver_name(tfm), cfs_crypto_hash_speeds[alg_id]); - return crypto_hash_init(desc); + err = crypto_ahash_init(*req); + if (err) { + ahash_request_free(*req); + crypto_free_ahash(tfm); + } + return err; } int cfs_crypto_hash_digest(unsigned char alg_id, @@ -95,27 +106,29 @@ int cfs_crypto_hash_digest(unsigned char alg_id, unsigned char *hash, unsigned int *hash_len) { struct scatterlist sl; - struct hash_deschdesc; + struct ahash_request *req; int err; const struct cfs_crypto_hash_type *type; if (buf == NULL || buf_len == 0 || hash_len == NULL) return -EINVAL; - err = cfs_crypto_hash_alloc(alg_id, &type, &hdesc, key, key_len); + err = cfs_crypto_hash_alloc(alg_id, &type, &req, key, key_len); if (err != 0) return err; if (hash == NULL || *hash_len < type->cht_size) { *hash_len = type->cht_size; - crypto_free_hash(hdesc.tfm); + crypto_free_ahash(crypto_ahash_reqtfm(req)); + ahash_request_free(req); return -ENOSPC; } sg_init_one(&sl, buf, buf_len); - hdesc.flags = 0; - err = crypto_hash_digest(&hdesc, &sl, sl.length, hash); - crypto_free_hash(hdesc.tfm); + ahash_request_set_crypt(req, &sl, hash, sl.length); + err = crypto_ahash_digest(req); + crypto_free_ahash(crypto_ahash_reqtfm(req)); + ahash_request_free(req); return err; } @
[PATCH v2] staging: rtl8723au: use list_for_each_entry*()
Use list_for_each_entry*() instead of list_for_each*() to simplify the code. Signed-off-by: Geliang Tang --- Changes in v2: - drop the coding style fixing in v1. --- drivers/staging/rtl8723au/core/rtw_ap.c | 92 ++- drivers/staging/rtl8723au/core/rtw_mlme.c | 38 +++--- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 15 +--- drivers/staging/rtl8723au/core/rtw_recv.c | 43 --- drivers/staging/rtl8723au/core/rtw_sta_mgt.c | 36 +++-- drivers/staging/rtl8723au/core/rtw_xmit.c | 90 -- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 22 ++ drivers/staging/rtl8723au/os_dep/usb_ops_linux.c | 9 +-- 8 files changed, 106 insertions(+), 239 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 1aa9b26..ce4b589 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -171,24 +171,20 @@ static u8 chk_sta_is_alive(struct sta_info *psta) return ret; } -void expire_timeout_chk23a(struct rtw_adapter *padapter) +void expire_timeout_chk23a(struct rtw_adapter *padapter) { - struct list_head *phead, *plist, *ptmp; + struct list_head *phead; u8 updated = 0; - struct sta_info *psta; + struct sta_info *psta, *ptmp; struct sta_priv *pstapriv = &padapter->stapriv; u8 chk_alive_num = 0; struct sta_info *chk_alive_list[NUM_STA]; int i; spin_lock_bh(&pstapriv->auth_list_lock); - phead = &pstapriv->auth_list; - /* check auth_queue */ - list_for_each_safe(plist, ptmp, phead) { - psta = container_of(plist, struct sta_info, auth_list); - + list_for_each_entry_safe(psta, ptmp, phead, auth_list) { if (psta->expire_to > 0) { psta->expire_to--; if (psta->expire_to == 0) { @@ -206,19 +202,13 @@ void expire_timeout_chk23a(struct rtw_adapter *padapter) spin_lock_bh(&pstapriv->auth_list_lock); } } - } - spin_unlock_bh(&pstapriv->auth_list_lock); spin_lock_bh(&pstapriv->asoc_list_lock); - phead = &pstapriv->asoc_list; - /* check asoc_queue */ - list_for_each_safe(plist, ptmp, phead) { - psta = container_of(plist, struct sta_info, asoc_list); - + list_for_each_entry_safe(psta, ptmp, phead, asoc_list) { if (chk_sta_is_alive(psta) || !psta->expire_to) { psta->expire_to = pstapriv->expire_to; psta->keep_alive_trycnt = 0; @@ -283,7 +273,6 @@ voidexpire_timeout_chk23a(struct rtw_adapter *padapter) } } } - spin_unlock_bh(&pstapriv->asoc_list_lock); if (chk_alive_num) { @@ -1059,7 +1048,7 @@ void rtw_set_macaddr_acl23a(struct rtw_adapter *padapter, int mode) int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr) { - struct list_head *plist, *phead; + struct list_head *phead; u8 added = false; int i, ret = 0; struct rtw_wlan_acl_node *paclnode; @@ -1073,12 +1062,8 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr) return -1; spin_lock_bh(&pacl_node_q->lock); - phead = get_list_head(pacl_node_q); - - list_for_each(plist, phead) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - + list_for_each_entry(paclnode, phead, list) { if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { if (paclnode->valid == true) { added = true; @@ -1087,7 +1072,6 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr) } } } - spin_unlock_bh(&pacl_node_q->lock); if (added) @@ -1121,8 +1105,8 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr) int rtw_acl_remove_sta23a(struct rtw_adapter *padapter, u8 *addr) { - struct list_head *plist, *phead, *ptmp; - struct rtw_wlan_acl_node *paclnode; + struct list_head *phead; + struct rtw_wlan_acl_node *paclnode, *ptmp; struct sta_priv *pstapriv = &padapter->stapriv; struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; struct rtw_queue *pacl_node_q = &pacl_list->acl_node_q; @@ -1130,12 +1114,8 @@ int rtw_acl_remove_sta23a(struct rtw_adapter *padapter, u8 *addr) DBG_8723A("%s(acl_num =%d) = %pM\n", __func__, pacl_list->num, addr); spin_lock_bh(&pacl_node_q->lock); - phead = get_list_head(pacl_node_q); - - list_for_each_safe(plist, ptmp, phead) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - + list_for_each_entry_safe(paclnode, ptmp, p
Re: [PATCH 3/3] Staging: rtl8723au: core: rtw_ieee80211: Fixed space and brace coding style issue.
On Mon, 2016-02-01 at 07:29 -0500, Jes Sorensen wrote: > Joe Perches writes: [] > > so this could be transformed into something like: > > > > int rtw_get_bit_value_from_ieee_value23a(u8 val) > > { > > int i; > > static const u8 dot11_rate_table[] = { > > 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 > > }; > > and per my previous email, the above is worse than than the original. > The cleaner way to list it would be: > > static const char dot11_rate_table[] = > { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; Either style is OK, but the style I used is slightly more common in the kernel overall, about 2:1. The type should ideally be u8 and not char. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: use list_first_entry_or_null()
Use list_first_entry_or_null() instead of list_empty() + container_of() to simplify the code. Signed-off-by: Geliang Tang --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 12 +--- drivers/staging/rtl8188eu/core/rtw_mlme.c| 19 +++ drivers/staging/rtl8188eu/core/rtw_recv.c| 15 ++--- drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 23 +++- drivers/staging/rtl8188eu/core/rtw_xmit.c| 84 5 files changed, 48 insertions(+), 105 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 433b926..1de7929 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -69,23 +69,17 @@ exit: return _SUCCESS; } -struct cmd_obj *rtw_dequeue_cmd(struct __queue *queue) +struct cmd_obj *rtw_dequeue_cmd(struct __queue *queue) { unsigned long irqL; struct cmd_obj *obj; - spin_lock_irqsave(&queue->lock, irqL); - if (list_empty(&(queue->queue))) { - obj = NULL; - } else { - obj = container_of((&queue->queue)->next, struct cmd_obj, list); + obj = list_first_entry_or_null(&queue->queue, struct cmd_obj, list); + if (obj) list_del_init(&obj->list); - } - spin_unlock_irqrestore(&queue->lock, irqL); - return obj; } diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index abab854..9c2e659 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -128,25 +128,22 @@ void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) } } -struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */ +struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv) + /* _queue *free_queue) */ { - struct wlan_network*pnetwork; + struct wlan_network *pnetwork; struct __queue *free_queue = &pmlmepriv->free_bss_pool; - struct list_head *plist = NULL; spin_lock_bh(&free_queue->lock); - - if (list_empty(&free_queue->queue)) { - pnetwork = NULL; + pnetwork = list_first_entry_or_null(&free_queue->queue, + struct wlan_network, list); + if (!pnetwork) goto exit; - } - plist = free_queue->queue.next; - - pnetwork = container_of(plist, struct wlan_network, list); list_del_init(&pnetwork->list); - RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("_rtw_alloc_network: ptr=%p\n", plist)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, +("_rtw_alloc_network: ptr=%p\n", &pnetwork->list)); pnetwork->network_type = 0; pnetwork->fixed = false; pnetwork->last_scanned = jiffies; diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 110b8c0..3b719b7 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -127,22 +127,15 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv) struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue) { struct recv_frame *hdr; - struct list_head *plist, *phead; struct adapter *padapter; struct recv_priv *precvpriv; - if (list_empty(&pfree_recv_queue->queue)) { - hdr = NULL; - } else { - phead = get_list_head(pfree_recv_queue); - - plist = phead->next; - - hdr = container_of(plist, struct recv_frame, list); - + hdr = list_first_entry_or_null(&pfree_recv_queue->queue, + struct recv_frame, list); + if (hdr) { list_del_init(&hdr->list); padapter = hdr->adapter; - if (padapter != NULL) { + if (padapter) { precvpriv = &padapter->recvpriv; if (pfree_recv_queue == &precvpriv->free_recv_queue) precvpriv->free_recvframe_cnt--; diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index 1beeac4..ce655b6 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -179,9 +179,9 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) return _SUCCESS; } -struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) +struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) { - s32 index; + s32 index; struct list_head *phash_list; struct sta_info *psta; struct __queue *pfree_sta_queue; @@ -189,17 +189,15 @@ structsta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) int i = 0;
Re: [PATCH] staging: goldfish: use div64_s64 instead of do_div
On Mon, 01 Feb 2016 11:33 +0100 Arnd Bergmann wrote: > The goldfish nand driver divides a signed 64-bit number (loff_t) > in multiple places using the do_div() function. This has always > been unreliable but now produces a compiler warning (since 4.5-rc1): > > goldfish/goldfish_nand.c: In function 'goldfish_nand_erase': > goldfish/goldfish_nand.c:107:91: error: comparison of distinct pointer types > lacks a cast [-Werror] > goldfish/goldfish_nand.c: In function 'goldfish_nand_read_oob': > goldfish/goldfish_nand.c:145:91: error: comparison of distinct pointer types > lacks a cast [-Werror] > > This changes the code to the equivalent div_s64{,_rem} that > works correctly for negative numbers (which we should never > get here). We can't get negatives as you say so surely the right fix is a cast or to fix mtd->writesize ? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8712: use list_first_entry_or_null()
Use list_first_entry_or_null() instead of list_empty() + LIST_CONTAINOR() to simplify the code. Signed-off-by: Geliang Tang --- drivers/staging/rtl8712/rtl871x_cmd.c | 13 +--- drivers/staging/rtl8712/rtl871x_mlme.c| 15 +++--- drivers/staging/rtl8712/rtl871x_recv.c| 12 --- drivers/staging/rtl8712/rtl871x_sta_mgt.c | 16 +++ drivers/staging/rtl8712/rtl871x_xmit.c| 33 +++ 5 files changed, 34 insertions(+), 55 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 562a102..5875677 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -136,15 +136,12 @@ static struct cmd_obj *_dequeue_cmd(struct __queue *queue) unsigned long irqL; struct cmd_obj *obj; - spin_lock_irqsave(&(queue->lock), irqL); - if (list_empty(&(queue->queue))) { - obj = NULL; - } else { - obj = LIST_CONTAINOR(queue->queue.next, -struct cmd_obj, list); + spin_lock_irqsave(&queue->lock, irqL); + obj = list_first_entry_or_null(&queue->queue, + struct cmd_obj, list); + if (obj) list_del_init(&obj->list); - } - spin_unlock_irqrestore(&(queue->lock), irqL); + spin_unlock_irqrestore(&queue->lock, irqL); return obj; } diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index 04f727f..1b022db 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -87,16 +87,15 @@ struct wlan_network *_r8712_alloc_network(struct mlme_priv *pmlmepriv) unsigned long irqL; struct wlan_network *pnetwork; struct __queue *free_queue = &pmlmepriv->free_bss_pool; - struct list_head *plist = NULL; - if (list_empty(&free_queue->queue)) - return NULL; spin_lock_irqsave(&free_queue->lock, irqL); - plist = free_queue->queue.next; - pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); - list_del_init(&pnetwork->list); - pnetwork->last_scanned = jiffies; - pmlmepriv->num_of_scanned++; + pnetwork = list_first_entry_or_null(&free_queue->queue, + struct wlan_network, list); + if (pnetwork) { + list_del_init(&pnetwork->list); + pnetwork->last_scanned = jiffies; + pmlmepriv->num_of_scanned++; + } spin_unlock_irqrestore(&free_queue->lock, irqL); return pnetwork; } diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index 4ff5301..8f040da 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -103,21 +103,17 @@ void _r8712_free_recv_priv(struct recv_priv *precvpriv) r8712_free_recv_priv(precvpriv); } -union recv_frame *r8712_alloc_recvframe(struct __queue *pfree_recv_queue) +union recv_frame *r8712_alloc_recvframe(struct __queue *pfree_recv_queue) { unsigned long irqL; union recv_frame *precvframe; - struct list_head *plist, *phead; struct _adapter *padapter; struct recv_priv *precvpriv; spin_lock_irqsave(&pfree_recv_queue->lock, irqL); - if (list_empty(&pfree_recv_queue->queue)) { - precvframe = NULL; - } else { - phead = &pfree_recv_queue->queue; - plist = phead->next; - precvframe = LIST_CONTAINOR(plist, union recv_frame, u); + precvframe = list_first_entry_or_null(&pfree_recv_queue->queue, + union recv_frame, u.hdr.list); + if (precvframe) { list_del_init(&precvframe->u.hdr.list); padapter = precvframe->u.hdr.adapter; if (padapter != NULL) { diff --git a/drivers/staging/rtl8712/rtl871x_sta_mgt.c b/drivers/staging/rtl8712/rtl871x_sta_mgt.c index 162e61c..659cebc 100644 --- a/drivers/staging/rtl8712/rtl871x_sta_mgt.c +++ b/drivers/staging/rtl8712/rtl871x_sta_mgt.c @@ -116,13 +116,11 @@ struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) unsigned long flags; pfree_sta_queue = &pstapriv->free_sta_queue; - spin_lock_irqsave(&(pfree_sta_queue->lock), flags); - if (list_empty(&pfree_sta_queue->queue)) { - psta = NULL; - } else { - psta = LIST_CONTAINOR(pfree_sta_queue->queue.next, - struct sta_info, list); - list_del_init(&(psta->list)); + spin_lock_irqsave(&pfree_sta_queue->lock, flags); + psta = list_first_entry_or_null(&pfree_sta_queue->queue, + struct sta_info, list); + if (psta) { + lis
Re: [PATCH 3/3] Staging: rtl8723au: core: rtw_ieee80211: Fixed space and brace coding style issue.
Joe Perches writes: > On Mon, 2016-02-01 at 07:29 -0500, Jes Sorensen wrote: >> Joe Perches writes: > [] >> > so this could be transformed into something like: >> > >> > int rtw_get_bit_value_from_ieee_value23a(u8 val) >> > { >> >int i; >> >static const u8 dot11_rate_table[] = { >> >2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 >> >}; >> >> and per my previous email, the above is worse than than the original. >> The cleaner way to list it would be: >> >> static const char dot11_rate_table[] = >> { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; > > Either style is OK, but the style I used is slightly > more common in the kernel overall, about 2:1. It wastes a line for now reason and having the open bracket on a line by itself is slightly more obfuscating. > The type should ideally be u8 and not char. u8 or char is not a big deal for me here, I'm fine with either. Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: goldfish: use div64_s64 instead of do_div
On Monday 01 February 2016 14:54:57 One Thousand Gnomes wrote: > On Mon, 01 Feb 2016 11:33 +0100 > Arnd Bergmann wrote: > > > The goldfish nand driver divides a signed 64-bit number (loff_t) > > in multiple places using the do_div() function. This has always > > been unreliable but now produces a compiler warning (since 4.5-rc1): > > > > goldfish/goldfish_nand.c: In function 'goldfish_nand_erase': > > goldfish/goldfish_nand.c:107:91: error: comparison of distinct pointer > > types lacks a cast [-Werror] > > goldfish/goldfish_nand.c: In function 'goldfish_nand_read_oob': > > goldfish/goldfish_nand.c:145:91: error: comparison of distinct pointer > > types lacks a cast [-Werror] > > > > This changes the code to the equivalent div_s64{,_rem} that > > works correctly for negative numbers (which we should never > > get here). > > We can't get negatives as you say so surely the right fix is a cast or to > fix mtd->writesize ? A cast won't work because the first argument to the do_div() macro is both input and output. It's not the mtd->writesize argument that is the problem here, but the 'ofs' argument that comes from the loff_t argument in mtdchar_read() and others (ultimately from the lseek/pread/pwrite/...) We could change all the function prototypes in struct mtd_info to use u64 instead of loff_t, but that involve change all MTD drivers and the subsystem. Arnd ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: amso1100: fix format string for 64-bit phys_addr
The amso1100 driver prints a phys_addr_t by casting it to a pointer, which causes a warning when phys_addr_t is 64-bit and pointers are 32-bit: drivers/staging/rdma/amso1100/c2.c: In function 'c2_rx_error': drivers/staging/rdma/amso1100/c2.c:430:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] This changes the format string to print the address as a 64-bit number all the time to avoids the warnings. Ideally we would use the %pap format string for phys_addr_t, but that doesn't work here easily as it requires passing a pointer to the address. Signed-off-by: Arnd Bergmann --- Found on ARM randconfig testing. This must have been there forever but is rather hard to trigger even with randconfig builds. diff --git a/drivers/staging/rdma/amso1100/c2.c b/drivers/staging/rdma/amso1100/c2.c index b46ebd1ae15a..170a42a60552 100644 --- a/drivers/staging/rdma/amso1100/c2.c +++ b/drivers/staging/rdma/amso1100/c2.c @@ -426,8 +426,8 @@ static void c2_rx_error(struct c2_port *c2_port, struct c2_element *elem) pr_debug("index : %Zu\n", elem - c2_port->rx_ring.start); pr_debug("len : %u\n", rx_desc->len); - pr_debug(" rxp_hdr : %p [PA %p]\n", rxp_hdr, - (void *) __pa((unsigned long) rxp_hdr)); + pr_debug(" rxp_hdr : %p [PA %016llx\n", rxp_hdr, + (u64)__pa((unsigned long) rxp_hdr)); pr_debug("flags : 0x%x\n", rxp_hdr->flags); pr_debug("status: 0x%x\n", rxp_hdr->status); pr_debug("len : %u\n", rxp_hdr->len); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 06/10] staging/android: turn fence_info into a __64 pointer
Hi Maarten, 2016-02-01 Maarten Lankhorst : > Op 29-01-16 om 22:20 schreef Gustavo Padovan: > > From: Gustavo Padovan > > > > Making fence_info a pointer enables us to extend the struct in the future > > without breaking the ABI. > > > > Signed-off-by: Gustavo Padovan > > --- > > drivers/staging/android/sync.c | 2 +- > > drivers/staging/android/uapi/sync.h | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c > > index f7530f0..51d4f47 100644 > > --- a/drivers/staging/android/sync.c > > +++ b/drivers/staging/android/sync.c > > @@ -525,7 +525,7 @@ static long sync_file_ioctl_fence_info(struct sync_file > > *sync_file, > > if (info->status >= 0) > > info->status = !info->status; > > > > - len = sizeof(struct sync_file_info); > > + len = sizeof(struct sync_file_info) - sizeof(__u64 *); > > > > for (i = 0; i < sync_file->num_fences; ++i) { > > struct fence *fence = sync_file->cbs[i].fence; > > diff --git a/drivers/staging/android/uapi/sync.h > > b/drivers/staging/android/uapi/sync.h > > index ed281fc..9f07aa7 100644 > > --- a/drivers/staging/android/uapi/sync.h > > +++ b/drivers/staging/android/uapi/sync.h > > @@ -54,7 +54,7 @@ struct sync_file_info { > > charname[32]; > > __s32 status; > > > > - __u8fence_info[0]; > > + __u64 *fence_info; > > }; > > > Pointers are awful, it should be a __u64 since it's a pointer type. Userspace > should cast it to a uintptr_t in userspace. Oh, I made a mistake. I'll fix this. > This structure also won't work on 64-bits systems, there may be a hole > between fence_info and status (or num_fences in next patch). > > It's probably best to move it to the top and ensure the struct is 64-bits > aligned. That is not possible because we are not allocating only 64bits there but a array of struct fence_info, so it needs to be the last one. Maybe we can add some sort of padding? Gustavo ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] rtlwifi: Fix warning from ieee80211_get_tx_rates() when using 5G
When using a 5G-capable device with VHT rates enabled, the following warning results: WARNING: CPU: 3 PID: 2253 at net/mac80211/rate.c:625 ieee80211_get_tx_rates+0x22e/0x620 [mac80211]() Modules linked in: rtl8821ae btcoexist rtl_pci rtlwifi fuse drbg ansi_cprng ctr ccm bnep bluetooth af_packet nfs fscache vboxpci(O) vboxnetadp(O) vboxne tflt(O) vboxdrv(O) arc4 snd_hda_codec_generic x86_pkg_temp_thermal rtsx_pci_sdmmc mmc_core rtsx_pci_ms kvm_intel memstick iwlmvm kvm mac80211 snd_hda_intel snd_hda_cod ec snd_hwdep snd_hda_core irqbypass snd_pcm iwlwifi crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64 snd_timer lrw gf128mul glue_h elper ablk_helper cryptd snd cfg80211 pcspkr serio_raw e1000e rtsx_pci lpc_ich ptp xhci_pci mfd_core pps_core xhci_hcd soundcore toshiba_acpi thermal sparse_keymap wmi toshiba_bluetooth rfkill acpi_cpufreq battery ac processor dm_mod i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm sr_mod cdrom video button sg autofs4 [last unloaded: rtlwifi] CPU: 3 PID: 2253 Comm: Timer Tainted: GW O4.5.0-rc1-wl+ #79 Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.20 04/17/2014 a05c4be6 8802262036d8 813d7912 880226203710 8106bcb6 8800c6831300 8800c6831330 8800c683133c 880065923638 880226203720 Call Trace: [] dump_stack+0x4b/0x79 [] warn_slowpath_common+0x86/0xc0 [] warn_slowpath_null+0x1a/0x20 [] ieee80211_get_tx_rates+0x22e/0x620 [mac80211] [] ? rtl_is_special_data+0x32/0x240 [rtlwifi] [] ? rate_control_get_rate+0xce/0x150 [mac80211] [] ? trace_hardirqs_on+0xd/0x10 [] ? __local_bh_enable_ip+0x65/0xd0 --- traceback terminated here --- The problem is that IEEE80211_TX_RC_VHT_MCS is not set in the rate flags. Reported-by: Linus Torvalds Tested-by: Linus Torvalds Signed-off-by: Johannes Berg Signed-off-by: Larry Finger Cc: Stable --- Kalle, This patch should be pushed upstream to v4.5 as soon as possible. It fixes a serious bug. Thanks, Larry --- drivers/net/wireless/realtek/rtlwifi/rc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c index 74c14ce..28f7010 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rc.c +++ b/drivers/net/wireless/realtek/rtlwifi/rc.c @@ -138,6 +138,11 @@ static void _rtl_rc_rate_set_series(struct rtl_priv *rtlpriv, ((wireless_mode == WIRELESS_MODE_N_5G) || (wireless_mode == WIRELESS_MODE_N_24G))) rate->flags |= IEEE80211_TX_RC_MCS; + if (sta && sta->vht_cap.vht_supported && + (wireless_mode == WIRELESS_MODE_AC_5G || +wireless_mode == WIRELESS_MODE_AC_24G || +wireless_mode == WIRELESS_MODE_AC_ONLY)) + rate->flags |= IEEE80211_TX_RC_VHT_MCS; } } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RESEND PATCH] Staging:speakup:add space around '|'
Fix checkpatch.pl check:CHECK: spaces preferred around that '|'. Add spaces around operands to fix these warnings. Signed-off-by: Bhumika Goyal --- drivers/staging/speakup/speakup_decext.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/speakup/speakup_decext.c b/drivers/staging/speakup/speakup_decext.c index fdd7488..1a5cf3d 100644 --- a/drivers/staging/speakup/speakup_decext.c +++ b/drivers/staging/speakup/speakup_decext.c @@ -67,30 +67,30 @@ static struct var_t vars[] = { * These attributes will appear in /sys/accessibility/speakup/decext. */ static struct kobj_attribute caps_start_attribute = - __ATTR(caps_start, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(caps_start, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute caps_stop_attribute = - __ATTR(caps_stop, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(caps_stop, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute pitch_attribute = - __ATTR(pitch, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(pitch, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute punct_attribute = - __ATTR(punct, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(punct, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute rate_attribute = - __ATTR(rate, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(rate, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute voice_attribute = - __ATTR(voice, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(voice, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute vol_attribute = - __ATTR(vol, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(vol, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute delay_time_attribute = - __ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(delay_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute direct_attribute = - __ATTR(direct, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(direct, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute full_time_attribute = - __ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(full_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute jiffy_delta_attribute = - __ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(jiffy_delta, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute trigger_time_attribute = - __ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(trigger_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); /* * Create a group of attributes so that we can create and destroy them all -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: speakup: Fix allyesconfig build on mn10300
On Mon, Feb 01, 2016 at 09:06:03AM +0100, Samuel Thibault wrote: > mn10300 uses an mmio-driven uart. This is not supported by speakup, so > prevent from enabling it. > > Signed-off-by: Samuel Thibault > > --- a/drivers/staging/speakup/Kconfig > +++ b/drivers/staging/speakup/Kconfig > @@ -1,7 +1,7 @@ > menu "Speakup console speech" > > config SPEAKUP > - depends on VT > + depends on VT && !MN10300 Heh, that's funny. I'll go queue this up, thanks for the patch. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/8] rtlwifi: rtl8723be: Fix module parameter initialization
On Mon, Dec 14, 2015 at 04:34:31PM -0600, Larry Finger wrote: > This driver has a number of errors in the module initialization. These > include the following: > > Parameter msi_support is stored in two places - one is removed. > Paramters sw_crypto and disable_watchdog were never stored in the final > locations, nor were they initialized properly. > > Signed-off-by: Larry Finger > Cc: Stable > --- > drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > index d091f1d..a78eaed 100644 > --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > @@ -93,7 +93,6 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw) > struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); > > rtl8723be_bt_reg_init(hw); > - rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support; > rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer(); > > rtlpriv->dm.dm_initialgain_enable = 1; > @@ -151,6 +150,10 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw) > rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; > rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; > rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support; > + rtlpriv->cfg->mod_params->sw_crypto = > + rtlpriv->cfg->mod_params->sw_crypto; > + rtlpriv->cfg->mod_params->disable_watchdog = > + rtlpriv->cfg->mod_params->disable_watchdog; Ok, I give up and just ask: are the above hw mapped registers that actually need to be read/written? Or am I missing something here, as the 2 statements above don't seem to make sense. The same for other patches in this series. Cheers, -- Luís > if (rtlpriv->cfg->mod_params->disable_watchdog) > pr_info("watchdog disabled\n"); > rtlpriv->psc.reg_fwctrl_lps = 3; > @@ -267,6 +270,9 @@ static struct rtl_mod_params rtl8723be_mod_params = { > .inactiveps = true, > .swctrl_lps = false, > .fwctrl_lps = true, > + .msi_support = false, > + .disable_watchdog = false, > + .debug = DBG_EMERG, > }; > > static struct rtl_hal_cfg rtl8723be_hal_cfg = { > -- > 2.1.4 > > -- > To unsubscribe from this list: send the line "unsubscribe stable" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel