Variable was assigned a value that is never used.
Now the variable is used, and the function returns if a call to
uvesafb_exec() returns a error.
Signed-off-by: Rickard Strandqvist <redacted>
---
drivers/video/fbdev/uvesafb.c | 2 ++
1 file changed, 2 insertions(+)
From: Wang YanQing <udknight@gmail.com> Date: 2014-07-24 17:32:48
On Wed, Jul 23, 2014 at 11:20:27PM +0200, Rickard Strandqvist wrote:
Variable was assigned a value that is never used.
Now the variable is used, and the function returns if a call to
uvesafb_exec() returns a error.
Because the only user of uvesafb_vbe_getpmi in uvesafb.c
don't check its return value, it should do the check indeed,
so maybe below change is better:
- if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
+ if (err || (task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
par->pmi_setpal = par->ypan = 0;
}
Or we check uvesafb_vbe_getpmi's return value, then the code will looks like below:
if (uvesafb_vbe_getpmi(task, par))
par->pmi_setpal = par->ypan = 0;
Thanks.
From: Wang YanQing <udknight@gmail.com> Date: 2014-07-24 17:37:51
On Wed, Jul 23, 2014 at 11:20:27PM +0200, Rickard Strandqvist wrote:
Variable was assigned a value that is never used.
Now the variable is used, and the function returns if a call to
uvesafb_exec() returns a error.
Because the only user of uvesafb_vbe_getpmi in uvesafb.c
don't check its return value, it should do the check indeed,
so maybe below change is better:
- if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
+ if (err || (task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
par->pmi_setpal = par->ypan = 0;
}
Or we check uvesafb_vbe_getpmi's return value, then the code will looks like below:
if (uvesafb_vbe_getpmi(task, par))
par->pmi_setpal = par->ypan = 0;
Add cc:pavel@ucw.cz, you should cc all the people who replied your patch
in later patch version.
Thanks.
2014-07-24 19:36 GMT+02:00 Wang YanQing [off-list ref]:
On Wed, Jul 23, 2014 at 11:20:27PM +0200, Rickard Strandqvist wrote:
quoted
Variable was assigned a value that is never used.
Now the variable is used, and the function returns if a call to
uvesafb_exec() returns a error.
Because the only user of uvesafb_vbe_getpmi in uvesafb.c
don't check its return value, it should do the check indeed,
so maybe below change is better:
- if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
+ if (err || (task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
par->pmi_setpal = par->ypan = 0;
}
Or we check uvesafb_vbe_getpmi's return value, then the code will looks like below:
if (uvesafb_vbe_getpmi(task, par))
par->pmi_setpal = par->ypan = 0;
Hi
Sure, I saw that much of the other code using something like:
if (err || ...)
But this whole discussion start with that you wished it would return
the error, and then error code I assumed?
Ok, but something like this then?
err = uvesafb_exec(task);
if (err) {
par->pmi_setpal = par->ypan = 0;
return err;
}
Kind regards
Rickard Strandqvist