diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-08-13 05:23:31 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-08-14 02:49:25 -0400 |
commit | d664cd9895b498da4fea3b43c72b4aacfc4126a2 (patch) | |
tree | 77d7d8c0950102a0f964be4b7fed6a7b25242409 /drivers/bluetooth/bluecard_cs.c | |
parent | f55889128a776b51581394b20abd0b470304cf95 (diff) |
Bluetooth: Remove typedef bluecard_info_t
The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedef for
bluecard_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:
@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/bluecard_cs.c')
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index dfa5043e68ba..35e63aaa6f80 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -61,7 +61,7 @@ MODULE_LICENSE("GPL"); | |||
61 | /* ======================== Local structures ======================== */ | 61 | /* ======================== Local structures ======================== */ |
62 | 62 | ||
63 | 63 | ||
64 | typedef struct bluecard_info_t { | 64 | struct bluecard_info { |
65 | struct pcmcia_device *p_dev; | 65 | struct pcmcia_device *p_dev; |
66 | 66 | ||
67 | struct hci_dev *hdev; | 67 | struct hci_dev *hdev; |
@@ -78,7 +78,7 @@ typedef struct bluecard_info_t { | |||
78 | 78 | ||
79 | unsigned char ctrl_reg; | 79 | unsigned char ctrl_reg; |
80 | unsigned long hw_state; /* Status of the hardware and LED control */ | 80 | unsigned long hw_state; /* Status of the hardware and LED control */ |
81 | } bluecard_info_t; | 81 | }; |
82 | 82 | ||
83 | 83 | ||
84 | static int bluecard_config(struct pcmcia_device *link); | 84 | static int bluecard_config(struct pcmcia_device *link); |
@@ -157,7 +157,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev); | |||
157 | 157 | ||
158 | static void bluecard_activity_led_timeout(u_long arg) | 158 | static void bluecard_activity_led_timeout(u_long arg) |
159 | { | 159 | { |
160 | bluecard_info_t *info = (bluecard_info_t *)arg; | 160 | struct bluecard_info *info = (struct bluecard_info *)arg; |
161 | unsigned int iobase = info->p_dev->resource[0]->start; | 161 | unsigned int iobase = info->p_dev->resource[0]->start; |
162 | 162 | ||
163 | if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) | 163 | if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) |
@@ -173,7 +173,7 @@ static void bluecard_activity_led_timeout(u_long arg) | |||
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
176 | static void bluecard_enable_activity_led(bluecard_info_t *info) | 176 | static void bluecard_enable_activity_led(struct bluecard_info *info) |
177 | { | 177 | { |
178 | unsigned int iobase = info->p_dev->resource[0]->start; | 178 | unsigned int iobase = info->p_dev->resource[0]->start; |
179 | 179 | ||
@@ -215,7 +215,7 @@ static int bluecard_write(unsigned int iobase, unsigned int offset, __u8 *buf, i | |||
215 | } | 215 | } |
216 | 216 | ||
217 | 217 | ||
218 | static void bluecard_write_wakeup(bluecard_info_t *info) | 218 | static void bluecard_write_wakeup(struct bluecard_info *info) |
219 | { | 219 | { |
220 | if (!info) { | 220 | if (!info) { |
221 | BT_ERR("Unknown device"); | 221 | BT_ERR("Unknown device"); |
@@ -368,7 +368,8 @@ static int bluecard_read(unsigned int iobase, unsigned int offset, __u8 *buf, in | |||
368 | } | 368 | } |
369 | 369 | ||
370 | 370 | ||
371 | static void bluecard_receive(bluecard_info_t *info, unsigned int offset) | 371 | static void bluecard_receive(struct bluecard_info *info, |
372 | unsigned int offset) | ||
372 | { | 373 | { |
373 | unsigned int iobase; | 374 | unsigned int iobase; |
374 | unsigned char buf[31]; | 375 | unsigned char buf[31]; |
@@ -497,7 +498,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset) | |||
497 | 498 | ||
498 | static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) | 499 | static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) |
499 | { | 500 | { |
500 | bluecard_info_t *info = dev_inst; | 501 | struct bluecard_info *info = dev_inst; |
501 | unsigned int iobase; | 502 | unsigned int iobase; |
502 | unsigned char reg; | 503 | unsigned char reg; |
503 | 504 | ||
@@ -562,7 +563,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) | |||
562 | 563 | ||
563 | static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) | 564 | static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) |
564 | { | 565 | { |
565 | bluecard_info_t *info = hci_get_drvdata(hdev); | 566 | struct bluecard_info *info = hci_get_drvdata(hdev); |
566 | struct sk_buff *skb; | 567 | struct sk_buff *skb; |
567 | 568 | ||
568 | /* Ericsson baud rate command */ | 569 | /* Ericsson baud rate command */ |
@@ -611,7 +612,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) | |||
611 | 612 | ||
612 | static int bluecard_hci_flush(struct hci_dev *hdev) | 613 | static int bluecard_hci_flush(struct hci_dev *hdev) |
613 | { | 614 | { |
614 | bluecard_info_t *info = hci_get_drvdata(hdev); | 615 | struct bluecard_info *info = hci_get_drvdata(hdev); |
615 | 616 | ||
616 | /* Drop TX queue */ | 617 | /* Drop TX queue */ |
617 | skb_queue_purge(&(info->txq)); | 618 | skb_queue_purge(&(info->txq)); |
@@ -622,7 +623,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev) | |||
622 | 623 | ||
623 | static int bluecard_hci_open(struct hci_dev *hdev) | 624 | static int bluecard_hci_open(struct hci_dev *hdev) |
624 | { | 625 | { |
625 | bluecard_info_t *info = hci_get_drvdata(hdev); | 626 | struct bluecard_info *info = hci_get_drvdata(hdev); |
626 | 627 | ||
627 | if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) | 628 | if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) |
628 | bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); | 629 | bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); |
@@ -643,7 +644,7 @@ static int bluecard_hci_open(struct hci_dev *hdev) | |||
643 | 644 | ||
644 | static int bluecard_hci_close(struct hci_dev *hdev) | 645 | static int bluecard_hci_close(struct hci_dev *hdev) |
645 | { | 646 | { |
646 | bluecard_info_t *info = hci_get_drvdata(hdev); | 647 | struct bluecard_info *info = hci_get_drvdata(hdev); |
647 | 648 | ||
648 | if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags))) | 649 | if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags))) |
649 | return 0; | 650 | return 0; |
@@ -663,7 +664,7 @@ static int bluecard_hci_close(struct hci_dev *hdev) | |||
663 | 664 | ||
664 | static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) | 665 | static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) |
665 | { | 666 | { |
666 | bluecard_info_t *info = hci_get_drvdata(hdev); | 667 | struct bluecard_info *info = hci_get_drvdata(hdev); |
667 | 668 | ||
668 | switch (bt_cb(skb)->pkt_type) { | 669 | switch (bt_cb(skb)->pkt_type) { |
669 | case HCI_COMMAND_PKT: | 670 | case HCI_COMMAND_PKT: |
@@ -691,7 +692,7 @@ static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) | |||
691 | /* ======================== Card services HCI interaction ======================== */ | 692 | /* ======================== Card services HCI interaction ======================== */ |
692 | 693 | ||
693 | 694 | ||
694 | static int bluecard_open(bluecard_info_t *info) | 695 | static int bluecard_open(struct bluecard_info *info) |
695 | { | 696 | { |
696 | unsigned int iobase = info->p_dev->resource[0]->start; | 697 | unsigned int iobase = info->p_dev->resource[0]->start; |
697 | struct hci_dev *hdev; | 698 | struct hci_dev *hdev; |
@@ -806,7 +807,7 @@ static int bluecard_open(bluecard_info_t *info) | |||
806 | } | 807 | } |
807 | 808 | ||
808 | 809 | ||
809 | static int bluecard_close(bluecard_info_t *info) | 810 | static int bluecard_close(struct bluecard_info *info) |
810 | { | 811 | { |
811 | unsigned int iobase = info->p_dev->resource[0]->start; | 812 | unsigned int iobase = info->p_dev->resource[0]->start; |
812 | struct hci_dev *hdev = info->hdev; | 813 | struct hci_dev *hdev = info->hdev; |
@@ -833,7 +834,7 @@ static int bluecard_close(bluecard_info_t *info) | |||
833 | 834 | ||
834 | static int bluecard_probe(struct pcmcia_device *link) | 835 | static int bluecard_probe(struct pcmcia_device *link) |
835 | { | 836 | { |
836 | bluecard_info_t *info; | 837 | struct bluecard_info *info; |
837 | 838 | ||
838 | /* Create new info device */ | 839 | /* Create new info device */ |
839 | info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); | 840 | info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); |
@@ -857,7 +858,7 @@ static void bluecard_detach(struct pcmcia_device *link) | |||
857 | 858 | ||
858 | static int bluecard_config(struct pcmcia_device *link) | 859 | static int bluecard_config(struct pcmcia_device *link) |
859 | { | 860 | { |
860 | bluecard_info_t *info = link->priv; | 861 | struct bluecard_info *info = link->priv; |
861 | int i, n; | 862 | int i, n; |
862 | 863 | ||
863 | link->config_index = 0x20; | 864 | link->config_index = 0x20; |
@@ -897,7 +898,7 @@ failed: | |||
897 | 898 | ||
898 | static void bluecard_release(struct pcmcia_device *link) | 899 | static void bluecard_release(struct pcmcia_device *link) |
899 | { | 900 | { |
900 | bluecard_info_t *info = link->priv; | 901 | struct bluecard_info *info = link->priv; |
901 | 902 | ||
902 | bluecard_close(info); | 903 | bluecard_close(info); |
903 | 904 | ||