Re: [PATCH v2] drivers: staging: media: go7007: go7007-usb.c use pr_*() instead of dev_*() before 'go' initialized in go7007_usb_probe()
On 11/27/2013 06:43 PM, Dan Carpenter wrote: > On Wed, Nov 27, 2013 at 12:24:22PM +0800, Chen Gang wrote: >> On 11/27/2013 12:03 PM, Greg KH wrote: >>> On Wed, Nov 27, 2013 at 11:48:08AM +0800, Chen Gang wrote: >>>> dev_*() assumes 'go' is already initialized, so need use pr_*() instead >>>> of before 'go' initialized. Related warning (with allmodconfig under >>>> hexagon): >>>> >>>> CC [M] drivers/staging/media/go7007/go7007-usb.o >>>> drivers/staging/media/go7007/go7007-usb.c: In function >>>> 'go7007_usb_probe': >>>> drivers/staging/media/go7007/go7007-usb.c:1060:2: warning: 'go' may be >>>> used uninitialized in this function [-Wuninitialized] >>>> >>>> Also remove useless code after 'return' statement. >>> >>> This should all be fixed in my staging-linus branch already, right? No >>> need for this anymore from what I can tell, sorry. >>> >> >> That's all right (in fact don't need sorry). :-) >> >> And excuse me, I am not quite familiar upstream kernel version merging >> and branches. Is it still better/suitable/possible to sync some bug fix >> patches from staging brach to next brach? > > next syncs with everyone once a day. > OK, thanks. :-) -- Chen Gang -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] drivers: staging: media: go7007: go7007-usb.c use pr_*() instead of dev_*() before 'go' initialized in go7007_usb_probe()
On 11/27/2013 12:03 PM, Greg KH wrote: > On Wed, Nov 27, 2013 at 11:48:08AM +0800, Chen Gang wrote: >> dev_*() assumes 'go' is already initialized, so need use pr_*() instead >> of before 'go' initialized. Related warning (with allmodconfig under >> hexagon): >> >> CC [M] drivers/staging/media/go7007/go7007-usb.o >> drivers/staging/media/go7007/go7007-usb.c: In function 'go7007_usb_probe': >> drivers/staging/media/go7007/go7007-usb.c:1060:2: warning: 'go' may be >> used uninitialized in this function [-Wuninitialized] >> >> Also remove useless code after 'return' statement. > > This should all be fixed in my staging-linus branch already, right? No > need for this anymore from what I can tell, sorry. > That's all right (in fact don't need sorry). :-) And excuse me, I am not quite familiar upstream kernel version merging and branches. Is it still better/suitable/possible to sync some bug fix patches from staging brach to next brach? Thanks. -- Chen Gang -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] drivers: staging: media: go7007: go7007-usb.c use pr_*() instead of dev_*() before 'go' initialized in go7007_usb_probe()
dev_*() assumes 'go' is already initialized, so need use pr_*() instead of before 'go' initialized. Related warning (with allmodconfig under hexagon): CC [M] drivers/staging/media/go7007/go7007-usb.o drivers/staging/media/go7007/go7007-usb.c: In function 'go7007_usb_probe': drivers/staging/media/go7007/go7007-usb.c:1060:2: warning: 'go' may be used uninitialized in this function [-Wuninitialized] Also remove useless code after 'return' statement. Signed-off-by: Chen Gang --- drivers/staging/media/go7007/go7007-usb.c | 11 --- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c index 58684da..2423643 100644 --- a/drivers/staging/media/go7007/go7007-usb.c +++ b/drivers/staging/media/go7007/go7007-usb.c @@ -1057,7 +1057,7 @@ static int go7007_usb_probe(struct usb_interface *intf, char *name; int video_pipe, i, v_urb_len; - dev_dbg(go->dev, "probing new GO7007 USB board\n"); + pr_debug("probing new GO7007 USB board\n"); switch (id->driver_info) { case GO7007_BOARDID_MATRIX_II: @@ -1097,13 +1097,10 @@ static int go7007_usb_probe(struct usb_interface *intf, board = &board_px_tv402u; break; case GO7007_BOARDID_LIFEVIEW_LR192: - dev_err(go->dev, "The Lifeview TV Walker Ultra is not supported. Sorry!\n"); + pr_err("The Lifeview TV Walker Ultra is not supported. Sorry!\n"); return -ENODEV; - name = "Lifeview TV Walker Ultra"; - board = &board_lifeview_lr192; - break; case GO7007_BOARDID_SENSORAY_2250: - dev_info(go->dev, "Sensoray 2250 found\n"); + pr_info("Sensoray 2250 found\n"); name = "Sensoray 2250/2251"; board = &board_sensoray_2250; break; @@ -1112,7 +1109,7 @@ static int go7007_usb_probe(struct usb_interface *intf, board = &board_ads_usbav_709; break; default: - dev_err(go->dev, "unknown board ID %d!\n", + pr_err("unknown board ID %d!\n", (unsigned int)id->driver_info); return -ENODEV; } -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] drivers: staging: media: go7007: go7007-usb.c use pr_*() instead of dev_*() before 'go' initialized in go7007_usb_probe()
On 11/27/2013 11:21 AM, Joe Perches wrote: > On Wed, 2013-11-27 at 11:17 +0800, Chen Gang wrote: >> dev_*() assumes 'go' is already initialized, so need use pr_*() instead >> of before 'go' initialized. > [] >> diff --git a/drivers/staging/media/go7007/go7007-usb.c >> b/drivers/staging/media/go7007/go7007-usb.c > [] >> @@ -1057,7 +1057,7 @@ static int go7007_usb_probe(struct usb_interface *intf, >> char *name; >> int video_pipe, i, v_urb_len; >> >> -dev_dbg(go->dev, "probing new GO7007 USB board\n"); >> +pr_devel("probing new GO7007 USB board\n"); > > pr_devel is commonly compiled out completely unless DEBUG is #defined. > You probably want to use pr_debug here. > > Oh, yes, it is my fault, I will send patch v2. :-) Thanks. -- Chen Gang -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers: staging: media: go7007: go7007-usb.c use pr_*() instead of dev_*() before 'go' initialized in go7007_usb_probe()
dev_*() assumes 'go' is already initialized, so need use pr_*() instead of before 'go' initialized. Related warning (with allmodconfig under hexagon): CC [M] drivers/staging/media/go7007/go7007-usb.o drivers/staging/media/go7007/go7007-usb.c: In function 'go7007_usb_probe': drivers/staging/media/go7007/go7007-usb.c:1060:2: warning: 'go' may be used uninitialized in this function [-Wuninitialized] Also remove useless code after 'return' statement. Signed-off-by: Chen Gang --- drivers/staging/media/go7007/go7007-usb.c | 11 --- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c index 58684da..30310e9 100644 --- a/drivers/staging/media/go7007/go7007-usb.c +++ b/drivers/staging/media/go7007/go7007-usb.c @@ -1057,7 +1057,7 @@ static int go7007_usb_probe(struct usb_interface *intf, char *name; int video_pipe, i, v_urb_len; - dev_dbg(go->dev, "probing new GO7007 USB board\n"); + pr_devel("probing new GO7007 USB board\n"); switch (id->driver_info) { case GO7007_BOARDID_MATRIX_II: @@ -1097,13 +1097,10 @@ static int go7007_usb_probe(struct usb_interface *intf, board = &board_px_tv402u; break; case GO7007_BOARDID_LIFEVIEW_LR192: - dev_err(go->dev, "The Lifeview TV Walker Ultra is not supported. Sorry!\n"); + pr_err("The Lifeview TV Walker Ultra is not supported. Sorry!\n"); return -ENODEV; - name = "Lifeview TV Walker Ultra"; - board = &board_lifeview_lr192; - break; case GO7007_BOARDID_SENSORAY_2250: - dev_info(go->dev, "Sensoray 2250 found\n"); + pr_info("Sensoray 2250 found\n"); name = "Sensoray 2250/2251"; board = &board_sensoray_2250; break; @@ -1112,7 +1109,7 @@ static int go7007_usb_probe(struct usb_interface *intf, board = &board_ads_usbav_709; break; default: - dev_err(go->dev, "unknown board ID %d!\n", + pr_err("unknown board ID %d!\n", (unsigned int)id->driver_info); return -ENODEV; } -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers: media: usb: b2c2: use usb_*_coherent() instead of pci_*_consistent() in flexcop-usb.c
Some architectures do not support PCI, but still support USB, so need let our usb driver try to use usb_* instead of pci_* to support these architectures, or can not pass compiling. The related error (with allmodconfig for arc): CC [M] drivers/media/usb/b2c2/flexcop-usb.o drivers/media/usb/b2c2/flexcop-usb.c: In function ‘flexcop_usb_transfer_exit’: drivers/media/usb/b2c2/flexcop-usb.c:393: error: implicit declaration of function ‘pci_free_consistent’ drivers/media/usb/b2c2/flexcop-usb.c: In function ‘flexcop_usb_transfer_init’: drivers/media/usb/b2c2/flexcop-usb.c:410: error: implicit declaration of function ‘pci_alloc_consistent’ Signed-off-by: Chen Gang --- drivers/media/usb/b2c2/flexcop-usb.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index 8b6275f..0bd9690 100644 --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -390,7 +390,7 @@ static void flexcop_usb_transfer_exit(struct flexcop_usb *fc_usb) } if (fc_usb->iso_buffer != NULL) - pci_free_consistent(NULL, + usb_free_coherent(fc_usb->udev, fc_usb->buffer_size, fc_usb->iso_buffer, fc_usb->dma_addr); } @@ -407,8 +407,8 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb) "each of %d bytes size = %d.\n", B2C2_USB_NUM_ISO_URB, B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize); - fc_usb->iso_buffer = pci_alloc_consistent(NULL, - bufsize, &fc_usb->dma_addr); + fc_usb->iso_buffer = usb_alloc_coherent(fc_usb->udev, + bufsize, GFP_KERNEL, &fc_usb->dma_addr); if (fc_usb->iso_buffer == NULL) return -ENOMEM; -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] media: usb: b2c2: Kconfig: add PCI dependancy to DVB_B2C2_FLEXCOP_USB
On 08/30/2013 04:06 PM, Patrick Boettcher wrote: > Hi, > > > > On Friday 30 August 2013 10:23:24 Chen Gang wrote: > >> DVB_B2C2_FLEXCOP_USB need depend on PCI, or can not pass compiling with > >> allmodconfig for h8300. > >> > >> The related error: > >> > >> drivers/media/usb/b2c2/flexcop-usb.c: In function > >> 'flexcop_usb_transfer_exit': drivers/media/usb/b2c2/flexcop-usb.c:393:3: > >> error: implicit declaration of function 'pci_free_consistent' > >> [-Werror=implicit-function-declaration] pci_free_consistent(NULL, > >> > >> [..] > >> > >> config DVB_B2C2_FLEXCOP_USB > >> tristate "Technisat/B2C2 Air/Sky/Cable2PC USB" > >> - depends on DVB_CORE && I2C > >> + depends on DVB_CORE && I2C && PCI > >> help > >> Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by > >> Technisat/B2C2, > > > > Instead of selecting PCI we could/should use usb_alloc_coherent() and > usb_free_cohrerent(), shouldn't we? > Hmm... maybe it is a good idea, but I am just trying another ways. Just now, I find that the module which calls pci*consistent() may not be pci dependent module (e.g. may depend on ISA or EISA instead of). So "arch/h8300/include/asm/pci.h" has related issues, I am just fixing. Maybe our case is not an issue, after "asm/pci.h" fixed (although for our case only, it can be improved, too, and if you are sure about it, please help improving it, thanks). > > > -- > > Patrick > Thanks. -- Chen Gang -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] media: usb: b2c2: Kconfig: add PCI dependancy to DVB_B2C2_FLEXCOP_USB
DVB_B2C2_FLEXCOP_USB need depend on PCI, or can not pass compiling with allmodconfig for h8300. The related error: drivers/media/usb/b2c2/flexcop-usb.c: In function 'flexcop_usb_transfer_exit': drivers/media/usb/b2c2/flexcop-usb.c:393:3: error: implicit declaration of function 'pci_free_consistent' [-Werror=implicit-function-declaration] pci_free_consistent(NULL, ^ drivers/media/usb/b2c2/flexcop-usb.c: In function 'flexcop_usb_transfer_init': drivers/media/usb/b2c2/flexcop-usb.c:410:2: error: implicit declaration of function 'pci_alloc_consistent' [-Werror=implicit-function-declaration] fc_usb->iso_buffer = pci_alloc_consistent(NULL, ^ drivers/media/usb/b2c2/flexcop-usb.c:410:21: warning: assignment makes pointer from integer without a cast [enabled by default] fc_usb->iso_buffer = pci_alloc_consistent(NULL, ^ cc1: some warnings being treated as errors Signed-off-by: Chen Gang --- drivers/media/usb/b2c2/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/usb/b2c2/Kconfig b/drivers/media/usb/b2c2/Kconfig index 17d3583..06fdf30 100644 --- a/drivers/media/usb/b2c2/Kconfig +++ b/drivers/media/usb/b2c2/Kconfig @@ -1,6 +1,6 @@ config DVB_B2C2_FLEXCOP_USB tristate "Technisat/B2C2 Air/Sky/Cable2PC USB" - depends on DVB_CORE && I2C + depends on DVB_CORE && I2C && PCI help Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2, -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: strncpy issue, need always let NUL terminated string ended by zero.
Hello Maintainers: Please help check it when you have time. Thanks. On 05/21/2013 07:53 PM, Chen Gang wrote: > On 05/21/2013 07:47 PM, Mauro Carvalho Chehab wrote: >> Em Tue, 07 May 2013 20:11:08 +0800 >> Chen Gang escreveu: >> >>>> >>>> For NUL terminated string, need always let it ended by zero. >>>> >>>> The 'name' may be copied to user mode ('dvb_fe->ops.info' is 'struct >>>> dvb_frontend_info' which is defined in ./include/uapi/...), and its >>>> length is also known within as102_dvb_register_fe(), so need fully >>>> initialize it (not use strlcpy instead of strncpy). >>>> >>>> >>>> Signed-off-by: Chen Gang >>>> --- >>>> drivers/staging/media/as102/as102_fe.c |1 + >>>> 1 files changed, 1 insertions(+), 0 deletions(-) >>>> >>>> diff --git a/drivers/staging/media/as102/as102_fe.c >>>> b/drivers/staging/media/as102/as102_fe.c >>>> index 9ce8c9d..b3efec9 100644 >>>> --- a/drivers/staging/media/as102/as102_fe.c >>>> +++ b/drivers/staging/media/as102/as102_fe.c >>>> @@ -334,6 +334,7 @@ int as102_dvb_register_fe(struct as102_dev_t >>>> *as102_dev, >>>>memcpy(&dvb_fe->ops, &as102_fe_ops, sizeof(struct dvb_frontend_ops)); >>>>strncpy(dvb_fe->ops.info.name, as102_dev->name, >>>>sizeof(dvb_fe->ops.info.name)); >>>> + dvb_fe->ops.info.name[sizeof(dvb_fe->ops.info.name) - 1] = '\0'; >> Instead, the better would be to use strlcpy(), as it warrants that the >> copied string will be nul-terminated. > > Within this function, we know 'dvb_fe->ops.info' my copy to user mode > (the structure is defined in ./include/uapi/...), and we also known the > full length of the buffer, so better still use strncpy to give a full > initialized, and still be sure of the nul-terminated. > > > Thanks. > -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: strncpy issue, need always let NUL terminated string ended by zero.
On 05/21/2013 07:47 PM, Mauro Carvalho Chehab wrote: > Em Tue, 07 May 2013 20:11:08 +0800 > Chen Gang escreveu: > >> > >> > For NUL terminated string, need always let it ended by zero. >> > >> > The 'name' may be copied to user mode ('dvb_fe->ops.info' is 'struct >> > dvb_frontend_info' which is defined in ./include/uapi/...), and its >> > length is also known within as102_dvb_register_fe(), so need fully >> > initialize it (not use strlcpy instead of strncpy). >> > >> > >> > Signed-off-by: Chen Gang >> > --- >> > drivers/staging/media/as102/as102_fe.c |1 + >> > 1 files changed, 1 insertions(+), 0 deletions(-) >> > >> > diff --git a/drivers/staging/media/as102/as102_fe.c >> > b/drivers/staging/media/as102/as102_fe.c >> > index 9ce8c9d..b3efec9 100644 >> > --- a/drivers/staging/media/as102/as102_fe.c >> > +++ b/drivers/staging/media/as102/as102_fe.c >> > @@ -334,6 +334,7 @@ int as102_dvb_register_fe(struct as102_dev_t >> > *as102_dev, >> >memcpy(&dvb_fe->ops, &as102_fe_ops, sizeof(struct dvb_frontend_ops)); >> >strncpy(dvb_fe->ops.info.name, as102_dev->name, >> >sizeof(dvb_fe->ops.info.name)); >> > + dvb_fe->ops.info.name[sizeof(dvb_fe->ops.info.name) - 1] = '\0'; > Instead, the better would be to use strlcpy(), as it warrants that the > copied string will be nul-terminated. Within this function, we know 'dvb_fe->ops.info' my copy to user mode (the structure is defined in ./include/uapi/...), and we also known the full length of the buffer, so better still use strncpy to give a full initialized, and still be sure of the nul-terminated. Thanks. -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] staging: strncpy issue, need always let NUL terminated string ended by zero.
For NUL terminated string, need always let it ended by zero. The 'name' may be copied to user mode ('dvb_fe->ops.info' is 'struct dvb_frontend_info' which is defined in ./include/uapi/...), and its length is also known within as102_dvb_register_fe(), so need fully initialize it (not use strlcpy instead of strncpy). Signed-off-by: Chen Gang --- drivers/staging/media/as102/as102_fe.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/staging/media/as102/as102_fe.c b/drivers/staging/media/as102/as102_fe.c index 9ce8c9d..b3efec9 100644 --- a/drivers/staging/media/as102/as102_fe.c +++ b/drivers/staging/media/as102/as102_fe.c @@ -334,6 +334,7 @@ int as102_dvb_register_fe(struct as102_dev_t *as102_dev, memcpy(&dvb_fe->ops, &as102_fe_ops, sizeof(struct dvb_frontend_ops)); strncpy(dvb_fe->ops.info.name, as102_dev->name, sizeof(dvb_fe->ops.info.name)); + dvb_fe->ops.info.name[sizeof(dvb_fe->ops.info.name) - 1] = '\0'; /* register dvb frontend */ errno = dvb_register_frontend(dvb_adap, dvb_fe); -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/staging/media/go7007: using strlcpy instead of strncpy
for NUL terminated string, need always set '\0' in the end. Signed-off-by: Chen Gang --- drivers/staging/media/go7007/saa7134-go7007.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/media/go7007/saa7134-go7007.c b/drivers/staging/media/go7007/saa7134-go7007.c index cf7c34a..2d1c6c2 100644 --- a/drivers/staging/media/go7007/saa7134-go7007.c +++ b/drivers/staging/media/go7007/saa7134-go7007.c @@ -456,7 +456,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev) if (go == NULL) goto allocfail; go->board_id = GO7007_BOARDID_PCI_VOYAGER; - strncpy(go->name, saa7134_boards[dev->board].name, sizeof(go->name)); + strlcpy(go->name, saa7134_boards[dev->board].name, sizeof(go->name)); go->hpi_ops = &saa7134_go7007_hpi_ops; go->hpi_context = saa; saa->dev = dev; -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/staging/media/go7007: using strlcpy instead of strncpy
better to treate them as NUL terminated string. Signed-off-by: Chen Gang --- drivers/staging/media/go7007/go7007-v4l2.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c index cb9fe33..9050e19 100644 --- a/drivers/staging/media/go7007/go7007-v4l2.c +++ b/drivers/staging/media/go7007/go7007-v4l2.c @@ -637,7 +637,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt->flags = V4L2_FMT_FLAG_COMPRESSED; - strncpy(fmt->description, desc, sizeof(fmt->description)); + strlcpy(fmt->description, desc, sizeof(fmt->description)); return 0; } @@ -1181,7 +1181,7 @@ static int vidioc_enum_input(struct file *file, void *priv, if (inp->index >= go->board_info->num_inputs) return -EINVAL; - strncpy(inp->name, go->board_info->inputs[inp->index].name, + strlcpy(inp->name, go->board_info->inputs[inp->index].name, sizeof(inp->name)); /* If this board has a tuner, it will be the last input */ -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/staging/media/go7007: using strlcpy instead of strncpy
for NUL terminated string, need always set '\0' in the end. Signed-off-by: Chen Gang --- drivers/staging/media/go7007/snd-go7007.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/go7007/snd-go7007.c b/drivers/staging/media/go7007/snd-go7007.c index 5af29ff..6f6271e 100644 --- a/drivers/staging/media/go7007/snd-go7007.c +++ b/drivers/staging/media/go7007/snd-go7007.c @@ -267,9 +267,9 @@ int go7007_snd_init(struct go7007 *go) kfree(gosnd); return ret; } - strncpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver)); - strncpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->driver)); - strncpy(gosnd->card->longname, gosnd->card->shortname, + strlcpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver)); + strlcpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->driver)); + strlcpy(gosnd->card->longname, gosnd->card->shortname, sizeof(gosnd->card->longname)); gosnd->pcm->private_data = go; -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/staging/media/as102: using ccflags-y instead of EXTRA_FLAGS in Makefile
need using ccflags-y instead of EXTRA_CFLAGS can reference scripts/checkpatch.pl (1755..1766) when make EXTRA_CFLAGS=-W, the compiling issue will be occured. Signed-off-by: Chen Gang --- drivers/staging/media/as102/Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/media/as102/Makefile b/drivers/staging/media/as102/Makefile index d8dfb75..8916d8a 100644 --- a/drivers/staging/media/as102/Makefile +++ b/drivers/staging/media/as102/Makefile @@ -3,4 +3,4 @@ dvb-as102-objs := as102_drv.o as102_fw.o as10x_cmd.o as10x_cmd_stream.o \ obj-$(CONFIG_DVB_AS102) += dvb-as102.o -EXTRA_CFLAGS += -Idrivers/media/dvb-core +ccflags-y += -Idrivers/media/dvb-core -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html