Commit d664cd98 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Marcel Holtmann

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: default avatarHimangi Saraogi <himangi774@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent f5588912
...@@ -61,7 +61,7 @@ MODULE_LICENSE("GPL"); ...@@ -61,7 +61,7 @@ MODULE_LICENSE("GPL");
/* ======================== Local structures ======================== */ /* ======================== Local structures ======================== */
typedef struct bluecard_info_t { struct bluecard_info {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -78,7 +78,7 @@ typedef struct bluecard_info_t { ...@@ -78,7 +78,7 @@ typedef struct bluecard_info_t {
unsigned char ctrl_reg; unsigned char ctrl_reg;
unsigned long hw_state; /* Status of the hardware and LED control */ unsigned long hw_state; /* Status of the hardware and LED control */
} bluecard_info_t; };
static int bluecard_config(struct pcmcia_device *link); static int bluecard_config(struct pcmcia_device *link);
...@@ -157,7 +157,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev); ...@@ -157,7 +157,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev);
static void bluecard_activity_led_timeout(u_long arg) static void bluecard_activity_led_timeout(u_long arg)
{ {
bluecard_info_t *info = (bluecard_info_t *)arg; struct bluecard_info *info = (struct bluecard_info *)arg;
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
...@@ -173,7 +173,7 @@ static void bluecard_activity_led_timeout(u_long arg) ...@@ -173,7 +173,7 @@ static void bluecard_activity_led_timeout(u_long arg)
} }
static void bluecard_enable_activity_led(bluecard_info_t *info) static void bluecard_enable_activity_led(struct bluecard_info *info)
{ {
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
...@@ -215,7 +215,7 @@ static int bluecard_write(unsigned int iobase, unsigned int offset, __u8 *buf, i ...@@ -215,7 +215,7 @@ static int bluecard_write(unsigned int iobase, unsigned int offset, __u8 *buf, i
} }
static void bluecard_write_wakeup(bluecard_info_t *info) static void bluecard_write_wakeup(struct bluecard_info *info)
{ {
if (!info) { if (!info) {
BT_ERR("Unknown device"); BT_ERR("Unknown device");
...@@ -368,7 +368,8 @@ static int bluecard_read(unsigned int iobase, unsigned int offset, __u8 *buf, in ...@@ -368,7 +368,8 @@ static int bluecard_read(unsigned int iobase, unsigned int offset, __u8 *buf, in
} }
static void bluecard_receive(bluecard_info_t *info, unsigned int offset) static void bluecard_receive(struct bluecard_info *info,
unsigned int offset)
{ {
unsigned int iobase; unsigned int iobase;
unsigned char buf[31]; unsigned char buf[31];
...@@ -497,7 +498,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset) ...@@ -497,7 +498,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
{ {
bluecard_info_t *info = dev_inst; struct bluecard_info *info = dev_inst;
unsigned int iobase; unsigned int iobase;
unsigned char reg; unsigned char reg;
...@@ -562,7 +563,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) ...@@ -562,7 +563,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
struct sk_buff *skb; struct sk_buff *skb;
/* Ericsson baud rate command */ /* Ericsson baud rate command */
...@@ -611,7 +612,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) ...@@ -611,7 +612,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
static int bluecard_hci_flush(struct hci_dev *hdev) static int bluecard_hci_flush(struct hci_dev *hdev)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
/* Drop TX queue */ /* Drop TX queue */
skb_queue_purge(&(info->txq)); skb_queue_purge(&(info->txq));
...@@ -622,7 +623,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev) ...@@ -622,7 +623,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev)
static int bluecard_hci_open(struct hci_dev *hdev) static int bluecard_hci_open(struct hci_dev *hdev)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
...@@ -643,7 +644,7 @@ static int bluecard_hci_open(struct hci_dev *hdev) ...@@ -643,7 +644,7 @@ static int bluecard_hci_open(struct hci_dev *hdev)
static int bluecard_hci_close(struct hci_dev *hdev) static int bluecard_hci_close(struct hci_dev *hdev)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags))) if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
return 0; return 0;
...@@ -663,7 +664,7 @@ static int bluecard_hci_close(struct hci_dev *hdev) ...@@ -663,7 +664,7 @@ static int bluecard_hci_close(struct hci_dev *hdev)
static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
switch (bt_cb(skb)->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
...@@ -691,7 +692,7 @@ static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -691,7 +692,7 @@ static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* ======================== Card services HCI interaction ======================== */ /* ======================== Card services HCI interaction ======================== */
static int bluecard_open(bluecard_info_t *info) static int bluecard_open(struct bluecard_info *info)
{ {
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -806,7 +807,7 @@ static int bluecard_open(bluecard_info_t *info) ...@@ -806,7 +807,7 @@ static int bluecard_open(bluecard_info_t *info)
} }
static int bluecard_close(bluecard_info_t *info) static int bluecard_close(struct bluecard_info *info)
{ {
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
struct hci_dev *hdev = info->hdev; struct hci_dev *hdev = info->hdev;
...@@ -833,7 +834,7 @@ static int bluecard_close(bluecard_info_t *info) ...@@ -833,7 +834,7 @@ static int bluecard_close(bluecard_info_t *info)
static int bluecard_probe(struct pcmcia_device *link) static int bluecard_probe(struct pcmcia_device *link)
{ {
bluecard_info_t *info; struct bluecard_info *info;
/* Create new info device */ /* Create new info device */
info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
...@@ -857,7 +858,7 @@ static void bluecard_detach(struct pcmcia_device *link) ...@@ -857,7 +858,7 @@ static void bluecard_detach(struct pcmcia_device *link)
static int bluecard_config(struct pcmcia_device *link) static int bluecard_config(struct pcmcia_device *link)
{ {
bluecard_info_t *info = link->priv; struct bluecard_info *info = link->priv;
int i, n; int i, n;
link->config_index = 0x20; link->config_index = 0x20;
...@@ -897,7 +898,7 @@ static int bluecard_config(struct pcmcia_device *link) ...@@ -897,7 +898,7 @@ static int bluecard_config(struct pcmcia_device *link)
static void bluecard_release(struct pcmcia_device *link) static void bluecard_release(struct pcmcia_device *link)
{ {
bluecard_info_t *info = link->priv; struct bluecard_info *info = link->priv;
bluecard_close(info); bluecard_close(info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment