Re: genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (goldfish_pdev_bus)
On 04/02/2016, 12:35 PM, Dmitry Vyukov wrote: > Hello, > > After updating from 8e0f93cda48ed054e1216bab5c60017e1a5fc1e8 to > 05cf8077e54b20dddb756eaa26f3aeb5c38dd3cf (Apr 1) I've started seeing > the following warnings: > > genirq: Flags mismatch irq 4. (serial) vs. 0080 > (goldfish_pdev_bus) > CPU: 3 PID: 6626 Comm: init Tainted: GW 4.6.0-rc1+ #338 > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 > 87eb26a0 88003da17618 82c8ea9f 86f0c740 > fbfff0fd64d4 88003e8a6aa8 88005eb4c4c8 fff0 > 874f6be0 880034ae63a8 88003da17708 8149e73c > Call Trace: > [< inline >] __dump_stack lib/dump_stack.c:15 > [] dump_stack+0x12e/0x18f lib/dump_stack.c:51 > [] __setup_irq+0x11fc/0x1610 kernel/irq/manage.c:1369 > [] request_threaded_irq+0x275/0x410 > kernel/irq/manage.c:1652 > [< inline >] request_irq include/linux/interrupt.h:147 ... > They appear after boot every 10 seconds. > I am using qemu. Here are GOLDFISH related .config values: > > CONFIG_GOLDFISH=y > # CONFIG_X86_GOLDFISH is not set > CONFIG_KEYBOARD_GOLDFISH_EVENTS=y > CONFIG_GOLDFISH_TTY=y > CONFIG_BATTERY_GOLDFISH=y > CONFIG_FB_GOLDFISH=y > CONFIG_MMC_GOLDFISH=y > CONFIG_GOLDFISH_AUDIO=y > CONFIG_MTD_GOLDFISH_NAND=y > CONFIG_GOLDFISH_BUS=y > CONFIG_GOLDFISH_PIPE=y > > Is it a known issue? How can it be fixed? This is a conflict between request_irq of goldfish and 8250. Setting SERIAL_8250_SHARE_IRQ (which is the default) should make the trace gone. Note that GOLDFISH=y makes sense only if you build a goldfish kernel. I.e. setting both 8250 and goldfish does not make much sense IIRC. thanks, -- js suse labs ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: dgnc: remove parenthesis around the CONST |
remove parenthesis around the CONST | CONST. Signed-off-by: Daeseok Youn --- drivers/staging/dgnc/dgnc_cls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 5e46ac8..46c050c 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -1168,7 +1168,7 @@ static void cls_uart_init(struct channel_t *ch) /* Clear out UART and FIFO */ readb(&ch->ch_cls_uart->txrx); - writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT), + writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, &ch->ch_cls_uart->isr_fcr); udelay(10); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: dgnc: remove blank line
fix checkpatch.pl warning: Blank lines aren't necessary after an open brace '{' Signed-off-by: Daeseok Youn --- drivers/staging/dgnc/dgnc_neo.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 2da6a72..3b8ce38 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1794,7 +1794,6 @@ static void neo_vpd(struct dgnc_board *brd) if (((brd->vpd[0x08] != 0x82) && (brd->vpd[0x10] != 0x82)) || (brd->vpd[0x7F] != 0x78)) { - memset(brd->vpd, '\0', NEO_VPD_IMAGESIZE); } else { /* Search for the serial number */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] android,lowmemorykiller: Don't abuse TIF_MEMDIE.
Greg KH wrote: > On Mon, Mar 21, 2016 at 08:00:49PM +0900, Tetsuo Handa wrote: > > Greg Kroah-Hartman wrote: > > > On Tue, Mar 08, 2016 at 03:18:59PM +0100, Michal Hocko wrote: > > > > On Tue 08-03-16 20:01:32, Tetsuo Handa wrote: > > > > > Currently, lowmemorykiller (LMK) is using TIF_MEMDIE for two purposes. > > > > > One is to remember processes killed by LMK, and the other is to > > > > > accelerate termination of processes killed by LMK. > > > > > > > > > > But since LMK is invoked as a memory shrinker function, there still > > > > > should be some memory available. It is very likely that memory > > > > > allocations by processes killed by LMK will succeed without using > > > > > ALLOC_NO_WATERMARKS via TIF_MEMDIE. Even if their allocations cannot > > > > > escape from memory allocation loop unless they use > > > > > ALLOC_NO_WATERMARKS, > > > > > lowmem_deathpending_timeout can guarantee forward progress by choosing > > > > > next victim process. > > > > > > > > > > On the other hand, mark_oom_victim() assumes that it must be called > > > > > with > > > > > oom_lock held and it must not be called after oom_killer_disable() was > > > > > called. But LMK is calling it without holding oom_lock and checking > > > > > oom_killer_disabled. It is possible that LMK calls mark_oom_victim() > > > > > due to allocation requests by kernel threads after current thread > > > > > returned from oom_killer_disabled(). This will break synchronization > > > > > for PM/suspend. > > > > > > > > > > This patch introduces per a task_struct flag for remembering processes > > > > > killed by LMK, and replaces TIF_MEMDIE with that flag. By applying > > > > > this > > > > > patch, assumption by mark_oom_victim() becomes true. > > > > > > > > Thanks for looking into this. A separate flag sounds like a better way > > > > to go (assuming that the flags are not scarce which doesn't seem to be > > > > the case here). > > > > > > > > The LMK cannot kill the frozen tasks now but this shouldn't be a big > > > > deal > > > > because this is not strictly necessary for the system to move on. We are > > > > not OOM. > > > > > > > > > Signed-off-by: Tetsuo Handa > > > > > Cc: Michal Hocko > > > > > Cc: Greg Kroah-Hartman > > > > > Cc: Arve Hjonnevag > > > > > Cc: Riley Andrews > > > > > > > > Acked-by: Michal Hocko > > > > > > So, any objection for me taking this through the staging tree? > > > > > Seems no objection. Please take this through the staging tree. > > Ok, will do so after 4.6-rc1 is out. > I haven't seen this patch in linux-next. Would you take this? Regards. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/8] staging: wilc1000: rename pstrHostIFscanAttr in handle_scan
This patch renames pstrHostIFscanAttr to scan_info to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 55 +++ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 053e6f1..23080ff 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -731,8 +731,7 @@ unlock: return result; } -static s32 handle_scan(struct wilc_vif *vif, - struct scan_attr *pstrHostIFscanAttr) +static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) { s32 result = 0; struct wid strWIDList[5]; @@ -743,8 +742,8 @@ static s32 handle_scan(struct wilc_vif *vif, u8 *pu8HdnNtwrksWidVal = NULL; struct host_if_drv *hif_drv = vif->hif_drv; - hif_drv->usr_scan_req.scan_result = pstrHostIFscanAttr->result; - hif_drv->usr_scan_req.arg = pstrHostIFscanAttr->arg; + hif_drv->usr_scan_req.scan_result = scan_info->result; + hif_drv->usr_scan_req.arg = scan_info->arg; if ((hif_drv->hif_state >= HOST_IF_SCANNING) && (hif_drv->hif_state < HOST_IF_CONNECTED)) { @@ -764,19 +763,19 @@ static s32 handle_scan(struct wilc_vif *vif, strWIDList[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ; strWIDList[u32WidsCount].type = WID_STR; - for (i = 0; i < pstrHostIFscanAttr->hidden_network.n_ssids; i++) - valuesize += ((pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len) + 1); + for (i = 0; i < scan_info->hidden_network.n_ssids; i++) + valuesize += ((scan_info->hidden_network.net_info[i].ssid_len) + 1); pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL); strWIDList[u32WidsCount].val = pu8HdnNtwrksWidVal; if (strWIDList[u32WidsCount].val) { pu8Buffer = strWIDList[u32WidsCount].val; - *pu8Buffer++ = pstrHostIFscanAttr->hidden_network.n_ssids; + *pu8Buffer++ = scan_info->hidden_network.n_ssids; - for (i = 0; i < pstrHostIFscanAttr->hidden_network.n_ssids; i++) { - *pu8Buffer++ = pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len; - memcpy(pu8Buffer, pstrHostIFscanAttr->hidden_network.net_info[i].ssid, pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len); - pu8Buffer += pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len; + for (i = 0; i < scan_info->hidden_network.n_ssids; i++) { + *pu8Buffer++ = scan_info->hidden_network.net_info[i].ssid_len; + memcpy(pu8Buffer, scan_info->hidden_network.net_info[i].ssid, scan_info->hidden_network.net_info[i].ssid_len); + pu8Buffer += scan_info->hidden_network.net_info[i].ssid_len; } strWIDList[u32WidsCount].size = (s32)(valuesize + 1); @@ -785,37 +784,37 @@ static s32 handle_scan(struct wilc_vif *vif, strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_PROBE; strWIDList[u32WidsCount].type = WID_BIN_DATA; - strWIDList[u32WidsCount].val = pstrHostIFscanAttr->ies; - strWIDList[u32WidsCount].size = pstrHostIFscanAttr->ies_len; + strWIDList[u32WidsCount].val = scan_info->ies; + strWIDList[u32WidsCount].size = scan_info->ies_len; u32WidsCount++; strWIDList[u32WidsCount].id = WID_SCAN_TYPE; strWIDList[u32WidsCount].type = WID_CHAR; strWIDList[u32WidsCount].size = sizeof(char); - strWIDList[u32WidsCount].val = (s8 *)&pstrHostIFscanAttr->type; + strWIDList[u32WidsCount].val = (s8 *)&scan_info->type; u32WidsCount++; strWIDList[u32WidsCount].id = WID_SCAN_CHANNEL_LIST; strWIDList[u32WidsCount].type = WID_BIN_DATA; - if (pstrHostIFscanAttr->ch_freq_list && - pstrHostIFscanAttr->ch_list_len > 0) { + if (scan_info->ch_freq_list && + scan_info->ch_list_len > 0) { int i; - for (i = 0; i < pstrHostIFscanAttr->ch_list_len; i++) { - if (pstrHostIFscanAttr->ch_freq_list[i] > 0) - pstrHostIFscanAttr->ch_freq_list[i] = pstrHostIFscanAttr->ch_freq_list[i] - 1; + for (i = 0; i < scan_info->ch_list_len; i++){ + if (scan_info->ch_freq_list[i] > 0) + scan_info->ch_freq_list[i] = scan_info->ch_freq_list[i] - 1; } } - strWIDList[u32WidsCount].val = pstrHostIFscanAttr->ch_freq_list; - strWIDList[u32WidsCount].size = pstrHostIFscanAttr->ch_list_len; + strWIDList[u32WidsCount].val = scan_info->ch_freq_list; + strWIDList[u32WidsCount].size = scan_info->ch_list_len; u32WidsCount++; strWIDList[u32WidsCount].id =
[PATCH 3/8] staging: wilc1000: remove block scope braces and fix indentation
This patch removes unnecessary block scope braces and fix indentation of the codes. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index aa95eda..e978208 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -783,13 +783,11 @@ static s32 Handle_Scan(struct wilc_vif *vif, u32WidsCount++; } - { - strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_PROBE; - strWIDList[u32WidsCount].type = WID_BIN_DATA; - strWIDList[u32WidsCount].val = pstrHostIFscanAttr->ies; - strWIDList[u32WidsCount].size = pstrHostIFscanAttr->ies_len; - u32WidsCount++; - } + strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_PROBE; + strWIDList[u32WidsCount].type = WID_BIN_DATA; + strWIDList[u32WidsCount].val = pstrHostIFscanAttr->ies; + strWIDList[u32WidsCount].size = pstrHostIFscanAttr->ies_len; + u32WidsCount++; strWIDList[u32WidsCount].id = WID_SCAN_TYPE; strWIDList[u32WidsCount].type = WID_CHAR; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/8] staging: wilc1000: rename Handle_Scan
This patch renames Handle_Scan to handle_scan to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e978208..053e6f1 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -731,7 +731,7 @@ unlock: return result; } -static s32 Handle_Scan(struct wilc_vif *vif, +static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *pstrHostIFscanAttr) { s32 result = 0; @@ -2515,7 +2515,7 @@ static int hostIFthread(void *pvArg) switch (msg.id) { case HOST_IF_MSG_SCAN: - Handle_Scan(msg.vif, &msg.body.scan_info); + handle_scan(msg.vif, &msg.body.scan_info); break; case HOST_IF_MSG_CONNECT: -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/8] staging: wilc1000: rename goto label in handle_cfg_param
This patch changes goto label from ERRORHANDLER to unlock. unlock is a more meaningful name than ERRORHANDLER. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 38 +++ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 04cbff5..b8dae09 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -456,7 +456,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "check value 6 over\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -472,7 +472,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Impossible value\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -487,7 +487,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Range(1 ~ 65535) over\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -501,7 +501,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Invalid power mode\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -516,7 +516,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Range(1~256) over\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -531,7 +531,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Range(1~256) over\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -546,7 +546,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Threshold Range fail\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -561,7 +561,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Threshold Range fail\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -575,7 +575,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Preamle Range(0~2) over\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -589,7 +589,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Short slot(2) over\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -603,7 +603,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "TXOP prot disable\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -618,7 +618,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -633,7 +633,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else { netdev_err(vif->ndev, "DTIM range(1~255) fail\n"); result = -EINVAL; - goto ERRORHANDLER; + goto unlock; } i++; } @@ -647,7 +647,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, } else {
[PATCH 8/8] staging: wilc1000: rename pu8Buffer in handle_scan
This patch renames pu8Buffer to buffer to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index a5f109a..1fe811f 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -737,7 +737,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) struct wid wid_list[5]; u32 index = 0; u32 i; - u8 *pu8Buffer; + u8 *buffer; u8 valuesize = 0; u8 *pu8HdnNtwrksWidVal = NULL; struct host_if_drv *hif_drv = vif->hif_drv; @@ -768,14 +768,14 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL); wid_list[index].val = pu8HdnNtwrksWidVal; if (wid_list[index].val) { - pu8Buffer = wid_list[index].val; + buffer = wid_list[index].val; - *pu8Buffer++ = scan_info->hidden_network.n_ssids; + *buffer++ = scan_info->hidden_network.n_ssids; for (i = 0; i < scan_info->hidden_network.n_ssids; i++) { - *pu8Buffer++ = scan_info->hidden_network.net_info[i].ssid_len; - memcpy(pu8Buffer, scan_info->hidden_network.net_info[i].ssid, scan_info->hidden_network.net_info[i].ssid_len); - pu8Buffer += scan_info->hidden_network.net_info[i].ssid_len; + *buffer++ = scan_info->hidden_network.net_info[i].ssid_len; + memcpy(buffer, scan_info->hidden_network.net_info[i].ssid, scan_info->hidden_network.net_info[i].ssid_len); + buffer += scan_info->hidden_network.net_info[i].ssid_len; } wid_list[index].size = (s32)(valuesize + 1); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/8] staging: wilc1000: rename strWIDList in handle_scan
This patch renames strWIDList to wid_list to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 48 +++ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 23080ff..aae0028 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -734,7 +734,7 @@ unlock: static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) { s32 result = 0; - struct wid strWIDList[5]; + struct wid wid_list[5]; u32 u32WidsCount = 0; u32 i; u8 *pu8Buffer; @@ -760,15 +760,15 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) hif_drv->usr_scan_req.rcvd_ch_cnt = 0; - strWIDList[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ; - strWIDList[u32WidsCount].type = WID_STR; + wid_list[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ; + wid_list[u32WidsCount].type = WID_STR; for (i = 0; i < scan_info->hidden_network.n_ssids; i++) valuesize += ((scan_info->hidden_network.net_info[i].ssid_len) + 1); pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL); - strWIDList[u32WidsCount].val = pu8HdnNtwrksWidVal; - if (strWIDList[u32WidsCount].val) { - pu8Buffer = strWIDList[u32WidsCount].val; + wid_list[u32WidsCount].val = pu8HdnNtwrksWidVal; + if (wid_list[u32WidsCount].val) { + pu8Buffer = wid_list[u32WidsCount].val; *pu8Buffer++ = scan_info->hidden_network.n_ssids; @@ -778,24 +778,24 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) pu8Buffer += scan_info->hidden_network.net_info[i].ssid_len; } - strWIDList[u32WidsCount].size = (s32)(valuesize + 1); + wid_list[u32WidsCount].size = (s32)(valuesize + 1); u32WidsCount++; } - strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_PROBE; - strWIDList[u32WidsCount].type = WID_BIN_DATA; - strWIDList[u32WidsCount].val = scan_info->ies; - strWIDList[u32WidsCount].size = scan_info->ies_len; + wid_list[u32WidsCount].id = WID_INFO_ELEMENT_PROBE; + wid_list[u32WidsCount].type = WID_BIN_DATA; + wid_list[u32WidsCount].val = scan_info->ies; + wid_list[u32WidsCount].size = scan_info->ies_len; u32WidsCount++; - strWIDList[u32WidsCount].id = WID_SCAN_TYPE; - strWIDList[u32WidsCount].type = WID_CHAR; - strWIDList[u32WidsCount].size = sizeof(char); - strWIDList[u32WidsCount].val = (s8 *)&scan_info->type; + wid_list[u32WidsCount].id = WID_SCAN_TYPE; + wid_list[u32WidsCount].type = WID_CHAR; + wid_list[u32WidsCount].size = sizeof(char); + wid_list[u32WidsCount].val = (s8 *)&scan_info->type; u32WidsCount++; - strWIDList[u32WidsCount].id = WID_SCAN_CHANNEL_LIST; - strWIDList[u32WidsCount].type = WID_BIN_DATA; + wid_list[u32WidsCount].id = WID_SCAN_CHANNEL_LIST; + wid_list[u32WidsCount].type = WID_BIN_DATA; if (scan_info->ch_freq_list && scan_info->ch_list_len > 0) { @@ -807,14 +807,14 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) } } - strWIDList[u32WidsCount].val = scan_info->ch_freq_list; - strWIDList[u32WidsCount].size = scan_info->ch_list_len; + wid_list[u32WidsCount].val = scan_info->ch_freq_list; + wid_list[u32WidsCount].size = scan_info->ch_list_len; u32WidsCount++; - strWIDList[u32WidsCount].id = WID_START_SCAN_REQ; - strWIDList[u32WidsCount].type = WID_CHAR; - strWIDList[u32WidsCount].size = sizeof(char); - strWIDList[u32WidsCount].val = (s8 *)&scan_info->src; + wid_list[u32WidsCount].id = WID_START_SCAN_REQ; + wid_list[u32WidsCount].type = WID_CHAR; + wid_list[u32WidsCount].size = sizeof(char); + wid_list[u32WidsCount].val = (s8 *)&scan_info->src; u32WidsCount++; if (hif_drv->hif_state == HOST_IF_CONNECTED) @@ -822,7 +822,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) else if (hif_drv->hif_state == HOST_IF_IDLE) scan_while_connected = false; - result = wilc_send_config_pkt(vif, SET_CFG, strWIDList, + result = wilc_send_config_pkt(vif, SET_CFG, wid_list, u32WidsCount, wilc_get_vif_idx(vif)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/8] staging: wilc1000: rename u32WidsCount in handle_scan
This patch renames u32WidsCount to index to avoid camelcase. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 58 +++ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index aae0028..a5f109a 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -735,7 +735,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) { s32 result = 0; struct wid wid_list[5]; - u32 u32WidsCount = 0; + u32 index = 0; u32 i; u8 *pu8Buffer; u8 valuesize = 0; @@ -760,15 +760,15 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) hif_drv->usr_scan_req.rcvd_ch_cnt = 0; - wid_list[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ; - wid_list[u32WidsCount].type = WID_STR; + wid_list[index].id = (u16)WID_SSID_PROBE_REQ; + wid_list[index].type = WID_STR; for (i = 0; i < scan_info->hidden_network.n_ssids; i++) valuesize += ((scan_info->hidden_network.net_info[i].ssid_len) + 1); pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL); - wid_list[u32WidsCount].val = pu8HdnNtwrksWidVal; - if (wid_list[u32WidsCount].val) { - pu8Buffer = wid_list[u32WidsCount].val; + wid_list[index].val = pu8HdnNtwrksWidVal; + if (wid_list[index].val) { + pu8Buffer = wid_list[index].val; *pu8Buffer++ = scan_info->hidden_network.n_ssids; @@ -778,24 +778,24 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) pu8Buffer += scan_info->hidden_network.net_info[i].ssid_len; } - wid_list[u32WidsCount].size = (s32)(valuesize + 1); - u32WidsCount++; + wid_list[index].size = (s32)(valuesize + 1); + index++; } - wid_list[u32WidsCount].id = WID_INFO_ELEMENT_PROBE; - wid_list[u32WidsCount].type = WID_BIN_DATA; - wid_list[u32WidsCount].val = scan_info->ies; - wid_list[u32WidsCount].size = scan_info->ies_len; - u32WidsCount++; + wid_list[index].id = WID_INFO_ELEMENT_PROBE; + wid_list[index].type = WID_BIN_DATA; + wid_list[index].val = scan_info->ies; + wid_list[index].size = scan_info->ies_len; + index++; - wid_list[u32WidsCount].id = WID_SCAN_TYPE; - wid_list[u32WidsCount].type = WID_CHAR; - wid_list[u32WidsCount].size = sizeof(char); - wid_list[u32WidsCount].val = (s8 *)&scan_info->type; - u32WidsCount++; + wid_list[index].id = WID_SCAN_TYPE; + wid_list[index].type = WID_CHAR; + wid_list[index].size = sizeof(char); + wid_list[index].val = (s8 *)&scan_info->type; + index++; - wid_list[u32WidsCount].id = WID_SCAN_CHANNEL_LIST; - wid_list[u32WidsCount].type = WID_BIN_DATA; + wid_list[index].id = WID_SCAN_CHANNEL_LIST; + wid_list[index].type = WID_BIN_DATA; if (scan_info->ch_freq_list && scan_info->ch_list_len > 0) { @@ -807,15 +807,15 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) } } - wid_list[u32WidsCount].val = scan_info->ch_freq_list; - wid_list[u32WidsCount].size = scan_info->ch_list_len; - u32WidsCount++; + wid_list[index].val = scan_info->ch_freq_list; + wid_list[index].size = scan_info->ch_list_len; + index++; - wid_list[u32WidsCount].id = WID_START_SCAN_REQ; - wid_list[u32WidsCount].type = WID_CHAR; - wid_list[u32WidsCount].size = sizeof(char); - wid_list[u32WidsCount].val = (s8 *)&scan_info->src; - u32WidsCount++; + wid_list[index].id = WID_START_SCAN_REQ; + wid_list[index].type = WID_CHAR; + wid_list[index].size = sizeof(char); + wid_list[index].val = (s8 *)&scan_info->src; + index++; if (hif_drv->hif_state == HOST_IF_CONNECTED) scan_while_connected = true; @@ -823,7 +823,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info) scan_while_connected = false; result = wilc_send_config_pkt(vif, SET_CFG, wid_list, - u32WidsCount, + index, wilc_get_vif_idx(vif)); if (result) -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/8] staging: wilc1000: move Handle_ScanDone function declaration
Handle_ScanDone function declaration is moved to front of host_interface.c file. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b8dae09..aa95eda 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -263,6 +263,7 @@ static struct wilc_vif *join_req_vif; static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo); static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx); +static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent); /* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as * special purpose in wilc device, so we add 1 to the index to starts from 1. @@ -730,9 +731,6 @@ unlock: return result; } -static s32 Handle_ScanDone(struct wilc_vif *vif, - enum scan_event enuEvent); - static s32 Handle_Scan(struct wilc_vif *vif, struct scan_attr *pstrHostIFscanAttr) { -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] Drivers: hv: vmbus: Cleanup and mmio management.
"K. Y. Srinivasan" writes: > Cleanup and mmio management. Also included is a patch > to fix an issue in KVP. > > Jake Oshins (5): > hv: Make a function to free mmio regions through vmbus > hv: Lock access to hyperv_mmio resource tree > hv: Use new vmbus_mmio_free() from client drivers. > hv: Reverse order of resources in hyperv_mmio > hv: Track allocations of children of hv_vmbus in private resource > tree It seems there is an updated version of the patchset from Jake: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2016-April/088262.html It consists of 7 patches. It would probably make sense to take them all I think. > > Vitaly Kuznetsov (1): > Drivers: hv: kvp: fix IP Failover > > drivers/hv/hv_kvp.c | 31 + > drivers/hv/hyperv_vmbus.h |5 +++ > drivers/hv/vmbus_drv.c | 56 > ++- > drivers/pci/host/pci-hyperv.c | 14 +- > drivers/video/fbdev/hyperv_fb.c |4 +- > include/linux/hyperv.h |2 +- > 6 files changed, 95 insertions(+), 17 deletions(-) -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] android,lowmemorykiller: Don't abuse TIF_MEMDIE.
On Mon, Apr 04, 2016 at 07:48:15PM +0900, Tetsuo Handa wrote: > Greg KH wrote: > > On Mon, Mar 21, 2016 at 08:00:49PM +0900, Tetsuo Handa wrote: > > > Greg Kroah-Hartman wrote: > > > > On Tue, Mar 08, 2016 at 03:18:59PM +0100, Michal Hocko wrote: > > > > > On Tue 08-03-16 20:01:32, Tetsuo Handa wrote: > > > > > > Currently, lowmemorykiller (LMK) is using TIF_MEMDIE for two > > > > > > purposes. > > > > > > One is to remember processes killed by LMK, and the other is to > > > > > > accelerate termination of processes killed by LMK. > > > > > > > > > > > > But since LMK is invoked as a memory shrinker function, there still > > > > > > should be some memory available. It is very likely that memory > > > > > > allocations by processes killed by LMK will succeed without using > > > > > > ALLOC_NO_WATERMARKS via TIF_MEMDIE. Even if their allocations cannot > > > > > > escape from memory allocation loop unless they use > > > > > > ALLOC_NO_WATERMARKS, > > > > > > lowmem_deathpending_timeout can guarantee forward progress by > > > > > > choosing > > > > > > next victim process. > > > > > > > > > > > > On the other hand, mark_oom_victim() assumes that it must be called > > > > > > with > > > > > > oom_lock held and it must not be called after oom_killer_disable() > > > > > > was > > > > > > called. But LMK is calling it without holding oom_lock and checking > > > > > > oom_killer_disabled. It is possible that LMK calls mark_oom_victim() > > > > > > due to allocation requests by kernel threads after current thread > > > > > > returned from oom_killer_disabled(). This will break synchronization > > > > > > for PM/suspend. > > > > > > > > > > > > This patch introduces per a task_struct flag for remembering > > > > > > processes > > > > > > killed by LMK, and replaces TIF_MEMDIE with that flag. By applying > > > > > > this > > > > > > patch, assumption by mark_oom_victim() becomes true. > > > > > > > > > > Thanks for looking into this. A separate flag sounds like a better way > > > > > to go (assuming that the flags are not scarce which doesn't seem to be > > > > > the case here). > > > > > > > > > > The LMK cannot kill the frozen tasks now but this shouldn't be a big > > > > > deal > > > > > because this is not strictly necessary for the system to move on. We > > > > > are > > > > > not OOM. > > > > > > > > > > > Signed-off-by: Tetsuo Handa > > > > > > Cc: Michal Hocko > > > > > > Cc: Greg Kroah-Hartman > > > > > > Cc: Arve Hjonnevag > > > > > > Cc: Riley Andrews > > > > > > > > > > Acked-by: Michal Hocko > > > > > > > > So, any objection for me taking this through the staging tree? > > > > > > > Seems no objection. Please take this through the staging tree. > > > > Ok, will do so after 4.6-rc1 is out. > > > I haven't seen this patch in linux-next. Would you take this? It's in my queue, I'll get to it soon, thanks. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 0/6] Drivers: hv: vmbus: Cleanup and mmio management.
> -Original Message- > From: KY Srinivasan > Sent: Saturday, April 2, 2016 10:18 PM > To: 'Greg KH' > Cc: o...@aepfle.de; jasow...@redhat.com; linux-ker...@vger.kernel.org; > a...@canonical.com; de...@linuxdriverproject.org > Subject: RE: [PATCH 0/6] Drivers: hv: vmbus: Cleanup and mmio > management. > > > > > -Original Message- > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > Sent: Saturday, April 2, 2016 6:48 PM > > To: KY Srinivasan > > Cc: o...@aepfle.de; jasow...@redhat.com; linux-ker...@vger.kernel.org; > > a...@canonical.com; de...@linuxdriverproject.org > > Subject: Re: [PATCH 0/6] Drivers: hv: vmbus: Cleanup and mmio > > management. > > > > On Sat, Apr 02, 2016 at 11:46:21PM +, KY Srinivasan wrote: > > > > > > > > > > -Original Message- > > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > > Sent: Saturday, April 2, 2016 3:23 PM > > > > To: KY Srinivasan > > > > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > > > > o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com; > > > > jasow...@redhat.com > > > > Subject: Re: [PATCH 0/6] Drivers: hv: vmbus: Cleanup and mmio > > > > management. > > > > > > > > On Sat, Apr 02, 2016 at 11:10:38AM -0700, K. Y. Srinivasan wrote: > > > > > Cleanup and mmio management. Also included is a patch > > > > > to fix an issue in KVP. > > > > > > > > So these all are for 4.7-rc1? > > > > > > Jake's PCI driver made it into 4.6 and some of the patches in this series > > > fix > > issues in the Hyper-V > > > PCI pass-through driver. Is it possible for this series to go into 4.6. > > > If not, > > 4.7-rc1 is fine. > > > > Even patch 1? Please be specific where you want patches to be merged > > to. > > Patch 1 can go into 4.7. If Jake's patches can go into 4.6, that would be > good. > Do you want me > to resend the patches that clearly indicate where the patches need to be > merged. Greg, Please drop this set. Jake has sent out a new series that we may want to pick up. I will resend the patches I sent the on April 2, 2016 with appropriate adjustments. Regards, K. Y ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Staging: unisys/verisonic: Correct double unlock
On Sat, Apr 02, 2016 at 11:20:14PM +, Sell, Timothy C wrote: > > -Original Message- > > From: Iban Rodriguez [mailto:iban.rodrig...@ono.com] > > Sent: Saturday, April 02, 2016 1:47 PM > > To: Kershner, David A; Greg Kroah-Hartman; Benjamin Romer; Sell, Timothy > > C; Neil Horman > > Cc: *S-Par-Maintainer; de...@driverdev.osuosl.org; linux- > > ker...@vger.kernel.org; Iban Rodriguez > > Subject: Staging: unisys/verisonic: Correct double unlock > > > > 'priv_lock' is unlocked twice. The first one is removed and > > the function 'visornic_serverdown_complete' is now called with > > 'priv_lock' locked because 'devdata' is modified inside. > > > > Signed-off-by: Iban Rodriguez > > --- > > drivers/staging/unisys/visornic/visornic_main.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/drivers/staging/unisys/visornic/visornic_main.c > > b/drivers/staging/unisys/visornic/visornic_main.c > > index be0d057346c3..af03f2938fe9 100644 > > --- a/drivers/staging/unisys/visornic/visornic_main.c > > +++ b/drivers/staging/unisys/visornic/visornic_main.c > > @@ -368,7 +368,6 @@ visornic_serverdown(struct visornic_devdata > > *devdata, > > } > > devdata->server_change_state = true; > > devdata->server_down_complete_func = complete_func; > > - spin_unlock_irqrestore(&devdata->priv_lock, flags); > > visornic_serverdown_complete(devdata); > > } else if (devdata->server_change_state) { > > dev_dbg(&devdata->dev->device, "%s changing state\n", > > I agree there is a bug here involving priv_lock being unlocked > twice, but this patch isn't the appropriate fix. Reason is, we can NOT > call visornic_serverdown_complete() while holding a spinlock > (which is what this patch would cause to occur) because > visornic_serverdown_complete() might block when it calls > rtnl_lock() in this code sequence (rtnl_lock() grabs a mutex): > > rtnl_lock(); > dev_close(netdev); > rtnl_unlock(); > > Blocking with a spinlock held is always a bad idea. :-( > You should just get rid of the priv_lock entirely, its not needed. priv_lock is used the following functions: visornic_serverdown - only called at the end of a tx_timeout reset operation, so you are sure that the rx and tx paths are quiesced (i.e. no data access happening) visornic_disable_with_timeout - move the netif_stop_queue operation to the top of this function and you will be guaranteed no concurrent access in the tx path visornic_enable_with_timeout - same as above, make sure that netif_start_queue and napi_enable are at the end of the function and you are guarantted no concurrent access. visornic_xmit - The queue lock in the netdev_start_xmit routine guarantees you single access here from multiple transmits. visornic_xmit_timeout - only called on a tx timeout, when you are guaranteed not to have concurrent transmit occuing, by definition. visornic_rx - the only tests made here are to devdata members that are altered in service_resp_queue, and the visornic_rx is only called from service_resp_queue, so you are guaranteed a stable data structure, as there is only ever one context in service_resp_queue as its called from the napi poll routine service_resp_queue - Same as above, for any given queue, service_resp_queue only has one context exectuing at once. host_side_disappeared - only called from visornic_remove, when implies that all associated devices are closed already, guaranteeing single access. visornic_remove visornic_resume - Both of these function only get called when all network interfaces are quiesced. just remove the lock and make the minor changes needed to guarantee isolated access. It makes the code cleaner and faster Neil > > -- > > 1.9.1 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: android: timed_gpio: fixed bare use of 'unsigned'
'unsigned int gpio' is added in place of 'unsigned gpio' Signed-off-by: Shyam Saini --- drivers/staging/android/timed_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c index 914fd10..8926b3f 100644 --- a/drivers/staging/android/timed_gpio.c +++ b/drivers/staging/android/timed_gpio.c @@ -29,7 +29,7 @@ struct timed_gpio_data { struct timed_output_dev dev; struct hrtimer timer; spinlock_t lock; - unsigned gpio; + unsigned int gpio; int max_timeout; u8 active_low; }; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: android: timed_gpio: fixed bare use of 'unsigned'
On Mon, Apr 04, 2016 at 09:12:28PM +0530, Shyam Saini wrote: > 'unsigned int gpio' is added in place of 'unsigned gpio' > > Signed-off-by: Shyam Saini > --- > drivers/staging/android/timed_gpio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) This file is no longer in linux-next, please always work against that tree, otherwise you duplicate work others have already done. sorry, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: vme: fix bare use of 'unsigned'
On Sun, Apr 03, 2016 at 09:36:31PM +0100, Martyn Welch wrote: > > > On 31/03/16 23:53, Clifton Barnes wrote: > > fix checkpatch.pl warning about 'Prefer 'unsigned int' to bare use of > > 'unsigned'' > > > > Signed-off-by: Clifton Barnes > > Acked-by: Martyn Welch > > Greg: Whilst this patch seems valid and compiles fine, I no longer have > access to the hardware for this driver. I'm aware this driver has been in > the staging tree for a rather long time. I will check to see if there's any > intention for further work to be done on this driver, if not I guess we > should be looking to delete it from the staging tree. > Thanks, let me know if you want it deleted. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: Staging: unisys/verisonic: Correct double unlock
> -Original Message- > From: Neil Horman [mailto:nhor...@redhat.com] > Sent: Monday, April 04, 2016 10:35 AM > To: Sell, Timothy C > Cc: Iban Rodriguez; Kershner, David A; Greg Kroah-Hartman; Benjamin > Romer; *S-Par-Maintainer; de...@driverdev.osuosl.org; linux- > ker...@vger.kernel.org > Subject: Re: Staging: unisys/verisonic: Correct double unlock > > On Sat, Apr 02, 2016 at 11:20:14PM +, Sell, Timothy C wrote: > > > -Original Message- > > > From: Iban Rodriguez [mailto:iban.rodrig...@ono.com] > > > Sent: Saturday, April 02, 2016 1:47 PM > > > To: Kershner, David A; Greg Kroah-Hartman; Benjamin Romer; Sell, > Timothy > > > C; Neil Horman > > > Cc: *S-Par-Maintainer; de...@driverdev.osuosl.org; linux- > > > ker...@vger.kernel.org; Iban Rodriguez > > > Subject: Staging: unisys/verisonic: Correct double unlock > > > > > > 'priv_lock' is unlocked twice. The first one is removed and > > > the function 'visornic_serverdown_complete' is now called with > > > 'priv_lock' locked because 'devdata' is modified inside. > > > > > > Signed-off-by: Iban Rodriguez > > > --- > > > drivers/staging/unisys/visornic/visornic_main.c | 1 - > > > 1 file changed, 1 deletion(-) > > > > > > diff --git a/drivers/staging/unisys/visornic/visornic_main.c > > > b/drivers/staging/unisys/visornic/visornic_main.c > > > index be0d057346c3..af03f2938fe9 100644 > > > --- a/drivers/staging/unisys/visornic/visornic_main.c > > > +++ b/drivers/staging/unisys/visornic/visornic_main.c > > > @@ -368,7 +368,6 @@ visornic_serverdown(struct visornic_devdata > > > *devdata, > > > } > > > devdata->server_change_state = true; > > > devdata->server_down_complete_func = complete_func; > > > - spin_unlock_irqrestore(&devdata->priv_lock, flags); > > > visornic_serverdown_complete(devdata); > > > } else if (devdata->server_change_state) { > > > dev_dbg(&devdata->dev->device, "%s changing state\n", > > > > I agree there is a bug here involving priv_lock being unlocked > > twice, but this patch isn't the appropriate fix. Reason is, we can NOT > > call visornic_serverdown_complete() while holding a spinlock > > (which is what this patch would cause to occur) because > > visornic_serverdown_complete() might block when it calls > > rtnl_lock() in this code sequence (rtnl_lock() grabs a mutex): > > > > rtnl_lock(); > > dev_close(netdev); > > rtnl_unlock(); > > > > Blocking with a spinlock held is always a bad idea. :-( > > > > You should just get rid of the priv_lock entirely, its not needed. > > priv_lock is used the following functions: > > visornic_serverdown - only called at the end of a tx_timeout reset > operation, so > you are sure that the rx and tx paths are quiesced (i.e. no data access > happening) > > visornic_disable_with_timeout - move the netif_stop_queue operation to > the top > of this function and you will be guaranteed no concurrent access in the tx > path > > visornic_enable_with_timeout - same as above, make sure that > netif_start_queue > and napi_enable are at the end of the function and you are guarantted no > concurrent access. > > visornic_xmit - The queue lock in the netdev_start_xmit routine guarantees > you > single access here from multiple transmits. > > visornic_xmit_timeout - only called on a tx timeout, when you are > guaranteed not > to have concurrent transmit occuing, by definition. > > visornic_rx - the only tests made here are to devdata members that are > altered > in service_resp_queue, and the visornic_rx is only called from > service_resp_queue, so you are guaranteed a stable data structure, as there > is > only ever one context in service_resp_queue as its called from the napi poll > routine > > service_resp_queue - Same as above, for any given queue, > service_resp_queue only > has one context exectuing at once. > > host_side_disappeared - only called from visornic_remove, when implies > that all > associated devices are closed already, guaranteeing single access. > > visornic_remove > visornic_resume - Both of these function only get called when all network > interfaces are quiesced. > > just remove the lock and make the minor changes needed to guarantee > isolated > access. It makes the code cleaner and faster > > Neil Neil, Although I would also love to get rid of this lock, I think we still need it, and will attempt to explain. There's a thread of execution present in visornic that doesn't exist in traditional network drivers, which involves the visornic_pause() and visornic_resume() functions registered during: visorbus_register_visor_driver(&visornic_driver) visornic_pause() and visornic_resume() are called on a thread managed by visorbus, in response to messages received from our hypervisor back-end. Note that visornic_pause() calls visornic_serverdown(), which is one of the users of priv_lock. (I.e., visornic_serverdown() is called from other places besides the end of a tx_timeout reset op
[PATCH 1/7] Trivial: Fixed cast and operator white space in skein_api.c
Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/skein/skein_api.c b/drivers/staging/skein/skein_api.c index 36f849f..cab26e7 100644 --- a/drivers/staging/skein/skein_api.c +++ b/drivers/staging/skein/skein_api.c @@ -165,7 +165,6 @@ int skein_update(struct skein_ctx *ctx, const u8 *msg, break; } return ret; - } int skein_update_bits(struct skein_ctx *ctx, const u8 *msg, @@ -210,7 +209,7 @@ int skein_update_bits(struct skein_ctx *ctx, const u8 *msg, /* internal sanity check: there IS a partial byte in the buffer! */ skein_assert(length != 0); /* partial byte bit mask */ - mask = (u8) (1u << (7 - (msg_bit_cnt & 7))); + mask = (u8)(1u << (7 - (msg_bit_cnt & 7))); /* apply bit padding on final byte (in the buffer) */ up[length - 1] = (u8)((up[length - 1] & (0 - mask)) | mask); -- 2.8.0 -- Manu ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/7] Trivial: Fixed cast and operator whitespace in skein_base.c
Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_base.c | 98 +++--- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/drivers/staging/skein/skein_base.c b/drivers/staging/skein/skein_base.c index 25a01ca..3d9c632 100644 --- a/drivers/staging/skein/skein_base.c +++ b/drivers/staging/skein/skein_base.c @@ -58,7 +58,7 @@ int skein_256_init(struct skein_256_ctx *ctx, size_t hash_bit_len) cfg.w[1] = skein_swap64(hash_bit_len); cfg.w[2] = skein_swap64(SKEIN_CFG_TREE_INFO_SEQUENTIAL); /* zero pad config block */ - memset(&cfg.w[3], 0, sizeof(cfg) - 3*sizeof(cfg.w[0])); + memset(&cfg.w[3], 0, sizeof(cfg) - 3 * sizeof(cfg.w[0])); /* compute the initial chaining values from config block */ /* zero the chaining variables */ @@ -98,7 +98,7 @@ int skein_256_init_ext(struct skein_256_ctx *ctx, size_t hash_bit_len, skein_assert(sizeof(cfg.b) >= sizeof(ctx->x)); /* do a mini-Init right here */ /* set output hash bit count = state size */ - ctx->h.hash_bit_len = 8*sizeof(ctx->x); + ctx->h.hash_bit_len = 8 * sizeof(ctx->x); /* set tweaks: T0 = 0; T1 = KEY type */ skein_start_new_type(ctx, KEY); /* zero the initial chaining variables */ @@ -171,11 +171,11 @@ int skein_256_update(struct skein_256_ctx *ctx, const u8 *msg, */ if (msg_byte_cnt > SKEIN_256_BLOCK_BYTES) { /* number of full blocks to process */ - n = (msg_byte_cnt-1) / SKEIN_256_BLOCK_BYTES; + n = (msg_byte_cnt - 1) / SKEIN_256_BLOCK_BYTES; skein_256_process_block(ctx, msg, n, SKEIN_256_BLOCK_BYTES); msg_byte_cnt -= n * SKEIN_256_BLOCK_BYTES; - msg+= n * SKEIN_256_BLOCK_BYTES; + msg += n * SKEIN_256_BLOCK_BYTES; } skein_assert(ctx->h.b_cnt == 0); } @@ -205,7 +205,7 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val) /* zero pad b[] if necessary */ if (ctx->h.b_cnt < SKEIN_256_BLOCK_BYTES) memset(&ctx->b[ctx->h.b_cnt], 0, - SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt); + SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt); /* process the final block */ skein_256_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); @@ -219,19 +219,19 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val) memset(ctx->b, 0, sizeof(ctx->b)); /* keep a local copy of counter mode "key" */ memcpy(x, ctx->x, sizeof(x)); - for (i = 0; i*SKEIN_256_BLOCK_BYTES < byte_cnt; i++) { + for (i = 0; i * SKEIN_256_BLOCK_BYTES < byte_cnt; i++) { /* build the counter block */ - ((u64 *)ctx->b)[0] = skein_swap64((u64) i); + ((u64 *)ctx->b)[0] = skein_swap64((u64)i); skein_start_new_type(ctx, OUT_FINAL); /* run "counter mode" */ skein_256_process_block(ctx, ctx->b, 1, sizeof(u64)); /* number of output bytes left to go */ - n = byte_cnt - i*SKEIN_256_BLOCK_BYTES; + n = byte_cnt - i * SKEIN_256_BLOCK_BYTES; if (n >= SKEIN_256_BLOCK_BYTES) n = SKEIN_256_BLOCK_BYTES; /* "output" the ctr mode bytes */ - skein_put64_lsb_first(hash_val+i*SKEIN_256_BLOCK_BYTES, ctx->x, - n); + skein_put64_lsb_first(hash_val + i * SKEIN_256_BLOCK_BYTES, + ctx->x, n); /* restore the counter mode key for next time */ memcpy(ctx->x, x, sizeof(x)); } @@ -282,7 +282,7 @@ int skein_512_init(struct skein_512_ctx *ctx, size_t hash_bit_len) cfg.w[1] = skein_swap64(hash_bit_len); cfg.w[2] = skein_swap64(SKEIN_CFG_TREE_INFO_SEQUENTIAL); /* zero pad config block */ - memset(&cfg.w[3], 0, sizeof(cfg) - 3*sizeof(cfg.w[0])); + memset(&cfg.w[3], 0, sizeof(cfg) - 3 * sizeof(cfg.w[0])); /* compute the initial chaining values from config block */ /* zero the chaining variables */ @@ -326,7 +326,7 @@ int skein_512_init_ext(struct skein_512_ctx *ctx, size_t hash_bit_len, skein_assert(sizeof(cfg.b) >= sizeof(ctx->x)); /* do a mini-Init right here */ /* set output hash bit count = state size */ - ctx->h.hash_bit_len = 8*sizeof(ctx->x); + ctx->h.hash_bit_len = 8 * sizeof(ctx->x); /* set tweaks: T0 = 0; T1 = KEY type */
[PATCH 3/7] Trivial: Fixed cast and operator whitespace in skein_base.h
Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_base.h | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/skein/skein_base.h b/drivers/staging/skein/skein_base.h index 3c7f8ad..a7a3a33 100644 --- a/drivers/staging/skein/skein_base.h +++ b/drivers/staging/skein/skein_base.h @@ -32,7 +32,7 @@ /* below two prototype assume we are handed aligned data */ #define skein_put64_lsb_first(dst08, src64, b_cnt) memcpy(dst08, src64, b_cnt) #define skein_get64_lsb_first(dst64, src08, w_cnt) \ - memcpy(dst64, src08, 8*(w_cnt)) + memcpy(dst64, src08, 8 * (w_cnt)) #define skein_swap64(w64) (w64) enum { @@ -46,19 +46,19 @@ enum { #define SKEIN_256_STATE_WORDS 4 #define SKEIN_512_STATE_WORDS 8 #define SKEIN_1024_STATE_WORDS 16 -#define SKEIN_MAX_STATE_WORDS 16 +#define SKEIN_MAX_STATE_WORDS 16 -#define SKEIN_256_STATE_BYTES (8*SKEIN_256_STATE_WORDS) -#define SKEIN_512_STATE_BYTES (8*SKEIN_512_STATE_WORDS) -#define SKEIN_1024_STATE_BYTES (8*SKEIN_1024_STATE_WORDS) +#define SKEIN_256_STATE_BYTES (8 * SKEIN_256_STATE_WORDS) +#define SKEIN_512_STATE_BYTES (8 * SKEIN_512_STATE_WORDS) +#define SKEIN_1024_STATE_BYTES (8 * SKEIN_1024_STATE_WORDS) -#define SKEIN_256_STATE_BITS (64*SKEIN_256_STATE_WORDS) -#define SKEIN_512_STATE_BITS (64*SKEIN_512_STATE_WORDS) -#define SKEIN_1024_STATE_BITS (64*SKEIN_1024_STATE_WORDS) +#define SKEIN_256_STATE_BITS (64 * SKEIN_256_STATE_WORDS) +#define SKEIN_512_STATE_BITS (64 * SKEIN_512_STATE_WORDS) +#define SKEIN_1024_STATE_BITS (64 * SKEIN_1024_STATE_WORDS) -#define SKEIN_256_BLOCK_BYTES (8*SKEIN_256_STATE_WORDS) -#define SKEIN_512_BLOCK_BYTES (8*SKEIN_512_STATE_WORDS) -#define SKEIN_1024_BLOCK_BYTES (8*SKEIN_1024_STATE_WORDS) +#define SKEIN_256_BLOCK_BYTES (8 * SKEIN_256_STATE_WORDS) +#define SKEIN_512_BLOCK_BYTES (8 * SKEIN_512_STATE_WORDS) +#define SKEIN_1024_BLOCK_BYTES (8 * SKEIN_1024_STATE_WORDS) struct skein_ctx_hdr { size_t hash_bit_len;/* size of hash result, in bits */ @@ -162,13 +162,13 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val); #define SKEIN_T1_POS_FINAL SKEIN_T1_BIT(127) /* 127 final blk flag */ /* tweak word tweak[1]: flag bit definition(s) */ -#define SKEIN_T1_FLAG_FIRST (((u64) 1) << SKEIN_T1_POS_FIRST) -#define SKEIN_T1_FLAG_FINAL (((u64) 1) << SKEIN_T1_POS_FINAL) -#define SKEIN_T1_FLAG_BIT_PAD (((u64) 1) << SKEIN_T1_POS_BIT_PAD) +#define SKEIN_T1_FLAG_FIRST (((u64)1) << SKEIN_T1_POS_FIRST) +#define SKEIN_T1_FLAG_FINAL (((u64)1) << SKEIN_T1_POS_FINAL) +#define SKEIN_T1_FLAG_BIT_PAD (((u64)1) << SKEIN_T1_POS_BIT_PAD) /* tweak word tweak[1]: tree level bit field mask */ #define SKEIN_T1_TREE_LVL_MASK (((u64)0x7F) << SKEIN_T1_POS_TREE_LVL) -#define SKEIN_T1_TREE_LEVEL(n) (((u64) (n)) << SKEIN_T1_POS_TREE_LVL) +#define SKEIN_T1_TREE_LEVEL(n) (((u64)(n)) << SKEIN_T1_POS_TREE_LVL) /* tweak word tweak[1]: block type field */ #define SKEIN_BLK_TYPE_KEY (0) /* key, for MAC and KDF */ @@ -181,7 +181,7 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val); #define SKEIN_BLK_TYPE_OUT (63) /* output stage */ #define SKEIN_BLK_TYPE_MASK (63) /* bit field mask */ -#define SKEIN_T1_BLK_TYPE(T) (((u64) (SKEIN_BLK_TYPE_##T)) << \ +#define SKEIN_T1_BLK_TYPE(T) (((u64)(SKEIN_BLK_TYPE_##T)) << \ SKEIN_T1_POS_BLK_TYPE) #define SKEIN_T1_BLK_TYPE_KEY SKEIN_T1_BLK_TYPE(KEY) /* for MAC and KDF */ #define SKEIN_T1_BLK_TYPE_CFG SKEIN_T1_BLK_TYPE(CFG) /* config block */ @@ -204,11 +204,11 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val); #define SKEIN_ID_STRING_LE (0x33414853) /* "SHA3" (little-endian)*/ #endif -#define SKEIN_MK_64(hi32, lo32) ((lo32) + (((u64) (hi32)) << 32)) +#define SKEIN_MK_64(hi32, lo32) ((lo32) + (((u64)(hi32)) << 32)) #define SKEIN_SCHEMA_VERSKEIN_MK_64(SKEIN_VERSION, SKEIN_ID_STRING_LE) #define SKEIN_KS_PARITY SKEIN_MK_64(0x1BD11BDA, 0xA9FC1A22) -#define SKEIN_CFG_STR_LEN (4*8) +#define SKEIN_CFG_STR_LEN (4 * 8) /* bit field definitions in config block tree_info word */ #define SKEIN_CFG_TREE_LEAF_SIZE_POS (0) @@ -323,13 +323,13 @@ enum { }; #ifndef SKEIN_ROUNDS -#define SKEIN_256_ROUNDS_TOTAL (72)/* # rounds for diff block sizes */ -#define SKEIN_512_ROUNDS_TOTAL (72) +#define SKEIN_256_ROUNDS_TOTAL (72) /* # rounds for diff block sizes */ +#define SKEIN_512_ROUNDS_TOTAL (72) #define SKEIN_1024_ROUNDS_TOTAL (80) #else /* allow command-line define in range 8*(5..14) */ -#define SKEIN_256_ROUNDS_TOTAL (8*SKEIN_ROUNDS/100) + 5) % 10) + 5)) -#define SKEIN_512_ROUNDS_TOTAL (8*SKEIN_ROUNDS/10) + 5) % 10) + 5)) -#define SKEIN_1024_ROUNDS_TOTAL (8*SKEIN_ROUNDS) + 5) % 10) + 5)) +#define SKEIN_256_ROUNDS_TOTAL (8 * SKEIN_ROUNDS / 100) + 5) % 10) + 5)) +#define SKEI
[PATCH 4/7] Trivial: Fixed cast and operator whitespace in
skein_block.c Reply-To: Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_block.c | 68 - 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/drivers/staging/skein/skein_block.c b/drivers/staging/skein/skein_block.c index 45b4732..09985c4 100644 --- a/drivers/staging/skein/skein_block.c +++ b/drivers/staging/skein/skein_block.c @@ -120,10 +120,10 @@ #if !(SKEIN_USE_ASM & 512) #undef RCNT -#define RCNT (SKEIN_512_ROUNDS_TOTAL/8) +#define RCNT (SKEIN_512_ROUNDS_TOTAL / 8) #ifdef SKEIN_LOOP /* configure how much to unroll the loop */ -#define SKEIN_UNROLL_512 (((SKEIN_LOOP)/10)%10) +#define SKEIN_UNROLL_512 (((SKEIN_LOOP) / 10) % 10) #else #define SKEIN_UNROLL_512 (0) #endif @@ -198,9 +198,9 @@ R512(6, 1, 0, 7, 2, 5, 4, 3, R_512_7, 8 * (R) + 8); \ I512(2 * (R) + 1); /* and key injection */ \ } while (0) -#define R512_UNROLL_R(NN) \ - ((SKEIN_UNROLL_512 == 0 &&\ - SKEIN_512_ROUNDS_TOTAL/8 > (NN)) || \ +#define R512_UNROLL_R(NN) \ + ((SKEIN_UNROLL_512 == 0 && \ + SKEIN_512_ROUNDS_TOTAL / 8 > (NN)) || \ (SKEIN_UNROLL_512 > (NN))) #if (SKEIN_UNROLL_512 > 14) @@ -210,7 +210,7 @@ #if !(SKEIN_USE_ASM & 1024) #undef RCNT -#define RCNT (SKEIN_1024_ROUNDS_TOTAL/8) +#define RCNT (SKEIN_1024_ROUNDS_TOTAL / 8) #ifdef SKEIN_LOOP /* configure how much to unroll the loop */ #define SKEIN_UNROLL_1024 ((SKEIN_LOOP) % 10) #else @@ -311,28 +311,28 @@ #define R1024_8_ROUNDS(R) \ do { \ R1024(00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, \ - 13, 14, 15, R1024_0, 8*(R) + 1);\ + 13, 14, 15, R1024_0, 8 * (R) + 1); \ R1024(00, 09, 02, 13, 06, 11, 04, 15, 10, 07, 12, 03, 14, \ - 05, 08, 01, R1024_1, 8*(R) + 2);\ + 05, 08, 01, R1024_1, 8 * (R) + 2); \ R1024(00, 07, 02, 05, 04, 03, 06, 01, 12, 15, 14, 13, 08, \ - 11, 10, 09, R1024_2, 8*(R) + 3);\ + 11, 10, 09, R1024_2, 8 * (R) + 3); \ R1024(00, 15, 02, 11, 06, 13, 04, 09, 14, 01, 08, 05, 10, \ - 03, 12, 07, R1024_3, 8*(R) + 4);\ - I1024(2*(R)); \ + 03, 12, 07, R1024_3, 8 * (R) + 4); \ + I1024(2 * (R)); \ R1024(00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, \ - 13, 14, 15, R1024_4, 8*(R) + 5);\ + 13, 14, 15, R1024_4, 8 * (R) + 5); \ R1024(00, 09, 02, 13, 06, 11, 04, 15, 10, 07, 12, 03, 14, \ - 05, 08, 01, R1024_5, 8*(R) + 6);\ + 05, 08, 01, R1024_5, 8 * (R) + 6); \ R1024(00, 07, 02, 05, 04, 03, 06, 01, 12, 15, 14, 13, 08, \ - 11, 10, 09, R1024_6, 8*(R) + 7);\ + 11, 10, 09, R1024_6, 8 * (R) + 7); \ R1024(00, 15, 02, 11, 06, 13, 04, 09, 14, 01, 08, 05, 10, \ - 03, 12, 07, R1024_7, 8*(R) + 8);\ - I1024(2*(R)+1); \ + 03, 12, 07, R1024_7, 8 * (R) + 8); \ + I1024(2 * (R) + 1); \ } while (0) -#define R1024_UNROLL_R(NN) \ - ((SKEIN_UNROLL_1024 == 0 && \ - SKEIN_1024_ROUNDS_TOTAL/8 > (NN)) ||\ +#define R1024_UNROLL_R(NN)\ + ((SKEIN_UNROLL_1024 == 0 && \ + SKEIN_1024_ROUNDS_TOTAL / 8 > (NN)) ||\ (SKEIN_UNROLL_1024 > (NN))) #if (SKEIN_UNROLL_1024 > 14) @@ -351,10 +351,10 @@ void skein_256_process_block(struct skein_256_ctx *ctx, const u8 *blk_ptr, size_t r; #if SKEIN_UNROLL_256 /* key schedule: chaining vars + tweak + "rot"*/ - u64 kw[WCNT+4+RCNT*2]; + u64 kw[WCNT + 4 + RCNT * 2]; #else /* key schedule words : chaining vars + tweak */ - u64 kw[WCNT+4]; + u64 kw[WCNT + 4]; #endif u64 X0, X1, X2, X3; /* local copy of context vars, for speed */ u64 w[WCNT]; /* local copy of input block */ @@ -460,9 +460,10 @@ void skein_256_process_block(struct skein_256_ctx *ctx, const u8 *blk_ptr, #if defin
[PATCH 5/7] Trivial: Fixed parentheses alignment in skein_generic.c
Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_generic.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/skein/skein_generic.c b/drivers/staging/skein/skein_generic.c index e29b9ab..16cbfbf 100644 --- a/drivers/staging/skein/skein_generic.c +++ b/drivers/staging/skein/skein_generic.c @@ -23,11 +23,11 @@ static int skein256_init(struct shash_desc *desc) { return skein_256_init((struct skein_256_ctx *)shash_desc_ctx(desc), - SKEIN256_DIGEST_BIT_SIZE); + SKEIN256_DIGEST_BIT_SIZE); } static int skein256_update(struct shash_desc *desc, const u8 *data, - unsigned int len) + unsigned int len) { return skein_256_update((struct skein_256_ctx *)shash_desc_ctx(desc), data, len); @@ -62,7 +62,7 @@ static int skein512_init(struct shash_desc *desc) } static int skein512_update(struct shash_desc *desc, const u8 *data, - unsigned int len) + unsigned int len) { return skein_512_update((struct skein_512_ctx *)shash_desc_ctx(desc), data, len); @@ -97,7 +97,7 @@ static int skein1024_init(struct shash_desc *desc) } static int skein1024_update(struct shash_desc *desc, const u8 *data, - unsigned int len) + unsigned int len) { return skein_1024_update((struct skein_1024_ctx *)shash_desc_ctx(desc), data, len); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/7] Trivial: Fixed operator whitespace in threefish_api.h
Signed-off-by: Manu Kumar --- drivers/staging/skein/threefish_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/skein/threefish_api.h b/drivers/staging/skein/threefish_api.h index 8e0a0b7..615e467 100644 --- a/drivers/staging/skein/threefish_api.h +++ b/drivers/staging/skein/threefish_api.h @@ -52,7 +52,7 @@ enum threefish_size { */ struct threefish_key { u64 state_size; - u64 key[SKEIN_MAX_STATE_WORDS+1]; /* max number of key words*/ + u64 key[SKEIN_MAX_STATE_WORDS + 1]; /* max number of key words*/ u64 tweak[3]; }; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/7] Trivial: Fixed cast and operator white space in skein_api.c
On Mon, Apr 04, 2016 at 02:52:28PM -0700, Manu Kumar wrote: > Signed-off-by: Manu Kumar I can't take patches without any changelog text, sorry. Also, only do one-thing-per-patch. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/7] Trivial: Fixed cast and operator white space in skein_api.c
On Mon, Apr 04, 2016 at 02:57:01PM -0700, Greg KH wrote: > On Mon, Apr 04, 2016 at 02:52:28PM -0700, Manu Kumar wrote: > > Signed-off-by: Manu Kumar > > I can't take patches without any changelog text, sorry. > > Also, only do one-thing-per-patch. Same goes for this whole series, please fix up and resend. Also put the name of the subsystem and driver first in the subject line, to look something like: staging: skein: fix up thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/7] Trivial: Fixed cast and operator whitespace in
On Mon, Apr 04, 2016 at 03:09:26PM -0700, Manu Kumar wrote: > skein_block.c > Reply-To: Really? Please be more careful. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/7] Trivial: Removed unnecessary whitespace in threefish_block.c
Signed-off-by: Manu Kumar --- drivers/staging/skein/threefish_block.c | 16 1 file changed, 16 deletions(-) diff --git a/drivers/staging/skein/threefish_block.c b/drivers/staging/skein/threefish_block.c index e19ac43..5ebc918 100644 --- a/drivers/staging/skein/threefish_block.c +++ b/drivers/staging/skein/threefish_block.c @@ -64,7 +64,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k3 + t2; b0 += b1 + k2; b1 = rol64(b1, 14) ^ b0; @@ -117,7 +116,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k0 + t1; b0 += b1 + k4; b1 = rol64(b1, 14) ^ b0; @@ -170,7 +168,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k2 + t0; b0 += b1 + k1; b1 = rol64(b1, 14) ^ b0; @@ -223,7 +220,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k4 + t2; b0 += b1 + k3; b1 = rol64(b1, 14) ^ b0; @@ -276,7 +272,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k1 + t1; b0 += b1 + k0; b1 = rol64(b1, 14) ^ b0; @@ -329,7 +324,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k3 + t0; b0 += b1 + k2; b1 = rol64(b1, 14) ^ b0; @@ -382,7 +376,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k0 + t2; b0 += b1 + k4; b1 = rol64(b1, 14) ^ b0; @@ -435,7 +428,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k2 + t1; b0 += b1 + k1; b1 = rol64(b1, 14) ^ b0; @@ -579,7 +571,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k3 + t2; b3 -= k4 + 16; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -648,7 +639,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k1 + t0; b3 -= k2 + 14; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -717,7 +707,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k4 + t1; b3 -= k0 + 12; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -786,7 +775,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k2 + t2; b3 -= k3 + 10; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -855,7 +843,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k0 + t0; b3 -= k1 + 8; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -924,7 +911,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k3 + t1; b3 -= k4 + 6; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -993,7 +979,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k1 + t2; b3 -= k2 + 4; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -1062,7 +1047,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k4 + t0; b3 -= k0 + 2; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: skein: cleanup: add operator white space
Added white space between operators and operands. Because this sometimes maxed out the column width, some expressions were broken up into multiple lines, and comments were moved appropriately. Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_base.c| 66 +-- drivers/staging/skein/skein_base.h| 28 +++ drivers/staging/skein/skein_block.c | 46 +--- drivers/staging/skein/threefish_api.h | 2 +- 4 files changed, 73 insertions(+), 69 deletions(-) diff --git a/drivers/staging/skein/skein_base.c b/drivers/staging/skein/skein_base.c index 25a01ca..3e3485c 100644 --- a/drivers/staging/skein/skein_base.c +++ b/drivers/staging/skein/skein_base.c @@ -58,7 +58,7 @@ int skein_256_init(struct skein_256_ctx *ctx, size_t hash_bit_len) cfg.w[1] = skein_swap64(hash_bit_len); cfg.w[2] = skein_swap64(SKEIN_CFG_TREE_INFO_SEQUENTIAL); /* zero pad config block */ - memset(&cfg.w[3], 0, sizeof(cfg) - 3*sizeof(cfg.w[0])); + memset(&cfg.w[3], 0, sizeof(cfg) - 3 * sizeof(cfg.w[0])); /* compute the initial chaining values from config block */ /* zero the chaining variables */ @@ -98,7 +98,7 @@ int skein_256_init_ext(struct skein_256_ctx *ctx, size_t hash_bit_len, skein_assert(sizeof(cfg.b) >= sizeof(ctx->x)); /* do a mini-Init right here */ /* set output hash bit count = state size */ - ctx->h.hash_bit_len = 8*sizeof(ctx->x); + ctx->h.hash_bit_len = 8 * sizeof(ctx->x); /* set tweaks: T0 = 0; T1 = KEY type */ skein_start_new_type(ctx, KEY); /* zero the initial chaining variables */ @@ -171,7 +171,7 @@ int skein_256_update(struct skein_256_ctx *ctx, const u8 *msg, */ if (msg_byte_cnt > SKEIN_256_BLOCK_BYTES) { /* number of full blocks to process */ - n = (msg_byte_cnt-1) / SKEIN_256_BLOCK_BYTES; + n = (msg_byte_cnt - 1) / SKEIN_256_BLOCK_BYTES; skein_256_process_block(ctx, msg, n, SKEIN_256_BLOCK_BYTES); msg_byte_cnt -= n * SKEIN_256_BLOCK_BYTES; @@ -219,19 +219,19 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val) memset(ctx->b, 0, sizeof(ctx->b)); /* keep a local copy of counter mode "key" */ memcpy(x, ctx->x, sizeof(x)); - for (i = 0; i*SKEIN_256_BLOCK_BYTES < byte_cnt; i++) { + for (i = 0; i * SKEIN_256_BLOCK_BYTES < byte_cnt; i++) { /* build the counter block */ ((u64 *)ctx->b)[0] = skein_swap64((u64) i); skein_start_new_type(ctx, OUT_FINAL); /* run "counter mode" */ skein_256_process_block(ctx, ctx->b, 1, sizeof(u64)); /* number of output bytes left to go */ - n = byte_cnt - i*SKEIN_256_BLOCK_BYTES; + n = byte_cnt - i * SKEIN_256_BLOCK_BYTES; if (n >= SKEIN_256_BLOCK_BYTES) n = SKEIN_256_BLOCK_BYTES; /* "output" the ctr mode bytes */ - skein_put64_lsb_first(hash_val+i*SKEIN_256_BLOCK_BYTES, ctx->x, - n); + skein_put64_lsb_first(hash_val + i * SKEIN_256_BLOCK_BYTES, + ctx->x, n); /* restore the counter mode key for next time */ memcpy(ctx->x, x, sizeof(x)); } @@ -282,7 +282,7 @@ int skein_512_init(struct skein_512_ctx *ctx, size_t hash_bit_len) cfg.w[1] = skein_swap64(hash_bit_len); cfg.w[2] = skein_swap64(SKEIN_CFG_TREE_INFO_SEQUENTIAL); /* zero pad config block */ - memset(&cfg.w[3], 0, sizeof(cfg) - 3*sizeof(cfg.w[0])); + memset(&cfg.w[3], 0, sizeof(cfg) - 3 * sizeof(cfg.w[0])); /* compute the initial chaining values from config block */ /* zero the chaining variables */ @@ -326,7 +326,7 @@ int skein_512_init_ext(struct skein_512_ctx *ctx, size_t hash_bit_len, skein_assert(sizeof(cfg.b) >= sizeof(ctx->x)); /* do a mini-Init right here */ /* set output hash bit count = state size */ - ctx->h.hash_bit_len = 8*sizeof(ctx->x); + ctx->h.hash_bit_len = 8 * sizeof(ctx->x); /* set tweaks: T0 = 0; T1 = KEY type */ skein_start_new_type(ctx, KEY); /* zero the initial chaining variables */ @@ -398,7 +398,7 @@ int skein_512_update(struct skein_512_ctx *ctx, const u8 *msg, */ if (msg_byte_cnt > SKEIN_512_BLOCK_BYTES) { /* number of full blocks to process */ - n
[PATCH 13/18] staging: lustre: hsm: Add CLF_RENAME_LAST flag
From: JC Lafoucriere Create a special flag for the last rename event. Signed-off-by: JC Lafoucriere Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3718 Reviewed-on: http://review.whamcloud.com/7260 Reviewed-by: Jinshan Xiong Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_user.h |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index 4672145..e4e42e1 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -676,7 +676,12 @@ static inline const char *changelog_type2str(int type) #define CLF_UNLINK_HSM_EXISTS 0x0002 /* File has something in HSM */ /* HSM cleaning needed */ /* Flags for rename */ -#define CLF_RENAME_LAST 0x0001 /* rename unlink last hardlink of target */ +#define CLF_RENAME_LAST0x0001 /* rename unlink last hardlink of +* target +*/ +#define CLF_RENAME_LAST_EXISTS 0x0002 /* rename unlink last hardlink of target +* has an archive in backend +*/ /* Flags for HSM */ /* 12b used (from high weight to low weight): -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/18] staging: lustre: ldlm: fix 'deadcode' errors
From: Sebastien Buisson Fix 'deadcode' issues found by Coverity version 6.5.1: Logically dead code (DEADCODE) Execution cannot reach this statement. Signed-off-by: Sebastien Buisson Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3097 Reviewed-on: http://review.whamcloud.com/7167 Reviewed-by: Dmitry Eremin Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c index b88b786..3f97e1c 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c @@ -530,12 +530,6 @@ granted: return -EIO; } - if (rc) { - LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)", - rc); - return rc; - } - LDLM_DEBUG(lock, "client-side enqueue granted"); lock_res_and_lock(lock); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/18] staging: lustre: mdc: document mdc_rpc_lock
From: Ned Bass As this lock can be a bottleneck, clarifying why it is needed may be helpful to those working on client performance. Signed-off-by: Ned Bass Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3443 Reviewed-on: http://review.whamcloud.com/6593 Reviewed-by: Andreas Dilger Reviewed-by: Keith Mannthey Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_mdc.h | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h b/drivers/staging/lustre/lustre/include/lustre_mdc.h index df94f9f..9e54790 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mdc.h +++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h @@ -64,9 +64,27 @@ struct obd_export; struct ptlrpc_request; struct obd_device; +/** + * Serializes in-flight MDT-modifying RPC requests to preserve idempotency. + * + * This mutex is used to implement execute-once semantics on the MDT. + * The MDT stores the last transaction ID and result for every client in + * its last_rcvd file. If the client doesn't get a reply, it can safely + * resend the request and the MDT will reconstruct the reply being aware + * that the request has already been executed. Without this lock, + * execution status of concurrent in-flight requests would be + * overwritten. + * + * This design limits the extent to which we can keep a full pipeline of + * in-flight requests from a single client. This limitation could be + * overcome by allowing multiple slots per client in the last_rcvd file. + */ struct mdc_rpc_lock { + /** Lock protecting in-flight RPC concurrency. */ struct mutexrpcl_mutex; + /** Intent associated with currently executing request. */ struct lookup_intent*rpcl_it; + /** Used for MDS/RPC load testing purposes. */ int rpcl_fakes; }; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/18] staging: lustre: llite: reset writeback index in ll_writepages
From: Jinshan Xiong Otherwise after one round the writeback index will become beyond the file size and ->writepages() turns into an empty operation. Also, a safety guard is added to limit the wait time for grant to 10 minutes(take recovery into consideration) at maximum in the osc_enter_cache() function. Otherwise, EDQUOT will be returned to the applications to start sync write. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3416 Reviewed-on: http://review.whamcloud.com/6554 Reviewed-by: Bobi Jam Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/rw.c |5 ++- drivers/staging/lustre/lustre/osc/osc_cache.c | 31 + 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 7d5dd38..ab490a5 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -1110,8 +1110,9 @@ int ll_writepages(struct address_space *mapping, struct writeback_control *wbc) if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) { if (end == OBD_OBJECT_EOF) - end = i_size_read(inode); - mapping->writeback_index = (end >> PAGE_CACHE_SHIFT) + 1; + mapping->writeback_index = 0; + else + mapping->writeback_index = (end >> PAGE_CACHE_SHIFT) + 1; } return result; } diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index d01f2a2..f09b89d 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -1379,15 +1379,19 @@ static int osc_completion(const struct lu_env *env, struct osc_async_page *oap, return 0; } -#define OSC_DUMP_GRANT(cli, fmt, args...) do { \ +#define OSC_DUMP_GRANT(lvl, cli, fmt, args...) do {\ struct client_obd *__tmp = (cli); \ - CDEBUG(D_CACHE, "%s: { dirty: %ld/%ld dirty_pages: %d/%d "\ - "dropped: %ld avail: %ld, reserved: %ld, flight: %d } " fmt, \ + CDEBUG(lvl, "%s: grant { dirty: %ld/%ld dirty_pages: %d/%d " \ + "dropped: %ld avail: %ld, reserved: %ld, flight: %d } " \ + "lru {in list: %d, left: %d, waiters: %d }" fmt, \ __tmp->cl_import->imp_obd->obd_name, \ __tmp->cl_dirty, __tmp->cl_dirty_max, \ atomic_read(&obd_dirty_pages), obd_max_dirty_pages,\ __tmp->cl_lost_grant, __tmp->cl_avail_grant, \ - __tmp->cl_reserved_grant, __tmp->cl_w_in_flight, ##args); \ + __tmp->cl_reserved_grant, __tmp->cl_w_in_flight, \ + atomic_read(&__tmp->cl_lru_in_list), \ + atomic_read(&__tmp->cl_lru_busy),\ + atomic_read(&__tmp->cl_lru_shrinkers), ##args); \ } while (0) /* caller must hold loi_list_lock */ @@ -1527,7 +1531,7 @@ static int osc_enter_cache_try(struct client_obd *cli, { int rc; - OSC_DUMP_GRANT(cli, "need:%d.\n", bytes); + OSC_DUMP_GRANT(D_CACHE, cli, "need:%d.\n", bytes); rc = osc_reserve_grant(cli, bytes); if (rc < 0) @@ -1572,10 +1576,11 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli, struct osc_object *osc = oap->oap_obj; struct lov_oinfo *loi = osc->oo_oinfo; struct osc_cache_waiter ocw; - struct l_wait_info lwi = LWI_INTR(LWI_ON_SIGNAL_NOOP, NULL); + struct l_wait_info lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(600), NULL, + LWI_ON_SIGNAL_NOOP, NULL); int rc = -EDQUOT; - OSC_DUMP_GRANT(cli, "need:%d.\n", bytes); + OSC_DUMP_GRANT(D_CACHE, cli, "need:%d.\n", bytes); spin_lock(&cli->cl_loi_list_lock); @@ -1619,8 +1624,14 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli, spin_lock(&cli->cl_loi_list_lock); - /* l_wait_event is interrupted by signal */ + /* l_wait_event is interrupted by signal, or timed out */ if (rc < 0) { + if (rc == -ETIMEDOUT) { + OSC_DUMP_GRANT(D_ERROR, cli, + "try to reserve %d.\n", bytes); + osc_extent_tree_dump(D_ERROR, osc); + rc = -EDQUOT; + } list_del_init(&ocw.ocw_entry); goto out; } @@ -1637,
[PATCH 09/18] staging: lustre: lov: Get the correct address of lmm_objects
From: Swapnil Pimpale The introduction of lmm_layout_gen makes the assumption that lmm_objects is present after lmm_stripe_count incorrect. Fixed this to get the correct address of lmm_objects when lmmk is cast to lov_mds_md_v1. Signed-off-by: Swapnil Pimpale Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3162 Reviewed-on: http://review.whamcloud.com/7258 Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lov/lov_pack.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 3925633..2f02be5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -444,8 +444,7 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm, if (lum.lmm_magic == LOV_USER_MAGIC) { /* User request for v1, we need skip lmm_pool_name */ if (lmmk->lmm_magic == LOV_MAGIC_V3) { - memmove((char *)(&lmmk->lmm_stripe_count) + - sizeof(lmmk->lmm_stripe_count), + memmove(((struct lov_mds_md_v1 *)lmmk)->lmm_objects, ((struct lov_mds_md_v3 *)lmmk)->lmm_objects, lmmk->lmm_stripe_count * sizeof(struct lov_ost_data_v1)); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/18] staging: lustre: hsm: Fix lu_ref for lease handle
From: Jinshan Xiong The lu_ref was not being decremented when releasing the lease handle. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3647 Reviewed-on: http://review.whamcloud.com/7243 Reviewed-by: John L. Hammond Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/file.c |4 ++-- drivers/staging/lustre/lustre/mdc/mdc_lib.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 02b5783..000ea58 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -908,7 +908,7 @@ static int ll_lease_close(struct obd_client_handle *och, struct inode *inode, lock_res_and_lock(lock); cancelled = ldlm_is_cancel(lock); unlock_res_and_lock(lock); - ldlm_lock_put(lock); + LDLM_LOCK_PUT(lock); } CDEBUG(D_INODE, "lease for " DFID " broken? %d\n", @@ -2509,7 +2509,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) rc = och->och_flags & (FMODE_READ | FMODE_WRITE); unlock_res_and_lock(lock); - ldlm_lock_put(lock); + LDLM_LOCK_PUT(lock); } } mutex_unlock(&lli->lli_och_mutex); diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index be0acf7..53cd56f 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -454,7 +454,7 @@ static void mdc_hsm_release_pack(struct ptlrpc_request *req, lock = ldlm_handle2lock(&op_data->op_lease_handle); if (lock) { data->cd_handle = lock->l_remote_handle; - ldlm_lock_put(lock); + LDLM_LOCK_PUT(lock); } ldlm_cli_cancel(&op_data->op_lease_handle, LCF_LOCAL); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/18] staging: lustre: hsm: copy start error should set HP_FLAG_COMPLETED
From: Aurelien Degremont If an error occurs when initializing a HSM request, in ll_ioc_copy_start(), the PROGRESS message, sent to coordinator, should carry the error code but also HP_FLAG_COMPLETED to mark the request as finished (with error). If not, the Coordinator will ignore this message and consider the request is still running. Signed-off-by: Aurelien Degremont Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3685 Reviewed-on: http://review.whamcloud.com/7265 Reviewed-by: Jinshan Xiong Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/dir.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index b085fb4..41481cc 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -959,6 +959,9 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy) } progress: + /* On error, the request should be considered as completed */ + if (hpk.hpk_errval > 0) + hpk.hpk_flags |= HP_FLAG_COMPLETED; rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk), &hpk, NULL); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/18] fill in missing patches present in 2.4.92 version
After the lustre client code was merged patches continued to land but gaps did happen were several patches were missed. This batch of patches are bug fixes that happened after the upstream client merger and before the creation of lustre version 2.4.92 tag. Aurelien Degremont (1): staging: lustre: hsm: copy start error should set HP_FLAG_COMPLETED Gaurav Mahajan (1): staging: lustre: llite: Delaying creation of client side proc entries. JC Lafoucriere (2): staging: lustre: hsm: rename hai_zero() HSM function staging: lustre: hsm: Add CLF_RENAME_LAST flag James Simmons (1): staging: lustre: osc: Lustre returns EINTR from writes when SA_RESTART is set Jinshan Xiong (7): staging: lustre: libcfs: remove userland comments in libcfs_debug.h staging: lustre: libcfs: create array of debug names staging: lustre: libcfs: make D_HSM a unique value staging: lustre: hsm: Fix lu_ref for lease handle staging: lustre: llite: reset writeback index in ll_writepages staging: lustre: llite: cancel open lock before closing file staging: lustre: hsm: Add support to drop all pages for ll_data_version Ned Bass (1): staging: lustre: mdc: document mdc_rpc_lock Niu Yawei (1): staging: lustre: llite: use 64bits flags in ll_lov_setea() Sebastien Buisson (3): staging: lustre: ldlm: fix 'deadcode' errors staging: lustre: fix 'NULL pointer dereference' errors staging: lustre: fix 'no effect' errors Swapnil Pimpale (1): staging: lustre: lov: Get the correct address of lmm_objects .../lustre/include/linux/libcfs/libcfs_debug.h | 18 ++- drivers/staging/lustre/lnet/libcfs/debug.c | 126 ++-- .../lustre/lustre/include/lustre/lustre_idl.h |1 + .../lustre/lustre/include/lustre/lustre_user.h | 18 ++- drivers/staging/lustre/lustre/include/lustre_mdc.h | 18 +++ drivers/staging/lustre/lustre/ldlm/ldlm_flock.c|6 - drivers/staging/lustre/lustre/llite/dir.c | 18 ++- drivers/staging/lustre/lustre/llite/file.c | 59 ++ .../staging/lustre/lustre/llite/llite_internal.h |4 +- drivers/staging/lustre/lustre/llite/llite_lib.c| 16 ++- drivers/staging/lustre/lustre/llite/rw.c |5 +- drivers/staging/lustre/lustre/llite/xattr.c|9 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c|2 +- drivers/staging/lustre/lustre/lov/lov_io.c |3 +- drivers/staging/lustre/lustre/lov/lov_merge.c | 11 ++ drivers/staging/lustre/lustre/lov/lov_pack.c |3 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c|2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c|2 +- drivers/staging/lustre/lustre/osc/osc_cache.c | 42 +-- 19 files changed, 166 insertions(+), 197 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/18] staging: lustre: fix 'no effect' errors
From: Sebastien Buisson Fix 'no effect' issues found by Coverity version 6.5.1: Unsigned compared against 0 (NO_EFFECT) This greater-than-or-equal-to-zero comparison of an unsigned value is always true. Remove useless cast. Signed-off-by: Sebastien Buisson Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3907 Reviewed-on: http://review.whamcloud.com/7166 Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c |3 +-- drivers/staging/lustre/lustre/lmv/lmv_obd.c |2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 6282478..6589108 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -423,8 +423,7 @@ getxattr_nocache: if (rce && rce->rce_ops == RMT_LSETFACL) { ext_acl_xattr_header *acl; - acl = lustre_posix_acl_xattr_2ext( - (posix_acl_xattr_header *)buffer, rc); + acl = lustre_posix_acl_xattr_2ext(buffer, rc); if (IS_ERR(acl)) { rc = PTR_ERR(acl); goto out; diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 8bd2dc5..3969732 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -926,7 +926,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp, struct obd_quotactl *oqctl; if (qctl->qc_valid == QC_MDTIDX) { - if (qctl->qc_idx < 0 || count <= qctl->qc_idx) + if (count <= qctl->qc_idx) return -EINVAL; tgt = lmv->tgts[qctl->qc_idx]; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/18] staging: lustre: hsm: Add support to drop all pages for ll_data_version
From: Jinshan Xiong This will be used by HSM release to get data version and drop all caching pages from all clients, before sending IT_RELEASE close REQ to MDT. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3647 Reviewed-on: http://review.whamcloud.com/6794 Reviewed-by: John L. Hammond Reviewed-by: Aurelien Degremont Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h |1 + .../lustre/lustre/include/lustre/lustre_user.h |5 +-- drivers/staging/lustre/lustre/llite/dir.c |5 +-- drivers/staging/lustre/lustre/llite/file.c | 35 .../staging/lustre/lustre/llite/llite_internal.h |2 +- drivers/staging/lustre/lustre/lov/lov_merge.c | 11 ++ 6 files changed, 38 insertions(+), 21 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 12e6718..fa4cbbe 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -1428,6 +1428,7 @@ enum obdo_flags { */ OBD_FL_RECOV_RESEND = 0x0008, /* recoverable resent */ OBD_FL_NOSPC_BLK= 0x0010, /* no more block space on OST */ + OBD_FL_FLUSH= 0x0020, /* flush pages on the OST */ /* Note that while these checksum values are currently separate bits, * in 2.x we can actually allow all values from 1-31 if we wanted. diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index e4e42e1..59ba48a 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -838,9 +838,8 @@ struct ioc_data_version { __u64 idv_flags; /* See LL_DV_xxx */ }; -#define LL_DV_NOFLUSH 0x01 /* Do not take READ EXTENT LOCK before sampling - * version. Dirty caches are left unchanged. - */ +#define LL_DV_RD_FLUSH BIT(0) /* Flush dirty pages from clients */ +#define LL_DV_WR_FLUSH BIT(1) /* Flush all caching pages from clients */ #ifndef offsetof # define offsetof(typ, memb) ((unsigned long)((char *)&(((typ *)0)->memb))) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 7251bef..45bdf8f 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -941,7 +941,7 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy) } /* Read current file data version */ - rc = ll_data_version(inode, &data_version, 1); + rc = ll_data_version(inode, &data_version, LL_DV_RD_FLUSH); iput(inode); if (rc != 0) { CDEBUG(D_HSM, "Could not read file data version of " @@ -1025,8 +1025,7 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy) goto progress; } - rc = ll_data_version(inode, &data_version, -copy->hc_hai.hai_action == HSMA_ARCHIVE); + rc = ll_data_version(inode, &data_version, LL_DV_RD_FLUSH); iput(inode); if (rc) { CDEBUG(D_HSM, "Could not read file data version. Request could not be confirmed.\n"); diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index ac17360..9b553d2 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -929,7 +929,7 @@ static int ll_lease_close(struct obd_client_handle *och, struct inode *inode, /* Fills the obdo with the attributes for the lsm */ static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp, - struct obdo *obdo, __u64 ioepoch, int sync) + struct obdo *obdo, __u64 ioepoch, int dv_flags) { struct ptlrpc_request_set *set; struct obd_info oinfo = { }; @@ -948,9 +948,11 @@ static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp, OBD_MD_FLMTIME | OBD_MD_FLCTIME | OBD_MD_FLGROUP | OBD_MD_FLEPOCH | OBD_MD_FLDATAVERSION; - if (sync) { + if (dv_flags & (LL_DV_WR_FLUSH | LL_DV_RD_FLUSH)) { oinfo.oi_oa->o_valid |= OBD_MD_FLFLAGS; oinfo.oi_oa->o_flags |= OBD_FL_SRVLOCK; + if (dv_flags & LL_DV_WR_FLUSH) + oinfo.oi_oa->o_flags |= OBD_FL_FLUSH; } set = ptlrpc_prep_set(); @@ -963,11 +965,16 @@ static int l
[PATCH 07/18] staging: lustre: hsm: rename hai_zero() HSM function
From: JC Lafoucriere rename hai_zero() to hai_first(). Use a better name for hai helper Signed-off-by: JC Lafoucriere Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3709 Reviewed-on: http://review.whamcloud.com/7254 Reviewed-by: Jinshan Xiong Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_user.h |6 +++--- drivers/staging/lustre/lustre/mdc/mdc_request.c|2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index 19f2271..4672145 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -1095,7 +1095,7 @@ struct hsm_action_list { __u32 padding1; char hal_fsname[0]; /* null-terminated */ /* struct hsm_action_item[hal_count] follows, aligned on 8-byte -* boundaries. See hai_zero +* boundaries. See hai_first */ } __packed; @@ -1109,7 +1109,7 @@ static inline int cfs_size_round(int val) #endif /* Return pointer to first hai in action list */ -static inline struct hsm_action_item *hai_zero(struct hsm_action_list *hal) +static inline struct hsm_action_item *hai_first(struct hsm_action_list *hal) { return (struct hsm_action_item *)(hal->hal_fsname + cfs_size_round(strlen(hal-> \ @@ -1131,7 +1131,7 @@ static inline int hal_size(struct hsm_action_list *hal) struct hsm_action_item *hai; sz = sizeof(*hal) + cfs_size_round(strlen(hal->hal_fsname) + 1); - hai = hai_zero(hal); + hai = hai_first(hal); for (i = 0; i < hal->hal_count; i++, hai = hai_next(hai)) sz += cfs_size_round(hai->hai_len); diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 98b27f1..a089237 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -1952,7 +1952,7 @@ static void lustre_swab_hal(struct hsm_action_list *h) __swab32s(&h->hal_count); __swab32s(&h->hal_archive_id); __swab64s(&h->hal_flags); - hai = hai_zero(h); + hai = hai_first(h); for (i = 0; i < h->hal_count; i++, hai = hai_next(hai)) lustre_swab_hai(hai); } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/18] staging: lustre: libcfs: make D_HSM a unique value
From: Jinshan Xiong Redefine D_HSM. It was defined to D_TRACE. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3647 Reviewed-on: http://review.whamcloud.com/7243 Reviewed-by: John L. Hammond Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_debug.h |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index 5e60c6f..455c54d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -154,8 +154,7 @@ struct ptldebug_header { #define D_QUOTA0x0400 #define D_SEC 0x0800 #define D_LFSCK0x1000 /* For both OI scrub and LFSCK */ - -#define D_HSM D_TRACE +#define D_HSM 0x2000 #define LIBCFS_DEBUG_MASKS_NAMES { \ "trace", "inode", "super", "ext2", "malloc", "cache", "info", \ -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/18] staging: lustre: fix 'NULL pointer dereference' errors
From: Sebastien Buisson Fix 'NULL pointer dereference' defects found by Coverity version 6.5.0: Dereference after null check (FORWARD_NULL) For instance, Passing null pointer to a function which dereferences it. Dereference before null check (REVERSE_INULL) Null-checking variable suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Dereference null return value (NULL_RETURNS) Signed-off-by: Sebastien Buisson Signed-off-by: James Nunez Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3042 Reviewed-on: http://review.whamcloud.com/5868 Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/dir.c | 10 ++ drivers/staging/lustre/lustre/lov/lov_io.c |3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 41481cc..7251bef 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -612,15 +612,16 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx) struct inode*inode = file_inode(filp); struct ll_file_data *lfd= LUSTRE_FPRIVATE(filp); struct ll_sb_info *sbi= ll_i2sbi(inode); + __u64 pos = lfd ? lfd->lfd_pos : 0; int hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH; int api32 = ll_need_32bit_api(sbi); int rc; CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p) pos %lu/%llu 32bit_api %d\n", inode->i_ino, inode->i_generation, - inode, (unsigned long)lfd->lfd_pos, i_size_read(inode), api32); + inode, (unsigned long)pos, i_size_read(inode), api32); - if (lfd->lfd_pos == MDS_DIR_END_OFF) { + if (pos == MDS_DIR_END_OFF) { /* * end-of-file. */ @@ -628,9 +629,10 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx) goto out; } - ctx->pos = lfd->lfd_pos; + ctx->pos = pos; rc = ll_dir_read(inode, ctx); - lfd->lfd_pos = ctx->pos; + if (lfd) + lfd->lfd_pos = ctx->pos; if (ctx->pos == MDS_DIR_END_OFF) { if (api32) ctx->pos = LL_DIR_END_OFF_32BIT; diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c index 4151237..0b59393 100644 --- a/drivers/staging/lustre/lustre/lov/lov_io.c +++ b/drivers/staging/lustre/lustre/lov/lov_io.c @@ -276,10 +276,11 @@ struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio, static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio, struct cl_io *io) { - struct lov_stripe_md *lsm = lio->lis_object->lo_lsm; + struct lov_stripe_md *lsm; int result; LASSERT(lio->lis_object); + lsm = lio->lis_object->lo_lsm; /* * Need to be optimized, we can't afford to allocate a piece of memory -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/18] staging: lustre: llite: Delaying creation of client side proc entries.
From: Gaurav Mahajan In client_common_fill_super() proc entries are created before before cl_sb_init() and therefore lu_site is not allocated resulting in client crash when tried reading lu_site stats. Delaying creation of proc entries after creation of all required data structures fixed the problem. Signed-off-by: Gaurav Mahajan Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2941 Reviewed-on: http://review.whamcloud.com/6852 Reviewed-by: Andreas Dilger Reviewed-by: Emoly Liu Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/llite_lib.c | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 95c55c3..9571742 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -166,12 +166,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, return -ENOMEM; } - if (llite_root) { - err = ldebugfs_register_mountpoint(llite_root, sb, dt, md); - if (err < 0) - CERROR("could not register mount in /lustre/llite\n"); - } - /* indicate the features supported by this client */ data->ocd_connect_flags = OBD_CONNECT_IBITS| OBD_CONNECT_NODEVOH | OBD_CONNECT_ATTRFID | @@ -552,6 +546,15 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, kfree(data); kfree(osfs); + if (llite_root) { + err = ldebugfs_register_mountpoint(llite_root, sb, dt, md); + if (err < 0) { + CERROR("%s: could not register mount in debugfs: " + "rc = %d\n", ll_get_fsname(sb, NULL, 0), err); + err = 0; + } + } + return err; out_root: iput(root); @@ -570,7 +573,6 @@ out_md: out: kfree(data); kfree(osfs); - ldebugfs_unregister_mountpoint(sbi); return err; } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/18] staging: lustre: llite: cancel open lock before closing file
From: Jinshan Xiong In error handling path of ll_lease_open(), och has already been freed in ll_close_inode_openhandle() so the sequence of cancel open lock and close open handle need adjusting. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3647 Reviewed-on: http://review.whamcloud.com/7346 Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/file.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 000ea58..ac17360 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -875,16 +875,19 @@ ll_lease_open(struct inode *inode, struct file *file, fmode_t fmode, return och; out_close: - rc2 = ll_close_inode_openhandle(sbi->ll_md_exp, inode, och, NULL); - if (rc2) - CERROR("Close openhandle returned %d\n", rc2); - - /* cancel open lock */ + /* Cancel open lock */ if (it.d.lustre.it_lock_mode != 0) { ldlm_lock_decref_and_cancel(&och->och_lease_handle, it.d.lustre.it_lock_mode); it.d.lustre.it_lock_mode = 0; + och->och_lease_handle.cookie = 0ULL; } + rc2 = ll_close_inode_openhandle(sbi->ll_md_exp, inode, och, NULL); + if (rc2 < 0) + CERROR("%s: error closing file "DFID": %d\n", + ll_get_fsname(inode->i_sb, NULL, 0), + PFID(&ll_i2info(inode)->lli_fid), rc2); + och = NULL; /* och has been freed in ll_close_inode_openhandle() */ out_release_it: ll_intent_release(&it); out: -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/18] staging: lustre: llite: use 64bits flags in ll_lov_setea()
From: Niu Yawei In ll_lov_setea(), setting MDS_OPEN_HAS_OBJS to an int flags will result in the flags being overflowed. Signed-off-by: Niu Yawei Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3744 Reviewed-on: http://review.whamcloud.com/7312 Reviewed-by: Emoly Liu Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/file.c |7 --- .../staging/lustre/lustre/llite/llite_internal.h |2 +- drivers/staging/lustre/lustre/llite/xattr.c|6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 69b56a8..02b5783 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -1363,7 +1363,8 @@ static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg) } int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry, -int flags, struct lov_user_md *lum, int lum_size) +__u64 flags, struct lov_user_md *lum, +int lum_size) { struct lov_stripe_md *lsm = NULL; struct lookup_intent oit = {.it_op = IT_OPEN, .it_flags = flags}; @@ -1487,7 +1488,7 @@ out: static int ll_lov_setea(struct inode *inode, struct file *file, unsigned long arg) { - int flags = MDS_OPEN_HAS_OBJS | FMODE_WRITE; + __u64flags = MDS_OPEN_HAS_OBJS | FMODE_WRITE; struct lov_user_md *lump; int lum_size = sizeof(struct lov_user_md) + sizeof(struct lov_user_ost_data); @@ -1521,7 +1522,7 @@ static int ll_lov_setstripe(struct inode *inode, struct file *file, struct lov_user_md_v1 __user *lumv1p = (void __user *)arg; struct lov_user_md_v3 __user *lumv3p = (void __user *)arg; int lum_size, rc; - int flags = FMODE_WRITE; + __u64 flags = FMODE_WRITE; /* first try with v1 which is smaller than v3 */ lum_size = sizeof(struct lov_user_md_v1); diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index ba24f09..ccbb9be 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -745,7 +745,7 @@ struct posix_acl *ll_get_acl(struct inode *inode, int type); int ll_inode_permission(struct inode *inode, int mask); int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry, -int flags, struct lov_user_md *lum, +__u64 flags, struct lov_user_md *lum, int lum_size); int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, struct lov_mds_md **lmm, int *lmm_size, diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index b68dcc9..6282478 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -243,12 +243,12 @@ int ll_setxattr(struct dentry *dentry, const char *name, lump->lmm_stripe_offset = -1; if (lump && S_ISREG(inode->i_mode)) { - int flags = FMODE_WRITE; + __u64 it_flags = FMODE_WRITE; int lum_size = (lump->lmm_magic == LOV_USER_MAGIC_V1) ? sizeof(*lump) : sizeof(struct lov_user_md_v3); - rc = ll_lov_setstripe_ea_info(inode, dentry, flags, lump, - lum_size); + rc = ll_lov_setstripe_ea_info(inode, dentry, it_flags, + lump, lum_size); /* b10667: rc always be 0 here for now */ rc = 0; } else if (S_ISDIR(inode->i_mode)) { -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/18] staging: lustre: libcfs: remove userland comments in libcfs_debug.h
From: Jinshan Xiong Remove comments about userland use. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3647 Reviewed-on: http://review.whamcloud.com/7243 Reviewed-by: John L. Hammond Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_debug.h |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index 98430e7..7472a31 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -85,7 +85,6 @@ struct ptldebug_header { #define PH_FLAG_FIRST_RECORD 1 /* Debugging subsystems (32 bits, non-overlapping) */ -/* keep these in sync with lnet/utils/debug.c and lnet/libcfs/debug.c */ #define S_UNDEFINED0x0001 #define S_MDC 0x0002 #define S_MDS 0x0004 @@ -118,10 +117,8 @@ struct ptldebug_header { #define S_MGS 0x2000 #define S_FID 0x4000 /* b_new_cmd */ #define S_FLD 0x8000 /* b_new_cmd */ -/* keep these in sync with lnet/utils/debug.c and lnet/libcfs/debug.c */ /* Debugging masks (32 bits, non-overlapping) */ -/* keep these in sync with lnet/utils/debug.c and lnet/libcfs/debug.c */ #define D_TRACE0x0001 /* ENTRY/EXIT markers */ #define D_INODE0x0002 #define D_SUPER0x0004 @@ -151,7 +148,6 @@ struct ptldebug_header { #define D_QUOTA0x0400 #define D_SEC 0x0800 #define D_LFSCK0x1000 /* For both OI scrub and LFSCK */ -/* keep these in sync with lnet/{utils,libcfs}/debug.c */ #define D_HSM D_TRACE -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/18] staging: lustre: osc: Lustre returns EINTR from writes when SA_RESTART is set
When Lustre is in a read or write system call and receives a SIGALRM, it will return EINTR if interrupted in osc_enter_cache. This prevents the system call from being restarted if SA_RESTART is set in the handler. This patch changes behavior in this location to return ERESTARTSYS when a signal arrives during the call to l_wait_event. Signed-off-by: Patrick Farrell Signed-off-by: James Simmons ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-3581 Reviewed-on: http://review.whamcloud.com/7002 Reviewed-by: Rahul Deshmukh Reviewed-by: Cory Spitz Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/osc/osc_cache.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index f09b89d..956d57b 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -1626,11 +1626,22 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli, /* l_wait_event is interrupted by signal, or timed out */ if (rc < 0) { - if (rc == -ETIMEDOUT) { + switch (rc) { + case -ETIMEDOUT: OSC_DUMP_GRANT(D_ERROR, cli, "try to reserve %d.\n", bytes); osc_extent_tree_dump(D_ERROR, osc); rc = -EDQUOT; + break; + case -EINTR: + /* Ensures restartability - LU-3581 */ + rc = -ERESTARTSYS; + break; + default: + CDEBUG(D_CACHE, "%s: event for cache space @ %p never arrived due to %d\n", + cli->cl_import->imp_obd->obd_name, + &ocw, rc); + break; } list_del_init(&ocw.ocw_entry); goto out; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/18] staging: lustre: libcfs: create array of debug names
From: Jinshan Xiong Instead of a using a growing case statement to handle more debugging options create a array to map debug flags to string names. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3647 Reviewed-on: http://review.whamcloud.com/7243 Reviewed-by: John L. Hammond Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_debug.h | 13 ++ drivers/staging/lustre/lnet/libcfs/debug.c | 126 ++-- 2 files changed, 23 insertions(+), 116 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index 7472a31..5e60c6f 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -118,6 +118,12 @@ struct ptldebug_header { #define S_FID 0x4000 /* b_new_cmd */ #define S_FLD 0x8000 /* b_new_cmd */ +#define LIBCFS_DEBUG_SUBSYS_NAMES {\ + "undefined", "mdc", "mds", "osc", "ost", "class", "log",\ + "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", "", \ + "echo", "ldlm", "lov", "lquota", "osd", "lfsck", "", "", "lmv", \ + "", "sec", "gss", "", "mgc", "mgs", "fid", "fld", NULL } + /* Debugging masks (32 bits, non-overlapping) */ #define D_TRACE0x0001 /* ENTRY/EXIT markers */ #define D_INODE0x0002 @@ -151,6 +157,13 @@ struct ptldebug_header { #define D_HSM D_TRACE +#define LIBCFS_DEBUG_MASKS_NAMES { \ + "trace", "inode", "super", "ext2", "malloc", "cache", "info", \ + "ioctl", "neterror", "net", "warning", "buffs", "other",\ + "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \ + "ha", "rpctrace", "vfstrace", "reada", "mmap", "config",\ + "console", "quota", "sec", "lfsck", "hsm", NULL } + #define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE) #ifndef DEBUG_SUBSYSTEM diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index c90e510..4753c32 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -232,130 +232,24 @@ int libcfs_panic_in_progress; static const char * libcfs_debug_subsys2str(int subsys) { - switch (1 << subsys) { - default: + static const char *libcfs_debug_subsystems[] = LIBCFS_DEBUG_SUBSYS_NAMES; + + if (subsys >= ARRAY_SIZE(libcfs_debug_subsystems)) return NULL; - case S_UNDEFINED: - return "undefined"; - case S_MDC: - return "mdc"; - case S_MDS: - return "mds"; - case S_OSC: - return "osc"; - case S_OST: - return "ost"; - case S_CLASS: - return "class"; - case S_LOG: - return "log"; - case S_LLITE: - return "llite"; - case S_RPC: - return "rpc"; - case S_LNET: - return "lnet"; - case S_LND: - return "lnd"; - case S_PINGER: - return "pinger"; - case S_FILTER: - return "filter"; - case S_ECHO: - return "echo"; - case S_LDLM: - return "ldlm"; - case S_LOV: - return "lov"; - case S_LQUOTA: - return "lquota"; - case S_OSD: - return "osd"; - case S_LFSCK: - return "lfsck"; - case S_LMV: - return "lmv"; - case S_SEC: - return "sec"; - case S_GSS: - return "gss"; - case S_MGC: - return "mgc"; - case S_MGS: - return "mgs"; - case S_FID: - return "fid"; - case S_FLD: - return "fld"; - } + + return libcfs_debug_subsystems[subsys]; } /* libcfs_debug_token2mask() expects the returned string in lower-case */ static const char * libcfs_debug_dbg2str(int debug) { - switch (1 << debug) { - default: + static const char *libcfs_debug_masks[] = LIBCFS_DEBUG_MASKS_NAMES; + + if (debug >= ARRAY_SIZE(libcfs_debug_masks)) return NULL; - case D_TRACE: - return "trace"; - case D_INODE: - return "inode"; - case D_SUPER: - return "super"; - case D_EXT2: - return "ext2"; - case D_MALLOC: - return "malloc"; - case D_CACHE: - return "cache"; - case D_INFO: - return "info"; - case D_IOCTL: - return "ioctl"; - case D_NETERROR: - return "neterror"; - case D
[PATCH] staging: rtl8712: use container_of() instead of LIST_CONTAINOR()
This patch drops the local definition of LIST_CONTAINOR(), and uses container_of() instead of it. Signed-off-by: Geliang Tang --- drivers/staging/rtl8712/osdep_service.h | 3 --- drivers/staging/rtl8712/rtl8712_recv.c| 10 +- drivers/staging/rtl8712/rtl8712_xmit.c| 8 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 12 ++-- drivers/staging/rtl8712/rtl871x_mlme.c| 12 ++-- drivers/staging/rtl8712/rtl871x_recv.c| 2 +- drivers/staging/rtl8712/rtl871x_sta_mgt.c | 6 +++--- drivers/staging/rtl8712/rtl871x_xmit.c| 2 +- 8 files changed, 26 insertions(+), 29 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 076d508..ad041c9 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -57,9 +57,6 @@ struct__queue { spin_lock_init(&((pqueue)->lock)); \ } while (0) -#define LIST_CONTAINOR(ptr, type, member) \ - ((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member))) - static inline u32 _down_sema(struct semaphore *sema) { if (down_interruptible(sema)) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index d187508..f25b34c 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -204,7 +204,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, pfree_recv_queue = &adapter->recvpriv.free_recv_queue; phead = &defrag_q->queue; plist = phead->next; - prframe = LIST_CONTAINOR(plist, union recv_frame, u); + prframe = container_of(plist, union recv_frame, u.list); list_del_init(&prframe->u.list); pfhdr = &prframe->u.hdr; curfragnum = 0; @@ -219,7 +219,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, plist = &defrag_q->queue; plist = plist->next; while (!end_of_queue_search(phead, plist)) { - pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); + pnextrframe = container_of(plist, union recv_frame, u.list); pnfhdr = &pnextrframe->u.hdr; /*check the fragment sequence (2nd ~n fragment frame) */ if (curfragnum != pnfhdr->attrib.frag_num) { @@ -492,7 +492,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, phead = &ppending_recvframe_queue->queue; plist = phead->next; while (!end_of_queue_search(phead, plist)) { - pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); + pnextrframe = container_of(plist, union recv_frame, u.list); pnextattrib = &pnextrframe->u.hdr.attrib; if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) plist = plist->next; @@ -525,14 +525,14 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, if (list_empty(phead)) return true; - prframe = LIST_CONTAINOR(plist, union recv_frame, u); + prframe = container_of(plist, union recv_frame, u.list); pattrib = &prframe->u.hdr.attrib; preorder_ctrl->indicate_seq = pattrib->seq_num; } /* Prepare indication list and indication. * Check if there is any packet need indicate. */ while (!list_empty(phead)) { - prframe = LIST_CONTAINOR(plist, union recv_frame, u); + prframe = container_of(plist, union recv_frame, u.list); pattrib = &prframe->u.hdr.attrib; if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { plist = plist->next; diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c index b21a60e..7e0b945 100644 --- a/drivers/staging/rtl8712/rtl8712_xmit.c +++ b/drivers/staging/rtl8712/rtl8712_xmit.c @@ -169,8 +169,8 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, xmitframe_phead = &pframe_queue->queue; xmitframe_plist = xmitframe_phead->next; if (!end_of_queue_search(xmitframe_phead, xmitframe_plist)) { - pxmitframe = LIST_CONTAINOR(xmitframe_plist, -struct xmit_frame, list); + pxmitframe = container_of(xmitframe_plist, + struct xmit_frame, list); list_del_init(&pxmitframe->list); ptxservq->qcnt--; phwxmit->txcmdcnt++; @@ -209,8 +209,8 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, sta_phead = &phwxmit->sta_queue->queue; sta_plist = sta_phead->next; while (!end_of_queue_search(sta_phead, sta_plist)) { - ptxservq = LIST_C
[PATCH 2/4] staging: skein: cleanup: fixed blank lines
Added a blank line between functions in skein_block.c and removed unneeded blank lines in skein_api.c and threefish_block.c Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_api.c | 1 - drivers/staging/skein/skein_block.c | 4 +++- drivers/staging/skein/threefish_block.c | 16 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/staging/skein/skein_api.c b/drivers/staging/skein/skein_api.c index 36f849f..e23cb16 100644 --- a/drivers/staging/skein/skein_api.c +++ b/drivers/staging/skein/skein_api.c @@ -165,7 +165,6 @@ int skein_update(struct skein_ctx *ctx, const u8 *msg, break; } return ret; - } int skein_update_bits(struct skein_ctx *ctx, const u8 *msg, diff --git a/drivers/staging/skein/skein_block.c b/drivers/staging/skein/skein_block.c index 64047d7b..0c372be 100644 --- a/drivers/staging/skein/skein_block.c +++ b/drivers/staging/skein/skein_block.c @@ -463,6 +463,7 @@ size_t skein_256_process_block_code_size(void) return ((u8 *) skein_256_process_block_code_size) - ((u8 *) skein_256_process_block); } + unsigned int skein_256_unroll_cnt(void) { return SKEIN_UNROLL_256; @@ -545,7 +546,6 @@ void skein_512_process_block(struct skein_512_ctx *ctx, const u8 *blk_ptr, for (r = 1; r < (SKEIN_UNROLL_512 ? 2 * RCNT : 2); r += (SKEIN_UNROLL_512 ? 2 * SKEIN_UNROLL_512 : 1)) { - R512_8_ROUNDS(0); #if R512_UNROLL_R(1) @@ -614,6 +614,7 @@ size_t skein_512_process_block_code_size(void) return ((u8 *) skein_512_process_block_code_size) - ((u8 *) skein_512_process_block); } + unsigned int skein_512_unroll_cnt(void) { return SKEIN_UNROLL_512; @@ -778,6 +779,7 @@ size_t skein_1024_process_block_code_size(void) return ((u8 *) skein_1024_process_block_code_size) - ((u8 *) skein_1024_process_block); } + unsigned int skein_1024_unroll_cnt(void) { return SKEIN_UNROLL_1024; diff --git a/drivers/staging/skein/threefish_block.c b/drivers/staging/skein/threefish_block.c index e19ac43..5ebc918 100644 --- a/drivers/staging/skein/threefish_block.c +++ b/drivers/staging/skein/threefish_block.c @@ -64,7 +64,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k3 + t2; b0 += b1 + k2; b1 = rol64(b1, 14) ^ b0; @@ -117,7 +116,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k0 + t1; b0 += b1 + k4; b1 = rol64(b1, 14) ^ b0; @@ -170,7 +168,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k2 + t0; b0 += b1 + k1; b1 = rol64(b1, 14) ^ b0; @@ -223,7 +220,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k4 + t2; b0 += b1 + k3; b1 = rol64(b1, 14) ^ b0; @@ -276,7 +272,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k1 + t1; b0 += b1 + k0; b1 = rol64(b1, 14) ^ b0; @@ -329,7 +324,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k3 + t0; b0 += b1 + k2; b1 = rol64(b1, 14) ^ b0; @@ -382,7 +376,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k0 + t2; b0 += b1 + k4; b1 = rol64(b1, 14) ^ b0; @@ -435,7 +428,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input, b2 += b1; b1 = rol64(b1, 32) ^ b2; - b1 += k2 + t1; b0 += b1 + k1; b1 = rol64(b1, 14) ^ b0; @@ -579,7 +571,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k3 + t2; b3 -= k4 + 16; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -648,7 +639,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k1 + t0; b3 -= k2 + 14; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -717,7 +707,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k4 + t1; b3 -= k0 + 12; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -= b3; @@ -786,7 +775,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, u64 *input, b2 -= b3 + k2 + t2; b3 -= k3 + 10; - tmp = b3 ^ b0; b3 = (tmp >> 32) | (tmp << (64 - 32)); b0 -=
[PATCH 3/4] staging: skein: cleanup: remove white space after casts
Clean skein files so that there is no white space after casts. Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_api.c | 2 +- drivers/staging/skein/skein_base.c | 12 ++-- drivers/staging/skein/skein_base.h | 12 ++-- drivers/staging/skein/skein_block.c | 12 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/skein/skein_api.c b/drivers/staging/skein/skein_api.c index e23cb16..cab26e7 100644 --- a/drivers/staging/skein/skein_api.c +++ b/drivers/staging/skein/skein_api.c @@ -209,7 +209,7 @@ int skein_update_bits(struct skein_ctx *ctx, const u8 *msg, /* internal sanity check: there IS a partial byte in the buffer! */ skein_assert(length != 0); /* partial byte bit mask */ - mask = (u8) (1u << (7 - (msg_bit_cnt & 7))); + mask = (u8)(1u << (7 - (msg_bit_cnt & 7))); /* apply bit padding on final byte (in the buffer) */ up[length - 1] = (u8)((up[length - 1] & (0 - mask)) | mask); diff --git a/drivers/staging/skein/skein_base.c b/drivers/staging/skein/skein_base.c index 3e3485c..252bba9 100644 --- a/drivers/staging/skein/skein_base.c +++ b/drivers/staging/skein/skein_base.c @@ -221,7 +221,7 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val) memcpy(x, ctx->x, sizeof(x)); for (i = 0; i * SKEIN_256_BLOCK_BYTES < byte_cnt; i++) { /* build the counter block */ - ((u64 *)ctx->b)[0] = skein_swap64((u64) i); + ((u64 *)ctx->b)[0] = skein_swap64((u64)i); skein_start_new_type(ctx, OUT_FINAL); /* run "counter mode" */ skein_256_process_block(ctx, ctx->b, 1, sizeof(u64)); @@ -448,7 +448,7 @@ int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val) memcpy(x, ctx->x, sizeof(x)); for (i = 0; i * SKEIN_512_BLOCK_BYTES < byte_cnt; i++) { /* build the counter block */ - ((u64 *)ctx->b)[0] = skein_swap64((u64) i); + ((u64 *)ctx->b)[0] = skein_swap64((u64)i); skein_start_new_type(ctx, OUT_FINAL); /* run "counter mode" */ skein_512_process_block(ctx, ctx->b, 1, sizeof(u64)); @@ -670,7 +670,7 @@ int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val) memcpy(x, ctx->x, sizeof(x)); for (i = 0; i * SKEIN_1024_BLOCK_BYTES < byte_cnt; i++) { /* build the counter block */ - ((u64 *)ctx->b)[0] = skein_swap64((u64) i); + ((u64 *)ctx->b)[0] = skein_swap64((u64)i); skein_start_new_type(ctx, OUT_FINAL); /* run "counter mode" */ skein_1024_process_block(ctx, ctx->b, 1, sizeof(u64)); @@ -777,7 +777,7 @@ int skein_256_output(struct skein_256_ctx *ctx, u8 *hash_val) memcpy(x, ctx->x, sizeof(x)); for (i = 0; i * SKEIN_256_BLOCK_BYTES < byte_cnt; i++) { /* build the counter block */ - ((u64 *)ctx->b)[0] = skein_swap64((u64) i); + ((u64 *)ctx->b)[0] = skein_swap64((u64)i); skein_start_new_type(ctx, OUT_FINAL); /* run "counter mode" */ skein_256_process_block(ctx, ctx->b, 1, sizeof(u64)); @@ -814,7 +814,7 @@ int skein_512_output(struct skein_512_ctx *ctx, u8 *hash_val) memcpy(x, ctx->x, sizeof(x)); for (i = 0; i * SKEIN_512_BLOCK_BYTES < byte_cnt; i++) { /* build the counter block */ - ((u64 *)ctx->b)[0] = skein_swap64((u64) i); + ((u64 *)ctx->b)[0] = skein_swap64((u64)i); skein_start_new_type(ctx, OUT_FINAL); /* run "counter mode" */ skein_512_process_block(ctx, ctx->b, 1, sizeof(u64)); @@ -851,7 +851,7 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val) memcpy(x, ctx->x, sizeof(x)); for (i = 0; i * SKEIN_1024_BLOCK_BYTES < byte_cnt; i++) { /* build the counter block */ - ((u64 *)ctx->b)[0] = skein_swap64((u64) i); + ((u64 *)ctx->b)[0] = skein_swap64((u64)i); skein_start_new_type(ctx, OUT_FINAL); /* run "counter mode" */ skein_1024_process_block(ctx, ctx->b, 1, sizeof(u64)); diff --git a/drivers/staging/skein/skein_base.h b/drivers/staging/skein/skein_base.h index 0817897..a6c2758 100644 --- a/drivers/staging/skein/skein_base.h +++ b/drivers/staging/skein/skein_base.h @@ -162,13 +162,13 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val); #define SKEIN_T1_POS_FINAL SKEIN_T1_BIT(127) /* 127 final blk flag */ /* tweak word tweak[1]: flag bit definition(s) */ -#define SKEIN_T1_FLAG_FIRST (((u64) 1) << SKEIN_T1_POS_FIRST) -#define SKEIN_T1_FLAG_FINAL (((u64) 1) << SKEIN_T1_POS_FINAL) -#define SKEIN_T1_FLAG_BIT_PAD (((u64) 1) << SKEIN_T1_POS_BIT_PAD) +#define SKEIN_T1_FLAG_FIRST (((u64)1) << SKEIN_T1_POS_FIRST)
[PATCH 4/4] staging: skein: cleanup: align parentheses
Aligned parentheses to conform to the coding style. Signed-off-by: Manu Kumar --- drivers/staging/skein/skein_base.c| 14 +++--- drivers/staging/skein/skein_generic.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/skein/skein_base.c b/drivers/staging/skein/skein_base.c index 252bba9..f8683e5 100644 --- a/drivers/staging/skein/skein_base.c +++ b/drivers/staging/skein/skein_base.c @@ -205,7 +205,7 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val) /* zero pad b[] if necessary */ if (ctx->h.b_cnt < SKEIN_256_BLOCK_BYTES) memset(&ctx->b[ctx->h.b_cnt], 0, - SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt); + SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt); /* process the final block */ skein_256_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); @@ -432,7 +432,7 @@ int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val) /* zero pad b[] if necessary */ if (ctx->h.b_cnt < SKEIN_512_BLOCK_BYTES) memset(&ctx->b[ctx->h.b_cnt], 0, - SKEIN_512_BLOCK_BYTES - ctx->h.b_cnt); + SKEIN_512_BLOCK_BYTES - ctx->h.b_cnt); /* process the final block */ skein_512_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); @@ -654,7 +654,7 @@ int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val) /* zero pad b[] if necessary */ if (ctx->h.b_cnt < SKEIN_1024_BLOCK_BYTES) memset(&ctx->b[ctx->h.b_cnt], 0, - SKEIN_1024_BLOCK_BYTES - ctx->h.b_cnt); + SKEIN_1024_BLOCK_BYTES - ctx->h.b_cnt); /* process the final block */ skein_1024_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); @@ -702,7 +702,7 @@ int skein_256_final_pad(struct skein_256_ctx *ctx, u8 *hash_val) /* zero pad b[] if necessary */ if (ctx->h.b_cnt < SKEIN_256_BLOCK_BYTES) memset(&ctx->b[ctx->h.b_cnt], 0, - SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt); + SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt); /* process the final block */ skein_256_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); @@ -724,7 +724,7 @@ int skein_512_final_pad(struct skein_512_ctx *ctx, u8 *hash_val) /* zero pad b[] if necessary */ if (ctx->h.b_cnt < SKEIN_512_BLOCK_BYTES) memset(&ctx->b[ctx->h.b_cnt], 0, - SKEIN_512_BLOCK_BYTES - ctx->h.b_cnt); + SKEIN_512_BLOCK_BYTES - ctx->h.b_cnt); /* process the final block */ skein_512_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); @@ -746,7 +746,7 @@ int skein_1024_final_pad(struct skein_1024_ctx *ctx, u8 *hash_val) /* zero pad b[] if necessary */ if (ctx->h.b_cnt < SKEIN_1024_BLOCK_BYTES) memset(&ctx->b[ctx->h.b_cnt], 0, - SKEIN_1024_BLOCK_BYTES - ctx->h.b_cnt); + SKEIN_1024_BLOCK_BYTES - ctx->h.b_cnt); /* process the final block */ skein_1024_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); @@ -861,7 +861,7 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val) n = SKEIN_1024_BLOCK_BYTES; /* "output" the ctr mode bytes */ skein_put64_lsb_first(hash_val + i * SKEIN_1024_BLOCK_BYTES, - ctx->x, n); + ctx->x, n); /* restore the counter mode key for next time */ memcpy(ctx->x, x, sizeof(x)); } diff --git a/drivers/staging/skein/skein_generic.c b/drivers/staging/skein/skein_generic.c index e29b9ab..11f5e53 100644 --- a/drivers/staging/skein/skein_generic.c +++ b/drivers/staging/skein/skein_generic.c @@ -27,7 +27,7 @@ static int skein256_init(struct shash_desc *desc) } static int skein256_update(struct shash_desc *desc, const u8 *data, - unsigned int len) + unsigned int len) { return skein_256_update((struct skein_256_ctx *)shash_desc_ctx(desc), data, len); @@ -62,7 +62,7 @@ static int skein512_init(struct shash_desc *desc) } static int skein512_update(struct shash_desc *desc, const u8 *data, - unsigned int len) + unsigned int len) { return skein_512_update((struct skein_512_ctx *)shash_desc_ctx(desc), data, len); @@ -97,7 +97,7 @@ static int skein1024_init(struct shash_desc *desc) } static int skein1024_update(struct shash_desc *desc, const u8 *data, - unsigned int len) + unsigned int len) { return skein_1024_update((struct skein_1024_ctx *)shash_desc_ctx(desc), data, len); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject
[PATCH 1/3] staging: unisys: visorbus: visorchipset_init clean up gotos
Several error paths were not logging a message to s-Par during failure. Error paths in visorchipset_init() were corrected so that they now all do proper clean-ups. This made it necessary to move the function visorchipset_file_cleanup() above visorchipset_init so it can be referenced. Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchipset.c | 68 +++--- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index afcd291..0583b51 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -2290,16 +2290,25 @@ visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel) return 0; } +static void +visorchipset_file_cleanup(dev_t major_dev) +{ + if (file_cdev.ops) + cdev_del(&file_cdev); + file_cdev.ops = NULL; + unregister_chrdev_region(major_dev, 1); +} + static int visorchipset_init(struct acpi_device *acpi_device) { - int rc = 0; + int err = -ENODEV; u64 addr; uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID; addr = controlvm_get_channel_address(); if (!addr) - return -ENODEV; + goto error; memset(&busdev_notifiers, 0, sizeof(busdev_notifiers)); memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info)); @@ -2307,22 +2316,19 @@ visorchipset_init(struct acpi_device *acpi_device) controlvm_channel = visorchannel_create_with_lock(addr, 0, GFP_KERNEL, uuid); if (!controlvm_channel) - return -ENODEV; + goto error; + if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT( visorchannel_get_header(controlvm_channel))) { initialize_controlvm_payload(); } else { - visorchannel_destroy(controlvm_channel); - controlvm_channel = NULL; - return -ENODEV; + goto error_destroy_channel; } major_dev = MKDEV(visorchipset_major, 0); - rc = visorchipset_file_init(major_dev, &controlvm_channel); - if (rc < 0) { - POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR); - goto cleanup; - } + err = visorchipset_file_init(major_dev, &controlvm_channel); + if (err < 0) + goto error_destroy_payload; memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header)); @@ -2341,27 +2347,33 @@ visorchipset_init(struct acpi_device *acpi_device) visorchipset_platform_device.dev.devt = major_dev; if (platform_device_register(&visorchipset_platform_device) < 0) { POSTCODE_LINUX_2(DEVICE_REGISTER_FAILURE_PC, DIAG_SEVERITY_ERR); - rc = -ENODEV; - goto cleanup; + err = -ENODEV; + goto error_cancel_work; } POSTCODE_LINUX_2(CHIPSET_INIT_SUCCESS_PC, POSTCODE_SEVERITY_INFO); - rc = visorbus_init(); -cleanup: - if (rc) { - POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, rc, -POSTCODE_SEVERITY_ERR); - } - return rc; -} + err = visorbus_init(); + if (err < 0) + goto error_unregister; -static void -visorchipset_file_cleanup(dev_t major_dev) -{ - if (file_cdev.ops) - cdev_del(&file_cdev); - file_cdev.ops = NULL; - unregister_chrdev_region(major_dev, 1); + return 0; + +error_unregister: + platform_device_unregister(&visorchipset_platform_device); + +error_cancel_work: + cancel_delayed_work_sync(&periodic_controlvm_work); + visorchipset_file_cleanup(major_dev); + +error_destroy_payload: + destroy_controlvm_payload_info(&controlvm_payload_info); + +error_destroy_channel: + visorchannel_destroy(controlvm_channel); + +error: + POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, err, POSTCODE_SEVERITY_ERR); + return err; } static int -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: unisys: visorbus: device_epilog: clean up gotos
The away flag is ambiguous, rename it to out and appropriately call the correct goto. Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchipset.c | 36 ++ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 0583b51..a22aec4 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1041,30 +1041,30 @@ device_epilog(struct visor_device *dev_info, bool need_response, bool for_visorbus) { struct visorchipset_busdev_notifiers *notifiers; - bool notified = false; struct controlvm_message_header *pmsg_hdr = NULL; notifiers = &busdev_notifiers; + down(¬ifier_lock); if (!dev_info) { /* relying on a valid passed in response code */ /* be lazy and re-use msg_hdr for this failure, is this ok?? */ pmsg_hdr = msg_hdr; - goto away; + goto out_respond_and_unlock; } if (dev_info->pending_msg_hdr) { /* only non-NULL if dev is still waiting on a response */ response = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT; pmsg_hdr = dev_info->pending_msg_hdr; - goto away; + goto out_respond_and_unlock; } if (need_response) { pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL); if (!pmsg_hdr) { response = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; - goto away; + goto out_respond_and_unlock; } memcpy(pmsg_hdr, msg_hdr, @@ -1072,13 +1072,12 @@ device_epilog(struct visor_device *dev_info, dev_info->pending_msg_hdr = pmsg_hdr; } - down(¬ifier_lock); if (response >= 0) { switch (cmd) { case CONTROLVM_DEVICE_CREATE: if (notifiers->device_create) { (*notifiers->device_create) (dev_info); - notified = true; + goto out_unlock; } break; case CONTROLVM_DEVICE_CHANGESTATE: @@ -1088,7 +1087,7 @@ device_epilog(struct visor_device *dev_info, segment_state_running.operating) { if (notifiers->device_resume) { (*notifiers->device_resume) (dev_info); - notified = true; + goto out_unlock; } } /* ServerNotReady / ServerLost / SegmentStateStandby */ @@ -1100,32 +1099,23 @@ device_epilog(struct visor_device *dev_info, */ if (notifiers->device_pause) { (*notifiers->device_pause) (dev_info); - notified = true; + goto out_unlock; } } break; case CONTROLVM_DEVICE_DESTROY: if (notifiers->device_destroy) { (*notifiers->device_destroy) (dev_info); - notified = true; + goto out_unlock; } break; } } -away: - if (notified) - /* The callback function just called above is responsible -* for calling the appropriate visorchipset_busdev_responders -* function, which will call device_responder() -*/ - ; - else - /* -* Do not kfree(pmsg_hdr) as this is the failure path. -* The success path ('notified') will call the responder -* directly and kfree() there. -*/ - device_responder(cmd, pmsg_hdr, response); + +out_respond_and_unlock: + device_responder(cmd, pmsg_hdr, response); + +out_unlock: up(¬ifier_lock); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: unisys: visornic: convert BUG_ON to dev_err() message
From: Tim Sell The caller of visor_copy_fragsinfo_from_skb() is prepared to log a dev_err() message if it fails (by returning a negative value), so we now just fail in the one occasion where visor_copy_fragsinfo_from_skb() was doing a BUG_ON. There was also a problem before where visor_copy_fragsinfo_from_skb() was returning a negative to indicate error, yet it was declared to return an unsigned value! So obviously that needed correcting too. Signed-off-by: Tim Sell Signed-off-by: David Kershner --- drivers/staging/unisys/visornic/visornic_main.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index 763738d..cd30d0a 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -209,7 +209,7 @@ static void poll_for_irq(unsigned long v); * Return value indicates number of entries filled in frags * Negative values indicate an error. */ -static unsigned int +static int visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen, unsigned int frags_max, struct phys_info frags[]) @@ -269,11 +269,9 @@ visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen, * zero if the frags array is out of room * That should never happen because we * fail above, if count+numfrags > frags_max. -* Given that theres no recovery mechanism from putting -* half a packet in the I/O channel, panic here as this -* should never happen */ - BUG_ON(!count); + if (!count) + return -1; } } if (skb_shinfo(skb)->frag_list) { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: unisys: visorbus: 'unsigned' --> 'unsigned int'
From: Tim Sell Fix as recommended by checkpatch. Signed-off-by: Tim Sell Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchipset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 6187772..9f0ec171 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -66,7 +66,7 @@ static u32 dump_vhba_bus; static int visorchipset_open(struct inode *inode, struct file *file) { - unsigned minor_number = iminor(inode); + unsigned int minor_number = iminor(inode); if (minor_number) return -ENODEV; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: unisys: visorbus: make bus_epilog match device_epilog
The paths in bus_epilog should match device_epilog. Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchipset.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index a22aec4..c1b872c 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -965,7 +965,6 @@ bus_epilog(struct visor_device *bus_info, u32 cmd, struct controlvm_message_header *msg_hdr, int response, bool need_response) { - bool notified = false; struct controlvm_message_header *pmsg_hdr = NULL; down(¬ifier_lock); @@ -1003,32 +1002,20 @@ bus_epilog(struct visor_device *bus_info, case CONTROLVM_BUS_CREATE: if (busdev_notifiers.bus_create) { (*busdev_notifiers.bus_create) (bus_info); - notified = true; + goto out_unlock; } break; case CONTROLVM_BUS_DESTROY: if (busdev_notifiers.bus_destroy) { (*busdev_notifiers.bus_destroy) (bus_info); - notified = true; + goto out_unlock; } break; } } out_respond_and_unlock: - if (notified) - /* The callback function just called above is responsible -* for calling the appropriate visorchipset_busdev_responders -* function, which will call bus_responder() -*/ - ; - else - /* -* Do not kfree(pmsg_hdr) as this is the failure path. -* The success path ('notified') will call the responder -* directly and kfree() there. -*/ - bus_responder(cmd, pmsg_hdr, response); + bus_responder(cmd, pmsg_hdr, response); out_unlock: up(¬ifier_lock); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/3] staging: unisys: clean gotos in visorchipset
This series cleans up some more gotos in the the visorbus driver. David Kershner (3): staging: unisys: visorbus: visorchipset_init clean up gotos staging: unisys: visorbus: device_epilog: clean up gotos staging: unisys: visorbus: make bus_epilog match device_epilog drivers/staging/unisys/visorbus/visorchipset.c | 123 +++-- 1 file changed, 56 insertions(+), 67 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: unisys: visorchannel: remove redundant member size
From: David Binder Removes size member from the visorchannel struct, since it was a duplicate of the nbytes member. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchannel.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index b68a904..4337358 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -40,7 +40,6 @@ struct visorchannel { bool requested; struct channel_header chan_hdr; uuid_le guid; - ulong size; bool needs_lock;/* channel creator knows if more than one */ /* thread will be inserting or removing */ spinlock_t insert_lock; /* protect head writes in chan_hdr */ @@ -134,8 +133,6 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes, } channel->nbytes = channel_bytes; - - channel->size = channel_bytes; channel->guid = guid; return channel; @@ -186,7 +183,7 @@ EXPORT_SYMBOL_GPL(visorchannel_get_physaddr); ulong visorchannel_get_nbytes(struct visorchannel *channel) { - return channel->size; + return channel->nbytes; } EXPORT_SYMBOL_GPL(visorchannel_get_nbytes); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: unisys: visornic: CHECK: Alignment should match open parenthesis
From: Tim Sell Fix 'CHECK: Alignment should match open parenthesis' as recommended by checkpatch. Signed-off-by: Tim Sell Signed-off-by: David Kershner --- drivers/staging/unisys/visornic/visornic_main.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index be0d057..763738d 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -436,8 +436,8 @@ post_skb(struct uiscmdrsp *cmdrsp, cmdrsp->net.type = NET_RCV_POST; cmdrsp->cmdtype = CMD_NET_TYPE; if (visorchannel_signalinsert(devdata->dev->visorchannel, - IOCHAN_TO_IOPART, - cmdrsp)) { + IOCHAN_TO_IOPART, + cmdrsp)) { atomic_inc(&devdata->num_rcvbuf_in_iovm); devdata->chstat.sent_post++; } else { @@ -465,8 +465,8 @@ send_enbdis(struct net_device *netdev, int state, devdata->cmdrsp_rcv->net.type = NET_RCV_ENBDIS; devdata->cmdrsp_rcv->cmdtype = CMD_NET_TYPE; if (visorchannel_signalinsert(devdata->dev->visorchannel, - IOCHAN_TO_IOPART, - devdata->cmdrsp_rcv)) + IOCHAN_TO_IOPART, + devdata->cmdrsp_rcv)) devdata->chstat.sent_enbdis++; } @@ -1647,8 +1647,9 @@ service_resp_queue(struct uiscmdrsp *cmdrsp, struct visornic_devdata *devdata, * the lower watermark for * netif_wake_queue() */ - if (vnic_hit_low_watermark(devdata, - devdata->lower_threshold_net_xmits)) { + if (vnic_hit_low_watermark + (devdata, +devdata->lower_threshold_net_xmits)) { /* enough NET_XMITs completed * so can restart netif queue */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: unisys: fix checkpatch warnings
This series fixes checkpatch warnings in the unisys visorbus and visornic drivers. Tim Sell (4): staging: unisys: visorbus: 'unsigned' --> 'unsigned int' staging: unisys: visorbus: CHECK: Alignment should match open parenthesis staging: unisys: visornic: CHECK: Alignment should match open parenthesis staging: unisys: visornic: convert BUG_ON to dev_err() message drivers/staging/unisys/visorbus/visorchipset.c | 82 ++--- drivers/staging/unisys/visornic/visornic_main.c | 21 +++ 2 files changed, 56 insertions(+), 47 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: unisys: visorbus: CHECK: Alignment should match open parenthesis
From: Tim Sell Fix 'CHECK: Alignment should match open parenthesis' as recommended by checkpatch. Signed-off-by: Tim Sell Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchipset.c | 80 +++--- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 9f0ec171..afcd291 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -530,10 +530,11 @@ static ssize_t toolaction_store(struct device *dev, if (kstrtou8(buf, 10, &tool_action)) return -EINVAL; - ret = visorchannel_write(controlvm_channel, - offsetof(struct spar_controlvm_channel_protocol, -tool_action), - &tool_action, sizeof(u8)); + ret = visorchannel_write + (controlvm_channel, +offsetof(struct spar_controlvm_channel_protocol, + tool_action), +&tool_action, sizeof(u8)); if (ret) return ret; @@ -565,10 +566,11 @@ static ssize_t boottotool_store(struct device *dev, return -EINVAL; efi_spar_indication.boot_to_tool = val; - ret = visorchannel_write(controlvm_channel, - offsetof(struct spar_controlvm_channel_protocol, -efi_spar_ind), &(efi_spar_indication), -sizeof(struct efi_spar_indication)); + ret = visorchannel_write + (controlvm_channel, +offsetof(struct spar_controlvm_channel_protocol, + efi_spar_ind), &(efi_spar_indication), +sizeof(struct efi_spar_indication)); if (ret) return ret; @@ -596,10 +598,11 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr, if (kstrtou32(buf, 10, &error)) return -EINVAL; - ret = visorchannel_write(controlvm_channel, - offsetof(struct spar_controlvm_channel_protocol, -installation_error), - &error, sizeof(u32)); + ret = visorchannel_write + (controlvm_channel, +offsetof(struct spar_controlvm_channel_protocol, + installation_error), +&error, sizeof(u32)); if (ret) return ret; return count; @@ -610,10 +613,11 @@ static ssize_t textid_show(struct device *dev, struct device_attribute *attr, { u32 text_id; - visorchannel_read(controlvm_channel, - offsetof(struct spar_controlvm_channel_protocol, - installation_text_id), - &text_id, sizeof(u32)); + visorchannel_read + (controlvm_channel, +offsetof(struct spar_controlvm_channel_protocol, + installation_text_id), +&text_id, sizeof(u32)); return scnprintf(buf, PAGE_SIZE, "%i\n", text_id); } @@ -626,10 +630,11 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr, if (kstrtou32(buf, 10, &text_id)) return -EINVAL; - ret = visorchannel_write(controlvm_channel, - offsetof(struct spar_controlvm_channel_protocol, -installation_text_id), - &text_id, sizeof(u32)); + ret = visorchannel_write + (controlvm_channel, +offsetof(struct spar_controlvm_channel_protocol, + installation_text_id), +&text_id, sizeof(u32)); if (ret) return ret; return count; @@ -657,10 +662,11 @@ static ssize_t remaining_steps_store(struct device *dev, if (kstrtou16(buf, 10, &remaining_steps)) return -EINVAL; - ret = visorchannel_write(controlvm_channel, - offsetof(struct spar_controlvm_channel_protocol, -installation_remaining_steps), - &remaining_steps, sizeof(u16)); + ret = visorchannel_write + (controlvm_channel, +offsetof(struct spar_controlvm_channel_protocol, + installation_remaining_steps), +&remaining_steps, sizeof(u16)); if (ret) return ret; return count; @@ -1226,8 +1232,9 @@ bus_configure(struct controlvm_message *inmsg, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT; } else { - visorchannel_set_clientpartition(bus_info->visorchannel, - cmd->configure_bus.guest_handle); + visorchannel_set_clientpartition + (bus_info->visorchan
[PATCH 01/14] staging: wilc1000: remove unused hif_drv in host_int_get_ipaddress
This patch removes unused hif_drv in host_int_get_ipaddress. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 1fe811f..168c823 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4157,12 +4157,6 @@ static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx) { int result = 0; struct host_if_msg msg; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/14] staging: wilc1000: remove unused hif_drv in wilc_set_power_mgmt
This patch removes unused hif_drv in wilc_set_power_mgmt. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index a47666c..bfb738a 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3922,12 +3922,6 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout) int result = 0; struct host_if_msg msg; struct power_mgmt_param *pwr_mgmt_info = &msg.body.pwr_mgmt_info; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } if (wilc_wlan_get_num_conn_ifcs(vif->wilc) == 2 && enabled) return 0; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/14] staging: wilc1000: remove unused hif_drv in wilc_setup_ipaddress
This patch removes unused hif_drv in wilc_setup_ipaddress. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 168c823..5cda382 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4131,12 +4131,6 @@ int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx) { int result = 0; struct host_if_msg msg; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/14] staging: wilc1000: remove unused hif_drv in wilc_setup_multicast_filter
This patch removes unused hif_drv in wilc_setup_multicast_filter. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 5cda382..a47666c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3952,12 +3952,6 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled, int result = 0; struct host_if_msg msg; struct set_multicast *multicast_filter_param = &msg.body.multicast_info; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/14] staging: wilc1000: remove unused hif_drv in wilc_del_allstation
This patch removes unused hif_drv in wilc_del_allstation. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 3222a5d..4433f99 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3848,16 +3848,10 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN]) int result = 0; struct host_if_msg msg; struct del_all_sta *del_all_sta_info = &msg.body.del_all_sta_info; - struct host_if_drv *hif_drv = vif->hif_drv; u8 zero_addr[ETH_ALEN] = {0}; int i; u8 assoc_sta = 0; - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } - memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_DEL_ALL_STA; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/14] staging: wilc1000: remove unused hif_drv in wilc_edit_station
This patch removes unused hif_drv in wilc_edit_station. There is no need to checku null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index bfb738a..3222a5d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3889,12 +3889,6 @@ int wilc_edit_station(struct wilc_vif *vif, int result = 0; struct host_if_msg msg; struct add_sta_param *add_sta_info = &msg.body.add_sta_info; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/14] staging: wilc1000: remove unused hif_drv in wilc_set_pmkid_info
This patch removes unused hif_drv in wilc_set_pmkid_info. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d23c8ba..270bb3e 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -2957,14 +2957,8 @@ int wilc_set_pmkid_info(struct wilc_vif *vif, { int result = 0; struct host_if_msg msg; - struct host_if_drv *hif_drv = vif->hif_drv; int i; - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } - memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_KEY; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/14] staging: wilc1000: remove unused hif_drv in wilc_add_station
This patch removes unused hif_drv in wilc_add_station. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 0c4a74e..0d0026e 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3788,12 +3788,6 @@ int wilc_add_station(struct wilc_vif *vif, struct add_sta_param *sta_param) int result = 0; struct host_if_msg msg; struct add_sta_param *add_sta_info = &msg.body.add_sta_info; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/14] staging: wilc1000: remove unused hif_drv in wilc_del_beacon
This patch removes unused hif_drv in wilc_del_beacon. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 270bb3e..2dba954 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3742,12 +3742,6 @@ int wilc_del_beacon(struct wilc_vif *vif) { int result = 0; struct host_if_msg msg; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } msg.id = HOST_IF_MSG_DEL_BEACON; msg.vif = vif; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/14] staging: wilc1000: remove unused hif_drv in wilc_remain_on_channel
This patch removes unused hif_drv in wilc_remain_on_channel. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 0d0026e..8591c00 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3630,12 +3630,6 @@ int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id, { int result = 0; struct host_if_msg msg; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/14] staging: wilc1000: remove unused hif_drv in wilc_set_mac_chnl_num
This patch removes unused hif_drv in wilc_set_mac_chnl_num. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 8591c00..7b28ae5 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3134,12 +3134,6 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel) { int result; struct host_if_msg msg; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_SET_CHANNEL; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/14] staging: wilc1000: remove unused hif_drv in host_int_get_assoc_res_info
This patch removes unused hif_drv in host_int_get_assoc_res_info. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7b28ae5..d23c8ba 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3106,12 +3106,6 @@ static s32 host_int_get_assoc_res_info(struct wilc_vif *vif, { s32 result = 0; struct wid wid; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "Driver is null\n"); - return -EFAULT; - } wid.id = (u16)WID_ASSOC_RES_INFO; wid.type = WID_STR; -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/14] staging: wilc1000: remove unused hif_drv in wilc_add_beacon
This patch removes unused hif_drv in wilc_add_beacon. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2dba954..eb86fd4 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3693,12 +3693,6 @@ int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period, int result = 0; struct host_if_msg msg; struct beacon_attr *beacon_info = &msg.body.beacon_info; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/14] staging: wilc1000: remove unused hif_drv in wilc_del_station
This patch removes unused hif_drv in wilc_del_station. There is no need to check null and print debug log. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4433f99..0c4a74e 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3820,12 +3820,6 @@ int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr) int result = 0; struct host_if_msg msg; struct del_sta *del_sta_info = &msg.body.del_sta_info; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - netdev_err(vif->ndev, "driver is null\n"); - return -EFAULT; - } memset(&msg, 0, sizeof(struct host_if_msg)); -- 2.8.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel