Skip to content

Commit ff785e1

Browse files
Finn Thainmpe
authored andcommitted
macintosh/adb-iop: Correct comment text
This patch improves comment style and corrects some misunderstandings in the text. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/996f835d2f3d90baaaf9ee954e252d06e8886c6f.1590880623.git.fthain@telegraphics.com.au
1 parent 8384c82 commit ff785e1

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

‎drivers/macintosh/adb-iop.c‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,10 @@ static void adb_iop_listen(struct iop_msg *msg)
101101

102102
req = current_req;
103103

104-
/* Handle a timeout. Timeout packets seem to occur even after */
105-
/* we've gotten a valid reply to a TALK, so I'm assuming that */
106-
/* a "timeout" is actually more like an "end-of-data" signal. */
107-
/* We need to send back a timeout packet to the IOP to shut */
108-
/* it up, plus complete the current request, if any. */
104+
/* Handle a timeout. Timeout packets seem to occur even after
105+
* we've gotten a valid reply to a TALK, presumably because of
106+
* autopolling.
107+
*/
109108

110109
if (amsg->flags & ADB_IOP_TIMEOUT) {
111110
msg->reply[0] = ADB_IOP_TIMEOUT | ADB_IOP_AUTOPOLL;
@@ -115,9 +114,6 @@ static void adb_iop_listen(struct iop_msg *msg)
115114
adb_iop_end_req(req, idle);
116115
}
117116
} else {
118-
/* TODO: is it possible for more than one chunk of data */
119-
/* to arrive before the timeout? If so we need to */
120-
/* use reply_ptr here like the other drivers do. */
121117
if ((adb_iop_state == awaiting_reply) &&
122118
(amsg->flags & ADB_IOP_EXPLICIT)) {
123119
req->reply_len = amsg->count + 1;
@@ -152,23 +148,24 @@ static void adb_iop_start(void)
152148

153149
local_irq_save(flags);
154150

155-
/* The IOP takes MacII-style packets, so */
156-
/* strip the initial ADB_PACKET byte. */
157-
151+
/* The IOP takes MacII-style packets, so strip the initial
152+
* ADB_PACKET byte.
153+
*/
158154
amsg.flags = ADB_IOP_EXPLICIT;
159155
amsg.count = req->nbytes - 2;
160156

161-
/* amsg.data immediately follows amsg.cmd, effectively making */
162-
/* amsg.cmd a pointer to the beginning of a full ADB packet. */
157+
/* amsg.data immediately follows amsg.cmd, effectively making
158+
* &amsg.cmd a pointer to the beginning of a full ADB packet.
159+
*/
163160
memcpy(&amsg.cmd, req->data + 1, req->nbytes - 1);
164161

165162
req->sent = 1;
166163
adb_iop_state = sending;
167164
local_irq_restore(flags);
168165

169-
/* Now send it. The IOP manager will call adb_iop_complete */
170-
/* when the packet has been sent. */
171-
166+
/* Now send it. The IOP manager will call adb_iop_complete
167+
* when the message has been sent.
168+
*/
172169
iop_send_message(ADB_IOP, ADB_CHAN, req, sizeof(amsg), (__u8 *)&amsg,
173170
adb_iop_complete);
174171
}

0 commit comments

Comments
 (0)