lkml.org 
[lkml]   [2020]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] Staging: comedi: dt2814: remove unused assignments
Oh, crap.  I'm really sorry but these lines of code can't be deleted.
Luc was suggesting that earlier and I saw what he said but I was sure
they could be deleted. Now that I look at it more closely I see I was
wrong.

hi = inb(dev->iobase + DT2814_DATA);
lo = inb(dev->iobase + DT2814_DATA);

Every time we read from DT2814_DATA we get different data. The first
time we get the byte and the second time we get the low byte. In other
words reading from the register has side effects so if we delete a read
then the next thing to read from there will get the data that we were
supposed to read.

What we could do instead would be to remove the "hi = " assignment.
There is one other places where the assignment is not used.

i = inb(dev->iobase + DT2814_DATA);
i = inb(dev->iobase + DT2814_DATA);

I feel really bad for not seeing this earlier. I know everyone hates
redoing patches. I certain hate redoing patches. This one was my
fault. :/ The v3 was in the right format and all, but it will cause a
bug.

regards,
dan carpenter

\
 
 \ /
  Last update: 2020-05-26 22:27    [W:0.050 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site