Re: [PATCH] staging: panel: Fixed line over 80 characters long
On Sat, Nov 21, 2015 at 09:26:32AM +0530, Anjali Menon wrote: > Moved the comments to the next line to remove the warning > detected by the checkpatch.pl. > > WARNING: line over 80 characters > > Signed-off-by: Anjali Menon > --- > drivers/staging/panel/panel.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c > index 79ac192..a810f6f 100644 > --- a/drivers/staging/panel/panel.c > +++ b/drivers/staging/panel/panel.c > @@ -947,7 +947,9 @@ static void lcd_clear_fast_s(void) > lcd_send_serial(0x5F); /* R/W=W, RS=1 */ > lcd_send_serial(' ' & 0x0F); > lcd_send_serial((' ' >> 4) & 0x0F); > - usleep_range(40, 100); /* the shortest data takes at least 40 > us */ > + usleep_range(40, 100); > + /* the shortest data takes at least 40 us */ > + usleep_range(40, 100); You introduced one new usleep_range(40, 100). regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/10] staging: wilc1000: sdio/spi: use device print api instead of custom one
This patch use device print api instead of driver defined print. Remove varialbe dPrint as well. String "[wilc sdio]" and "[wilc spi]" are also removed from all the print statment if exist because it shows which device the message is related to. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan_sdio.c | 18 ++-- drivers/staging/wilc1000/linux_wlan_spi.c | 24 +++-- drivers/staging/wilc1000/wilc_sdio.c | 151 +++-- drivers/staging/wilc1000/wilc_spi.c| 142 +-- 4 files changed, 213 insertions(+), 122 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c index ae31f7d..66cdca2 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.c +++ b/drivers/staging/wilc1000/linux_wlan_sdio.c @@ -52,7 +52,7 @@ int wilc_sdio_cmd52(struct wilc *wilc, sdio_cmd52_t *cmd) sdio_release_host(func); if (ret < 0) { - PRINT_ER("wilc_sdio_cmd52..failed, err(%d)\n", ret); + dev_err(&func->dev, "wilc_sdio_cmd52..failed, err(%d)\n", ret); return 0; } return 1; @@ -83,7 +83,7 @@ int wilc_sdio_cmd53(struct wilc *wilc, sdio_cmd53_t *cmd) if (ret < 0) { - PRINT_ER("wilc_sdio_cmd53..failed, err(%d)\n", ret); + dev_err(&func->dev, "wilc_sdio_cmd53..failed, err(%d)\n", ret); return 0; } @@ -102,16 +102,16 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id gpio = GPIO_NUM; } - PRINT_D(INIT_DBG, "Initializing netdev\n"); + dev_dbg(&func->dev, "Initializing netdev\n"); if (wilc_netdev_init(&wilc, &func->dev, HIF_SDIO, gpio, &wilc_hif_sdio)) { - PRINT_ER("Couldn't initialize netdev\n"); + dev_err(&func->dev, "Couldn't initialize netdev\n"); return -1; } sdio_set_drvdata(func, wilc); wilc->dev = &func->dev; - printk("Driver Initializing success\n"); + dev_info(&func->dev, "Driver Initializing success\n"); return 0; } @@ -139,7 +139,7 @@ int wilc_sdio_enable_interrupt(struct wilc *dev) sdio_release_host(func); if (ret < 0) { - PRINT_ER("can't claim sdio_irq, err(%d)\n", ret); + dev_err(&func->dev, "can't claim sdio_irq, err(%d)\n", ret); ret = -EIO; } return ret; @@ -150,16 +150,16 @@ void wilc_sdio_disable_interrupt(struct wilc *dev) struct sdio_func *func = container_of(dev->dev, struct sdio_func, dev); int ret; - PRINT_D(INIT_DBG, "wilc_sdio_disable_interrupt IN\n"); + dev_dbg(&func->dev, "wilc_sdio_disable_interrupt IN\n"); sdio_claim_host(func); ret = sdio_release_irq(func); if (ret < 0) { - PRINT_ER("can't release sdio_irq, err(%d)\n", ret); + dev_err(&func->dev, "can't release sdio_irq, err(%d)\n", ret); } sdio_release_host(func); - PRINT_D(INIT_DBG, "wilc_sdio_disable_interrupt OUT\n"); + dev_info(&func->dev, "wilc_sdio_disable_interrupt OUT\n"); } int wilc_sdio_init(void) diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c index f3ffc9e..01fa6fa 100644 --- a/drivers/staging/wilc1000/linux_wlan_spi.c +++ b/drivers/staging/wilc1000/linux_wlan_spi.c @@ -83,7 +83,7 @@ int wilc_spi_write(struct wilc *wilc, u8 *b, u32 len) return -ENOMEM; tr.rx_buf = r_buffer; - PRINT_D(BUS_DBG, "Request writing %d bytes\n", len); + dev_dbg(&spi->dev, "Request writing %d bytes\n", len); memset(&msg, 0, sizeof(msg)); spi_message_init(&msg); @@ -95,13 +95,17 @@ int wilc_spi_write(struct wilc *wilc, u8 *b, u32 len) ret = spi_sync(spi, &msg); if (ret < 0) { - PRINT_ER("SPI transaction failed\n"); + dev_err(&spi->dev, "SPI transaction failed\n"); } kfree(r_buffer); } else { - PRINT_ER("can't write data with the following length: %d\n", len); - PRINT_ER("FAILED due to NULL buffer or ZERO length check the following length: %d\n", len); + dev_err(&spi->dev, + "can't write data with the following length: %d\n", + len); + dev_err(&spi->dev, + "FAILED due to NULL buffer or ZERO length check the following length: %d\n", + len); ret = -1; } @@ -141,11 +145,13 @@ int wilc_spi_read(struct wilc *wilc, u8 *rb, u32 rlen) ret = spi_sync(spi, &msg); if (ret < 0) { - PRINT_ER("SPI transaction failed\n"); +
[PATCH 02/10] staging: wilc1000: remove wilc_debug_func of hif_init
This patch removes wilc_debug_func of hif_init and remove it's related functions as well because it is not used anymore. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_sdio.c | 2 +- drivers/staging/wilc1000/wilc_spi.c | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wlan.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 30dd7f9..c2c10dd 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -512,7 +512,7 @@ static int sdio_sync(struct wilc *wilc) return 1; } -static int sdio_init(struct wilc *wilc, wilc_debug_func debug_func) +static int sdio_init(struct wilc *wilc) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); sdio_cmd52_t cmd; diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index 2d51748..6032a8f 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -734,7 +734,7 @@ static int wilc_spi_sync(struct wilc *wilc) return 1; } -static int _wilc_spi_init(struct wilc *wilc, wilc_debug_func func) +static int _wilc_spi_init(struct wilc *wilc) { struct spi_device *spi = to_spi_device(wilc->dev); u32 reg; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 0427349..32ecc2d 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1587,7 +1587,7 @@ int wilc_wlan_init(struct net_device *dev) PRINT_D(INIT_DBG, "Initializing WILC_Wlan ...\n"); - if (!wilc->hif_func->hif_init(wilc, wilc_debug)) { + if (!wilc->hif_func->hif_init(wilc)) { ret = -EIO; goto _fail_; } diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 3666453..580e1d6 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -226,7 +226,7 @@ struct rxq_entry_t { / struct wilc; struct wilc_hif_func { - int (*hif_init)(struct wilc *, wilc_debug_func); + int (*hif_init)(struct wilc *); int (*hif_deinit)(struct wilc *); int (*hif_read_reg)(struct wilc *, u32, u32 *); int (*hif_write_reg)(struct wilc *, u32, u32); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/10] staging: wilc1000: linux_wlan_sdio.c: fix checkpatch warning line over 80
This patch fixes checkpatch warning line over 80 characters. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan_sdio.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c index 66cdca2..78e6808 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.c +++ b/drivers/staging/wilc1000/linux_wlan_sdio.c @@ -74,9 +74,11 @@ int wilc_sdio_cmd53(struct wilc *wilc, sdio_cmd53_t *cmd) size = cmd->count; if (cmd->read_write) { /* write */ - ret = sdio_memcpy_toio(func, cmd->address, (void *)cmd->buffer, size); + ret = sdio_memcpy_toio(func, cmd->address, + (void *)cmd->buffer, size); } else {/* read */ - ret = sdio_memcpy_fromio(func, (void *)cmd->buffer, cmd->address, size); + ret = sdio_memcpy_fromio(func, (void *)cmd->buffer, +cmd->address, size); } sdio_release_host(func); @@ -90,7 +92,8 @@ int wilc_sdio_cmd53(struct wilc *wilc, sdio_cmd53_t *cmd) return 1; } -static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) +static int linux_sdio_probe(struct sdio_func *func, + const struct sdio_device_id *id) { struct wilc *wilc; int gpio; @@ -126,7 +129,9 @@ static struct sdio_driver wilc1000_sdio_driver = { .probe = linux_sdio_probe, .remove = linux_sdio_remove, }; -module_driver(wilc1000_sdio_driver, sdio_register_driver, sdio_unregister_driver); +module_driver(wilc1000_sdio_driver, + sdio_register_driver, + sdio_unregister_driver); MODULE_LICENSE("GPL"); int wilc_sdio_enable_interrupt(struct wilc *dev) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/10] staging: wilc1000: wilc_sdio_cmd53: return linux error value
This patch changes return value with linux error value, not 1 or 0. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan_sdio.c | 7 ++- drivers/staging/wilc1000/wilc_sdio.c | 26 -- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c index 64fb81b..a918de9 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.c +++ b/drivers/staging/wilc1000/linux_wlan_sdio.c @@ -83,13 +83,10 @@ int wilc_sdio_cmd53(struct wilc *wilc, sdio_cmd53_t *cmd) sdio_release_host(func); - - if (ret < 0) { + if (ret) dev_err(&func->dev, "wilc_sdio_cmd53..failed, err(%d)\n", ret); - return 0; - } - return 1; + return ret; } static int linux_sdio_probe(struct sdio_func *func, diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 1381a10..24bc6f7 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -138,6 +138,7 @@ _fail_: static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); + int ret; data = cpu_to_le32(data); @@ -171,8 +172,8 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) cmd.count = 4; cmd.buffer = (u8 *)&data; cmd.block_size = g_sdio.block_size; /* johnny : prevent it from setting unexpected value */ - - if (!wilc_sdio_cmd53(wilc, &cmd)) { + ret = wilc_sdio_cmd53(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd53, write reg (%08x)...\n", addr); goto _fail_; @@ -191,7 +192,7 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) struct sdio_func *func = dev_to_sdio_func(wilc->dev); u32 block_size = g_sdio.block_size; sdio_cmd53_t cmd; - int nblk, nleft; + int nblk, nleft, ret; cmd.read_write = 1; if (addr > 0) { @@ -237,7 +238,8 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) if (!sdio_set_func0_csa_address(wilc, addr)) goto _fail_; } - if (!wilc_sdio_cmd53(wilc, &cmd)) { + ret = wilc_sdio_cmd53(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd53 [%x], block send...\n", addr); goto _fail_; @@ -259,7 +261,8 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) if (!sdio_set_func0_csa_address(wilc, addr)) goto _fail_; } - if (!wilc_sdio_cmd53(wilc, &cmd)) { + ret = wilc_sdio_cmd53(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd53 [%x], bytes send...\n", addr); goto _fail_; @@ -276,6 +279,7 @@ _fail_: static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); + int ret; if ((addr >= 0xf0) && (addr <= 0xff)) { sdio_cmd52_t cmd; @@ -305,8 +309,8 @@ static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) cmd.buffer = (u8 *)data; cmd.block_size = g_sdio.block_size; /* johnny : prevent it from setting unexpected value */ - - if (!wilc_sdio_cmd53(wilc, &cmd)) { + ret = wilc_sdio_cmd53(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd53, read reg (%08x)...\n", addr); goto _fail_; @@ -327,7 +331,7 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 *buf, u32 size) struct sdio_func *func = dev_to_sdio_func(wilc->dev); u32 block_size = g_sdio.block_size; sdio_cmd53_t cmd; - int nblk, nleft; + int nblk, nleft, ret; cmd.read_write = 0; if (addr > 0) { @@ -373,7 +377,8 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 *buf, u32 size) if (!sdio_set_func0_csa_address(wilc, addr)) goto _fail_; } - if (!wilc_sdio_cmd53(wilc, &cmd)) { + ret = wilc_sdio_cmd53(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd53 [%x], block read...\n", addr); goto _fail_; @@ -395,7 +400,8 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 *buf, u32 size) if (!sdio_set_func0_csa_address(wilc,
[PATCH 08/10] staging: wilc1000: linux_wlan_spi.c: remove braces for single statement
This patches fixes checkpatch warning: braces {} are not necessary for single statement blocks. Remove some comments also. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan_spi.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c index 01fa6fa..6fcf7b3 100644 --- a/drivers/staging/wilc1000/linux_wlan_spi.c +++ b/drivers/staging/wilc1000/linux_wlan_spi.c @@ -15,7 +15,7 @@ #include "linux_wlan_common.h" #include "wilc_wlan_if.h" -#define USE_SPI_DMA 0 /* johnny add */ +#define USE_SPI_DMA 0 static const struct wilc1000_ops wilc1000_spi_ops; @@ -87,16 +87,13 @@ int wilc_spi_write(struct wilc *wilc, u8 *b, u32 len) memset(&msg, 0, sizeof(msg)); spi_message_init(&msg); -/* [[johnny add */ msg.spi = spi; msg.is_dma_mapped = USE_SPI_DMA; -/* ]] */ spi_message_add_tail(&tr, &msg); ret = spi_sync(spi, &msg); - if (ret < 0) { + if (ret < 0) dev_err(&spi->dev, "SPI transaction failed\n"); - } kfree(r_buffer); } else { @@ -137,16 +134,13 @@ int wilc_spi_read(struct wilc *wilc, u8 *rb, u32 rlen) memset(&msg, 0, sizeof(msg)); spi_message_init(&msg); -/* [[ johnny add */ msg.spi = spi; msg.is_dma_mapped = USE_SPI_DMA; -/* ]] */ spi_message_add_tail(&tr, &msg); ret = spi_sync(spi, &msg); - if (ret < 0) { + if (ret < 0) dev_err(&spi->dev, "SPI transaction failed\n"); - } kfree(t_buffer); } else { dev_err(&spi->dev, @@ -183,9 +177,8 @@ int wilc_spi_write_read(struct wilc *wilc, u8 *wb, u8 *rb, u32 rlen) spi_message_add_tail(&tr, &msg); ret = spi_sync(spi, &msg); - if (ret < 0) { + if (ret < 0) dev_err(&spi->dev, "SPI transaction failed\n"); - } } else { dev_err(&spi->dev, "can't read data with the following length: %u\n", -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/10] staging: wilc1000: linux_wlan_spi.c: fix NULL comparison style
This patch fixes checkpatch CHECK:comparison to NULL could be written "b". Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c index 190243a..6111405 100644 --- a/drivers/staging/wilc1000/linux_wlan_spi.c +++ b/drivers/staging/wilc1000/linux_wlan_spi.c @@ -72,7 +72,7 @@ int wilc_spi_write(struct wilc *wilc, u8 *b, u32 len) int ret; struct spi_message msg; - if (len > 0 && b != NULL) { + if (len > 0 && b) { struct spi_transfer tr = { .tx_buf = b, .len = len, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/10] staging: wilc1000: remove unused functions
This patch removes unused function pointer hif_sync and hif_clear_int, and removes it's related functions sdio_clear_int, sdio_sync, wilc_spi_clear_int and wilc_spi_sync. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_sdio.c | 94 drivers/staging/wilc1000/wilc_spi.c | 60 --- drivers/staging/wilc1000/wilc_wlan.h | 2 - 3 files changed, 156 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index c2c10dd..1381a10 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -130,37 +130,6 @@ _fail_: return 0; } -static int sdio_clear_int(struct wilc *wilc) -{ - struct sdio_func *func = dev_to_sdio_func(wilc->dev); - - if (!g_sdio.irq_gpio) { - /* u32 sts; */ - sdio_cmd52_t cmd; - - cmd.read_write = 0; - cmd.function = 1; - cmd.raw = 0; - cmd.address = 0x4; - cmd.data = 0; - wilc_sdio_cmd52(wilc, &cmd); - - return cmd.data; - } else { - u32 reg; - - if (!sdio_read_reg(wilc, WILC_HOST_RX_CTRL_0, ®)) { - dev_err(&func->dev, "Failed read reg (%08x)...\n", - WILC_HOST_RX_CTRL_0); - return 0; - } - reg &= ~0x1; - sdio_write_reg(wilc, WILC_HOST_RX_CTRL_0, reg); - return 1; - } - -} - / * * Sdio interfaces @@ -451,67 +420,6 @@ static int sdio_deinit(struct wilc *wilc) return 1; } -static int sdio_sync(struct wilc *wilc) -{ - struct sdio_func *func = dev_to_sdio_func(wilc->dev); - u32 reg; - - /** -* Disable power sequencer -**/ - if (!sdio_read_reg(wilc, WILC_MISC, ®)) { - dev_err(&func->dev, "Failed read misc reg...\n"); - return 0; - } - - reg &= ~BIT(8); - if (!sdio_write_reg(wilc, WILC_MISC, reg)) { - dev_err(&func->dev, "Failed write misc reg...\n"); - return 0; - } - - if (g_sdio.irq_gpio) { - u32 reg; - int ret; - - /** -* interrupt pin mux select -**/ - ret = sdio_read_reg(wilc, WILC_PIN_MUX_0, ®); - if (!ret) { - dev_err(&func->dev, "Failed read reg (%08x)...\n", - WILC_PIN_MUX_0); - return 0; - } - reg |= BIT(8); - ret = sdio_write_reg(wilc, WILC_PIN_MUX_0, reg); - if (!ret) { - dev_err(&func->dev, "Failed write reg (%08x)...\n", - WILC_PIN_MUX_0); - return 0; - } - - /** -* interrupt enable -**/ - ret = sdio_read_reg(wilc, WILC_INTR_ENABLE, ®); - if (!ret) { - dev_err(&func->dev, "Failed read reg (%08x)...\n", - WILC_INTR_ENABLE); - return 0; - } - reg |= BIT(16); - ret = sdio_write_reg(wilc, WILC_INTR_ENABLE, reg); - if (!ret) { - dev_err(&func->dev, "Failed write reg (%08x)...\n", - WILC_INTR_ENABLE); - return 0; - } - } - - return 1; -} - static int sdio_init(struct wilc *wilc) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); @@ -950,8 +858,6 @@ const struct wilc_hif_func wilc_hif_sdio = { .hif_write_reg = sdio_write_reg, .hif_block_rx = sdio_read, .hif_block_tx = sdio_write, - .hif_sync = sdio_sync, - .hif_clear_int = sdio_clear_int, .hif_read_int = sdio_read_int, .hif_clear_int_ext = sdio_clear_int_ext, .hif_read_size = sdio_read_size, diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index 6032a8f..f54072b 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -668,21 +668,6 @@ static int _wilc_spi_read(struct wilc *wilc, u32 addr, u8 *buf, u32 size) * / -static int wilc_spi_clear_int(struct wilc *wilc) -{ - struct spi_device *spi = to_spi_device(wilc->dev); - u32 reg; - - if (!wilc_spi_read_reg(wilc, WILC_HOST_RX_CTRL_0, ®)) { - dev_err(&spi->dev, "Failed read reg (%08x)...\n", - WILC_HOST_RX_CTRL_0); - return 0; - } - reg &= ~0x1; - wilc_spi_write_reg(wilc, WILC_HOST_RX_CTRL_0, reg); - return 1; -} - static int _wilc_spi
[PATCH 09/10] staging: wilc1000: linux_wlan_spi.c: add a blank
This patch fixes checkpatch warning: missing a blank like after declarations. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan_spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c index 6fcf7b3..190243a 100644 --- a/drivers/staging/wilc1000/linux_wlan_spi.c +++ b/drivers/staging/wilc1000/linux_wlan_spi.c @@ -79,6 +79,7 @@ int wilc_spi_write(struct wilc *wilc, u8 *b, u32 len) .delay_usecs = 0, }; char *r_buffer = kzalloc(len, GFP_KERNEL); + if (!r_buffer) return -ENOMEM; @@ -127,6 +128,7 @@ int wilc_spi_read(struct wilc *wilc, u8 *rb, u32 rlen) }; char *t_buffer = kzalloc(rlen, GFP_KERNEL); + if (!t_buffer) return -ENOMEM; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/10] staging: wilc1000: linux_wlan_sdio.c: remove braces
This patch fixes checkpatch warning braces{} are not necessary for single statment blocks. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan_sdio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c index 78e6808..64fb81b 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.c +++ b/drivers/staging/wilc1000/linux_wlan_sdio.c @@ -159,9 +159,8 @@ void wilc_sdio_disable_interrupt(struct wilc *dev) sdio_claim_host(func); ret = sdio_release_irq(func); - if (ret < 0) { + if (ret < 0) dev_err(&func->dev, "can't release sdio_irq, err(%d)\n", ret); - } sdio_release_host(func); dev_info(&func->dev, "wilc_sdio_disable_interrupt OUT\n"); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/10] staging: wilc1000: wilc_sdio_cmd52: return linux error value
This patch changes return value with linux error value, not 1 or 0. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan_sdio.c | 6 ++-- drivers/staging/wilc1000/wilc_sdio.c | 51 +++--- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c index a918de9..e25811d 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.c +++ b/drivers/staging/wilc1000/linux_wlan_sdio.c @@ -51,11 +51,9 @@ int wilc_sdio_cmd52(struct wilc *wilc, sdio_cmd52_t *cmd) sdio_release_host(func); - if (ret < 0) { + if (ret) dev_err(&func->dev, "wilc_sdio_cmd52..failed, err(%d)\n", ret); - return 0; - } - return 1; + return ret; } diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 24bc6f7..fd640f1 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -38,6 +38,7 @@ static int sdio_set_func0_csa_address(struct wilc *wilc, u32 adr) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); sdio_cmd52_t cmd; + int ret; /** * Review: BIG ENDIAN @@ -47,21 +48,24 @@ static int sdio_set_func0_csa_address(struct wilc *wilc, u32 adr) cmd.raw = 0; cmd.address = 0x10c; cmd.data = (u8)adr; - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd52, set 0x10c data...\n"); goto _fail_; } cmd.address = 0x10d; cmd.data = (u8)(adr >> 8); - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd52, set 0x10d data...\n"); goto _fail_; } cmd.address = 0x10e; cmd.data = (u8)(adr >> 16); - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd52, set 0x10e data...\n"); goto _fail_; } @@ -75,20 +79,23 @@ static int sdio_set_func0_block_size(struct wilc *wilc, u32 block_size) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); sdio_cmd52_t cmd; + int ret; cmd.read_write = 1; cmd.function = 0; cmd.raw = 0; cmd.address = 0x10; cmd.data = (u8)block_size; - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd52, set 0x10 data...\n"); goto _fail_; } cmd.address = 0x11; cmd.data = (u8)(block_size >> 8); - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd52, set 0x11 data...\n"); goto _fail_; } @@ -108,19 +115,22 @@ static int sdio_set_func1_block_size(struct wilc *wilc, u32 block_size) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); sdio_cmd52_t cmd; + int ret; cmd.read_write = 1; cmd.function = 0; cmd.raw = 0; cmd.address = 0x110; cmd.data = (u8)block_size; - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd52, set 0x110 data...\n"); goto _fail_; } cmd.address = 0x111; cmd.data = (u8)(block_size >> 8); - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd52, set 0x111 data...\n"); goto _fail_; } @@ -150,7 +160,8 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) cmd.raw = 0; cmd.address = addr; cmd.data = data; - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd 52, read reg (%08x) ...\n", addr); goto _fail_; @@ -288,7 +299,8 @@ static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) cmd.function = 0; cmd.raw = 0; cmd.address = addr; - if (!wilc_sdio_cmd52(wilc, &cmd)) { + ret = wilc_sdio_cmd52(wilc, &cmd); + if (ret) { dev_err(&func->dev, "Failed cmd 52, read reg (%08x) ...\n", addr); goto _fail_; @@ -430,7 +442,7 @@ static int sdio_init(struct wilc *wilc) { struct sdio_func *func = dev_to_sdio_func(wi
Re: [PATCH] staging: comedi: Coding style warning fix for block comments
On 22/11/15 19:24, Andy Shevchenko wrote: On Sun, Nov 22, 2015 at 9:19 PM, Jitendra Kumar Khasdev wrote: This patch is to comedilib.h file that fixes up following warnings reported by checkpatch.pl : I) Block comments use * on subsequent lines Signed-off-by: Jitendra Kumar Khasdev --- drivers/staging/comedi/comedilib.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/comedilib.h b/drivers/staging/comedi/comedilib.h index 56baf85..ccbe17b 100644 --- a/drivers/staging/comedi/comedilib.h +++ b/drivers/staging/comedi/comedilib.h @@ -1,20 +1,20 @@ /* -linux/include/comedilib.h I don't think the file name is somehow useful here. To be fair, this patch is merely fixing the comment style, rather than changing the contents. Although I wouldn't mind if this line were changed, especially as the existing pathname is wrong. It could be changed to be just the basename of the header file like this: * comedilib.h which is similar to the header comment in comedidev.h. -header file for kcomedilib Perhaps * Header file for kcomedilib. No objections there. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: Coding style warning fix for block comments
On 22/11/15 19:19, Jitendra Kumar Khasdev wrote: This patch is to comedilib.h file that fixes up following warnings reported by checkpatch.pl : I) Block comments use * on subsequent lines Signed-off-by: Jitendra Kumar Khasdev --- drivers/staging/comedi/comedilib.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) Please could you mention comedilib.h in the Subject line? E.g.: staging: comedi: comedilib.h: Fix block comments It helps to localize the affected area more. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RFC 01/12] staging/android/sync: Support sync points created from dma-fences
From: Tvrtko Ursulin Debug output assumes all sync points are built on top of Android sync points and when we start creating them from dma-fences will NULL ptr deref unless taught about this. Signed-off-by: Tvrtko Ursulin Cc: Maarten Lankhorst Cc: de...@driverdev.osuosl.org Cc: Riley Andrews Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg --- drivers/staging/android/sync_debug.c | 42 +++- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index 91ed2c4..f45d13c 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -82,36 +82,42 @@ static const char *sync_status_str(int status) return "error"; } -static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence) +static void sync_print_pt(struct seq_file *s, struct fence *pt, bool fence) { int status = 1; - struct sync_timeline *parent = sync_pt_parent(pt); - if (fence_is_signaled_locked(&pt->base)) - status = pt->base.status; + if (fence_is_signaled_locked(pt)) + status = pt->status; seq_printf(s, " %s%spt %s", - fence ? parent->name : "", + fence && pt->ops->get_timeline_name ? + pt->ops->get_timeline_name(pt) : "", fence ? "_" : "", sync_status_str(status)); if (status <= 0) { struct timespec64 ts64 = - ktime_to_timespec64(pt->base.timestamp); + ktime_to_timespec64(pt->timestamp); seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec); } - if (parent->ops->timeline_value_str && - parent->ops->pt_value_str) { + if ((!fence || pt->ops->timeline_value_str) && + pt->ops->fence_value_str) { char value[64]; + bool success; - parent->ops->pt_value_str(pt, value, sizeof(value)); - seq_printf(s, ": %s", value); - if (fence) { - parent->ops->timeline_value_str(parent, value, - sizeof(value)); - seq_printf(s, " / %s", value); + pt->ops->fence_value_str(pt, value, sizeof(value)); + success = strlen(value); + + if (success) + seq_printf(s, ": %s", value); + + if (success && fence) { + pt->ops->timeline_value_str(pt, value, sizeof(value)); + + if (strlen(value)) + seq_printf(s, " / %s", value); } } @@ -138,7 +144,7 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj) list_for_each(pos, &obj->child_list_head) { struct sync_pt *pt = container_of(pos, struct sync_pt, child_list); - sync_print_pt(s, pt, false); + sync_print_pt(s, &pt->base, false); } spin_unlock_irqrestore(&obj->child_list_lock, flags); } @@ -153,11 +159,7 @@ static void sync_print_fence(struct seq_file *s, struct sync_fence *fence) sync_status_str(atomic_read(&fence->status))); for (i = 0; i < fence->num_fences; ++i) { - struct sync_pt *pt = - container_of(fence->cbs[i].sync_pt, -struct sync_pt, base); - - sync_print_pt(s, pt, true); + sync_print_pt(s, fence->cbs[i].sync_pt, true); } spin_lock_irqsave(&fence->wq.lock, flags); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RFC 02/12] staging/android/sync: add sync_fence_create_dma
From: Maarten Lankhorst This allows users of dma fences to create a android fence. v2: Added kerneldoc. (Tvrtko Ursulin). Signed-off-by: Maarten Lankhorst Signed-off-by: Tvrtko Ursulin Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Jesse Barnes Cc: de...@driverdev.osuosl.org Cc: Riley Andrews Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg --- drivers/staging/android/sync.c | 13 + drivers/staging/android/sync.h | 12 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..7f0e919 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -188,7 +188,7 @@ static void fence_check_cb_func(struct fence *f, struct fence_cb *cb) } /* TODO: implement a create which takes more that one sync_pt */ -struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt) { struct sync_fence *fence; @@ -199,16 +199,21 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) fence->num_fences = 1; atomic_set(&fence->status, 1); - fence->cbs[0].sync_pt = &pt->base; + fence->cbs[0].sync_pt = pt; fence->cbs[0].fence = fence; - if (fence_add_callback(&pt->base, &fence->cbs[0].cb, - fence_check_cb_func)) + if (fence_add_callback(pt, &fence->cbs[0].cb, fence_check_cb_func)) atomic_dec(&fence->status); sync_fence_debug_add(fence); return fence; } +EXPORT_SYMBOL(sync_fence_create_dma); + +struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +{ + return sync_fence_create_dma(name, &pt->base); +} EXPORT_SYMBOL(sync_fence_create); struct sync_fence *sync_fence_fdget(int fd) diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 61f8a3a..798cd56 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -250,10 +250,20 @@ void sync_pt_free(struct sync_pt *pt); * @pt:sync_pt to add to the fence * * Creates a fence containg @pt. Once this is called, the fence takes - * ownership of @pt. + * a reference on @pt. */ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt); +/** + * sync_fence_create_dma() - creates a sync fence from dma-fence + * @name: name of fence to create + * @pt:dma-fence to add to the fence + * + * Creates a fence containg @pt. Once this is called, the fence takes + * a reference on @pt. + */ +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt); + /* * API for sync_fence consumers */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wlan-ng: (coding style) remove unnecessary blank line before "}"
Fix checkpatch checks: "Blank lines aren't necessary before a close brace '}' " Remove two unnecessary blank lines. Signed-off-by: Christian Colic --- drivers/staging/wlan-ng/cfg80211.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index 8c1e3f0..497e3c9 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -558,7 +558,6 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev, (u8 *)sme->key); if (result) goto exit; - } /* Assume we should set privacy invoked and exclude unencrypted @@ -590,7 +589,6 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev, P80211ENUM_truth_false); if (result) goto exit; - } /* Now do the actual join. Note there is no way that I can -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC 02/12] staging/android/sync: add sync_fence_create_dma
Op 23-11-15 om 12:34 schreef john.c.harri...@intel.com: > From: Maarten Lankhorst > > This allows users of dma fences to create a android fence. > > v2: Added kerneldoc. (Tvrtko Ursulin). > > Signed-off-by: Maarten Lankhorst > Signed-off-by: Tvrtko Ursulin > Cc: Maarten Lankhorst > Cc: Daniel Vetter > Cc: Jesse Barnes > Cc: de...@driverdev.osuosl.org > Cc: Riley Andrews > Cc: Greg Kroah-Hartman > Cc: Arve Hjønnevåg > --- > drivers/staging/android/sync.c | 13 + > drivers/staging/android/sync.h | 12 +++- > 2 files changed, 20 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c > index f83e00c..7f0e919 100644 > --- a/drivers/staging/android/sync.c > +++ b/drivers/staging/android/sync.c > @@ -188,7 +188,7 @@ static void fence_check_cb_func(struct fence *f, struct > fence_cb *cb) > } > > /* TODO: implement a create which takes more that one sync_pt */ > -struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) > +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt) > { > struct sync_fence *fence; > > @@ -199,16 +199,21 @@ struct sync_fence *sync_fence_create(const char *name, > struct sync_pt *pt) > fence->num_fences = 1; > atomic_set(&fence->status, 1); > > - fence->cbs[0].sync_pt = &pt->base; > + fence->cbs[0].sync_pt = pt; > fence->cbs[0].fence = fence; > - if (fence_add_callback(&pt->base, &fence->cbs[0].cb, > -fence_check_cb_func)) > + if (fence_add_callback(pt, &fence->cbs[0].cb, fence_check_cb_func)) > atomic_dec(&fence->status); > > sync_fence_debug_add(fence); > > return fence; > } > +EXPORT_SYMBOL(sync_fence_create_dma); > + > +struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) > +{ > + return sync_fence_create_dma(name, &pt->base); > +} > EXPORT_SYMBOL(sync_fence_create); > > struct sync_fence *sync_fence_fdget(int fd) > diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h > index 61f8a3a..798cd56 100644 > --- a/drivers/staging/android/sync.h > +++ b/drivers/staging/android/sync.h > @@ -250,10 +250,20 @@ void sync_pt_free(struct sync_pt *pt); > * @pt: sync_pt to add to the fence > * > * Creates a fence containg @pt. Once this is called, the fence takes > - * ownership of @pt. > + * a reference on @pt. > */ > struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt); No it doesn't. > +/** > + * sync_fence_create_dma() - creates a sync fence from dma-fence > + * @name:name of fence to create > + * @pt: dma-fence to add to the fence > + * > + * Creates a fence containg @pt. Once this is called, the fence takes > + * a reference on @pt. > + */ No it doesn't. > +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt); > + > /* > * API for sync_fence consumers > */ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC 01/12] staging/android/sync: Support sync points created from dma-fences
Op 23-11-15 om 12:34 schreef john.c.harri...@intel.com: > From: Tvrtko Ursulin > > Debug output assumes all sync points are built on top of Android sync points > and when we start creating them from dma-fences will NULL ptr deref unless > taught about this. > > Signed-off-by: Tvrtko Ursulin > Cc: Maarten Lankhorst > Cc: de...@driverdev.osuosl.org > Cc: Riley Andrews > Cc: Greg Kroah-Hartman > Cc: Arve Hjønnevåg > Could this be upstreamed already? It makes the second patch possible and doesn't break current staging.. Signed-off-by: Maarten Lankhorst ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Intel-gfx] [RFC 01/12] staging/android/sync: Support sync points created from dma-fences
Hi, On 23/11/15 11:34, john.c.harri...@intel.com wrote: From: Tvrtko Ursulin This is actually Maarten's patch, I guess authorship got lost over time moving through different trees. Tvrtko Debug output assumes all sync points are built on top of Android sync points and when we start creating them from dma-fences will NULL ptr deref unless taught about this. Signed-off-by: Tvrtko Ursulin Cc: Maarten Lankhorst Cc: de...@driverdev.osuosl.org Cc: Riley Andrews Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg --- drivers/staging/android/sync_debug.c | 42 +++- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index 91ed2c4..f45d13c 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -82,36 +82,42 @@ static const char *sync_status_str(int status) return "error"; } -static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence) +static void sync_print_pt(struct seq_file *s, struct fence *pt, bool fence) { int status = 1; - struct sync_timeline *parent = sync_pt_parent(pt); - if (fence_is_signaled_locked(&pt->base)) - status = pt->base.status; + if (fence_is_signaled_locked(pt)) + status = pt->status; seq_printf(s, " %s%spt %s", - fence ? parent->name : "", + fence && pt->ops->get_timeline_name ? + pt->ops->get_timeline_name(pt) : "", fence ? "_" : "", sync_status_str(status)); if (status <= 0) { struct timespec64 ts64 = - ktime_to_timespec64(pt->base.timestamp); + ktime_to_timespec64(pt->timestamp); seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec); } - if (parent->ops->timeline_value_str && - parent->ops->pt_value_str) { + if ((!fence || pt->ops->timeline_value_str) && + pt->ops->fence_value_str) { char value[64]; + bool success; - parent->ops->pt_value_str(pt, value, sizeof(value)); - seq_printf(s, ": %s", value); - if (fence) { - parent->ops->timeline_value_str(parent, value, - sizeof(value)); - seq_printf(s, " / %s", value); + pt->ops->fence_value_str(pt, value, sizeof(value)); + success = strlen(value); + + if (success) + seq_printf(s, ": %s", value); + + if (success && fence) { + pt->ops->timeline_value_str(pt, value, sizeof(value)); + + if (strlen(value)) + seq_printf(s, " / %s", value); } } @@ -138,7 +144,7 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj) list_for_each(pos, &obj->child_list_head) { struct sync_pt *pt = container_of(pos, struct sync_pt, child_list); - sync_print_pt(s, pt, false); + sync_print_pt(s, &pt->base, false); } spin_unlock_irqrestore(&obj->child_list_lock, flags); } @@ -153,11 +159,7 @@ static void sync_print_fence(struct seq_file *s, struct sync_fence *fence) sync_status_str(atomic_read(&fence->status))); for (i = 0; i < fence->num_fences; ++i) { - struct sync_pt *pt = - container_of(fence->cbs[i].sync_pt, -struct sync_pt, base); - - sync_print_pt(s, pt, true); + sync_print_pt(s, fence->cbs[i].sync_pt, true); } spin_lock_irqsave(&fence->wq.lock, flags); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC 02/12] staging/android/sync: add sync_fence_create_dma
On 23/11/2015 13:27, Maarten Lankhorst wrote: Op 23-11-15 om 12:34 schreef john.c.harri...@intel.com: From: Maarten Lankhorst This allows users of dma fences to create a android fence. v2: Added kerneldoc. (Tvrtko Ursulin). Signed-off-by: Maarten Lankhorst Signed-off-by: Tvrtko Ursulin Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Jesse Barnes Cc: de...@driverdev.osuosl.org Cc: Riley Andrews Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg --- drivers/staging/android/sync.c | 13 + drivers/staging/android/sync.h | 12 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..7f0e919 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -188,7 +188,7 @@ static void fence_check_cb_func(struct fence *f, struct fence_cb *cb) } /* TODO: implement a create which takes more that one sync_pt */ -struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt) { struct sync_fence *fence; @@ -199,16 +199,21 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) fence->num_fences = 1; atomic_set(&fence->status, 1); - fence->cbs[0].sync_pt = &pt->base; + fence->cbs[0].sync_pt = pt; fence->cbs[0].fence = fence; - if (fence_add_callback(&pt->base, &fence->cbs[0].cb, - fence_check_cb_func)) + if (fence_add_callback(pt, &fence->cbs[0].cb, fence_check_cb_func)) atomic_dec(&fence->status); sync_fence_debug_add(fence); return fence; } +EXPORT_SYMBOL(sync_fence_create_dma); + +struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +{ + return sync_fence_create_dma(name, &pt->base); +} EXPORT_SYMBOL(sync_fence_create); struct sync_fence *sync_fence_fdget(int fd) diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 61f8a3a..798cd56 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -250,10 +250,20 @@ void sync_pt_free(struct sync_pt *pt); * @pt: sync_pt to add to the fence * * Creates a fence containg @pt. Once this is called, the fence takes - * ownership of @pt. + * a reference on @pt. */ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt); No it doesn't. +/** + * sync_fence_create_dma() - creates a sync fence from dma-fence + * @name: name of fence to create + * @pt:dma-fence to add to the fence + * + * Creates a fence containg @pt. Once this is called, the fence takes + * a reference on @pt. + */ No it doesn't. This is your patch isn't it? Or is this something Tvrtko added on the way past? Either way, what should the correct description be? It takes a copy of the pointer to 'pt'. Is the comment meaning a reference in the sense of 'pass by reference', i.e. a pointer? But you are meaning a reference in the sense of incrementing a usage count? +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt); + /* * API for sync_fence consumers */ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: wilc1000: Fix typo in linux_wlan.c
This patch fix some spelling typo in wilc1000.c. Signed-off-by: Masanari Iida --- drivers/staging/wilc1000/linux_wlan.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 086f1db..dc98ccb 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -130,7 +130,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event dev = (struct net_device *)dev_iface->ifa_dev->dev; if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) { - PRINT_D(GENERIC_DBG, "No Wireless registerd\n"); + PRINT_D(GENERIC_DBG, "No Wireless registered\n"); return NOTIFY_DONE; } priv = wiphy_priv(dev->ieee80211_ptr->wiphy); @@ -346,7 +346,7 @@ struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header) !memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN)) return wilc->vif[i].ndev; - PRINT_INFO(INIT_DBG, "Invalide handle\n"); + PRINT_INFO(INIT_DBG, "Invalid handle\n"); for (i = 0; i < 25; i++) PRINT_D(INIT_DBG, "%02x ", mac_header[i]); bssid = mac_header + 18; @@ -500,13 +500,13 @@ int linux_wlan_get_firmware(struct net_device *dev) #ifdef WILC_SDIO if (request_firmware(&wilc_firmware, firmware, &wilc->wilc_sdio_func->dev) != 0) { - PRINT_ER("%s - firmare not available\n", firmware); + PRINT_ER("%s - firmware not available\n", firmware); ret = -1; goto _fail_; } #else if (request_firmware(&wilc_firmware, firmware, &wilc->wilc_spidev->dev) != 0) { - PRINT_ER("%s - firmare not available\n", firmware); + PRINT_ER("%s - firmware not available\n", firmware); ret = -1; goto _fail_; } @@ -1155,19 +1155,19 @@ static void wilc_set_multicast_list(struct net_device *dev) dev->mc.count); if (dev->flags & IFF_PROMISC) { - PRINT_D(INIT_DBG, "Set promiscuous mode ON, retrive all packets\n"); + PRINT_D(INIT_DBG, "Set promiscuous mode ON, retrieve all packets\n"); return; } if ((dev->flags & IFF_ALLMULTI) || (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) { - PRINT_D(INIT_DBG, "Disable multicast filter, retrive all multicast packets\n"); + PRINT_D(INIT_DBG, "Disable multicast filter, retrieve all multicast packets\n"); host_int_setup_multicast_filter(hif_drv, false, 0); return; } if ((dev->mc.count) == 0) { - PRINT_D(INIT_DBG, "Enable multicast filter, retrive directed packets only.\n"); + PRINT_D(INIT_DBG, "Enable multicast filter, retrieve directed packets only.\n"); host_int_setup_multicast_filter(hif_drv, true, 0); return; } @@ -1413,7 +1413,7 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset) skb = dev_alloc_skb(frame_len); if (!skb) { - PRINT_ER("Low memory - packet droped\n"); + PRINT_ER("Low memory - packet dropped\n"); return; } -- 2.6.3.379.g0c83680 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: wilc1000: Fix typo in wilc_msgqueue.h
This patch fix some spelling typo in wilc_msgqueue.h Signed-off-by: Masanari Iida --- drivers/staging/wilc1000/wilc_msgqueue.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index d231c33..d7e0328 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -35,7 +35,7 @@ typedef struct __MessageQueue_struct { * any other message queue having the same name in the system * @param[in,out] pHandle handle to the message queue object * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating sucess/failure + * @returnError code indicating success/failure * @authorsyounan * @date 30 Aug 2010 * @version 1.0 @@ -44,7 +44,7 @@ int wilc_mq_create(WILC_MsgQueueHandle *pHandle); /*! * @brief Sends a message - * @details Sends a message, this API will block unil the message is + * @details Sends a message, this API will block until the message is * actually sent or until it is timedout (as long as the feature * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout * is not set to WILC_OS_INFINITY), zero timeout is a valid value @@ -52,7 +52,7 @@ int wilc_mq_create(WILC_MsgQueueHandle *pHandle); * @param[in] pvSendBuffer pointer to the data to send * @param[in] u32SendBufferSize the size of the data to send * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating sucess/failure + * @returnError code indicating success/failure * @authorsyounan * @date 30 Aug 2010 * @version 1.0 @@ -62,7 +62,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, /*! * @brief Receives a message - * @details Receives a message, this API will block unil a message is + * @details Receives a message, this API will block until a message is * received or until it is timedout (as long as the feature * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout * is not set to WILC_OS_INFINITY), zero timeout is a valid value @@ -71,7 +71,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, * @param[in] u32RecvBufferSize the size of the receive buffer * @param[out]pu32ReceivedLength the length of received data * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating sucess/failure + * @returnError code indicating success/failure * @authorsyounan * @date 30 Aug 2010 * @version 1.0 @@ -84,7 +84,7 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, * @brief Destroys an existing Message queue * @param[in] pHandle handle to the message queue object * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating sucess/failure + * @returnError code indicating success/failure * @authorsyounan * @date 30 Aug 2010 * @version 1.0 -- 2.6.3.379.g0c83680 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: wilc1000: Fix typo in wilc_wfi_cfgoperations.c
This patch fix some spelling typo in wilc_wfi_cfgoperations.c Signed-off-by: Masanari Iida --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 34 +++ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 6f40522..ee09d56 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -590,7 +590,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, } if (bNeedScanRefresh) { - /*Also, refrsh DIRECT- results if */ + /*Also, refresh DIRECT- results if */ refresh_scan(priv, 1, true); } @@ -1407,7 +1407,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, kfree(g_key_gtk_params.seq); g_key_gtk_params.seq = NULL; - /*Reset WILC_CHANGING_VIR_IF register to allow adding futrue keys to CE H/W*/ + /*Reset WILC_CHANGING_VIR_IF register to allow adding future keys to CE H/W*/ set_machw_change_vir_if(netdev, false); } @@ -1605,7 +1605,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, static int change_bss(struct wiphy *wiphy, struct net_device *dev, struct bss_parameters *params) { - PRINT_D(CFG80211_DBG, "Changing Bss parametrs\n"); + PRINT_D(CFG80211_DBG, "Changing Bss parameters\n"); return 0; } @@ -1743,7 +1743,7 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev, if (!memcmp(pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid, ETH_ALEN)) { /*If bssid is found, reset the values*/ - PRINT_D(CFG80211_DBG, "Reseting PMKID values\n"); + PRINT_D(CFG80211_DBG, "Resetting PMKID values\n"); memset(&priv->pmkid_list.pmkidlist[i], 0, sizeof(struct host_if_pmkid)); break; } @@ -1923,7 +1923,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size) /* Get WILC header */ memcpy(&header, (buff - HOST_HDR_OFFSET), HOST_HDR_OFFSET); - /* The packet offset field conain info about what type of managment frame */ + /* The packet offset field contain info about what type of management frame */ /* we are dealing with and ack status */ pkt_offset = GET_PKT_OFFSET(header); @@ -2001,7 +2001,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size) if ((buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_RSP) && (bWilc_ie)) { - PRINT_D(GENERIC_DBG, "Sending P2P to host without extra elemnt\n"); + PRINT_D(GENERIC_DBG, "Sending P2P to host without extra element\n"); /* extra attribute for sig_dbm: signal strength in mBm, or 0 if unknown */ cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0); return; @@ -2283,7 +2283,7 @@ static int mgmt_tx(struct wiphy *wiphy, if (u8P2Plocalrandom > u8P2Precvrandom) { PRINT_D(GENERIC_DBG, "LOCAL WILL BE GO LocaRand=%02x RecvRand %02x\n", u8P2Plocalrandom, u8P2Precvrandom); - /*Search for the p2p information information element , after the Public action subtype theres a byte for teh dialog token, skip that*/ + /*Search for the p2p information information element , after the Public action subtype theres a byte for the dialog token, skip that*/ for (i = P2P_PUB_ACTION_SUBTYPE + 2; i < len; i++) { if (buf[i] == P2PELEM_ATTR_ID && !(memcmp(u8P2P_oui, &buf[i + 2], 4))) { if (buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_REQ || buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_RSP) @@ -2546,7 +2546,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, g_obtainingIP = false; del_timer(&hDuringIpTimer); PRINT_D(GENERIC_DBG, "Changing virtual interface, enable scan\n"); - /*Set WILC_CHANGING_VIR_IF register to disallow adding futrue keys to CE H/W*/ +
[PATCH 2/4] staging: wilc1000: Fix typo in host_interface.c
This patch fix spelling typo in host_interface.c Signed-off-by: Masanari Iida --- drivers/staging/wilc1000/host_interface.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d5b7725..b9f9541 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -581,7 +581,7 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv, wid_list[wid_cnt].size = sizeof(char); hif_drv->cfg_values.power_mgmt_mode = (u8)cfg_param_attr->cfg_attr_info.power_mgmt_mode; } else { - PRINT_ER("Invalide power mode\n"); + PRINT_ER("Invalid power mode\n"); result = -EINVAL; goto ERRORHANDLER; } @@ -655,7 +655,7 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv, wid_list[wid_cnt].size = sizeof(char); hif_drv->cfg_values.preamble_type = cfg_param_attr->cfg_attr_info.preamble_type; } else { - PRINT_ER("Preamle Range(0~2) over\n"); + PRINT_ER("Preamble Range(0~2) over\n"); result = -EINVAL; goto ERRORHANDLER; } @@ -844,7 +844,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv, } if (g_obtainingIP || connecting) { - PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n"); + PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP addresses is obtained\n"); PRINT_ER("Don't do obss scan\n"); result = -EBUSY; goto ERRORHANDLER; @@ -924,7 +924,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv, get_id_from_handler(hif_drv)); if (result) - PRINT_ER("Failed to send scan paramters config packet\n"); + PRINT_ER("Failed to send scan parameters config packet\n"); else PRINT_D(HOSTINF_DBG, "Successfully sent SCAN params config packet\n"); @@ -1379,7 +1379,7 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv) result = send_config_pkt(SET_CFG, &wid, 1, get_id_from_handler(hif_drv)); if (result) - PRINT_ER("Failed to send dissconect config packet\n"); + PRINT_ER("Failed to send disconnect config packet\n"); hif_drv->usr_conn_req.ssid_len = 0; kfree(hif_drv->usr_conn_req.pu8ssid); @@ -1529,12 +1529,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv, u8MacStatus = pstrRcvdGnrlAsyncInfo->buffer[7]; u8MacStatusReasonCode = pstrRcvdGnrlAsyncInfo->buffer[8]; u8MacStatusAdditionalInfo = pstrRcvdGnrlAsyncInfo->buffer[9]; - PRINT_INFO(HOSTINF_DBG, "Recieved MAC status = %d with Reason = %d , Info = %d\n", u8MacStatus, u8MacStatusReasonCode, u8MacStatusAdditionalInfo); + PRINT_INFO(HOSTINF_DBG, "Received MAC status = %d with Reason = %d , Info = %d\n", u8MacStatus, u8MacStatusReasonCode, u8MacStatusAdditionalInfo); if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) { u32 u32RcvdAssocRespInfoLen; tstrConnectRespInfo *pstrConnectRespInfo = NULL; - PRINT_D(HOSTINF_DBG, "Recieved MAC status = %d with Reason = %d , Code = %d\n", u8MacStatus, u8MacStatusReasonCode, u8MacStatusAdditionalInfo); + PRINT_D(HOSTINF_DBG, "Received MAC status = %d with Reason = %d , Code = %d\n", u8MacStatus, u8MacStatusReasonCode, u8MacStatusAdditionalInfo); memset(&strConnectInfo, 0, sizeof(tstrConnectInfo)); @@ -1998,7 +1998,7 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv) get_id_from_handler(hif_drv)); if (result) { - PRINT_ER("Failed to send dissconect config packet\n"); + PRINT_ER("Failed to send disconnect config packet\n"); } else { tstrDisconnectNotifInfo strDisconnectNotifInfo; @@ -2179,7 +2179,7 @@ s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatis get_id_from_handler(hif_drv)); if (result) - PRINT_ER("Failed to send scan paramters config packet\n"); + PRINT_ER("Failed to send scan parameters config packet\n"); up(&hif_sema_wait_response); return 0; @@ -2206,7 +2206,7 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv, get_id_from_handler(hif_drv)); if (result) { -
Re: [Intel-gfx] [RFC 02/12] staging/android/sync: add sync_fence_create_dma
On 23/11/15 13:38, John Harrison wrote: On 23/11/2015 13:27, Maarten Lankhorst wrote: Op 23-11-15 om 12:34 schreef john.c.harri...@intel.com: From: Maarten Lankhorst This allows users of dma fences to create a android fence. v2: Added kerneldoc. (Tvrtko Ursulin). Signed-off-by: Maarten Lankhorst Signed-off-by: Tvrtko Ursulin Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Jesse Barnes Cc: de...@driverdev.osuosl.org Cc: Riley Andrews Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg --- drivers/staging/android/sync.c | 13 + drivers/staging/android/sync.h | 12 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..7f0e919 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -188,7 +188,7 @@ static void fence_check_cb_func(struct fence *f, struct fence_cb *cb) } /* TODO: implement a create which takes more that one sync_pt */ -struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt) { struct sync_fence *fence; @@ -199,16 +199,21 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) fence->num_fences = 1; atomic_set(&fence->status, 1); -fence->cbs[0].sync_pt = &pt->base; +fence->cbs[0].sync_pt = pt; fence->cbs[0].fence = fence; -if (fence_add_callback(&pt->base, &fence->cbs[0].cb, - fence_check_cb_func)) +if (fence_add_callback(pt, &fence->cbs[0].cb, fence_check_cb_func)) atomic_dec(&fence->status); sync_fence_debug_add(fence); return fence; } +EXPORT_SYMBOL(sync_fence_create_dma); + +struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +{ +return sync_fence_create_dma(name, &pt->base); +} EXPORT_SYMBOL(sync_fence_create); struct sync_fence *sync_fence_fdget(int fd) diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 61f8a3a..798cd56 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -250,10 +250,20 @@ void sync_pt_free(struct sync_pt *pt); * @pt:sync_pt to add to the fence * * Creates a fence containg @pt. Once this is called, the fence takes - * ownership of @pt. + * a reference on @pt. */ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt); No it doesn't. +/** + * sync_fence_create_dma() - creates a sync fence from dma-fence + * @name:name of fence to create + * @pt:dma-fence to add to the fence + * + * Creates a fence containg @pt. Once this is called, the fence takes + * a reference on @pt. + */ No it doesn't. This is your patch isn't it? Or is this something Tvrtko added on the way past? Either way, what should the correct description be? It takes a It is Maarten's patch, I just copied the comment over from one function to another. The one I picked up was https://patchwork.freedesktop.org/patch/38074/, December 2014. copy of the pointer to 'pt'. Is the comment meaning a reference in the sense of 'pass by reference', i.e. a pointer? But you are meaning a reference in the sense of incrementing a usage count? Maybe he means it is still taking ownership, not reference? Regards, Tvrtko ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Intel-gfx] [RFC 02/12] staging/android/sync: add sync_fence_create_dma
Op 23-11-15 om 14:44 schreef Tvrtko Ursulin: > > On 23/11/15 13:38, John Harrison wrote: >> On 23/11/2015 13:27, Maarten Lankhorst wrote: >>> Op 23-11-15 om 12:34 schreef john.c.harri...@intel.com: From: Maarten Lankhorst This allows users of dma fences to create a android fence. v2: Added kerneldoc. (Tvrtko Ursulin). Signed-off-by: Maarten Lankhorst Signed-off-by: Tvrtko Ursulin Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Jesse Barnes Cc: de...@driverdev.osuosl.org Cc: Riley Andrews Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg --- drivers/staging/android/sync.c | 13 + drivers/staging/android/sync.h | 12 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..7f0e919 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -188,7 +188,7 @@ static void fence_check_cb_func(struct fence *f, struct fence_cb *cb) } /* TODO: implement a create which takes more that one sync_pt */ -struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt) { struct sync_fence *fence; @@ -199,16 +199,21 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) fence->num_fences = 1; atomic_set(&fence->status, 1); -fence->cbs[0].sync_pt = &pt->base; +fence->cbs[0].sync_pt = pt; fence->cbs[0].fence = fence; -if (fence_add_callback(&pt->base, &fence->cbs[0].cb, - fence_check_cb_func)) +if (fence_add_callback(pt, &fence->cbs[0].cb, fence_check_cb_func)) atomic_dec(&fence->status); sync_fence_debug_add(fence); return fence; } +EXPORT_SYMBOL(sync_fence_create_dma); + +struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) +{ +return sync_fence_create_dma(name, &pt->base); +} EXPORT_SYMBOL(sync_fence_create); struct sync_fence *sync_fence_fdget(int fd) diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 61f8a3a..798cd56 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -250,10 +250,20 @@ void sync_pt_free(struct sync_pt *pt); * @pt:sync_pt to add to the fence * * Creates a fence containg @pt. Once this is called, the fence takes - * ownership of @pt. + * a reference on @pt. */ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt); >>> No it doesn't. +/** + * sync_fence_create_dma() - creates a sync fence from dma-fence + * @name:name of fence to create + * @pt:dma-fence to add to the fence + * + * Creates a fence containg @pt. Once this is called, the fence takes + * a reference on @pt. + */ >>> No it doesn't. >> This is your patch isn't it? Or is this something Tvrtko added on the >> way past? Either way, what should the correct description be? It takes a > > It is Maarten's patch, I just copied the comment over from one function to > another. The one I picked up was > https://patchwork.freedesktop.org/patch/38074/, December 2014. > >> copy of the pointer to 'pt'. Is the comment meaning a reference in the >> sense of 'pass by reference', i.e. a pointer? But you are meaning a >> reference in the sense of incrementing a usage count? > > Maybe he means it is still taking ownership, not reference? Indeed. See commit 3ea411c56ef "android: fix reference leak in sync_fence_create". This broke compatibility with android by creating a ref leak. :) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Your First Payment Of $12,000 From UBA Moneygram!
Greetings, I am Mr. Nzue Kenneth, I have tried reaching you on mail all this while, but you fail to respond back to me, please be aware that your matter came to my desk which were dated since on the 29-04-2015 (6) months ago, with the total fund of $2,250,000.00. Frankly speaking you are very lucky because you are going to receive your first (8) Ref-control numbers of $12,000 after responding to our mail, all this while your transfer had been stopped because it was under investigation of money laundry by the Ministry of Information and National Orientation and that was the reason your name were among those who were blacklisted, but now we have settled your problem and removed your name from the blacklist, so your funds is free for transfer to you now. This is your (8) Ref-control numbers of $12,000: (1) 5645-3?63 - $1,500USD (2) 6426-475? - $1,500USD (3) 9635-?438 - $1,500USD (4) 3466-49?5 - $1,500USD (5) 7416-37?5 - $1,500USD (6) 6406-24?5 - $1,500USD (7) 6004-14?5 - $1,500USD (8) 8426-94?5 - $1,500USD You will be receiving $12,000 everyday until your total payment of $2,250,000 is completed, the only thing we need from you is to obtain the (A.R.O) Authorization Release Order Certificate, which will reflect in any Money-Gram Office in your country, stating that you are not a victim or you are not a party of money laundry, the (A.R.O) Authorization Release Order Certificate will cost you the sum of $69 only. Remember that this is the only charges for you to pay before your (8) Ref-control numbers of $12,000 will be released to you today for pick up today. You are therefore required to get back to me as soon as you receive this message with your current information as requested below; Full Names: Contact Address: Phone Numbers(Cell & Home): I will be waiting to hear from you as soon as possible so that I can direct you on how to send the $69 which you will send through Moneygram. Yours Sincerely, Mr. Nzue Kenneth Phone: +229 66054044 Managing Director UBA Money-Gram Head Office Cotonou ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] Drivers: hv: ring_buffer.c: fix comment style
Convert 6+-string comments repeating function names to normal kernel-style comments and fix a couple of other comment style issues. No textual or functional changes intended. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/ring_buffer.c | 135 +-- 1 file changed, 26 insertions(+), 109 deletions(-) diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index 70a1a9a..7bca513 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c @@ -112,9 +112,7 @@ static bool hv_need_to_signal_on_read(u32 prev_write_sz, u32 read_loc = rbi->ring_buffer->read_index; u32 pending_sz = rbi->ring_buffer->pending_send_sz; - /* -* If the other end is not blocked on write don't bother. -*/ + /* If the other end is not blocked on write don't bother. */ if (pending_sz == 0) return false; @@ -128,12 +126,7 @@ static bool hv_need_to_signal_on_read(u32 prev_write_sz, return false; } -/* - * hv_get_next_write_location() - * - * Get the next write location for the specified ring buffer - * - */ +/* Get the next write location for the specified ring buffer. */ static inline u32 hv_get_next_write_location(struct hv_ring_buffer_info *ring_info) { @@ -142,12 +135,7 @@ hv_get_next_write_location(struct hv_ring_buffer_info *ring_info) return next; } -/* - * hv_set_next_write_location() - * - * Set the next write location for the specified ring buffer - * - */ +/* Set the next write location for the specified ring buffer. */ static inline void hv_set_next_write_location(struct hv_ring_buffer_info *ring_info, u32 next_write_location) @@ -155,11 +143,7 @@ hv_set_next_write_location(struct hv_ring_buffer_info *ring_info, ring_info->ring_buffer->write_index = next_write_location; } -/* - * hv_get_next_read_location() - * - * Get the next read location for the specified ring buffer - */ +/* Get the next read location for the specified ring buffer. */ static inline u32 hv_get_next_read_location(struct hv_ring_buffer_info *ring_info) { @@ -169,10 +153,8 @@ hv_get_next_read_location(struct hv_ring_buffer_info *ring_info) } /* - * hv_get_next_readlocation_withoffset() - * * Get the next read location + offset for the specified ring buffer. - * This allows the caller to skip + * This allows the caller to skip. */ static inline u32 hv_get_next_readlocation_withoffset(struct hv_ring_buffer_info *ring_info, @@ -186,13 +168,7 @@ hv_get_next_readlocation_withoffset(struct hv_ring_buffer_info *ring_info, return next; } -/* - * - * hv_set_next_read_location() - * - * Set the next read location for the specified ring buffer - * - */ +/* Set the next read location for the specified ring buffer. */ static inline void hv_set_next_read_location(struct hv_ring_buffer_info *ring_info, u32 next_read_location) @@ -201,12 +177,7 @@ hv_set_next_read_location(struct hv_ring_buffer_info *ring_info, } -/* - * - * hv_get_ring_buffer() - * - * Get the start of the ring buffer - */ +/* Get the start of the ring buffer. */ static inline void * hv_get_ring_buffer(struct hv_ring_buffer_info *ring_info) { @@ -214,25 +185,14 @@ hv_get_ring_buffer(struct hv_ring_buffer_info *ring_info) } -/* - * - * hv_get_ring_buffersize() - * - * Get the size of the ring buffer - */ +/* Get the size of the ring buffer. */ static inline u32 hv_get_ring_buffersize(struct hv_ring_buffer_info *ring_info) { return ring_info->ring_datasize; } -/* - * - * hv_get_ring_bufferindices() - * - * Get the read and write indices as u64 of the specified ring buffer - * - */ +/* Get the read and write indices as u64 of the specified ring buffer. */ static inline u64 hv_get_ring_bufferindices(struct hv_ring_buffer_info *ring_info) { @@ -240,12 +200,8 @@ hv_get_ring_bufferindices(struct hv_ring_buffer_info *ring_info) } /* - * - * hv_copyfrom_ringbuffer() - * * Helper routine to copy to source from ring buffer. * Assume there is enough room. Handles wrap-around in src case only!! - * */ static u32 hv_copyfrom_ringbuffer( struct hv_ring_buffer_info *ring_info, @@ -277,12 +233,8 @@ static u32 hv_copyfrom_ringbuffer( /* - * - * hv_copyto_ringbuffer() - * * Helper routine to copy from source to ring buffer. * Assume there is enough room. Handles wrap-around in dest case only!! - * */ static u32 hv_copyto_ringbuffer( struct hv_ring_buffer_info *ring_info, @@ -308,13 +260,7 @@ static u32 hv_copyto_ringbuffer( return start_write_offset; } -/* - * - * hv_ringbuffer_get_debuginfo() - * - * Get various debug metrics for the specified ring buffer - * - */ +/* Get various debug metrics for the specified ring buffer. */ void hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info, struct hv_ring_buffer_debug_info *debug_info) { @@ -337,13 +283,7 @@ void
[PATCH 2/3] Drivers: hv: ring_buffer: remove stray smp_read_barrier_depends()
smp_read_barrier_depends() does nothing on almost all arcitectures including x86 and having it in the beginning of hv_get_ringbuffer_availbytes() does not provide any guarantees anyway. Signed-off-by: Vitaly Kuznetsov --- include/linux/hyperv.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 8fdc17b..1777dc8 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -141,8 +141,6 @@ hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi, { u32 read_loc, write_loc, dsize; - smp_read_barrier_depends(); - /* Capture the read/write indices before they changed */ read_loc = rbi->ring_buffer->read_index; write_loc = rbi->ring_buffer->write_index; -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/3] Drivers: hv: ring_buffer: do some code cleanup
1) Fix comment style in ring_buffer.c 2) Remove unneeded smp_read_barrier_depends() from hyperv.h 3) Unify hv_ringbuffer_peek/read() functions. Vitaly Kuznetsov (3): Drivers: hv: ring_buffer.c: fix comment style Drivers: hv: ring_buffer: remove stray smp_read_barrier_depends() Drivers: hv: ring_buffer: remove code duplication from hv_ringbuffer_peek/read() drivers/hv/ring_buffer.c | 199 --- include/linux/hyperv.h | 2 - 2 files changed, 49 insertions(+), 152 deletions(-) -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] Drivers: hv: ring_buffer: remove code duplication from hv_ringbuffer_peek/read()
hv_ringbuffer_peek() does the same as hv_ringbuffer_read() without advancing the read index. The only functional change this patch brings is moving hv_need_to_signal_on_read() call under the ring_lock but this function is just a couple of comparisons. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/ring_buffer.c | 68 ++-- 1 file changed, 25 insertions(+), 43 deletions(-) diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index 7bca513..07f9408 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c @@ -380,47 +380,9 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info, return 0; } - -/* Read without advancing the read index. */ -int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info, - void *Buffer, u32 buflen) -{ - u32 bytes_avail_towrite; - u32 bytes_avail_toread; - u32 next_read_location = 0; - unsigned long flags; - - spin_lock_irqsave(&Inring_info->ring_lock, flags); - - hv_get_ringbuffer_availbytes(Inring_info, - &bytes_avail_toread, - &bytes_avail_towrite); - - /* Make sure there is something to read */ - if (bytes_avail_toread < buflen) { - - spin_unlock_irqrestore(&Inring_info->ring_lock, flags); - - return -EAGAIN; - } - - /* Convert to byte offset */ - next_read_location = hv_get_next_read_location(Inring_info); - - next_read_location = hv_copyfrom_ringbuffer(Inring_info, - Buffer, - buflen, - next_read_location); - - spin_unlock_irqrestore(&Inring_info->ring_lock, flags); - - return 0; -} - - -/* Read and advance the read index. */ -int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer, - u32 buflen, u32 offset, bool *signal) +static inline int __hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, + void *buffer, u32 buflen, u32 offset, + bool *signal, bool advance) { u32 bytes_avail_towrite; u32 bytes_avail_toread; @@ -452,6 +414,9 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer, buflen, next_read_location); + if (!advance) + goto out_unlock; + next_read_location = hv_copyfrom_ringbuffer(inring_info, &prev_indices, sizeof(u64), @@ -467,9 +432,26 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer, /* Update the read index */ hv_set_next_read_location(inring_info, next_read_location); - spin_unlock_irqrestore(&inring_info->ring_lock, flags); - *signal = hv_need_to_signal_on_read(bytes_avail_towrite, inring_info); +out_unlock: + spin_unlock_irqrestore(&inring_info->ring_lock, flags); return 0; } + +/* Read from ring buffer without advancing the read index. */ +int hv_ringbuffer_peek(struct hv_ring_buffer_info *inring_info, + void *buffer, u32 buflen) +{ + return __hv_ringbuffer_read(inring_info, buffer, buflen, + 0, NULL, false); +} + +/* Read from ring buffer and advance the read index. */ +int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, + void *buffer, u32 buflen, u32 offset, + bool *signal) +{ + return __hv_ringbuffer_read(inring_info, buffer, buflen, + offset, signal, true); +} -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: iio: adc: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider --- drivers/staging/iio/adc/ad7192.c | 2 +- drivers/staging/iio/adc/ad7280a.c | 2 +- drivers/staging/iio/adc/ad7780.c | 2 +- drivers/staging/iio/adc/ad7816.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index bb40f37..9221103 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -609,7 +609,7 @@ static const struct iio_chan_spec ad7192_channels[] = { static int ad7192_probe(struct spi_device *spi) { - const struct ad7192_platform_data *pdata = spi->dev.platform_data; + const struct ad7192_platform_data *pdata = dev_get_platdata(&spi->dev); struct ad7192_state *st; struct iio_dev *indio_dev; int ret, voltage_uv = 0; diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 35acb1a..f45ebed 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -833,7 +833,7 @@ static const struct ad7280_platform_data ad7793_default_pdata = { static int ad7280_probe(struct spi_device *spi) { - const struct ad7280_platform_data *pdata = spi->dev.platform_data; + const struct ad7280_platform_data *pdata = dev_get_platdata(&spi->dev); struct ad7280_state *st; int ret; const unsigned short tACQ_ns[4] = {465, 1010, 1460, 1890}; diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c index 3abc778..9baa703 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c @@ -163,7 +163,7 @@ static const struct iio_info ad7780_info = { static int ad7780_probe(struct spi_device *spi) { - struct ad7780_platform_data *pdata = spi->dev.platform_data; + struct ad7780_platform_data *pdata = dev_get_platdata(&spi->dev); struct ad7780_state *st; struct iio_dev *indio_dev; int ret, voltage_uv = 0; diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c index c8e1566..2226051 100644 --- a/drivers/staging/iio/adc/ad7816.c +++ b/drivers/staging/iio/adc/ad7816.c @@ -345,7 +345,7 @@ static int ad7816_probe(struct spi_device *spi_dev) { struct ad7816_chip_info *chip; struct iio_dev *indio_dev; - unsigned short *pins = spi_dev->dev.platform_data; + unsigned short *pins = dev_get_platdata(&spi_dev->dev); int ret = 0; int i; -- 1.8.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: comedilib.h: Coding style warning fix for block comments
This patch is to comedilib.h file that fixes up following warnings reported by checkpatch.pl : I) Block comments use * on subsequent lines Signed-off-by: Jitendra Kumar Khasdev --- drivers/staging/comedi/comedilib.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/comedilib.h b/drivers/staging/comedi/comedilib.h index 56baf85..e530028 100644 --- a/drivers/staging/comedi/comedilib.h +++ b/drivers/staging/comedi/comedilib.h @@ -1,20 +1,20 @@ /* -linux/include/comedilib.h -header file for kcomedilib - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1998-2001 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * linux/include/comedilib.h + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998-2001 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ #ifndef _LINUX_COMEDILIB_H #define _LINUX_COMEDILIB_H -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: iio: light: tsl2x7x_core: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider --- drivers/staging/iio/light/tsl2x7x_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/light/tsl2x7x_core.c b/drivers/staging/iio/light/tsl2x7x_core.c index 9dfd048..5b1c165 100644 --- a/drivers/staging/iio/light/tsl2x7x_core.c +++ b/drivers/staging/iio/light/tsl2x7x_core.c @@ -1898,7 +1898,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp, mutex_init(&chip->prox_mutex); chip->tsl2x7x_chip_status = TSL2X7X_CHIP_UNKNOWN; - chip->pdata = clientp->dev.platform_data; + chip->pdata = dev_get_platdata(&clientp->dev); chip->id = id->driver_data; chip->chip_info = &tsl2x7x_chip_info_tbl[device_channel_config[id->driver_data]]; -- 1.8.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: iio: frequency: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider --- drivers/staging/iio/frequency/ad9832.c | 2 +- drivers/staging/iio/frequency/ad9834.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c index 2b65faa..18b27a1 100644 --- a/drivers/staging/iio/frequency/ad9832.c +++ b/drivers/staging/iio/frequency/ad9832.c @@ -201,7 +201,7 @@ static const struct iio_info ad9832_info = { static int ad9832_probe(struct spi_device *spi) { - struct ad9832_platform_data *pdata = spi->dev.platform_data; + struct ad9832_platform_data *pdata = dev_get_platdata(&spi->dev); struct iio_dev *indio_dev; struct ad9832_state *st; struct regulator *reg; diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c index 6464f2c..6366216 100644 --- a/drivers/staging/iio/frequency/ad9834.c +++ b/drivers/staging/iio/frequency/ad9834.c @@ -318,7 +318,7 @@ static const struct iio_info ad9833_info = { static int ad9834_probe(struct spi_device *spi) { - struct ad9834_platform_data *pdata = spi->dev.platform_data; + struct ad9834_platform_data *pdata = dev_get_platdata(&spi->dev); struct ad9834_state *st; struct iio_dev *indio_dev; struct regulator *reg; -- 1.8.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/4] staging: wilc1000: Fix typo in wilc_wfi_cfgoperations.c
On 11/23/15 05:41, Masanari Iida wrote: > This patch fix some spelling typo in wilc_wfi_cfgoperations.c > > Signed-off-by: Masanari Iida > --- > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 34 > +++ > 1 file changed, 17 insertions(+), 17 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > index 6f40522..ee09d56 100644 > --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > @@ -1923,7 +1923,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, > u32 size) > /* Get WILC header */ > memcpy(&header, (buff - HOST_HDR_OFFSET), HOST_HDR_OFFSET); > > - /* The packet offset field conain info about what type of managment > frame */ > + /* The packet offset field contain info about what type of management > frame */ contains > /* we are dealing with and ack status */ > pkt_offset = GET_PKT_OFFSET(header); > > @@ -2283,7 +2283,7 @@ static int mgmt_tx(struct wiphy *wiphy, > if (u8P2Plocalrandom > > u8P2Precvrandom) { > > PRINT_D(GENERIC_DBG, "LOCAL WILL BE GO LocaRand=%02x RecvRand %02x\n", > u8P2Plocalrandom, u8P2Precvrandom); > > - /*Search for > the p2p information information element , after the Public action subtype > theres a byte for teh dialog token, skip that*/ > + /*Search for > the p2p information information element , after the Public action subtype > theres a byte for the dialog token, skip that*/ Please change "theres" to "there's" or "there is". > for (i = > P2P_PUB_ACTION_SUBTYPE + 2; i < len; i++) { > if > (buf[i] == P2PELEM_ATTR_ID && !(memcmp(u8P2P_oui, &buf[i + 2], 4))) { > > if (buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_REQ || buf[P2P_PUB_ACTION_SUBTYPE] > == P2P_INV_RSP) -- ~Randy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/4] staging: wilc1000: Fix typo in wilc_msgqueue.h
On 11/23/15 05:41, Masanari Iida wrote: > This patch fix some spelling typo in wilc_msgqueue.h > > Signed-off-by: Masanari Iida Acked-by: Randy Dunlap Thanks. > --- > drivers/staging/wilc1000/wilc_msgqueue.h | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h > b/drivers/staging/wilc1000/wilc_msgqueue.h > index d231c33..d7e0328 100644 > --- a/drivers/staging/wilc1000/wilc_msgqueue.h > +++ b/drivers/staging/wilc1000/wilc_msgqueue.h -- ~Randy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/4] staging: wilc1000: Fix typo in linux_wlan.c
On 11/23/15 05:41, Masanari Iida wrote: > This patch fix some spelling typo in wilc1000.c. > > Signed-off-by: Masanari Iida > --- > drivers/staging/wilc1000/linux_wlan.c | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > Acked-by: Randy Dunlap Thanks. -- ~Randy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/4] staging: wilc1000: Fix typo in host_interface.c
On 11/23/15 05:41, Masanari Iida wrote: > This patch fix spelling typo in host_interface.c > > Signed-off-by: Masanari Iida > --- > drivers/staging/wilc1000/host_interface.c | 30 +++--- > 1 file changed, 15 insertions(+), 15 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c > index d5b7725..b9f9541 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -844,7 +844,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv, > } > > if (g_obtainingIP || connecting) { > - PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until > IP adresss is obtained\n"); > + PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until > IP addresses is obtained\n"); address > PRINT_ER("Don't do obss scan\n"); > result = -EBUSY; > goto ERRORHANDLER; > @@ -2518,7 +2518,7 @@ static int Handle_RemainOnChan(struct host_if_drv > *hif_drv, > } > > if (g_obtainingIP || connecting) { > - PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until > IP adresss is obtained\n"); > + PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until > IP addresses is obtained\n"); address > result = -EBUSY; > goto ERRORHANDLER; > } -- ~Randy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: comedilib.h: Coding style warning fix for block comments
On 23/11/15 17:45, Jitendra Kumar Khasdev wrote: This patch is to comedilib.h file that fixes up following warnings reported by checkpatch.pl : I) Block comments use * on subsequent lines Signed-off-by: Jitendra Kumar Khasdev --- drivers/staging/comedi/comedilib.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/comedilib.h b/drivers/staging/comedi/comedilib.h index 56baf85..e530028 100644 --- a/drivers/staging/comedi/comedilib.h +++ b/drivers/staging/comedi/comedilib.h @@ -1,20 +1,20 @@ /* -linux/include/comedilib.h -header file for kcomedilib - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1998-2001 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * linux/include/comedilib.h + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998-2001 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ #ifndef _LINUX_COMEDILIB_H #define _LINUX_COMEDILIB_H You removed the "header file for kcomedilib" line, which was probably more useful than the "linux/include/comedilib.h" line, especially as the pathname "linux/include/comedilib.h" isn't very accurate! -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: ptlrpc: constify ptlrpc_sec_cops structs
Constifies ptlrpc_sec_cops structures in the lustre driver since they are not modified after their initialization. Detected and found using Coccinelle. Suggested-by: Julia Lawall Signed-off-by: Aya Mahfouz --- drivers/staging/lustre/lustre/ptlrpc/sec.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 39f5261..f959897 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -1580,7 +1580,7 @@ int sptlrpc_cli_enlarge_reqbuf(struct ptlrpc_request *req, int segment, int newsize) { struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx; - struct ptlrpc_sec_cops *cops; + const struct ptlrpc_sec_cops *cops; struct lustre_msg *msg = req->rq_reqmsg; LASSERT(ctx); diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index ebfa609..ffdad15 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -378,7 +378,7 @@ static struct ptlrpc_ctx_ops null_ctx_ops = { .verify = null_ctx_verify, }; -static struct ptlrpc_sec_cops null_sec_cops = { +static const struct ptlrpc_sec_cops null_sec_cops = { .create_sec = null_create_sec, .destroy_sec= null_destroy_sec, .lookup_ctx = null_lookup_ctx, diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c index f448b45..71351de 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c @@ -956,7 +956,7 @@ static struct ptlrpc_ctx_ops plain_ctx_ops = { .unwrap_bulk= plain_cli_unwrap_bulk, }; -static struct ptlrpc_sec_cops plain_sec_cops = { +static const struct ptlrpc_sec_cops plain_sec_cops = { .create_sec = plain_create_sec, .destroy_sec= plain_destroy_sec, .kill_sec = plain_kill_sec, -- 2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 06/10] hv_netvsc: Eliminate send_completion from struct hv_netvsc_packet
Eliminate send_completion from struct hv_netvsc_packet. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h |3 +-- drivers/net/hyperv/netvsc.c |6 +++--- drivers/net/hyperv/netvsc_drv.c |2 +- drivers/net/hyperv/rndis_filter.c |2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 506d552..9a3c972 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -135,7 +135,7 @@ struct hv_netvsc_packet { u8 rmsg_size; /* RNDIS header and PPI size */ u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */ u8 page_buf_cnt; - u8 pad0; + u8 completion_func; u16 vlan_tci; u16 q_idx; @@ -147,7 +147,6 @@ struct hv_netvsc_packet { u64 send_completion_tid; void *send_completion_ctx; - void (*send_completion)(void *context); struct hv_page_buffer *page_buf; }; diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 8fbf816..34c16d1 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -653,8 +653,8 @@ static void netvsc_send_completion(struct netvsc_device *net_device, netvsc_free_send_slot(net_device, send_index); q_idx = nvsc_packet->q_idx; channel = incoming_channel; - nvsc_packet->send_completion(nvsc_packet-> -send_completion_ctx); + netvsc_xmit_completion(nvsc_packet-> + send_completion_ctx); } num_outstanding_sends = @@ -775,7 +775,7 @@ static inline int netvsc_send_pkt( nvmsg.msg.v1_msg.send_rndis_pkt.send_buf_section_size = packet->total_data_buflen; - if (packet->send_completion) + if (packet->completion_func) req_id = (ulong)packet; else req_id = 0; diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index c73afb1..6d71a1e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -488,7 +488,7 @@ check_size: memset(rndis_msg, 0, RNDIS_AND_PPI_SIZE); /* Set the completion routine */ - packet->send_completion = netvsc_xmit_completion; + packet->completion_func = 1; packet->send_completion_ctx = packet; packet->send_completion_tid = (unsigned long)skb; diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index be0fa9c..c8af172 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -237,7 +237,7 @@ static int rndis_filter_send_request(struct rndis_device *dev, packet->page_buf[0].len; } - packet->send_completion = NULL; + packet->completion_func = 0; packet->xmit_more = false; ret = netvsc_send(dev->net_dev->dev, packet, NULL); -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 07/10] hv_netvsc: Eliminate send_completion_ctx from struct hv_netvsc_packet
Eliminate send_completion_ctx from struct hv_netvsc_packet. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h |1 - drivers/net/hyperv/netvsc.c |3 +-- drivers/net/hyperv/netvsc_drv.c |1 - 3 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 9a3c972..9504ca9 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -146,7 +146,6 @@ struct hv_netvsc_packet { u64 send_completion_tid; - void *send_completion_ctx; struct hv_page_buffer *page_buf; }; diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 34c16d1..0e0b723 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -653,8 +653,7 @@ static void netvsc_send_completion(struct netvsc_device *net_device, netvsc_free_send_slot(net_device, send_index); q_idx = nvsc_packet->q_idx; channel = incoming_channel; - netvsc_xmit_completion(nvsc_packet-> - send_completion_ctx); + netvsc_xmit_completion(nvsc_packet); } num_outstanding_sends = diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 6d71a1e..947b778 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -489,7 +489,6 @@ check_size: /* Set the completion routine */ packet->completion_func = 1; - packet->send_completion_ctx = packet; packet->send_completion_tid = (unsigned long)skb; isvlan = packet->vlan_tci & VLAN_TAG_PRESENT; -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 00/10] hv_netvsc: Eliminate the additional head room
In an attempt to avoid having to allocate memory on the send path, the netvsc driver was requesting additional head room so that both rndis header and the netvsc packet (the state that had to persist) could be placed in the skb. Since the amount of head room requested was exceeding the default head room as set in LL_MAX_HEADER, we were forcing a reallocation of skb. With this patch-set, I have reduced the size of the netvsc packet to 40 bytes and with this reduction we don't need to ask for any additional headroom. We place the rndis header in the skb head room and we place the netvsc packet in control buffer area in the skb. K. Y. Srinivasan (8): hv_netvsc: Resize some of the variables in hv_netvsc_packet hv_netvsc: Rearrange the hv_negtvsc_packet to be space efficient hv_netvsc: Eliminate the channel field in hv_netvsc_packet structure hv_netvsc: Eliminate rndis_msg pointer from hv_netvsc_packet structure hv_netvsc: Eliminatte the data field from struct hv_netvsc_packet hv_netvsc: Eliminate send_completion from struct hv_netvsc_packet hv_netvsc: Eliminate send_completion_ctx from struct hv_netvsc_packet hv_netvsc: Don't ask for additional head room in the skb Vitaly Kuznetsov (2): hv_netvsc: move subchannel existence check to netvsc_select_queue() hv_netvsc: remove locking in netvsc_send() drivers/net/hyperv/hyperv_net.h | 48 +--- drivers/net/hyperv/netvsc.c | 42 drivers/net/hyperv/netvsc_drv.c | 47 +++ drivers/net/hyperv/rndis_filter.c | 21 ++-- 4 files changed, 72 insertions(+), 86 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 01/10] hv_netvsc: Resize some of the variables in hv_netvsc_packet
As part of reducing the size of the hv_netvsc_packet, resize some of the variables based on their usage. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 5fa98f5..972e562 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -127,11 +127,11 @@ struct ndis_tcp_ip_checksum_info; */ struct hv_netvsc_packet { /* Bookkeeping stuff */ - u32 status; + u8 status; - bool is_data_pkt; - bool xmit_more; /* from skb */ - bool cp_partial; /* partial copy into send buffer */ + u8 is_data_pkt; + u8 xmit_more; /* from skb */ + u8 cp_partial; /* partial copy into send buffer */ u16 vlan_tci; @@ -147,13 +147,13 @@ struct hv_netvsc_packet { /* This points to the memory after page_buf */ struct rndis_message *rndis_msg; - u32 rmsg_size; /* RNDIS header and PPI size */ - u32 rmsg_pgcnt; /* page count of RNDIS header and PPI */ + u8 rmsg_size; /* RNDIS header and PPI size */ + u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */ u32 total_data_buflen; /* Points to the send/receive buffer where the ethernet frame is */ void *data; - u32 page_buf_cnt; + u8 page_buf_cnt; struct hv_page_buffer *page_buf; }; -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 03/10] hv_netvsc: Eliminate the channel field in hv_netvsc_packet structure
Eliminate the channel field in hv_netvsc_packet structure. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h | 22 ++ drivers/net/hyperv/netvsc.c | 19 --- drivers/net/hyperv/netvsc_drv.c |5 +++-- drivers/net/hyperv/rndis_filter.c | 10 ++ 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 7435673..ac24091 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -144,7 +144,6 @@ struct hv_netvsc_packet { u32 total_data_buflen; u32 pad1; - struct vmbus_channel *channel; u64 send_completion_tid; void *send_completion_ctx; @@ -199,7 +198,8 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, void netvsc_xmit_completion(void *context); int netvsc_recv_callback(struct hv_device *device_obj, struct hv_netvsc_packet *packet, - struct ndis_tcp_ip_checksum_info *csum_info); + struct ndis_tcp_ip_checksum_info *csum_info, + struct vmbus_channel *channel); void netvsc_channel_cb(void *context); int rndis_filter_open(struct hv_device *dev); int rndis_filter_close(struct hv_device *dev); @@ -207,12 +207,12 @@ int rndis_filter_device_add(struct hv_device *dev, void *additional_info); void rndis_filter_device_remove(struct hv_device *dev); int rndis_filter_receive(struct hv_device *dev, - struct hv_netvsc_packet *pkt); + struct hv_netvsc_packet *pkt, + struct vmbus_channel *channel); int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter); int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac); - #define NVSP_INVALID_PROTOCOL_VERSION ((u32)0x) #define NVSP_PROTOCOL_VERSION_12 @@ -1262,5 +1262,19 @@ struct rndis_message { #define TRANSPORT_INFO_IPV6_TCP ((INFO_IPV6 << 16) | INFO_TCP) #define TRANSPORT_INFO_IPV6_UDP ((INFO_IPV6 << 16) | INFO_UDP) +static inline struct vmbus_channel *get_channel(struct hv_netvsc_packet *packet, + struct netvsc_device *net_device) + +{ + struct vmbus_channel *out_channel; + + out_channel = net_device->chn_table[packet->q_idx]; + if (!out_channel) { + out_channel = net_device->dev->channel; + packet->q_idx = 0; + } + return out_channel; +} + #endif /* _HYPERV_NET_H */ diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 51e4c0f..52533ed 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -610,6 +610,7 @@ static inline void netvsc_free_send_slot(struct netvsc_device *net_device, } static void netvsc_send_completion(struct netvsc_device *net_device, + struct vmbus_channel *incoming_channel, struct hv_device *device, struct vmpacket_descriptor *packet) { @@ -651,7 +652,7 @@ static void netvsc_send_completion(struct netvsc_device *net_device, if (send_index != NETVSC_INVALID_INDEX) netvsc_free_send_slot(net_device, send_index); q_idx = nvsc_packet->q_idx; - channel = nvsc_packet->channel; + channel = incoming_channel; nvsc_packet->send_completion(nvsc_packet-> send_completion_ctx); } @@ -748,7 +749,7 @@ static inline int netvsc_send_pkt( struct netvsc_device *net_device) { struct nvsp_message nvmsg; - struct vmbus_channel *out_channel = packet->channel; + struct vmbus_channel *out_channel = get_channel(packet, net_device); u16 q_idx = packet->q_idx; struct net_device *ndev = net_device->ndev; u64 req_id; @@ -857,13 +858,9 @@ int netvsc_send(struct hv_device *device, if (!net_device) return -ENODEV; - out_channel = net_device->chn_table[q_idx]; - if (!out_channel) { - out_channel = device->channel; - q_idx = 0; - packet->q_idx = 0; - } - packet->channel = out_channel; + out_channel = get_channel(packet, net_device); + q_idx = packet->q_idx; + packet->send_buf_index = NETVSC_INVALID_INDEX; packet->cp_partial = false; @@ -1043,7 +1040,6 @@ static void netvsc_receive(struct netvsc_device *net_device, } count = vmxferpage_packet->range_cnt; - netvsc_packet->channel = channel; /* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */ for (i = 0; i < count; i++) { @@ -1055,7 +1
[PATCH net-next 10/10] hv_netvsc: remove locking in netvsc_send()
From: Vitaly Kuznetsov Packet scheduler guarantees there won't be multiple senders for the same queue and as we use q_idx for multi_send_data the spinlock is redundant. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/net/hyperv/hyperv_net.h |1 - drivers/net/hyperv/netvsc.c |8 2 files changed, 0 insertions(+), 9 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index a9d2bdc5..f5b2145 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -633,7 +633,6 @@ struct nvsp_message { #define RNDIS_PKT_ALIGN_DEFAULT 8 struct multi_send_data { - spinlock_t lock; /* protect struct multi_send_data */ struct hv_netvsc_packet *pkt; /* netvsc pkt pending */ u32 count; /* counter of batched packets */ }; diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 419b055..081f14f 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -38,7 +38,6 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device) { struct netvsc_device *net_device; struct net_device *ndev = hv_get_drvdata(device); - int i; net_device = kzalloc(sizeof(struct netvsc_device), GFP_KERNEL); if (!net_device) @@ -58,9 +57,6 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device) net_device->max_pkt = RNDIS_MAX_PKT_DEFAULT; net_device->pkt_align = RNDIS_PKT_ALIGN_DEFAULT; - for (i = 0; i < num_online_cpus(); i++) - spin_lock_init(&net_device->msd[i].lock); - hv_set_drvdata(device, net_device); return net_device; } @@ -850,7 +846,6 @@ int netvsc_send(struct hv_device *device, u16 q_idx = packet->q_idx; u32 pktlen = packet->total_data_buflen, msd_len = 0; unsigned int section_index = NETVSC_INVALID_INDEX; - unsigned long flag; struct multi_send_data *msdp; struct hv_netvsc_packet *msd_send = NULL, *cur_send = NULL; bool try_batch; @@ -867,7 +862,6 @@ int netvsc_send(struct hv_device *device, msdp = &net_device->msd[q_idx]; /* batch packets in send buffer if possible */ - spin_lock_irqsave(&msdp->lock, flag); if (msdp->pkt) msd_len = msdp->pkt->total_data_buflen; @@ -927,8 +921,6 @@ int netvsc_send(struct hv_device *device, cur_send = packet; } - spin_unlock_irqrestore(&msdp->lock, flag); - if (msd_send) { m_ret = netvsc_send_pkt(msd_send, net_device); -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 05/10] hv_netvsc: Eliminatte the data field from struct hv_netvsc_packet
Eliminatte the data field from struct hv_netvsc_packet. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h |5 ++--- drivers/net/hyperv/netvsc.c |5 +++-- drivers/net/hyperv/netvsc_drv.c |3 ++- drivers/net/hyperv/rndis_filter.c | 11 +++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 7fa4f43..506d552 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -148,9 +148,6 @@ struct hv_netvsc_packet { u64 send_completion_tid; void *send_completion_ctx; void (*send_completion)(void *context); - - /* Points to the send/receive buffer where the ethernet frame is */ - void *data; struct hv_page_buffer *page_buf; }; @@ -196,6 +193,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, void netvsc_xmit_completion(void *context); int netvsc_recv_callback(struct hv_device *device_obj, struct hv_netvsc_packet *packet, + void **data, struct ndis_tcp_ip_checksum_info *csum_info, struct vmbus_channel *channel); void netvsc_channel_cb(void *context); @@ -206,6 +204,7 @@ int rndis_filter_device_add(struct hv_device *dev, void rndis_filter_device_remove(struct hv_device *dev); int rndis_filter_receive(struct hv_device *dev, struct hv_netvsc_packet *pkt, + void **data, struct vmbus_channel *channel); int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter); diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 2de9e7f..8fbf816 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -1008,6 +1008,7 @@ static void netvsc_receive(struct netvsc_device *net_device, int i; int count = 0; struct net_device *ndev; + void *data; ndev = net_device->ndev; @@ -1047,13 +1048,13 @@ static void netvsc_receive(struct netvsc_device *net_device, for (i = 0; i < count; i++) { /* Initialize the netvsc packet */ netvsc_packet->status = NVSP_STAT_SUCCESS; - netvsc_packet->data = (void *)((unsigned long)net_device-> + data = (void *)((unsigned long)net_device-> recv_buf + vmxferpage_packet->ranges[i].byte_offset); netvsc_packet->total_data_buflen = vmxferpage_packet->ranges[i].byte_count; /* Pass it to the upper layer */ - rndis_filter_receive(device, netvsc_packet, channel); + rndis_filter_receive(device, netvsc_packet, &data, channel); if (netvsc_packet->status != NVSP_STAT_SUCCESS) status = NVSP_STAT_FAIL; diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 77c0849..c73afb1 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -685,6 +685,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, */ int netvsc_recv_callback(struct hv_device *device_obj, struct hv_netvsc_packet *packet, + void **data, struct ndis_tcp_ip_checksum_info *csum_info, struct vmbus_channel *channel) { @@ -713,7 +714,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, * Copy to skb. This copy is needed here since the memory pointed by * hv_netvsc_packet cannot be deallocated */ - memcpy(skb_put(skb, packet->total_data_buflen), packet->data, + memcpy(skb_put(skb, packet->total_data_buflen), *data, packet->total_data_buflen); skb->protocol = eth_type_trans(skb, net); diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 63584e7..be0fa9c 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -351,6 +351,7 @@ static inline void *rndis_get_ppi(struct rndis_packet *rpkt, u32 type) static void rndis_filter_receive_data(struct rndis_device *dev, struct rndis_message *msg, struct hv_netvsc_packet *pkt, + void **data, struct vmbus_channel *channel) { struct rndis_packet *rndis_pkt; @@ -383,7 +384,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev, * the data packet to the stack, without the rndis trailer padding */ pkt->total_data_buflen = rndis_pkt->data_len; - pkt->data = (void *)((unsigned long)pkt->data + data_offset); + *data = (void *)((unsigned long)(*data) + data_offs
[PATCH net-next 08/10] hv_netvsc: Don't ask for additional head room in the skb
The rndis header is 116 bytes big and can be placed in the default head room that will be available in the skb. Since the netvsc packet is less than 48 bytes, we can use the skb control buffer for the netvsc packet. With these changes we don't need to ask for additional head room. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h |3 +++ drivers/net/hyperv/netvsc_drv.c | 28 +--- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 9504ca9..e15dc2c 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -124,6 +124,9 @@ struct ndis_tcp_ip_checksum_info; /* * Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame * within the RNDIS + * + * The size of this structure is less than 48 bytes and we can now + * place this structure in the skb->cb field. */ struct hv_netvsc_packet { /* Bookkeeping stuff */ diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 947b778..9b6c507 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -432,7 +432,6 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) u32 net_trans_info; u32 hash; u32 skb_length; - u32 pkt_sz; struct hv_page_buffer page_buf[MAX_PAGE_BUFFER_COUNT]; struct netvsc_stats *tx_stats = this_cpu_ptr(net_device_ctx->tx_stats); @@ -460,16 +459,19 @@ check_size: goto check_size; } - pkt_sz = sizeof(struct hv_netvsc_packet) + RNDIS_AND_PPI_SIZE; - - ret = skb_cow_head(skb, pkt_sz); + /* +* Place the rndis header in the skb head room and +* the skb->cb will be used for hv_netvsc_packet +* structure. +*/ + ret = skb_cow_head(skb, RNDIS_AND_PPI_SIZE); if (ret) { netdev_err(net, "unable to alloc hv_netvsc_packet\n"); ret = -ENOMEM; goto drop; } - /* Use the headroom for building up the packet */ - packet = (struct hv_netvsc_packet *)skb->head; + /* Use the skb control buffer for building up the packet */ + packet = (struct hv_netvsc_packet *)skb->cb; packet->status = 0; packet->xmit_more = skb->xmit_more; @@ -482,8 +484,7 @@ check_size: packet->is_data_pkt = true; packet->total_data_buflen = skb->len; - rndis_msg = (struct rndis_message *)((unsigned long)packet + - sizeof(struct hv_netvsc_packet)); + rndis_msg = (struct rndis_message *)skb->head; memset(rndis_msg, 0, RNDIS_AND_PPI_SIZE); @@ -1071,16 +1072,12 @@ static int netvsc_probe(struct hv_device *dev, struct netvsc_device_info device_info; struct netvsc_device *nvdev; int ret; - u32 max_needed_headroom; net = alloc_etherdev_mq(sizeof(struct net_device_context), num_online_cpus()); if (!net) return -ENOMEM; - max_needed_headroom = sizeof(struct hv_netvsc_packet) + - RNDIS_AND_PPI_SIZE; - netif_carrier_off(net); net_device_ctx = netdev_priv(net); @@ -1116,13 +1113,6 @@ static int netvsc_probe(struct hv_device *dev, net->ethtool_ops = ðtool_ops; SET_NETDEV_DEV(net, &dev->device); - /* -* Request additional head room in the skb. -* We will use this space to build the rndis -* heaser and other state we need to maintain. -*/ - net->needed_headroom = max_needed_headroom; - /* Notify the netvsc driver of the new device */ memset(&device_info, 0, sizeof(device_info)); device_info.ring_size = ring_size; -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 02/10] hv_netvsc: Rearrange the hv_negtvsc_packet to be space efficient
Rearrange the elements of struct hv_negtvsc_packet for optimal layout - eliminate unnecessary padding. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h | 18 ++ 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 972e562..7435673 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -128,32 +128,34 @@ struct ndis_tcp_ip_checksum_info; struct hv_netvsc_packet { /* Bookkeeping stuff */ u8 status; - u8 is_data_pkt; u8 xmit_more; /* from skb */ u8 cp_partial; /* partial copy into send buffer */ - u16 vlan_tci; + u8 rmsg_size; /* RNDIS header and PPI size */ + u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */ + u8 page_buf_cnt; + u8 pad0; + u16 vlan_tci; u16 q_idx; + u32 send_buf_index; + + u32 total_data_buflen; + u32 pad1; + struct vmbus_channel *channel; u64 send_completion_tid; void *send_completion_ctx; void (*send_completion)(void *context); - u32 send_buf_index; /* This points to the memory after page_buf */ struct rndis_message *rndis_msg; - u8 rmsg_size; /* RNDIS header and PPI size */ - u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */ - - u32 total_data_buflen; /* Points to the send/receive buffer where the ethernet frame is */ void *data; - u8 page_buf_cnt; struct hv_page_buffer *page_buf; }; -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 09/10] hv_netvsc: move subchannel existence check to netvsc_select_queue()
From: Vitaly Kuznetsov Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/net/hyperv/hyperv_net.h | 15 --- drivers/net/hyperv/netvsc.c |5 ++--- drivers/net/hyperv/netvsc_drv.c |3 +++ 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index e15dc2c..a9d2bdc5 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -1260,19 +1260,4 @@ struct rndis_message { #define TRANSPORT_INFO_IPV6_TCP ((INFO_IPV6 << 16) | INFO_TCP) #define TRANSPORT_INFO_IPV6_UDP ((INFO_IPV6 << 16) | INFO_UDP) -static inline struct vmbus_channel *get_channel(struct hv_netvsc_packet *packet, - struct netvsc_device *net_device) - -{ - struct vmbus_channel *out_channel; - - out_channel = net_device->chn_table[packet->q_idx]; - if (!out_channel) { - out_channel = net_device->dev->channel; - packet->q_idx = 0; - } - return out_channel; -} - - #endif /* _HYPERV_NET_H */ diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 0e0b723..419b055 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -749,8 +749,8 @@ static inline int netvsc_send_pkt( struct netvsc_device *net_device) { struct nvsp_message nvmsg; - struct vmbus_channel *out_channel = get_channel(packet, net_device); u16 q_idx = packet->q_idx; + struct vmbus_channel *out_channel = net_device->chn_table[q_idx]; struct net_device *ndev = net_device->ndev; u64 req_id; int ret; @@ -859,8 +859,7 @@ int netvsc_send(struct hv_device *device, if (!net_device) return -ENODEV; - out_channel = get_channel(packet, net_device); - q_idx = packet->q_idx; + out_channel = net_device->chn_table[q_idx]; packet->send_buf_index = NETVSC_INVALID_INDEX; packet->cp_partial = false; diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 9b6c507..83b457e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -272,6 +272,9 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb, skb_set_hash(skb, hash, PKT_HASH_TYPE_L3); } + if (!nvsc_dev->chn_table[q_idx]) + q_idx = 0; + return q_idx; } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next 04/10] hv_netvsc: Eliminate rndis_msg pointer from hv_netvsc_packet structure
Eliminate rndis_msg pointer from hv_netvsc_packet structure. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h |8 +++- drivers/net/hyperv/netvsc.c | 10 ++ drivers/net/hyperv/netvsc_drv.c |7 +++ drivers/net/hyperv/rndis_filter.c |2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index ac24091..7fa4f43 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -149,10 +149,6 @@ struct hv_netvsc_packet { void *send_completion_ctx; void (*send_completion)(void *context); - - /* This points to the memory after page_buf */ - struct rndis_message *rndis_msg; - /* Points to the send/receive buffer where the ethernet frame is */ void *data; struct hv_page_buffer *page_buf; @@ -189,10 +185,12 @@ struct rndis_device { /* Interface */ +struct rndis_message; int netvsc_device_add(struct hv_device *device, void *additional_info); int netvsc_device_remove(struct hv_device *device); int netvsc_send(struct hv_device *device, - struct hv_netvsc_packet *packet); + struct hv_netvsc_packet *packet, + struct rndis_message *rndis_msg); void netvsc_linkstatus_callback(struct hv_device *device_obj, struct rndis_message *resp); void netvsc_xmit_completion(void *context); diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 52533ed..2de9e7f 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -706,7 +706,8 @@ static u32 netvsc_get_next_send_section(struct netvsc_device *net_device) static u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device, unsigned int section_index, u32 pend_size, - struct hv_netvsc_packet *packet) + struct hv_netvsc_packet *packet, + struct rndis_message *rndis_msg) { char *start = net_device->send_buf; char *dest = start + (section_index * net_device->send_section_size) @@ -722,7 +723,7 @@ static u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device, if (packet->is_data_pkt && packet->xmit_more && remain && !packet->cp_partial) { padding = net_device->pkt_align - remain; - packet->rndis_msg->msg_len += padding; + rndis_msg->msg_len += padding; packet->total_data_buflen += padding; } @@ -841,7 +842,8 @@ static inline int netvsc_send_pkt( } int netvsc_send(struct hv_device *device, - struct hv_netvsc_packet *packet) + struct hv_netvsc_packet *packet, + struct rndis_message *rndis_msg) { struct netvsc_device *net_device; int ret = 0, m_ret = 0; @@ -897,7 +899,7 @@ int netvsc_send(struct hv_device *device, if (section_index != NETVSC_INVALID_INDEX) { netvsc_copy_to_send_buf(net_device, section_index, msd_len, - packet); + packet, rndis_msg); packet->send_buf_index = section_index; diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index e5f4eec..77c0849 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -482,10 +482,10 @@ check_size: packet->is_data_pkt = true; packet->total_data_buflen = skb->len; - packet->rndis_msg = (struct rndis_message *)((unsigned long)packet + + rndis_msg = (struct rndis_message *)((unsigned long)packet + sizeof(struct hv_netvsc_packet)); - memset(packet->rndis_msg, 0, RNDIS_AND_PPI_SIZE); + memset(rndis_msg, 0, RNDIS_AND_PPI_SIZE); /* Set the completion routine */ packet->send_completion = netvsc_xmit_completion; @@ -495,7 +495,6 @@ check_size: isvlan = packet->vlan_tci & VLAN_TAG_PRESENT; /* Add the rndis header */ - rndis_msg = packet->rndis_msg; rndis_msg->ndis_msg_type = RNDIS_MSG_PACKET; rndis_msg->msg_len = packet->total_data_buflen; rndis_pkt = &rndis_msg->msg.pkt; @@ -619,7 +618,7 @@ do_send: packet->page_buf_cnt = init_page_array(rndis_msg, rndis_msg_size, skb, packet); - ret = netvsc_send(net_device_ctx->device_ctx, packet); + ret = netvsc_send(net_device_ctx->device_ctx, packet, rndis_msg); drop: if (ret == 0) { diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 1b04d78..63584e7 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -
Re: [PATCH] staging: lustre: ptlrpc: constify ptlrpc_sec_cops structs
Hi Aya, [auto build test WARNING on staging/staging-testing] [also build test WARNING on v4.4-rc2 next-20151123] url: https://github.com/0day-ci/linux/commits/Aya-Mahfouz/staging-lustre-ptlrpc-constify-ptlrpc_sec_cops-structs/20151124-054437 config: tile-allyesconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=tile All warnings (new ones prefixed by >>): >> drivers/staging/lustre/lustre/ptlrpc/sec_null.c:404:2: warning: >> initialization discards 'const' qualifier from pointer target type [enabled >> by default] vim +/const +404 drivers/staging/lustre/lustre/ptlrpc/sec_null.c d7e09d039 Peng Tao 2013-05-02 388 .free_reqbuf= null_free_reqbuf, d7e09d039 Peng Tao 2013-05-02 389 .free_repbuf= null_free_repbuf, d7e09d039 Peng Tao 2013-05-02 390 .enlarge_reqbuf = null_enlarge_reqbuf, d7e09d039 Peng Tao 2013-05-02 391 }; d7e09d039 Peng Tao 2013-05-02 392 d7e09d039 Peng Tao 2013-05-02 393 static struct ptlrpc_sec_sops null_sec_sops = { d7e09d039 Peng Tao 2013-05-02 394 .accept = null_accept, d7e09d039 Peng Tao 2013-05-02 395 .alloc_rs = null_alloc_rs, d7e09d039 Peng Tao 2013-05-02 396 .authorize= null_authorize, d7e09d039 Peng Tao 2013-05-02 397 .free_rs= null_free_rs, d7e09d039 Peng Tao 2013-05-02 398 }; d7e09d039 Peng Tao 2013-05-02 399 d7e09d039 Peng Tao 2013-05-02 400 static struct ptlrpc_sec_policy null_policy = { d7e09d039 Peng Tao 2013-05-02 401 .sp_owner = THIS_MODULE, d7e09d039 Peng Tao 2013-05-02 402 .sp_name= "sec.null", d7e09d039 Peng Tao 2013-05-02 403 .sp_policy= SPTLRPC_POLICY_NULL, d7e09d039 Peng Tao 2013-05-02 @404 .sp_cops= &null_sec_cops, d7e09d039 Peng Tao 2013-05-02 405 .sp_sops= &null_sec_sops, d7e09d039 Peng Tao 2013-05-02 406 }; d7e09d039 Peng Tao 2013-05-02 407 d7e09d039 Peng Tao 2013-05-02 408 static void null_init_internal(void) d7e09d039 Peng Tao 2013-05-02 409 { d7e09d039 Peng Tao 2013-05-02 410 static HLIST_HEAD(__list); d7e09d039 Peng Tao 2013-05-02 411 d7e09d039 Peng Tao 2013-05-02 412 null_sec.ps_policy = &null_policy; :: The code at line 404 was first introduced by commit :: d7e09d0397e84eefbabfd9cb353221f3c6448d83 staging: add Lustre file system client support :: TO: Peng Tao :: CC: Greg Kroah-Hartman --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Future of Lustre in staging
On 2015/11/20, 06:30, "Denis Kirjanov" wrote: >On 11/20/15, Xose Vazquez Perez wrote: >> Hi, >> >> From https://lwn.net/Articles/662979/ >> >> --cut-- >> Christoph complained a bit about the staging tree. He said that it >> breaks allmodconfig builds, but that problem was evidently fixed a while >> ago. He also dislikes the Lustre filesystem, which has been in staging >> for some time now; Greg agreed and said that he would like to delete it. >> It was generally agreed that the work being done on Lustre is not >> substantial enough to justify its continued presence. Christoph also >> said that the use of the staging tree for code that is about to be >> deleted could be improved; there are, he said, people doing white-space >> fixes on doomed code. >> --end-- >> >> Could anyone clarify it? > >AFAIK, Intel is going to work more harder on Lustre code, so the best >option would be to wait a bit. >Agreed, checkpatch fixes are just a mess.. I think it is important to note that it isn't just Intel working on this code, but also ORNL, Cray, Indiana University, and others. As for build breakage pf Lustre in staging, more often as not that is due to patches landing outside of staging that cause Lustre builds to break. That isn't really something that we can control while Lustre is in the staging branch if that isn't required for normal builds. The zero-day patch bot has been good at catching those issues, and we've been good at submitting fixes quickly, so I don't think it is a huge problem. Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel High Performance Data Division ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: comedilib.h: Coding style warning fix for block comments
This patch is to comedilib.h file that fixes up following warnings reported by checkpatch.pl : I) Block comments use * on subsequent lines Signed-off-by: Jitendra Kumar Khasdev --- drivers/staging/comedi/comedilib.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/comedilib.h b/drivers/staging/comedi/comedilib.h index 56baf85..e530028 100644 --- a/drivers/staging/comedi/comedilib.h +++ b/drivers/staging/comedi/comedilib.h @@ -1,20 +1,20 @@ /* -linux/include/comedilib.h -header file for kcomedilib - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1998-2001 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * linux/include/comedilib.h + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998-2001 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ #ifndef _LINUX_COMEDILIB_H #define _LINUX_COMEDILIB_H -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel