Commit 66f4e0e4 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Marcel Holtmann

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: 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 ad709d48
...@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL"); ...@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL");
/* ======================== Local structures ======================== */ /* ======================== Local structures ======================== */
typedef struct dtl1_info_t { struct dtl1_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 dtl1_info_t { ...@@ -78,7 +78,7 @@ typedef struct dtl1_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;
} dtl1_info_t; };
static int dtl1_config(struct pcmcia_device *link); static int dtl1_config(struct pcmcia_device *link);
...@@ -94,11 +94,11 @@ static int dtl1_config(struct pcmcia_device *link); ...@@ -94,11 +94,11 @@ static int dtl1_config(struct pcmcia_device *link);
#define RECV_WAIT_DATA 1 #define RECV_WAIT_DATA 1
typedef struct { struct nsh {
u8 type; u8 type;
u8 zero; u8 zero;
u16 len; u16 len;
} __packed nsh_t; /* Nokia Specific Header */ } __packed; /* Nokia Specific Header */
#define NSHL 4 /* Nokia Specific Header Length */ #define NSHL 4 /* Nokia Specific Header Length */
...@@ -126,7 +126,7 @@ static int dtl1_write(unsigned int iobase, int fifo_size, __u8 *buf, int len) ...@@ -126,7 +126,7 @@ static int dtl1_write(unsigned int iobase, int fifo_size, __u8 *buf, int len)
} }
static void dtl1_write_wakeup(dtl1_info_t *info) static void dtl1_write_wakeup(struct dtl1_info *info)
{ {
if (!info) { if (!info) {
BT_ERR("Unknown device"); BT_ERR("Unknown device");
...@@ -176,7 +176,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info) ...@@ -176,7 +176,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info)
} }
static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb) static void dtl1_control(struct dtl1_info *info, struct sk_buff *skb)
{ {
u8 flowmask = *(u8 *)skb->data; u8 flowmask = *(u8 *)skb->data;
int i; int i;
...@@ -199,10 +199,10 @@ static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb) ...@@ -199,10 +199,10 @@ static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb)
} }
static void dtl1_receive(dtl1_info_t *info) static void dtl1_receive(struct dtl1_info *info)
{ {
unsigned int iobase; unsigned int iobase;
nsh_t *nsh; struct nsh *nsh;
int boguscount = 0; int boguscount = 0;
if (!info) { if (!info) {
...@@ -227,7 +227,7 @@ static void dtl1_receive(dtl1_info_t *info) ...@@ -227,7 +227,7 @@ static void dtl1_receive(dtl1_info_t *info)
} }
*skb_put(info->rx_skb, 1) = inb(iobase + UART_RX); *skb_put(info->rx_skb, 1) = inb(iobase + UART_RX);
nsh = (nsh_t *)info->rx_skb->data; nsh = (struct nsh *)info->rx_skb->data;
info->rx_count--; info->rx_count--;
...@@ -287,7 +287,7 @@ static void dtl1_receive(dtl1_info_t *info) ...@@ -287,7 +287,7 @@ static void dtl1_receive(dtl1_info_t *info)
static irqreturn_t dtl1_interrupt(int irq, void *dev_inst) static irqreturn_t dtl1_interrupt(int irq, void *dev_inst)
{ {
dtl1_info_t *info = dev_inst; struct dtl1_info *info = dev_inst;
unsigned int iobase; unsigned int iobase;
unsigned char msr; unsigned char msr;
int boguscount = 0; int boguscount = 0;
...@@ -365,7 +365,7 @@ static int dtl1_hci_open(struct hci_dev *hdev) ...@@ -365,7 +365,7 @@ static int dtl1_hci_open(struct hci_dev *hdev)
static int dtl1_hci_flush(struct hci_dev *hdev) static int dtl1_hci_flush(struct hci_dev *hdev)
{ {
dtl1_info_t *info = hci_get_drvdata(hdev); struct dtl1_info *info = hci_get_drvdata(hdev);
/* Drop TX queue */ /* Drop TX queue */
skb_queue_purge(&(info->txq)); skb_queue_purge(&(info->txq));
...@@ -387,9 +387,9 @@ static int dtl1_hci_close(struct hci_dev *hdev) ...@@ -387,9 +387,9 @@ static int dtl1_hci_close(struct hci_dev *hdev)
static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{ {
dtl1_info_t *info = hci_get_drvdata(hdev); struct dtl1_info *info = hci_get_drvdata(hdev);
struct sk_buff *s; struct sk_buff *s;
nsh_t nsh; struct nsh nsh;
switch (bt_cb(skb)->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
...@@ -436,7 +436,7 @@ static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -436,7 +436,7 @@ static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* ======================== Card services HCI interaction ======================== */ /* ======================== Card services HCI interaction ======================== */
static int dtl1_open(dtl1_info_t *info) static int dtl1_open(struct dtl1_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;
...@@ -505,7 +505,7 @@ static int dtl1_open(dtl1_info_t *info) ...@@ -505,7 +505,7 @@ static int dtl1_open(dtl1_info_t *info)
} }
static int dtl1_close(dtl1_info_t *info) static int dtl1_close(struct dtl1_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;
...@@ -534,7 +534,7 @@ static int dtl1_close(dtl1_info_t *info) ...@@ -534,7 +534,7 @@ static int dtl1_close(dtl1_info_t *info)
static int dtl1_probe(struct pcmcia_device *link) static int dtl1_probe(struct pcmcia_device *link)
{ {
dtl1_info_t *info; struct dtl1_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);
...@@ -552,7 +552,7 @@ static int dtl1_probe(struct pcmcia_device *link) ...@@ -552,7 +552,7 @@ static int dtl1_probe(struct pcmcia_device *link)
static void dtl1_detach(struct pcmcia_device *link) static void dtl1_detach(struct pcmcia_device *link)
{ {
dtl1_info_t *info = link->priv; struct dtl1_info *info = link->priv;
dtl1_close(info); dtl1_close(info);
pcmcia_disable_device(link); pcmcia_disable_device(link);
...@@ -571,7 +571,7 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) ...@@ -571,7 +571,7 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)
static int dtl1_config(struct pcmcia_device *link) static int dtl1_config(struct pcmcia_device *link)
{ {
dtl1_info_t *info = link->priv; struct dtl1_info *info = link->priv;
int ret; int ret;
/* Look for a generic full-sized window */ /* Look for a generic full-sized window */
......
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