* [PATCH] [media] davinci-vpfe: Fix retcode check
@ 2014-07-05 1:31 ` Andrey Utkin
0 siblings, 0 replies; 7+ messages in thread
From: Andrey Utkin @ 2014-07-05 1:31 UTC (permalink / raw)
To: linux-media, linux-kernel, kernel-janitors; +Cc: Andrey Utkin
See https://bugzilla.kernel.org/show_bug.cgi?id=69071
---8<---
Use signed type to check correctly for negative error code
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
index b2daf5e..e326032 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
@@ -254,7 +254,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe)
void __iomem *ipipe_base = ipipe->base_addr;
struct v4l2_mbus_framefmt *outformat;
u32 color_pat;
- u32 ipipe_mode;
+ int ipipe_mode;
u32 data_path;
/* enable clock to IPIPE */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] [media] davinci-vpfe: Fix retcode check
@ 2014-07-05 1:31 ` Andrey Utkin
0 siblings, 0 replies; 7+ messages in thread
From: Andrey Utkin @ 2014-07-05 1:31 UTC (permalink / raw)
To: linux-media, linux-kernel, kernel-janitors; +Cc: Andrey Utkin
See https://bugzilla.kernel.org/show_bug.cgi?idi071
---8<---
Use signed type to check correctly for negative error code
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
index b2daf5e..e326032 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
@@ -254,7 +254,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe)
void __iomem *ipipe_base = ipipe->base_addr;
struct v4l2_mbus_framefmt *outformat;
u32 color_pat;
- u32 ipipe_mode;
+ int ipipe_mode;
u32 data_path;
/* enable clock to IPIPE */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] [media] davinci-vpfe: Fix retcode check
2014-07-08 14:58 ` Andrey Utkin
@ 2014-07-08 15:41 ` Prabhakar Lad
0 siblings, 0 replies; 7+ messages in thread
From: Prabhakar Lad @ 2014-07-08 15:41 UTC (permalink / raw)
To: Andrey Utkin
Cc: Levente Kurusa, linux-kernel, OSUOSL Drivers, Linux Media,
Greg Kroah-Hartman, Mauro Carvalho Chehab, Josh Triplett,
Archana Kumari, Lisa Nguyen
Hi Andrey,
Thanks for the patch!
On Tue, Jul 8, 2014 at 3:58 PM, Andrey Utkin
<andrey.krieger.utkin@gmail.com> wrote:
> 2014-07-08 17:32 GMT+03:00 Levente Kurusa <lkurusa@redhat.com>:
>> Hmm, while it is true that get_ipipe_mode returns an int, but
>> the consequent call to regw_ip takes an u32 as its second
>> argument. Did it cause a build warning for you? (Can't really
>> check since I don't have ARM cross compilers close-by)
>> If not, then:
>
> Cannot say for sure would compiler complain.
> I also haven't really checked it, and unfortunately even haven't
> succeeded to make a config that would build that code. But i believe
> that warning is still better than misbehaviour.
>
It wont cause any compile warning.
Applied for v3.17
Thanks,
--Prabhakar Lad
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [media] davinci-vpfe: Fix retcode check
2014-07-08 14:32 ` Levente Kurusa
2014-07-08 14:58 ` Andrey Utkin
@ 2014-07-08 15:11 ` Dan Carpenter
1 sibling, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2014-07-08 15:11 UTC (permalink / raw)
To: Levente Kurusa
Cc: Andrey Utkin, OSUOSL Drivers, Lisa Nguyen, Greg Kroah-Hartman,
linux-kernel, Josh Triplett, prabhakar.csengg, Linux Media,
Archana Kumari, Mauro Carvalho Chehab
On Tue, Jul 08, 2014 at 04:32:57PM +0200, Levente Kurusa wrote:
> 2014-07-08 16:08 GMT+02:00 Andrey Utkin <andrey.krieger.utkin@gmail.com>:
> > Use signed type to check correctly for negative error code. The issue
> > was reported with static analyser:
> >
> > [linux-3.13/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:270]:
> > (style) A pointer can not be negative so it is either pointless or an
> > error to check if it is.
> >
> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=69071
> > Reported-by: David Binderman <dcb314@hotmail.com>
> > Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
>
> Hmm, while it is true that get_ipipe_mode returns an int, but
> the consequent call to regw_ip takes an u32 as its second
> argument. Did it cause a build warning for you?
It won't cause a compile warning.
> (Can't really
> check since I don't have ARM cross compilers close-by)
Make a small test program and test.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [media] davinci-vpfe: Fix retcode check
2014-07-08 14:32 ` Levente Kurusa
@ 2014-07-08 14:58 ` Andrey Utkin
2014-07-08 15:41 ` Prabhakar Lad
2014-07-08 15:11 ` Dan Carpenter
1 sibling, 1 reply; 7+ messages in thread
From: Andrey Utkin @ 2014-07-08 14:58 UTC (permalink / raw)
To: Levente Kurusa
Cc: linux-kernel, OSUOSL Drivers, Linux Media, Greg Kroah-Hartman,
Mauro Carvalho Chehab, prabhakar.csengg, Josh Triplett,
Archana Kumari, Lisa Nguyen
2014-07-08 17:32 GMT+03:00 Levente Kurusa <lkurusa@redhat.com>:
> Hmm, while it is true that get_ipipe_mode returns an int, but
> the consequent call to regw_ip takes an u32 as its second
> argument. Did it cause a build warning for you? (Can't really
> check since I don't have ARM cross compilers close-by)
> If not, then:
Cannot say for sure would compiler complain.
I also haven't really checked it, and unfortunately even haven't
succeeded to make a config that would build that code. But i believe
that warning is still better than misbehaviour.
--
Andrey Utkin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [media] davinci-vpfe: Fix retcode check
2014-07-08 14:08 Andrey Utkin
@ 2014-07-08 14:32 ` Levente Kurusa
2014-07-08 14:58 ` Andrey Utkin
2014-07-08 15:11 ` Dan Carpenter
0 siblings, 2 replies; 7+ messages in thread
From: Levente Kurusa @ 2014-07-08 14:32 UTC (permalink / raw)
To: Andrey Utkin
Cc: linux-kernel, OSUOSL Drivers, Linux Media, Greg Kroah-Hartman,
Mauro Carvalho Chehab, prabhakar.csengg, Josh Triplett,
Archana Kumari, Lisa Nguyen
2014-07-08 16:08 GMT+02:00 Andrey Utkin <andrey.krieger.utkin@gmail.com>:
> Use signed type to check correctly for negative error code. The issue
> was reported with static analyser:
>
> [linux-3.13/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:270]:
> (style) A pointer can not be negative so it is either pointless or an
> error to check if it is.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=69071
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Hmm, while it is true that get_ipipe_mode returns an int, but
the consequent call to regw_ip takes an u32 as its second
argument. Did it cause a build warning for you? (Can't really
check since I don't have ARM cross compilers close-by)
If not, then:
Reviewed-by: Levente Kurusa <lkurusa@redhat.com>
Thanks,
Levente Kurusa
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] [media] davinci-vpfe: Fix retcode check
@ 2014-07-08 14:08 Andrey Utkin
2014-07-08 14:32 ` Levente Kurusa
0 siblings, 1 reply; 7+ messages in thread
From: Andrey Utkin @ 2014-07-08 14:08 UTC (permalink / raw)
To: linux-kernel, devel, linux-media
Cc: gregkh, m.chehab, prabhakar.csengg, josh, levex,
archanakumari959, lisa, Andrey Utkin
Use signed type to check correctly for negative error code. The issue
was reported with static analyser:
[linux-3.13/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:270]:
(style) A pointer can not be negative so it is either pointless or an
error to check if it is.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=69071
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
index b2daf5e..e326032 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
@@ -254,7 +254,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe)
void __iomem *ipipe_base = ipipe->base_addr;
struct v4l2_mbus_framefmt *outformat;
u32 color_pat;
- u32 ipipe_mode;
+ int ipipe_mode;
u32 data_path;
/* enable clock to IPIPE */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-07-08 15:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-05 1:31 [PATCH] [media] davinci-vpfe: Fix retcode check Andrey Utkin
2014-07-05 1:31 ` Andrey Utkin
2014-07-08 14:08 Andrey Utkin
2014-07-08 14:32 ` Levente Kurusa
2014-07-08 14:58 ` Andrey Utkin
2014-07-08 15:41 ` Prabhakar Lad
2014-07-08 15:11 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.