Skip to content

Commit 7e8eebe

Browse files
Lee Jonesgregkh
authored andcommitted
misc: ti-st: st_core: Tidy-up bespoke commentry
If it's still in use and worth the effort, it sure looks like this driver could do with a good scrub (clean). This patch conserns itself with the non-standard comments located thoughout the file. It also fixes the following W=1 warnings by demoting the kerneldoc function headers to standard comments, since there doesn't appear to be a requirement for the function args to be documented: drivers/misc/ti-st/st_core.c:132: warning: Function parameter or member 'st_gdata' not described in 'st_reg_complete' drivers/misc/ti-st/st_core.c:132: warning: Function parameter or member 'err' not described in 'st_reg_complete' drivers/misc/ti-st/st_core.c:197: warning: Function parameter or member 'st_gdata' not described in 'st_wakeup_ack' drivers/misc/ti-st/st_core.c:197: warning: Function parameter or member 'cmd' not described in 'st_wakeup_ack' drivers/misc/ti-st/st_core.c:226: warning: Function parameter or member 'disc_data' not described in 'st_int_recv' drivers/misc/ti-st/st_core.c:226: warning: Function parameter or member 'data' not described in 'st_int_recv' drivers/misc/ti-st/st_core.c:226: warning: Function parameter or member 'count' not described in 'st_int_recv' drivers/misc/ti-st/st_core.c:387: warning: Function parameter or member 'st_gdata' not described in 'st_int_dequeue' drivers/misc/ti-st/st_core.c:409: warning: Function parameter or member 'st_gdata' not described in 'st_int_enqueue' drivers/misc/ti-st/st_core.c:409: warning: Function parameter or member 'skb' not described in 'st_int_enqueue' Cc: Pavan Savoy <pavan_savoy@ti.com> Cc: Naveen Jain <naveen_jain@ti.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20200626130525.389469-3-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b23d515 commit 7e8eebe

1 file changed

Lines changed: 49 additions & 30 deletions

File tree

‎drivers/misc/ti-st/st_core.c‎

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
extern void st_kim_recv(void *, const unsigned char *, long);
2020
void st_int_recv(void *, const unsigned char *, long);
21-
/* function pointer pointing to either,
21+
/*
22+
* function pointer pointing to either,
2223
* st_kim_recv during registration to receive fw download responses
2324
* st_int_recv after registration to receive proto stack responses
2425
*/
@@ -60,7 +61,8 @@ int st_get_uart_wr_room(struct st_data_s *st_gdata)
6061
return tty->ops->write_room(tty);
6162
}
6263

63-
/* can be called in from
64+
/*
65+
* can be called in from
6466
* -- KIM (during fw download)
6567
* -- ST Core (during st_write)
6668
*
@@ -100,7 +102,8 @@ static void st_send_frame(unsigned char chnl_id, struct st_data_s *st_gdata)
100102
kfree_skb(st_gdata->rx_skb);
101103
return;
102104
}
103-
/* this cannot fail
105+
/*
106+
* this cannot fail
104107
* this shouldn't take long
105108
* - should be just skb_queue_tail for the
106109
* protocol stack driver
@@ -121,9 +124,8 @@ static void st_send_frame(unsigned char chnl_id, struct st_data_s *st_gdata)
121124
return;
122125
}
123126

124-
/**
125-
* st_reg_complete -
126-
* to call registration complete callbacks
127+
/*
128+
* st_reg_complete - to call registration complete callbacks
127129
* of all protocol stack drivers
128130
* This function is being called with spin lock held, protocol drivers are
129131
* only expected to complete their waits and do nothing more than that.
@@ -156,30 +158,32 @@ static inline int st_check_data_len(struct st_data_s *st_gdata,
156158
pr_debug("len %d room %d", len, room);
157159

158160
if (!len) {
159-
/* Received packet has only packet header and
161+
/*
162+
* Received packet has only packet header and
160163
* has zero length payload. So, ask ST CORE to
161164
* forward the packet to protocol driver (BT/FM/GPS)
162165
*/
163166
st_send_frame(chnl_id, st_gdata);
164167

165168
} else if (len > room) {
166-
/* Received packet's payload length is larger.
169+
/*
170+
* Received packet's payload length is larger.
167171
* We can't accommodate it in created skb.
168172
*/
169173
pr_err("Data length is too large len %d room %d", len,
170174
room);
171175
kfree_skb(st_gdata->rx_skb);
172176
} else {
173-
/* Packet header has non-zero payload length and
177+
/*
178+
* Packet header has non-zero payload length and
174179
* we have enough space in created skb. Lets read
175180
* payload data */
176181
st_gdata->rx_state = ST_W4_DATA;
177182
st_gdata->rx_count = len;
178183
return len;
179184
}
180185

181-
/* Change ST state to continue to process next
182-
* packet */
186+
/* Change ST state to continue to process next packet */
183187
st_gdata->rx_state = ST_W4_PACKET_TYPE;
184188
st_gdata->rx_skb = NULL;
185189
st_gdata->rx_count = 0;
@@ -188,7 +192,7 @@ static inline int st_check_data_len(struct st_data_s *st_gdata,
188192
return 0;
189193
}
190194

191-
/**
195+
/*
192196
* st_wakeup_ack - internal function for action when wake-up ack
193197
* received
194198
*/
@@ -199,7 +203,8 @@ static inline void st_wakeup_ack(struct st_data_s *st_gdata,
199203
unsigned long flags = 0;
200204

201205
spin_lock_irqsave(&st_gdata->lock, flags);
202-
/* de-Q from waitQ and Q in txQ now that the
206+
/*
207+
* de-Q from waitQ and Q in txQ now that the
203208
* chip is awake
204209
*/
205210
while ((waiting_skb = skb_dequeue(&st_gdata->tx_waitq)))
@@ -213,7 +218,7 @@ static inline void st_wakeup_ack(struct st_data_s *st_gdata,
213218
st_tx_wakeup(st_gdata);
214219
}
215220

216-
/**
221+
/*
217222
* st_int_recv - ST's internal receive function.
218223
* Decodes received RAW data and forwards to corresponding
219224
* client drivers (Bluetooth,FM,GPS..etc).
@@ -262,8 +267,10 @@ void st_int_recv(void *disc_data,
262267
/* Waiting for complete packet ? */
263268
case ST_W4_DATA:
264269
pr_debug("Complete pkt received");
265-
/* Ask ST CORE to forward
266-
* the packet to protocol driver */
270+
/*
271+
* Ask ST CORE to forward
272+
* the packet to protocol driver
273+
*/
267274
st_send_frame(st_gdata->rx_chnl, st_gdata);
268275

269276
st_gdata->rx_state = ST_W4_PACKET_TYPE;
@@ -276,7 +283,7 @@ void st_int_recv(void *disc_data,
276283
&st_gdata->rx_skb->data
277284
[proto->offset_len_in_hdr];
278285
pr_debug("plen pointing to %x\n", *plen);
279-
if (proto->len_size == 1)/* 1 byte len field */
286+
if (proto->len_size == 1) /* 1 byte len field */
280287
payload_len = *(unsigned char *)plen;
281288
else if (proto->len_size == 2)
282289
payload_len =
@@ -294,18 +301,23 @@ void st_int_recv(void *disc_data,
294301
}
295302

296303
/* end of if rx_count */
297-
/* Check first byte of packet and identify module
298-
* owner (BT/FM/GPS) */
304+
305+
/*
306+
* Check first byte of packet and identify module
307+
* owner (BT/FM/GPS)
308+
*/
299309
switch (*ptr) {
300310
case LL_SLEEP_IND:
301311
case LL_SLEEP_ACK:
302312
case LL_WAKE_UP_IND:
303313
pr_debug("PM packet");
304-
/* this takes appropriate action based on
314+
/*
315+
* this takes appropriate action based on
305316
* sleep state received --
306317
*/
307318
st_ll_sleep_state(st_gdata, *ptr);
308-
/* if WAKEUP_IND collides copy from waitq to txq
319+
/*
320+
* if WAKEUP_IND collides copy from waitq to txq
309321
* and assume chip awake
310322
*/
311323
spin_unlock_irqrestore(&st_gdata->lock, flags);
@@ -331,7 +343,8 @@ void st_int_recv(void *disc_data,
331343
default:
332344
type = *ptr;
333345

334-
/* Default case means non-HCILL packets,
346+
/*
347+
* Default case means non-HCILL packets,
335348
* possibilities are packets for:
336349
* (a) valid protocol - Supported Protocols within
337350
* the ST_MAX_CHANNELS.
@@ -377,7 +390,7 @@ void st_int_recv(void *disc_data,
377390
return;
378391
}
379392

380-
/**
393+
/*
381394
* st_int_dequeue - internal de-Q function.
382395
* If the previous data set was not written
383396
* completely, return that skb which has the pending data.
@@ -396,7 +409,7 @@ static struct sk_buff *st_int_dequeue(struct st_data_s *st_gdata)
396409
return skb_dequeue(&st_gdata->txq);
397410
}
398411

399-
/**
412+
/*
400413
* st_int_enqueue - internal Q-ing function.
401414
* Will either Q the skb to txq or the tx_waitq
402415
* depending on the ST LL state.
@@ -561,7 +574,8 @@ long st_register(struct st_proto_s *new_proto)
561574
/* release lock previously held - re-locked below */
562575
spin_unlock_irqrestore(&st_gdata->lock, flags);
563576

564-
/* this may take a while to complete
577+
/*
578+
* this may take a while to complete
565579
* since it involves BT fw download
566580
*/
567581
err = st_kim_start(st_gdata->kim_data);
@@ -583,7 +597,8 @@ long st_register(struct st_proto_s *new_proto)
583597
clear_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state);
584598
st_recv = st_int_recv;
585599

586-
/* this is where all pending registration
600+
/*
601+
* this is where all pending registration
587602
* are signalled to be complete by calling callback functions
588603
*/
589604
if ((st_gdata->protos_registered != ST_EMPTY) &&
@@ -593,7 +608,8 @@ long st_register(struct st_proto_s *new_proto)
593608
}
594609
clear_bit(ST_REG_PENDING, &st_gdata->st_state);
595610

596-
/* check for already registered once more,
611+
/*
612+
* check for already registered once more,
597613
* since the above check is old
598614
*/
599615
if (st_gdata->is_registered[new_proto->chnl_id] == true) {
@@ -622,7 +638,8 @@ long st_register(struct st_proto_s *new_proto)
622638
}
623639
EXPORT_SYMBOL_GPL(st_register);
624640

625-
/* to unregister a protocol -
641+
/*
642+
* to unregister a protocol -
626643
* to be called from protocol stack driver
627644
*/
628645
long st_unregister(struct st_proto_s *proto)
@@ -742,7 +759,8 @@ static void st_tty_close(struct tty_struct *tty)
742759

743760
pr_info("%s ", __func__);
744761

745-
/* TODO:
762+
/*
763+
* TODO:
746764
* if a protocol has been registered & line discipline
747765
* un-installed for some reason - what should be done ?
748766
*/
@@ -795,7 +813,8 @@ static void st_tty_receive(struct tty_struct *tty, const unsigned char *data,
795813
pr_debug("done %s", __func__);
796814
}
797815

798-
/* wake-up function called in from the TTY layer
816+
/*
817+
* wake-up function called in from the TTY layer
799818
* inside the internal wakeup function will be called
800819
*/
801820
static void st_tty_wakeup(struct tty_struct *tty)

0 commit comments

Comments
 (0)