Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: ti-st: st_kim: 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_kim.c:42: warning: Function parameter or member 'id' not described in 'st_get_plat_device'
/drivers/misc/ti-st/st_kim.c:53: warning: Function parameter or member 'kim_gdata' not described in 'validate_firmware_response'
/drivers/misc/ti-st/st_kim.c:126: warning: Function parameter or member 'kim_gdata' not described in 'kim_int_recv'
/drivers/misc/ti-st/st_kim.c:126: warning: Function parameter or member 'data' not described in 'kim_int_recv'
/drivers/misc/ti-st/st_kim.c:126: warning: Function parameter or member 'count' not described in 'kim_int_recv'
/drivers/misc/ti-st/st_kim.c:272: warning: Function parameter or member 'kim_gdata' not described in 'download_firmware'
/drivers/misc/ti-st/st_kim.c:445: warning: Function parameter or member 'kim_data' not described in 'st_kim_start'
/drivers/misc/ti-st/st_kim.c:509: warning: Function parameter or member 'kim_data' not described in 'st_kim_stop'
/drivers/misc/ti-st/st_kim.c:661: warning: Function parameter or member 'core_data' not described in 'st_kim_ref'
/drivers/misc/ti-st/st_kim.c:661: warning: Function parameter or member 'id' not described in 'st_kim_ref'

Cc: Pavan Savoy <pavan_savoy@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-4-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Lee Jones and committed by
Greg Kroah-Hartman
3caf1b48 7e8eebef

+44 -27
+44 -27
drivers/misc/ti-st/st_kim.c
··· 30 30 /**********************************************************************/ 31 31 /* internal functions */ 32 32 33 - /** 33 + /* 34 34 * st_get_plat_device - 35 35 * function which returns the reference to the platform device 36 36 * requested by id. As of now only 1 such device exists (id=0) ··· 43 43 return st_kim_devices[id]; 44 44 } 45 45 46 - /** 46 + /* 47 47 * validate_firmware_response - 48 48 * function to return whether the firmware response was proper 49 49 * in case of error don't complete so that waiting for proper ··· 55 55 if (!skb) 56 56 return; 57 57 58 - /* these magic numbers are the position in the response buffer which 58 + /* 59 + * these magic numbers are the position in the response buffer which 59 60 * allows us to distinguish whether the response is for the read 60 61 * version info. command 61 62 */ ··· 80 79 kfree_skb(skb); 81 80 } 82 81 83 - /* check for data len received inside kim_int_recv 82 + /* 83 + * check for data len received inside kim_int_recv 84 84 * most often hit the last case to update state to waiting for data 85 85 */ 86 86 static inline int kim_check_data_len(struct kim_data_s *kim_gdata, int len) ··· 93 91 if (!len) { 94 92 validate_firmware_response(kim_gdata); 95 93 } else if (len > room) { 96 - /* Received packet's payload length is larger. 94 + /* 95 + * Received packet's payload length is larger. 97 96 * We can't accommodate it in created skb. 98 97 */ 99 98 pr_err("Data length is too large len %d room %d", len, 100 99 room); 101 100 kfree_skb(kim_gdata->rx_skb); 102 101 } else { 103 - /* Packet header has non-zero payload length and 102 + /* 103 + * Packet header has non-zero payload length and 104 104 * we have enough space in created skb. Lets read 105 105 * payload data */ 106 106 kim_gdata->rx_state = ST_W4_DATA; ··· 110 106 return len; 111 107 } 112 108 113 - /* Change ST LL state to continue to process next 114 - * packet */ 109 + /* 110 + * Change ST LL state to continue to process next 111 + * packet 112 + */ 115 113 kim_gdata->rx_state = ST_W4_PACKET_TYPE; 116 114 kim_gdata->rx_skb = NULL; 117 115 kim_gdata->rx_count = 0; ··· 121 115 return 0; 122 116 } 123 117 124 - /** 118 + /* 125 119 * kim_int_recv - receive function called during firmware download 126 120 * firmware download responses on different UART drivers 127 121 * have been observed to come in bursts of different ··· 222 216 return timeout ? -ERESTARTSYS : -ETIMEDOUT; 223 217 } 224 218 reinit_completion(&kim_gdata->kim_rcvd); 225 - /* the positions 12 & 13 in the response buffer provide with the 219 + /* 220 + * the positions 12 & 13 in the response buffer provide with the 226 221 * chip, major & minor numbers 227 222 */ 228 223 ··· 270 263 } 271 264 } 272 265 273 - /** 266 + /* 274 267 * download_firmware - 275 268 * internal function which parses through the .bts firmware 276 269 * script file intreprets SEND, DELAY actions only as of now ··· 302 295 } 303 296 ptr = (void *)kim_gdata->fw_entry->data; 304 297 len = kim_gdata->fw_entry->size; 305 - /* bts_header to remove out magic number and 298 + /* 299 + * bts_header to remove out magic number and 306 300 * version 307 301 */ 308 302 ptr += sizeof(struct bts_header); ··· 321 313 if (unlikely 322 314 (((struct hci_command *)action_ptr)->opcode == 323 315 0xFF36)) { 324 - /* ignore remote change 325 - * baud rate HCI VS command */ 316 + /* 317 + * ignore remote change 318 + * baud rate HCI VS command 319 + */ 326 320 pr_warn("change remote baud" 327 321 " rate command in firmware"); 328 322 skip_change_remote_baud(&ptr, &len); ··· 356 346 release_firmware(kim_gdata->fw_entry); 357 347 return -ETIMEDOUT; 358 348 } 359 - /* reinit completion before sending for the 349 + /* 350 + * reinit completion before sending for the 360 351 * relevant wait 361 352 */ 362 353 reinit_completion(&kim_gdata->kim_rcvd); ··· 429 418 struct st_data_s *st_gdata = (struct st_data_s *)disc_data; 430 419 struct kim_data_s *kim_gdata = st_gdata->kim_data; 431 420 432 - /* proceed to gather all data and distinguish read fw version response 421 + /* 422 + * proceed to gather all data and distinguish read fw version response 433 423 * from other fw responses when data gathering is complete 434 424 */ 435 425 kim_int_recv(kim_gdata, data, count); 436 426 return; 437 427 } 438 428 439 - /* to signal completion of line discipline installation 429 + /* 430 + * to signal completion of line discipline installation 440 431 * called from ST Core, upon tty_open 441 432 */ 442 433 void st_kim_complete(void *kim_data) ··· 447 434 complete(&kim_gdata->ldisc_installed); 448 435 } 449 436 450 - /** 437 + /* 451 438 * st_kim_start - called from ST Core upon 1st registration 452 439 * This involves toggling the chip enable gpio, reading 453 440 * the firmware version from chip, forming the fw file name ··· 485 472 err = wait_for_completion_interruptible_timeout( 486 473 &kim_gdata->ldisc_installed, msecs_to_jiffies(LDISC_TIME)); 487 474 if (!err) { 488 - /* ldisc installation timeout, 489 - * flush uart, power cycle BT_EN */ 475 + /* 476 + * ldisc installation timeout, 477 + * flush uart, power cycle BT_EN 478 + */ 490 479 pr_err("ldisc installation timeout"); 491 480 err = st_kim_stop(kim_gdata); 492 481 continue; ··· 497 482 pr_info("line discipline installed"); 498 483 err = download_firmware(kim_gdata); 499 484 if (err != 0) { 500 - /* ldisc installed but fw download failed, 501 - * flush uart & power cycle BT_EN */ 485 + /* 486 + * ldisc installed but fw download failed, 487 + * flush uart & power cycle BT_EN 488 + */ 502 489 pr_err("download firmware failed"); 503 490 err = st_kim_stop(kim_gdata); 504 491 continue; ··· 512 495 return err; 513 496 } 514 497 515 - /** 498 + /* 516 499 * st_kim_stop - stop communication with chip. 517 500 * This can be called from ST Core/KIM, on the- 518 501 * (a) last un-register when chip need not be powered there-after, ··· 667 650 .attrs = uim_attrs, 668 651 }; 669 652 670 - /** 653 + /* 671 654 * st_kim_ref - reference the core's data 672 655 * This references the per-ST platform device in the arch/xx/ 673 656 * board-xx.c file. ··· 746 729 pr_err(" unable to configure gpio %d", kim_gdata->nshutdown); 747 730 goto err_sysfs_group; 748 731 } 749 - /* get reference of pdev for request_firmware 750 - */ 732 + /* get reference of pdev for request_firmware */ 751 733 kim_gdata->kim_pdev = pdev; 752 734 init_completion(&kim_gdata->kim_rcvd); 753 735 init_completion(&kim_gdata->ldisc_installed); ··· 788 772 789 773 kim_gdata = platform_get_drvdata(pdev); 790 774 791 - /* Free the Bluetooth/FM/GPIO 775 + /* 776 + * Free the Bluetooth/FM/GPIO 792 777 * nShutdown gpio from the system 793 778 */ 794 779 gpio_free(pdata->nshutdown_gpio);