All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: usb-misc: sisusbvga: remove dead code
@ 2017-02-08  4:01 Gustavo A. R. Silva
  2017-02-16 10:28 ` Oliver Neukum
  0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-02-08  4:01 UTC (permalink / raw)
  To: thomas, gregkh; +Cc: linux-usb, linux-kernel

The condition modex % 16 cannot be true when modex value is equal to 640
The condition du & 0xff cannot be true when du value is equal to 0x1400

Addresses-Coverity-Id: 101163
Addresses-Coverity-Id: 744373
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/usb/misc/sisusbvga/sisusb.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 05bd39d..440d7fe 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -1831,16 +1831,10 @@ static int sisusb_set_default_mode(struct sisusb_usb_data *sisusb,
 	SETIREGANDOR(SISCR, 0x09, 0x5f, ((crtcdata[16] & 0x01) << 5));
 	SETIREG(SISCR, 0x14, 0x4f);
 	du = (modex / 16) * (bpp * 2);	/* offset/pitch */
-	if (modex % 16)
-		du += bpp;
-
 	SETIREGANDOR(SISSR, 0x0e, 0xf0, ((du >> 8) & 0x0f));
 	SETIREG(SISCR, 0x13, (du & 0xff));
 	du <<= 5;
 	tmp8 = du >> 8;
-	if (du & 0xff)
-		tmp8++;
-
 	SETIREG(SISSR, 0x10, tmp8);
 	SETIREG(SISSR, 0x31, 0x00);	/* VCLK */
 	SETIREG(SISSR, 0x2b, 0x1b);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drivers: usb-misc: sisusbvga: remove dead code
  2017-02-08  4:01 [PATCH] drivers: usb-misc: sisusbvga: remove dead code Gustavo A. R. Silva
@ 2017-02-16 10:28 ` Oliver Neukum
  2017-02-16 16:39   ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Neukum @ 2017-02-16 10:28 UTC (permalink / raw)
  To: Gustavo A. R. Silva, gregkh, thomas; +Cc: linux-kernel, linux-usb

Am Dienstag, den 07.02.2017, 22:01 -0600 schrieb Gustavo A. R. Silva:
> The condition modex % 16 cannot be true when modex value is equal to
> 640
> The condition du & 0xff cannot be true when du value is equal to
> 0x1400
> 

Sorry for speaking up so late, but this is not a good idea.
We lose the knowledge how to do this correctly, if we want
to change the resolution.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drivers: usb-misc: sisusbvga: remove dead code
  2017-02-16 10:28 ` Oliver Neukum
@ 2017-02-16 16:39   ` Greg KH
  2017-02-16 20:59     ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2017-02-16 16:39 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: Gustavo A. R. Silva, thomas, linux-kernel, linux-usb

On Thu, Feb 16, 2017 at 11:28:49AM +0100, Oliver Neukum wrote:
> Am Dienstag, den 07.02.2017, 22:01 -0600 schrieb Gustavo A. R. Silva:
> > The condition modex % 16 cannot be true when modex value is equal to
> > 640
> > The condition du & 0xff cannot be true when du value is equal to
> > 0x1400
> > 
> 
> Sorry for speaking up so late, but this is not a good idea.
> We lose the knowledge how to do this correctly, if we want
> to change the resolution.

Given the age of this driver, I doubt that will ever happen :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drivers: usb-misc: sisusbvga: remove dead code
  2017-02-16 16:39   ` Greg KH
@ 2017-02-16 20:59     ` Felipe Balbi
  0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2017-02-16 20:59 UTC (permalink / raw)
  To: Greg KH, Oliver Neukum
  Cc: Gustavo A. R. Silva, thomas, linux-kernel, linux-usb


Hi,

Greg KH <gregkh@linuxfoundation.org> writes:
> On Thu, Feb 16, 2017 at 11:28:49AM +0100, Oliver Neukum wrote:
>> Am Dienstag, den 07.02.2017, 22:01 -0600 schrieb Gustavo A. R. Silva:
>> > The condition modex % 16 cannot be true when modex value is equal to
>> > 640
>> > The condition du & 0xff cannot be true when du value is equal to
>> > 0x1400
>> > 
>> 
>> Sorry for speaking up so late, but this is not a good idea.
>> We lose the knowledge how to do this correctly, if we want
>> to change the resolution.
>
> Given the age of this driver, I doubt that will ever happen :)

besides, the "knowledge" will always be in git history.

-- 
balbi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-16 21:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08  4:01 [PATCH] drivers: usb-misc: sisusbvga: remove dead code Gustavo A. R. Silva
2017-02-16 10:28 ` Oliver Neukum
2017-02-16 16:39   ` Greg KH
2017-02-16 20:59     ` Felipe Balbi

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.