Skip to content

Commit

Permalink
Bluetooth: Remove typedef bluecard_info_t
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
himangi774 authored and holtmann committed Aug 14, 2014
1 parent f558891 commit d664cd9
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ MODULE_LICENSE("GPL");
/* ======================== Local structures ======================== */


typedef struct bluecard_info_t {
struct bluecard_info {
struct pcmcia_device *p_dev;

struct hci_dev *hdev;
Expand All @@ -78,7 +78,7 @@ typedef struct bluecard_info_t {

unsigned char ctrl_reg;
unsigned long hw_state; /* Status of the hardware and LED control */
} bluecard_info_t;
};


static int bluecard_config(struct pcmcia_device *link);
Expand Down Expand Up @@ -157,7 +157,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev);

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;

if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
Expand All @@ -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;

Expand Down Expand Up @@ -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) {
BT_ERR("Unknown device");
Expand Down Expand Up @@ -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 char buf[31];
Expand Down Expand Up @@ -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)
{
bluecard_info_t *info = dev_inst;
struct bluecard_info *info = dev_inst;
unsigned int iobase;
unsigned char reg;

Expand Down Expand Up @@ -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)
{
bluecard_info_t *info = hci_get_drvdata(hdev);
struct bluecard_info *info = hci_get_drvdata(hdev);
struct sk_buff *skb;

/* Ericsson baud rate command */
Expand Down Expand Up @@ -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)
{
bluecard_info_t *info = hci_get_drvdata(hdev);
struct bluecard_info *info = hci_get_drvdata(hdev);

/* Drop TX queue */
skb_queue_purge(&(info->txq));
Expand All @@ -622,7 +623,7 @@ static int bluecard_hci_flush(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)))
bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
Expand All @@ -643,7 +644,7 @@ static int bluecard_hci_open(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)))
return 0;
Expand All @@ -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)
{
bluecard_info_t *info = hci_get_drvdata(hdev);
struct bluecard_info *info = hci_get_drvdata(hdev);

switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT:
Expand Down Expand Up @@ -691,7 +692,7 @@ static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* ======================== 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;
struct hci_dev *hdev;
Expand Down Expand Up @@ -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;
struct hci_dev *hdev = info->hdev;
Expand All @@ -833,7 +834,7 @@ static int bluecard_close(bluecard_info_t *info)

static int bluecard_probe(struct pcmcia_device *link)
{
bluecard_info_t *info;
struct bluecard_info *info;

/* Create new info device */
info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
Expand All @@ -857,7 +858,7 @@ static void bluecard_detach(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;

link->config_index = 0x20;
Expand Down Expand Up @@ -897,7 +898,7 @@ static int bluecard_config(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);

Expand Down

0 comments on commit d664cd9

Please sign in to comment.