* [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used
@ 2014-07-05 12:51 Rickard Strandqvist
2014-07-06 19:01 ` Rickard Strandqvist
2014-07-21 21:25 ` Pavel Machek
0 siblings, 2 replies; 5+ messages in thread
From: Rickard Strandqvist @ 2014-07-05 12:51 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Rickard Strandqvist, Rickard Strandqvist, Wang YanQing,
Jingoo Han, Evgeniy Polyakov, Joe Perches, Sachin Kamat,
David Fries, linux-fbdev, linux-kernel
From: Rickard Strandqvist <rickard.strandqvist@sonymobile.com>
Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/video/fbdev/uvesafb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 509d452..50086b9 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -555,12 +555,12 @@ static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
struct uvesafb_par *par)
{
- int i, err;
+ int i;
uvesafb_reset(task);
task->t.regs.eax = 0x4f0a;
task->t.regs.ebx = 0x0;
- err = uvesafb_exec(task);
+ uvesafb_exec(task);
if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
par->pmi_setpal = par->ypan = 0;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used
2014-07-05 12:51 [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used Rickard Strandqvist
@ 2014-07-06 19:01 ` Rickard Strandqvist
2014-07-21 21:25 ` Pavel Machek
1 sibling, 0 replies; 5+ messages in thread
From: Rickard Strandqvist @ 2014-07-06 19:01 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Rickard Strandqvist, Wang YanQing, Jingoo Han, Evgeniy Polyakov,
Joe Perches, Sachin Kamat, linux-fbdev, linux-kernel
Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/video/fbdev/uvesafb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 509d452..50086b9 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -555,12 +555,12 @@ static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
struct uvesafb_par *par)
{
- int i, err;
+ int i;
uvesafb_reset(task);
task->t.regs.eax = 0x4f0a;
task->t.regs.ebx = 0x0;
- err = uvesafb_exec(task);
+ uvesafb_exec(task);
if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
par->pmi_setpal = par->ypan = 0;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used
2014-07-05 12:51 [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used Rickard Strandqvist
2014-07-06 19:01 ` Rickard Strandqvist
@ 2014-07-21 21:25 ` Pavel Machek
[not found] ` <CAFo99gYhrNR68mdJY=fn1x-+4U=6gdv=C4-Xn-w-YJAPSa5bBQ@mail.gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2014-07-21 21:25 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Rickard Strandqvist, Wang YanQing, Jingoo Han, Evgeniy Polyakov,
Joe Perches, Sachin Kamat, David Fries, linux-fbdev, linux-kernel
On Sat 2014-07-05 14:51:22, Rickard Strandqvist wrote:
> From: Rickard Strandqvist <rickard.strandqvist@sonymobile.com>
>
> Variable ar assigned a value that is never used.
> I have also removed all the code that thereby serves no purpose.
>
> This was found using a static code analysis program called cppcheck
Are you sure this is right fix?
Should we be returning the error when there's error?
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used
[not found] ` <CAFo99gYhrNR68mdJY=fn1x-+4U=6gdv=C4-Xn-w-YJAPSa5bBQ@mail.gmail.com>
@ 2014-07-22 9:27 ` Pavel Machek
2014-07-23 20:37 ` Rickard Strandqvist
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2014-07-22 9:27 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Joe Perches, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Sachin Kamat, Evgeniy Polyakov, Wang YanQing, Rickard Strandqvist,
Jingoo Han, Linux Fbdev development list, David Fries,
linux-kernel
On Tue 2014-07-22 11:16:58, Rickard Strandqvist wrote:
> Hi
>
> Sure, I agree. But as I thought that I would not change
> currentfunctionality, I would increase the chance that the patches were
> included. And it would of course also clarify this type of problem.
I'm trying to say that getting rid of the variables without changing
functionality might be wrong thing to do, for example in this case. It
looks like error handing is missing by mistake, and you are removing
traces saying that error handing is required here.
Dunno. Perhaps don't push patches where solution is not obvious?
Or push them but mark the place with fixme?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used
2014-07-22 9:27 ` Pavel Machek
@ 2014-07-23 20:37 ` Rickard Strandqvist
0 siblings, 0 replies; 5+ messages in thread
From: Rickard Strandqvist @ 2014-07-23 20:37 UTC (permalink / raw)
To: Pavel Machek
Cc: Joe Perches, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Sachin Kamat, Evgeniy Polyakov, Wang YanQing, Rickard Strandqvist,
Jingoo Han, Linux Fbdev development list, David Fries,
linux-kernel@vger.kernel.org
Hi
There is a lot in what you say.
In the beginning I send in a remark to the maintainer. It happened
absolutely nothing.
When I send out a patch that code is not used, then this code will be
reviewed. Which is the main purpose!
However, agree that this was perhaps an unusually clear solution.
I submit such a patch now.
Kind regards
Rickard Strandqvist
2014-07-22 11:27 GMT+02:00 Pavel Machek <pavel@ucw.cz>:
> On Tue 2014-07-22 11:16:58, Rickard Strandqvist wrote:
>> Hi
>>
>> Sure, I agree. But as I thought that I would not change
>> currentfunctionality, I would increase the chance that the patches were
>> included. And it would of course also clarify this type of problem.
>
> I'm trying to say that getting rid of the variables without changing
> functionality might be wrong thing to do, for example in this case. It
> looks like error handing is missing by mistake, and you are removing
> traces saying that error handing is required here.
>
> Dunno. Perhaps don't push patches where solution is not obvious?
>
> Or push them but mark the place with fixme?
>
> Pavel
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-23 20:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-05 12:51 [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used Rickard Strandqvist
2014-07-06 19:01 ` Rickard Strandqvist
2014-07-21 21:25 ` Pavel Machek
[not found] ` <CAFo99gYhrNR68mdJY=fn1x-+4U=6gdv=C4-Xn-w-YJAPSa5bBQ@mail.gmail.com>
2014-07-22 9:27 ` Pavel Machek
2014-07-23 20:37 ` Rickard Strandqvist
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).