creating initramfs
Hi, How can I create a initramfs file without dracut from the files in an installed system? regards, Ronit ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: android: ion: fixed a blank line after declarations coding style issue
On Thu, 2015-07-09 at 11:05 +0530, Sudip Mukherjee wrote: > On Thu, Jul 09, 2015 at 08:20:57AM +0530, rcodin wrote: > > From: Ronit Halder > > You do not need a From: here. Please fix your gitconfig file and > git send-email will give your name correctly in the email header. > > regards > sudip thanks for pointing it sudip. Sorry for the stupid mistake, version 2 of the patch is coming. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] Staging: android: ion: fixed a blank line after declarations coding style issue
Fixed a coding style issue. Signed-off-by: Ronit Halder --- drivers/staging/android/ion/ion.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 6f48112..e44f5e6 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -1106,6 +1106,7 @@ struct dma_buf *ion_share_dma_buf(struct ion_client *client, struct ion_buffer *buffer; struct dma_buf *dmabuf; bool valid_handle; + DEFINE_DMA_BUF_EXPORT_INFO(exp_info); mutex_lock(&client->lock); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: lustre: fixed a blank line after declarations coding style issue
Fixed a blank line after declarations coding style issue Signed-off-by: Ronit Halder --- drivers/staging/lustre/lustre/lov/lov_merge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/lustre/lustre/lov/lov_merge.c b/drivers/staging/lustre/lustre/lov/lov_merge.c index b7e7bfa..dd1cf3d 100644 --- a/drivers/staging/lustre/lustre/lov/lov_merge.c +++ b/drivers/staging/lustre/lustre/lov/lov_merge.c @@ -123,6 +123,7 @@ int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm, if (shrink) { for (; stripe < lsm->lsm_stripe_count; stripe++) { struct lov_oinfo *loi = lsm->lsm_oinfo[stripe]; + kms = lov_size_to_stripe(lsm, size, stripe); CDEBUG(D_INODE, "stripe %d KMS %sing %llu->%llu\n", -- 2.4.0.GIT ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgap: fix memory leak in dgap_parsefile()
In dgap_parsefile() char pointers are set with kstrdup() without checking that some string is allocated to that char pointer before. This patch frees the memory if already allocated and then set the poniter with kstrdup(). Signed-off-by: Ronit halder --- drivers/staging/dgap/dgap.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index e17bde7..64f6149 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -672,6 +672,7 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } + kfree(p->u.board.portstr); p->u.board.portstr = kstrdup(s, GFP_KERNEL); if (kstrtol(s, 0, &p->u.board.port)) { pr_err("bad number for IO port"); @@ -690,6 +691,7 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } + kfree(p->u.board.addrstr); p->u.board.addrstr = kstrdup(s, GFP_KERNEL); if (kstrtoul(s, 0, &p->u.board.addr)) { pr_err("bad number for memory address"); @@ -708,6 +710,7 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } + kfree(p->u.board.pcibusstr); p->u.board.pcibusstr = kstrdup(s, GFP_KERNEL); if (kstrtoul(s, 0, &p->u.board.pcibus)) { pr_err("bad number for pci bus"); @@ -719,6 +722,7 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } + kfree(p->u.board.pcislotstr); p->u.board.pcislotstr = kstrdup(s, GFP_KERNEL); if (kstrtoul(s, 0, &p->u.board.pcislot)) { pr_err("bad number for pci slot"); @@ -737,6 +741,7 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } + kfree(p->u.board.method); p->u.board.method = kstrdup(s, GFP_KERNEL); p->u.board.v_method = 1; break; @@ -751,6 +756,7 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } + kfree(p->u.board.status); p->u.board.status = kstrdup(s, GFP_KERNEL); break; @@ -800,13 +806,15 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } - + kfree(p->u.board.status); p->u.board.status = kstrdup(s, GFP_KERNEL); if (p->type == CNODE) { + kfree(p->u.conc.id); p->u.conc.id = kstrdup(s, GFP_KERNEL); p->u.conc.v_id = 1; } else if (p->type == MNODE) { + kfree(p->u.module.id); p->u.module.id = kstrdup(s, GFP_KERNEL); p->u.module.v_id = 1; } else { @@ -1003,6 +1011,7 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } + kfree(p->u.line.cable); p->u.line.cable = kstrdup(s, GFP_KERNEL); p->u.line.v_cable = 1; } @@ -1044,6 +1053,7 @@ static int dgap_parsefile(char **in) pr_err("unexpected end of file"); return -1; } + kfree(p->u.conc.connect); p->u.conc.connect = kstrdup(s, GFP_KERNEL); p->u.conc.v_connect = 1; } -- 2.4.0.GIT ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgap: fix memory leak in dgap_parsefile()
The existing dgap_parsefile() rejects invalid config file. But before we know that config file is invalid a lot of memory leak can happen. Removing the chances of memory leak won't heart anyone. regards, Ronit Halder ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgap: fix memory leak in dgap_parsefile()
> Why not just reject it earlier instead of allocating more data? I agree on your point. But we have to make different mechanism for that and my patch is only to fix the current code. regards ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: fbtft: Use BIT macro
Replace (1 << x) by BIT(x) Signed-off-by: Ronit halder --- drivers/staging/fbtft/fb_ssd1351.c | 4 +-- drivers/staging/fbtft/fbtft.h | 56 +++--- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/staging/fbtft/fb_ssd1351.c b/drivers/staging/fbtft/fb_ssd1351.c index eb45b27..28cc5d9 100644 --- a/drivers/staging/fbtft/fb_ssd1351.c +++ b/drivers/staging/fbtft/fb_ssd1351.c @@ -80,10 +80,10 @@ static int set_var(struct fbtft_par *par) switch (par->info->var.rotate) { case 0: - write_reg(par, 0xA0, remap | 0x00 | 1<<4); + write_reg(par, 0xA0, remap | 0x00 | BIT(4)); break; case 270: - write_reg(par, 0xA0, remap | 0x03 | 1<<4); + write_reg(par, 0xA0, remap | 0x03 | BIT(4)); break; case 180: write_reg(par, 0xA0, remap | 0x02); diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index 6dd42b2..375af6b 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -374,39 +374,39 @@ module_exit(fbtft_driver_module_exit); #define DEBUG_LEVEL_6 (DEBUG_LEVEL_4 | DEBUG_LEVEL_5) #define DEBUG_LEVEL_7 0x -#define DEBUG_DRIVER_INIT_FUNCTIONS (1<<3) -#define DEBUG_TIME_FIRST_UPDATE (1<<4) -#define DEBUG_TIME_EACH_UPDATE (1<<5) -#define DEBUG_DEFERRED_IO (1<<6) -#define DEBUG_FBTFT_INIT_FUNCTIONS (1<<7) +#define DEBUG_DRIVER_INIT_FUNCTIONSBIT(3) +#define DEBUG_TIME_FIRST_UPDATEBIT(4) +#define DEBUG_TIME_EACH_UPDATE BIT(5) +#define DEBUG_DEFERRED_IO BIT(6) +#define DEBUG_FBTFT_INIT_FUNCTIONS BIT(7) /* fbops */ -#define DEBUG_FB_READ (1<<8) -#define DEBUG_FB_WRITE (1<<9) -#define DEBUG_FB_FILLRECT (1<<10) -#define DEBUG_FB_COPYAREA (1<<11) -#define DEBUG_FB_IMAGEBLIT (1<<12) -#define DEBUG_FB_SETCOLREG (1<<13) -#define DEBUG_FB_BLANK (1<<14) +#define DEBUG_FB_READ BIT(8) +#define DEBUG_FB_WRITE BIT(9) +#define DEBUG_FB_FILLRECT BIT(10) +#define DEBUG_FB_COPYAREA BIT(11) +#define DEBUG_FB_IMAGEBLIT BIT(12) +#define DEBUG_FB_SETCOLREG BIT(13) +#define DEBUG_FB_BLANK BIT(14) -#define DEBUG_SYSFS (1<<16) +#define DEBUG_SYSFS BIT(16) /* fbtftops */ -#define DEBUG_BACKLIGHT (1<<17) -#define DEBUG_READ (1<<18) -#define DEBUG_WRITE (1<<19) -#define DEBUG_WRITE_VMEM(1<<20) -#define DEBUG_WRITE_REGISTER(1<<21) -#define DEBUG_SET_ADDR_WIN (1<<22) -#define DEBUG_RESET (1<<23) -#define DEBUG_MKDIRTY (1<<24) -#define DEBUG_UPDATE_DISPLAY(1<<25) -#define DEBUG_INIT_DISPLAY (1<<26) -#define DEBUG_BLANK (1<<27) -#define DEBUG_REQUEST_GPIOS (1<<28) -#define DEBUG_FREE_GPIOS(1<<29) -#define DEBUG_REQUEST_GPIOS_MATCH (1<<30) -#define DEBUG_VERIFY_GPIOS (1<<31) +#define DEBUG_BACKLIGHT BIT(17) +#define DEBUG_READ BIT(18) +#define DEBUG_WRITE BIT(19) +#define DEBUG_WRITE_VMEMBIT(20) +#define DEBUG_WRITE_REGISTERBIT(21) +#define DEBUG_SET_ADDR_WIN BIT(22) +#define DEBUG_RESET BIT(23) +#define DEBUG_MKDIRTY BIT(24) +#define DEBUG_UPDATE_DISPLAYBIT(25) +#define DEBUG_INIT_DISPLAY BIT(26) +#define DEBUG_BLANK BIT(27) +#define DEBUG_REQUEST_GPIOS BIT(28) +#define DEBUG_FREE_GPIOSBIT(29) +#define DEBUG_REQUEST_GPIOS_MATCH BIT(30) +#define DEBUG_VERIFY_GPIOS BIT(31) #define fbtft_init_dbg(dev, format, arg...) \ do { \ -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rts5208: use dmam_alloc_coherent
This patch replaces dma_alloc_coherent with the corresponding managed interface. Signed-off-by: Ronit Halder --- drivers/staging/rts5208/rtsx.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index b4e4543..1fe8e3e 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -647,8 +647,6 @@ static void rtsx_release_resources(struct rtsx_dev *dev) wait_timeout(200); if (dev->rtsx_resv_buf) { - dma_free_coherent(&(dev->pci->dev), RTSX_RESV_BUF_LEN, - dev->rtsx_resv_buf, dev->rtsx_resv_buf_addr); dev->chip->host_cmds_ptr = NULL; dev->chip->host_sg_tbl_ptr = NULL; } @@ -918,8 +916,8 @@ static int rtsx_probe(struct pci_dev *pci, dev_info(&pci->dev, "Original address: 0x%lx, remapped address: 0x%lx\n", (unsigned long)(dev->addr), (unsigned long)(dev->remap_addr)); - dev->rtsx_resv_buf = dma_alloc_coherent(&(pci->dev), RTSX_RESV_BUF_LEN, - &(dev->rtsx_resv_buf_addr), GFP_KERNEL); + dev->rtsx_resv_buf = dmam_alloc_coherent(&pci->dev, RTSX_RESV_BUF_LEN, + &dev->rtsx_resv_buf_addr, GFP_KERNEL); if (dev->rtsx_resv_buf == NULL) { dev_err(&pci->dev, "alloc dma buffer fail\n"); err = -ENXIO; -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: comedi: removing useless init/exit
Removing init and exit functions as they do nothing. Signed-off-by: Ronit Halder --- drivers/staging/comedi/comedi_usb.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/comedi/comedi_usb.c b/drivers/staging/comedi/comedi_usb.c index 9c946d4..ed13bf6 100644 --- a/drivers/staging/comedi/comedi_usb.c +++ b/drivers/staging/comedi/comedi_usb.c @@ -144,16 +144,6 @@ void comedi_usb_driver_unregister(struct comedi_driver *comedi_driver, } EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister); -static int __init comedi_usb_init(void) -{ - return 0; -} -module_init(comedi_usb_init); - -static void __exit comedi_usb_exit(void) -{ -} -module_exit(comedi_usb_exit); MODULE_AUTHOR("http://www.comedi.org";); MODULE_DESCRIPTION("Comedi USB interface module"); -- 2.6.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: fbtft: Fix iomem dereference
This patch fixes the warning generated by sparse "cast removes address space of expression" by using ioread16 function insted of directly dereferencing I/O memory. Signed-off-by: Ronit halder --- drivers/staging/fbtft/fb_agm1264k-fl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 94dd49c..59826a4 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -273,7 +273,7 @@ construct_line_bitmap(struct fbtft_par *par, u8 *dest, signed short *src, static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { - u16 *vmem16 = (u16 *)par->info->screen_base; + void __iomem *vmem16 = (u16 __iomem *)par->info->screen_base; u8 *buf = par->txbuf.buf; int x, y; int ret = 0; @@ -290,7 +290,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) /* converting to grayscale16 */ for (x = 0; x < par->info->var.xres; ++x) for (y = 0; y < par->info->var.yres; ++y) { - u16 pixel = vmem16[y * par->info->var.xres + x]; + u16 pixel = ioread16(vmem16 + + y * par->info->var.xres + x); u16 b = pixel & 0x1f; u16 g = (pixel & (0x3f << 5)) >> 5; u16 r = (pixel & (0x1f << (5 + 6))) >> (5 + 6); -- 2.4.0.GIT ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: fbtft: Fix iomem dereference
Yes, it is not I/O memory address. I was wrong on that. But it makes sparse happy. Is here any side effect of using ioread16() ? regards, ronit On Tue, Aug 18, 2015 at 2:27 PM, Dan Carpenter wrote: > On Tue, Aug 18, 2015 at 12:16:57PM +0530, Ronit Halder wrote: >> This patch fixes the warning generated by sparse >> "cast removes address space of expression" by using ioread16 >> function insted of directly dereferencing I/O memory. >> >> Signed-off-by: Ronit halder > > Are these really iomem pointers? A lot of drivers use a fake > screen_base which is just a buffer of normal memory. > > regards, > dan carpenter > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: most: Use NULL instead of zero
This patch fixes the warning generated by sparse "Using plain integer as NULL pointer" by using NULL instead of zero. Signed-off-by: Ronit halder --- drivers/staging/most/aim-network/networking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/most/aim-network/networking.c b/drivers/staging/most/aim-network/networking.c index c8ab239..a1e1bce 100644 --- a/drivers/staging/most/aim-network/networking.c +++ b/drivers/staging/most/aim-network/networking.c @@ -295,7 +295,7 @@ static void most_net_rm_netdev_safe(struct net_dev_context *nd) unregister_netdev(nd->dev); free_netdev(nd->dev); - nd->dev = 0; + nd->dev = NULL; } static struct net_dev_context *get_net_dev_context( -- 2.4.0.GIT ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: wilc1000: Use NULL instead of zero
This patch fixes the warning generated by sparse "Using plain integer as NULL pointer" by using NULL instead of zero. Signed-off-by: Ronit halder --- drivers/staging/wilc1000/coreconfigurator.c | 14 +++--- drivers/staging/wilc1000/linux_wlan.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 544c12d..8164a33 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -525,7 +525,7 @@ u8 *get_tim_elm(u8 *pu8msa, u16 u16RxLen, u16 u16TagParamOffset) u16index += (IE_HDR_LEN + pu8msa[u16index + 1]); } - return 0; + return NULL; } /* This function gets the current channel information from @@ -587,7 +587,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) u16 u16WidID = (u16)WID_NIL; u16 u16WidLen = 0; - u8 *pu8WidVal = 0; + u8 *pu8WidVal = NULL; u8MsgType = pu8MsgBuffer[0]; @@ -614,10 +614,10 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) /* parse the WID value of the WID "WID_NEWORK_INFO" */ { - u8 *pu8msa = 0; + u8 *pu8msa = NULL; u16 u16RxLen = 0; - u8 *pu8TimElm = 0; - u8 *pu8IEs = 0; + u8 *pu8TimElm = NULL; + u8 *pu8IEs = NULL; u16 u16IEsLen = 0; u8 u8index = 0; u32 u32Tsf_Lo; @@ -670,7 +670,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) /* Get DTIM Period */ pu8TimElm = get_tim_elm(pu8msa, (u16RxLen + FCS_LEN), u8index); - if (pu8TimElm != 0) + if (pu8TimElm != NULL) pstrNetworkInfo->u8DtimPeriod = pu8TimElm[3]; pu8IEs = &pu8msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN]; u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); @@ -743,7 +743,7 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen, s32 s32Error = WILC_SUCCESS; tstrConnectRespInfo *pstrConnectRespInfo = NULL; u16 u16AssocRespLen = 0; - u8 *pu8IEs = 0; + u8 *pu8IEs = NULL; u16 u16IEsLen = 0; pstrConnectRespInfo = kmalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL); diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 63f44f8..d8f17c6 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -412,7 +412,7 @@ static int isr_bh_routine(void *vp) break; } PRINT_D(INT_DBG, "Interrupt received BH\n"); - if (g_linux_wlan->oup.wlan_handle_rx_isr != 0) + if (g_linux_wlan->oup.wlan_handle_rx_isr != NULL) g_linux_wlan->oup.wlan_handle_rx_isr(); else PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n"); @@ -1284,7 +1284,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic) #elif (RX_BH_TYPE == RX_BH_KTHREAD) PRINT_D(INIT_DBG, "Creating kthread for Rxq BH\n"); g_linux_wlan->rx_bh_thread = kthread_run(isr_bh_routine, (void *)g_linux_wlan, "K_RXQ_BH"); - if (g_linux_wlan->rx_bh_thread == 0) { + if (g_linux_wlan->rx_bh_thread == NULL) { PRINT_ER("couldn't create RX BH thread\n"); ret = -ENOBUFS; goto _fail_; @@ -1309,7 +1309,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic) /* create tx task */ PRINT_D(INIT_DBG, "Creating kthread for transmission\n"); g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void *)g_linux_wlan, "K_TXQ_TASK"); - if (g_linux_wlan->txq_thread == 0) { + if (g_linux_wlan->txq_thread == NULL) { PRINT_ER("couldn't create TXQ thread\n"); ret = -ENOBUFS; goto _fail_2; -- 2.4.0.GIT ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: wilc1000: Use NULL instead of zero
I checked but it didn't show me any warning. Can you please specify the warning? regards On Mon, Sep 14, 2015 at 2:06 PM, Sudip Mukherjee wrote: > On Mon, Sep 14, 2015 at 11:03:34AM +0530, Ronit Halder wrote: >> This patch fixes the warning generated by sparse >> "Using plain integer as NULL pointer" by using NULL >> instead of zero. >> >> Signed-off-by: Ronit halder >> --- > This fixes sparse warning but introduces new checkpatch warnings about > NULL comparison. > > regards > sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
This patch fixes the warning generated by sparse "Using plain integer as NULL pointer" by using NULL instead of zero. Signed-off-by: Ronit halder --- v2: added a new patch in this patch series to fix the NULL comparison style drivers/staging/wilc1000/coreconfigurator.c | 14 +++--- drivers/staging/wilc1000/linux_wlan.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 544c12d..8164a33 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -525,7 +525,7 @@ u8 *get_tim_elm(u8 *pu8msa, u16 u16RxLen, u16 u16TagParamOffset) u16index += (IE_HDR_LEN + pu8msa[u16index + 1]); } - return 0; + return NULL; } /* This function gets the current channel information from @@ -587,7 +587,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) u16 u16WidID = (u16)WID_NIL; u16 u16WidLen = 0; - u8 *pu8WidVal = 0; + u8 *pu8WidVal = NULL; u8MsgType = pu8MsgBuffer[0]; @@ -614,10 +614,10 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) /* parse the WID value of the WID "WID_NEWORK_INFO" */ { - u8 *pu8msa = 0; + u8 *pu8msa = NULL; u16 u16RxLen = 0; - u8 *pu8TimElm = 0; - u8 *pu8IEs = 0; + u8 *pu8TimElm = NULL; + u8 *pu8IEs = NULL; u16 u16IEsLen = 0; u8 u8index = 0; u32 u32Tsf_Lo; @@ -670,7 +670,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) /* Get DTIM Period */ pu8TimElm = get_tim_elm(pu8msa, (u16RxLen + FCS_LEN), u8index); - if (pu8TimElm != 0) + if (pu8TimElm != NULL) pstrNetworkInfo->u8DtimPeriod = pu8TimElm[3]; pu8IEs = &pu8msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN]; u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); @@ -743,7 +743,7 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen, s32 s32Error = WILC_SUCCESS; tstrConnectRespInfo *pstrConnectRespInfo = NULL; u16 u16AssocRespLen = 0; - u8 *pu8IEs = 0; + u8 *pu8IEs = NULL; u16 u16IEsLen = 0; pstrConnectRespInfo = kmalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL); diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 63f44f8..d8f17c6 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -412,7 +412,7 @@ static int isr_bh_routine(void *vp) break; } PRINT_D(INT_DBG, "Interrupt received BH\n"); - if (g_linux_wlan->oup.wlan_handle_rx_isr != 0) + if (g_linux_wlan->oup.wlan_handle_rx_isr != NULL) g_linux_wlan->oup.wlan_handle_rx_isr(); else PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n"); @@ -1284,7 +1284,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic) #elif (RX_BH_TYPE == RX_BH_KTHREAD) PRINT_D(INIT_DBG, "Creating kthread for Rxq BH\n"); g_linux_wlan->rx_bh_thread = kthread_run(isr_bh_routine, (void *)g_linux_wlan, "K_RXQ_BH"); - if (g_linux_wlan->rx_bh_thread == 0) { + if (g_linux_wlan->rx_bh_thread == NULL) { PRINT_ER("couldn't create RX BH thread\n"); ret = -ENOBUFS; goto _fail_; @@ -1309,7 +1309,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic) /* create tx task */ PRINT_D(INIT_DBG, "Creating kthread for transmission\n"); g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void *)g_linux_wlan, "K_TXQ_TASK"); - if (g_linux_wlan->txq_thread == 0) { + if (g_linux_wlan->txq_thread == NULL) { PRINT_ER("couldn't create TXQ thread\n"); ret = -ENOBUFS; goto _fail_2; -- 2.4.0.GIT ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] Staging: wilc1000: fix NULL comparison style
Fixed NULL comparison style as suggested by checkpatch.pl with --strict option. Signed-off-by: Ronit halder --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/linux_wlan.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 8164a33..872400a 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -670,7 +670,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) /* Get DTIM Period */ pu8TimElm = get_tim_elm(pu8msa, (u16RxLen + FCS_LEN), u8index); - if (pu8TimElm != NULL) + if (pu8TimElm) pstrNetworkInfo->u8DtimPeriod = pu8TimElm[3]; pu8IEs = &pu8msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN]; u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index d8f17c6..d2b0ce6 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -412,7 +412,7 @@ static int isr_bh_routine(void *vp) break; } PRINT_D(INT_DBG, "Interrupt received BH\n"); - if (g_linux_wlan->oup.wlan_handle_rx_isr != NULL) + if (g_linux_wlan->oup.wlan_handle_rx_isr) g_linux_wlan->oup.wlan_handle_rx_isr(); else PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n"); @@ -1284,7 +1284,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic) #elif (RX_BH_TYPE == RX_BH_KTHREAD) PRINT_D(INIT_DBG, "Creating kthread for Rxq BH\n"); g_linux_wlan->rx_bh_thread = kthread_run(isr_bh_routine, (void *)g_linux_wlan, "K_RXQ_BH"); - if (g_linux_wlan->rx_bh_thread == NULL) { + if (!g_linux_wlan->rx_bh_thread) { PRINT_ER("couldn't create RX BH thread\n"); ret = -ENOBUFS; goto _fail_; @@ -1309,7 +1309,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic) /* create tx task */ PRINT_D(INIT_DBG, "Creating kthread for transmission\n"); g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void *)g_linux_wlan, "K_TXQ_TASK"); - if (g_linux_wlan->txq_thread == NULL) { + if (!g_linux_wlan->txq_thread) { PRINT_ER("couldn't create TXQ thread\n"); ret = -ENOBUFS; goto _fail_2; -- 2.4.0.GIT ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
Why not the second one? None of the line edited in first patch haven't changed after that. On Tue, Sep 15, 2015 at 7:24 PM, Greg KH wrote: > On Tue, Sep 15, 2015 at 03:04:58PM +0530, Ronit Halder wrote: >> This patch fixes the warning generated by sparse >> "Using plain integer as NULL pointer" by using NULL >> instead of zero. >> >> Signed-off-by: Ronit halder >> --- >> >> v2: added a new patch in this patch series to fix the NULL comparison style > > This patch, and the second one, do not apply to my tree anymore :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
On Wed, 2015-09-16 at 20:15 -0700, Greg KH wrote: > On Thu, Sep 17, 2015 at 08:28:52AM +0530, roni wrote: > > Sorry for the ambiguity. > > I am talking about my second patch in the series. > > https://lkml.org/lkml/2015/9/15/293 > > > > > > None of the line edited in first patch haven't changed after that. > > > > You applied the version 1 of the first patch in the series > > https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?h=staging-testing&id=0e04f3f381c6a3ab3a7ef0ec9ded709e95996527 > > > > Since then those lines I changed in the patch mentioned above haven't > > changed. > > > > Why my second patch in this series doesn't apply? > > I don't remember, that was many hundreds of patches ago, sorry. Try it > yourself to see if I messed up. Perhaps someone else had already sent > in that same change before you did? git-apply shows no error if I apply second patch on staging/staging-testing. regards ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel