* [PATCH] staging: media: usbvision: Remove comparision to NULL
@ 2023-05-02 1:05 Anup Sharma
2023-05-23 11:36 ` Hans Verkuil
0 siblings, 1 reply; 2+ messages in thread
From: Anup Sharma @ 2023-05-02 1:05 UTC (permalink / raw)
To: hverkuil, mchehab, gregkh; +Cc: linux-media, devel, linux-kernel
Remove comparison to null in file usbvision-core.c and usbvision-i2c.c.
Signed-off-by: Anup Sharma <anupnewsmail@gmail.com>
---
drivers/staging/media/usbvision/usbvision-core.c | 8 ++++----
drivers/staging/media/usbvision/usbvision-i2c.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/media/usbvision/usbvision-core.c b/drivers/staging/media/usbvision/usbvision-core.c
index e35dee35b068..a38104b2a0f9 100644
--- a/drivers/staging/media/usbvision/usbvision-core.c
+++ b/drivers/staging/media/usbvision/usbvision-core.c
@@ -349,7 +349,7 @@ int usbvision_scratch_alloc(struct usb_usbvision *usbvision)
{
usbvision->scratch = vmalloc_32(scratch_buf_size);
scratch_reset(usbvision);
- if (usbvision->scratch == NULL) {
+ if (!usbvision->scratch) {
dev_err(&usbvision->dev->dev,
"%s: unable to allocate %d bytes for scratch\n",
__func__, scratch_buf_size);
@@ -374,7 +374,7 @@ int usbvision_decompress_alloc(struct usb_usbvision *usbvision)
int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2;
usbvision->intra_frame_buffer = vmalloc_32(IFB_size);
- if (usbvision->intra_frame_buffer == NULL) {
+ if (!usbvision->intra_frame_buffer) {
dev_err(&usbvision->dev->dev,
"%s: unable to allocate %d for compr. frame buffer\n",
__func__, IFB_size);
@@ -2284,7 +2284,7 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
struct urb *urb;
urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
- if (urb == NULL)
+ if (!urb)
return -ENOMEM;
usbvision->sbuf[buf_idx].urb = urb;
usbvision->sbuf[buf_idx].data =
@@ -2343,7 +2343,7 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
int buf_idx, err_code, reg_value;
int sb_size = USBVISION_URB_FRAMES * usbvision->isoc_packet_size;
- if ((usbvision->streaming == stream_off) || (usbvision->dev == NULL))
+ if ((usbvision->streaming == stream_off) || (!usbvision->dev))
return;
/* Unschedule all of the iso td's */
diff --git a/drivers/staging/media/usbvision/usbvision-i2c.c b/drivers/staging/media/usbvision/usbvision-i2c.c
index 6e4df3335b1b..3bba93293463 100644
--- a/drivers/staging/media/usbvision/usbvision-i2c.c
+++ b/drivers/staging/media/usbvision/usbvision-i2c.c
@@ -233,7 +233,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
&usbvision->i2c_adap,
"tuner", 0, v4l2_i2c_tuner_addrs(type));
- if (sd == NULL)
+ if (!sd)
return -ENODEV;
if (usbvision->tuner_type != -1) {
tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: media: usbvision: Remove comparision to NULL
2023-05-02 1:05 [PATCH] staging: media: usbvision: Remove comparision to NULL Anup Sharma
@ 2023-05-23 11:36 ` Hans Verkuil
0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2023-05-23 11:36 UTC (permalink / raw)
To: Anup Sharma, mchehab, gregkh; +Cc: linux-media, devel, linux-kernel
Hi Anup,
On 02/05/2023 03:05, Anup Sharma wrote:
> Remove comparison to null in file usbvision-core.c and usbvision-i2c.c.
>
> Signed-off-by: Anup Sharma <anupnewsmail@gmail.com>
> ---
> drivers/staging/media/usbvision/usbvision-core.c | 8 ++++----
> drivers/staging/media/usbvision/usbvision-i2c.c | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
The usbvision driver has been removed almost 2 years ago, so this patch is for
a really old kernel.
Rather odd, but in any case, I'm rejecting this patch for obvious reasons...
Regards,
Hans
>
> diff --git a/drivers/staging/media/usbvision/usbvision-core.c b/drivers/staging/media/usbvision/usbvision-core.c
> index e35dee35b068..a38104b2a0f9 100644
> --- a/drivers/staging/media/usbvision/usbvision-core.c
> +++ b/drivers/staging/media/usbvision/usbvision-core.c
> @@ -349,7 +349,7 @@ int usbvision_scratch_alloc(struct usb_usbvision *usbvision)
> {
> usbvision->scratch = vmalloc_32(scratch_buf_size);
> scratch_reset(usbvision);
> - if (usbvision->scratch == NULL) {
> + if (!usbvision->scratch) {
> dev_err(&usbvision->dev->dev,
> "%s: unable to allocate %d bytes for scratch\n",
> __func__, scratch_buf_size);
> @@ -374,7 +374,7 @@ int usbvision_decompress_alloc(struct usb_usbvision *usbvision)
> int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2;
>
> usbvision->intra_frame_buffer = vmalloc_32(IFB_size);
> - if (usbvision->intra_frame_buffer == NULL) {
> + if (!usbvision->intra_frame_buffer) {
> dev_err(&usbvision->dev->dev,
> "%s: unable to allocate %d for compr. frame buffer\n",
> __func__, IFB_size);
> @@ -2284,7 +2284,7 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
> struct urb *urb;
>
> urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
> - if (urb == NULL)
> + if (!urb)
> return -ENOMEM;
> usbvision->sbuf[buf_idx].urb = urb;
> usbvision->sbuf[buf_idx].data =
> @@ -2343,7 +2343,7 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
> int buf_idx, err_code, reg_value;
> int sb_size = USBVISION_URB_FRAMES * usbvision->isoc_packet_size;
>
> - if ((usbvision->streaming == stream_off) || (usbvision->dev == NULL))
> + if ((usbvision->streaming == stream_off) || (!usbvision->dev))
> return;
>
> /* Unschedule all of the iso td's */
> diff --git a/drivers/staging/media/usbvision/usbvision-i2c.c b/drivers/staging/media/usbvision/usbvision-i2c.c
> index 6e4df3335b1b..3bba93293463 100644
> --- a/drivers/staging/media/usbvision/usbvision-i2c.c
> +++ b/drivers/staging/media/usbvision/usbvision-i2c.c
> @@ -233,7 +233,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
> &usbvision->i2c_adap,
> "tuner", 0, v4l2_i2c_tuner_addrs(type));
>
> - if (sd == NULL)
> + if (!sd)
> return -ENODEV;
> if (usbvision->tuner_type != -1) {
> tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-23 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 1:05 [PATCH] staging: media: usbvision: Remove comparision to NULL Anup Sharma
2023-05-23 11:36 ` Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).