]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: irda: Remove typedef struct
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Thu, 14 Sep 2017 04:55:38 +0000 (22:55 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Sep 2017 09:50:40 +0000 (11:50 +0200)
This patch remove typedef from a structure with all its ocurrences
since using typedefs for structures is discouraged.
Issue found using Coccinelle:

@r1@
type T;
@@

typedef struct { ... } T;

@script:python c1@
T2;
T << r1.T;
@@
if T[-2:] =="_t" or T[-2:] == "_T":
coccinelle.T2 = T[:-2];
else:
coccinelle.T2 = T;

print T, coccinelle.T2

@r2@
type r1.T;
identifier c1.T2;
@@
-typedef
struct
+ T2
{ ... }
-T
;

@r3@
type r1.T;
identifier c1.T2;
@@
-T
+struct T2

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/irda/include/net/irda/qos.h

index 05a5a249956f8b18bee66e0b2bf22202a125d36b..a0315b50ac27bca0160a99a74e270ca16bea70b2 100644 (file)
 #define IR_16000000 0x02
 
 /* Quality of Service information */
-typedef struct {
+struct qos_value {
        __u32 value;
        __u16 bits; /* LSB is first byte, MSB is second byte */
-} qos_value_t;
+};
 
 struct qos_info {
        magic_t magic;
 
-       qos_value_t baud_rate;       /* IR_11520O | ... */
-       qos_value_t max_turn_time;
-       qos_value_t data_size;
-       qos_value_t window_size;
-       qos_value_t additional_bofs;
-       qos_value_t min_turn_time;
-       qos_value_t link_disc_time;
+       struct qos_value baud_rate;       /* IR_11520O | ... */
+       struct qos_value max_turn_time;
+       struct qos_value data_size;
+       struct qos_value window_size;
+       struct qos_value additional_bofs;
+       struct qos_value min_turn_time;
+       struct qos_value link_disc_time;
        
-       qos_value_t power;
+       struct qos_value power;
 };
 
 extern int sysctl_max_baud_rate;