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

Bluetooth: Remove typedef btuart_info_t

The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedef for
btuart_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 d664cd98
...@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL"); ...@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL");
/* ======================== Local structures ======================== */ /* ======================== Local structures ======================== */
typedef struct btuart_info_t { struct btuart_info {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -75,7 +75,7 @@ typedef struct btuart_info_t { ...@@ -75,7 +75,7 @@ typedef struct btuart_info_t {
unsigned long rx_state; unsigned long rx_state;
unsigned long rx_count; unsigned long rx_count;
struct sk_buff *rx_skb; struct sk_buff *rx_skb;
} btuart_info_t; };
static int btuart_config(struct pcmcia_device *link); static int btuart_config(struct pcmcia_device *link);
...@@ -127,7 +127,7 @@ static int btuart_write(unsigned int iobase, int fifo_size, __u8 *buf, int len) ...@@ -127,7 +127,7 @@ static int btuart_write(unsigned int iobase, int fifo_size, __u8 *buf, int len)
} }
static void btuart_write_wakeup(btuart_info_t *info) static void btuart_write_wakeup(struct btuart_info *info)
{ {
if (!info) { if (!info) {
BT_ERR("Unknown device"); BT_ERR("Unknown device");
...@@ -172,7 +172,7 @@ static void btuart_write_wakeup(btuart_info_t *info) ...@@ -172,7 +172,7 @@ static void btuart_write_wakeup(btuart_info_t *info)
} }
static void btuart_receive(btuart_info_t *info) static void btuart_receive(struct btuart_info *info)
{ {
unsigned int iobase; unsigned int iobase;
int boguscount = 0; int boguscount = 0;
...@@ -286,7 +286,7 @@ static void btuart_receive(btuart_info_t *info) ...@@ -286,7 +286,7 @@ static void btuart_receive(btuart_info_t *info)
static irqreturn_t btuart_interrupt(int irq, void *dev_inst) static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
{ {
btuart_info_t *info = dev_inst; struct btuart_info *info = dev_inst;
unsigned int iobase; unsigned int iobase;
int boguscount = 0; int boguscount = 0;
int iir, lsr; int iir, lsr;
...@@ -340,7 +340,8 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst) ...@@ -340,7 +340,8 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
} }
static void btuart_change_speed(btuart_info_t *info, unsigned int speed) static void btuart_change_speed(struct btuart_info *info,
unsigned int speed)
{ {
unsigned long flags; unsigned long flags;
unsigned int iobase; unsigned int iobase;
...@@ -397,7 +398,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed) ...@@ -397,7 +398,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
static int btuart_hci_flush(struct hci_dev *hdev) static int btuart_hci_flush(struct hci_dev *hdev)
{ {
btuart_info_t *info = hci_get_drvdata(hdev); struct btuart_info *info = hci_get_drvdata(hdev);
/* Drop TX queue */ /* Drop TX queue */
skb_queue_purge(&(info->txq)); skb_queue_purge(&(info->txq));
...@@ -427,7 +428,7 @@ static int btuart_hci_close(struct hci_dev *hdev) ...@@ -427,7 +428,7 @@ static int btuart_hci_close(struct hci_dev *hdev)
static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{ {
btuart_info_t *info = hci_get_drvdata(hdev); struct btuart_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:
...@@ -455,7 +456,7 @@ static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -455,7 +456,7 @@ static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* ======================== Card services HCI interaction ======================== */ /* ======================== Card services HCI interaction ======================== */
static int btuart_open(btuart_info_t *info) static int btuart_open(struct btuart_info *info)
{ {
unsigned long flags; unsigned long flags;
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
...@@ -521,7 +522,7 @@ static int btuart_open(btuart_info_t *info) ...@@ -521,7 +522,7 @@ static int btuart_open(btuart_info_t *info)
} }
static int btuart_close(btuart_info_t *info) static int btuart_close(struct btuart_info *info)
{ {
unsigned long flags; unsigned long flags;
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
...@@ -550,7 +551,7 @@ static int btuart_close(btuart_info_t *info) ...@@ -550,7 +551,7 @@ static int btuart_close(btuart_info_t *info)
static int btuart_probe(struct pcmcia_device *link) static int btuart_probe(struct pcmcia_device *link)
{ {
btuart_info_t *info; struct btuart_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);
...@@ -613,7 +614,7 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, ...@@ -613,7 +614,7 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
static int btuart_config(struct pcmcia_device *link) static int btuart_config(struct pcmcia_device *link)
{ {
btuart_info_t *info = link->priv; struct btuart_info *info = link->priv;
int i; int i;
int try; int try;
...@@ -654,7 +655,7 @@ static int btuart_config(struct pcmcia_device *link) ...@@ -654,7 +655,7 @@ static int btuart_config(struct pcmcia_device *link)
static void btuart_release(struct pcmcia_device *link) static void btuart_release(struct pcmcia_device *link)
{ {
btuart_info_t *info = link->priv; struct btuart_info *info = link->priv;
btuart_close(info); btuart_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