diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-08-13 05:22:27 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-08-14 02:49:26 -0400 |
commit | 66f4e0e43a0389a7f2814f0cc6df39019aead54f (patch) | |
tree | d754ff9f008059766d0e5dcb92b3b606afaa1338 /drivers/bluetooth | |
parent | ad709d4867985de0b239d01702f9ac6bb578099e (diff) |
Bluetooth: Remove typedefs nsh_t and dtl1_info_t
The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedefs for nsh_t and
dtl1_info_t. Also, the name of the struct is changed to drop the _t,
to make the name look less typedef-like.
The following Coccinelle semantic patch detects the case for dtl1_info_t
and a similar patch finds the nsh_t case:
@tn@
identifier i;
type td;
@@
-typedef
struct i { ... }
-td
;
@@
type tn.td;
identifier tn.i;
@@
-td
+ struct i
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/dtl1_cs.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index 2bd8fad17206..78e10f0c65b2 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c | |||
@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL"); | |||
62 | /* ======================== Local structures ======================== */ | 62 | /* ======================== Local structures ======================== */ |
63 | 63 | ||
64 | 64 | ||
65 | typedef struct dtl1_info_t { | 65 | struct dtl1_info { |
66 | struct pcmcia_device *p_dev; | 66 | struct pcmcia_device *p_dev; |
67 | 67 | ||
68 | struct hci_dev *hdev; | 68 | struct hci_dev *hdev; |
@@ -78,7 +78,7 @@ typedef struct dtl1_info_t { | |||
78 | unsigned long rx_state; | 78 | unsigned long rx_state; |
79 | unsigned long rx_count; | 79 | unsigned long rx_count; |
80 | struct sk_buff *rx_skb; | 80 | struct sk_buff *rx_skb; |
81 | } dtl1_info_t; | 81 | }; |
82 | 82 | ||
83 | 83 | ||
84 | static int dtl1_config(struct pcmcia_device *link); | 84 | static int dtl1_config(struct pcmcia_device *link); |
@@ -94,11 +94,11 @@ static int dtl1_config(struct pcmcia_device *link); | |||
94 | #define RECV_WAIT_DATA 1 | 94 | #define RECV_WAIT_DATA 1 |
95 | 95 | ||
96 | 96 | ||
97 | typedef struct { | 97 | struct nsh { |
98 | u8 type; | 98 | u8 type; |
99 | u8 zero; | 99 | u8 zero; |
100 | u16 len; | 100 | u16 len; |
101 | } __packed nsh_t; /* Nokia Specific Header */ | 101 | } __packed; /* Nokia Specific Header */ |
102 | 102 | ||
103 | #define NSHL 4 /* Nokia Specific Header Length */ | 103 | #define NSHL 4 /* Nokia Specific Header Length */ |
104 | 104 | ||
@@ -126,7 +126,7 @@ static int dtl1_write(unsigned int iobase, int fifo_size, __u8 *buf, int len) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
129 | static void dtl1_write_wakeup(dtl1_info_t *info) | 129 | static void dtl1_write_wakeup(struct dtl1_info *info) |
130 | { | 130 | { |
131 | if (!info) { | 131 | if (!info) { |
132 | BT_ERR("Unknown device"); | 132 | BT_ERR("Unknown device"); |
@@ -176,7 +176,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info) | |||
176 | } | 176 | } |
177 | 177 | ||
178 | 178 | ||
179 | static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb) | 179 | static void dtl1_control(struct dtl1_info *info, struct sk_buff *skb) |
180 | { | 180 | { |
181 | u8 flowmask = *(u8 *)skb->data; | 181 | u8 flowmask = *(u8 *)skb->data; |
182 | int i; | 182 | int i; |
@@ -199,10 +199,10 @@ static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb) | |||
199 | } | 199 | } |
200 | 200 | ||
201 | 201 | ||
202 | static void dtl1_receive(dtl1_info_t *info) | 202 | static void dtl1_receive(struct dtl1_info *info) |
203 | { | 203 | { |
204 | unsigned int iobase; | 204 | unsigned int iobase; |
205 | nsh_t *nsh; | 205 | struct nsh *nsh; |
206 | int boguscount = 0; | 206 | int boguscount = 0; |
207 | 207 | ||
208 | if (!info) { | 208 | if (!info) { |
@@ -227,7 +227,7 @@ static void dtl1_receive(dtl1_info_t *info) | |||
227 | } | 227 | } |
228 | 228 | ||
229 | *skb_put(info->rx_skb, 1) = inb(iobase + UART_RX); | 229 | *skb_put(info->rx_skb, 1) = inb(iobase + UART_RX); |
230 | nsh = (nsh_t *)info->rx_skb->data; | 230 | nsh = (struct nsh *)info->rx_skb->data; |
231 | 231 | ||
232 | info->rx_count--; | 232 | info->rx_count--; |
233 | 233 | ||
@@ -287,7 +287,7 @@ static void dtl1_receive(dtl1_info_t *info) | |||
287 | 287 | ||
288 | static irqreturn_t dtl1_interrupt(int irq, void *dev_inst) | 288 | static irqreturn_t dtl1_interrupt(int irq, void *dev_inst) |
289 | { | 289 | { |
290 | dtl1_info_t *info = dev_inst; | 290 | struct dtl1_info *info = dev_inst; |
291 | unsigned int iobase; | 291 | unsigned int iobase; |
292 | unsigned char msr; | 292 | unsigned char msr; |
293 | int boguscount = 0; | 293 | int boguscount = 0; |
@@ -365,7 +365,7 @@ static int dtl1_hci_open(struct hci_dev *hdev) | |||
365 | 365 | ||
366 | static int dtl1_hci_flush(struct hci_dev *hdev) | 366 | static int dtl1_hci_flush(struct hci_dev *hdev) |
367 | { | 367 | { |
368 | dtl1_info_t *info = hci_get_drvdata(hdev); | 368 | struct dtl1_info *info = hci_get_drvdata(hdev); |
369 | 369 | ||
370 | /* Drop TX queue */ | 370 | /* Drop TX queue */ |
371 | skb_queue_purge(&(info->txq)); | 371 | skb_queue_purge(&(info->txq)); |
@@ -387,9 +387,9 @@ static int dtl1_hci_close(struct hci_dev *hdev) | |||
387 | 387 | ||
388 | static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) | 388 | static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) |
389 | { | 389 | { |
390 | dtl1_info_t *info = hci_get_drvdata(hdev); | 390 | struct dtl1_info *info = hci_get_drvdata(hdev); |
391 | struct sk_buff *s; | 391 | struct sk_buff *s; |
392 | nsh_t nsh; | 392 | struct nsh nsh; |
393 | 393 | ||
394 | switch (bt_cb(skb)->pkt_type) { | 394 | switch (bt_cb(skb)->pkt_type) { |
395 | case HCI_COMMAND_PKT: | 395 | case HCI_COMMAND_PKT: |
@@ -436,7 +436,7 @@ static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) | |||
436 | /* ======================== Card services HCI interaction ======================== */ | 436 | /* ======================== Card services HCI interaction ======================== */ |
437 | 437 | ||
438 | 438 | ||
439 | static int dtl1_open(dtl1_info_t *info) | 439 | static int dtl1_open(struct dtl1_info *info) |
440 | { | 440 | { |
441 | unsigned long flags; | 441 | unsigned long flags; |
442 | unsigned int iobase = info->p_dev->resource[0]->start; | 442 | unsigned int iobase = info->p_dev->resource[0]->start; |
@@ -505,7 +505,7 @@ static int dtl1_open(dtl1_info_t *info) | |||
505 | } | 505 | } |
506 | 506 | ||
507 | 507 | ||
508 | static int dtl1_close(dtl1_info_t *info) | 508 | static int dtl1_close(struct dtl1_info *info) |
509 | { | 509 | { |
510 | unsigned long flags; | 510 | unsigned long flags; |
511 | unsigned int iobase = info->p_dev->resource[0]->start; | 511 | unsigned int iobase = info->p_dev->resource[0]->start; |
@@ -534,7 +534,7 @@ static int dtl1_close(dtl1_info_t *info) | |||
534 | 534 | ||
535 | static int dtl1_probe(struct pcmcia_device *link) | 535 | static int dtl1_probe(struct pcmcia_device *link) |
536 | { | 536 | { |
537 | dtl1_info_t *info; | 537 | struct dtl1_info *info; |
538 | 538 | ||
539 | /* Create new info device */ | 539 | /* Create new info device */ |
540 | info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); | 540 | info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); |
@@ -552,7 +552,7 @@ static int dtl1_probe(struct pcmcia_device *link) | |||
552 | 552 | ||
553 | static void dtl1_detach(struct pcmcia_device *link) | 553 | static void dtl1_detach(struct pcmcia_device *link) |
554 | { | 554 | { |
555 | dtl1_info_t *info = link->priv; | 555 | struct dtl1_info *info = link->priv; |
556 | 556 | ||
557 | dtl1_close(info); | 557 | dtl1_close(info); |
558 | pcmcia_disable_device(link); | 558 | pcmcia_disable_device(link); |
@@ -571,7 +571,7 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) | |||
571 | 571 | ||
572 | static int dtl1_config(struct pcmcia_device *link) | 572 | static int dtl1_config(struct pcmcia_device *link) |
573 | { | 573 | { |
574 | dtl1_info_t *info = link->priv; | 574 | struct dtl1_info *info = link->priv; |
575 | int ret; | 575 | int ret; |
576 | 576 | ||
577 | /* Look for a generic full-sized window */ | 577 | /* Look for a generic full-sized window */ |