summaryrefslogtreecommitdiff
path: root/drivers/misc/ti-st/st_kim.c
diff options
context:
space:
mode:
authorPavan Savoy <pavan_savoy@ti.com>2010-10-13 00:27:38 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-14 23:41:10 +0400
commit73f12e8d3d94828b9efe2b8b8a34b4ad6d14ee47 (patch)
tree42b4dad70d74feccd5c6c802eef6837606096ffe /drivers/misc/ti-st/st_kim.c
parentda6830ac3969c9480e05ed2b21eee64e21a101d2 (diff)
downloadlinux-73f12e8d3d94828b9efe2b8b8a34b4ad6d14ee47.tar.xz
drivers: misc: ti-st: fix review comments
Based on comments from Jiri Slaby, drop the register storage specifier, remove the unused code, cleanup the const to non-const type casting. Also make the line discipline ops structure static, since its a singleton, unmodified structure which need not be in heap. Reported-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/misc/ti-st/st_kim.c')
-rw-r--r--drivers/misc/ti-st/st_kim.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 6d23a7222627..73b6c8b0e869 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -75,7 +75,7 @@ const unsigned char *protocol_names[] = {
};
#define MAX_ST_DEVICES 3 /* Imagine 1 on each UART for now */
-struct platform_device *st_kim_devices[MAX_ST_DEVICES];
+static struct platform_device *st_kim_devices[MAX_ST_DEVICES];
/**********************************************************************/
/* internal functions */
@@ -157,17 +157,18 @@ static inline int kim_check_data_len(struct kim_data_s *kim_gdata, int len)
void kim_int_recv(struct kim_data_s *kim_gdata,
const unsigned char *data, long count)
{
- register char *ptr;
+ const unsigned char *ptr;
struct hci_event_hdr *eh;
- register int len = 0, type = 0;
+ int len = 0, type = 0;
pr_debug("%s", __func__);
/* Decode received bytes here */
- ptr = (char *)data;
+ ptr = data;
if (unlikely(ptr == NULL)) {
pr_err(" received null from TTY ");
return;
}
+
while (count) {
if (kim_gdata->rx_count) {
len = min_t(unsigned int, kim_gdata->rx_count, count);
@@ -231,7 +232,7 @@ void kim_int_recv(struct kim_data_s *kim_gdata,
static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
{
unsigned short version = 0, chip = 0, min_ver = 0, maj_ver = 0;
- char read_ver_cmd[] = { 0x01, 0x01, 0x10, 0x00 };
+ const char read_ver_cmd[] = { 0x01, 0x01, 0x10, 0x00 };
pr_debug("%s", __func__);
@@ -278,8 +279,8 @@ static long download_firmware(struct kim_data_s *kim_gdata)
{
long err = 0;
long len = 0;
- register unsigned char *ptr = NULL;
- register unsigned char *action_ptr = NULL;
+ unsigned char *ptr = NULL;
+ unsigned char *action_ptr = NULL;
unsigned char bts_scr_name[30] = { 0 }; /* 30 char long bts scr name? */
err = read_local_version(kim_gdata, bts_scr_name);