[PATCH 31/33] staging: vc04_services: Remove VCHIQ_SLOT_ZERO_T typedef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Typedefing structs is not encouraged in the kernel.

The removal of typedefs was requested in interface/vchi/TODO in commit
7626e002225a4c1b9455689b1f22909dfeff43ca.

Signed-off-by: Dominic Braun <inf.braun@xxxxxx>
Signed-off-by: Tobias Büttner <tobias.buettner@xxxxxx>
---
 .../interface/vchiq_arm/vchiq_2835_arm.c          |  2 +-
 .../interface/vchiq_arm/vchiq_core.c              | 15 ++++++++-------
 .../interface/vchiq_arm/vchiq_core.h              | 11 ++++++-----
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 4c349f09471a..33e45feb9940 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -111,7 +111,7 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
 	struct device *dev = &pdev->dev;
 	struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
 	struct rpi_firmware *fw = drvdata->fw;
-	VCHIQ_SLOT_ZERO_T *vchiq_slot_zero;
+	struct vchiq_slot_zero_struct *vchiq_slot_zero;
 	struct resource *res;
 	void *slot_mem;
 	dma_addr_t slot_phys;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 0c188b3ea386..72f02ea06a2b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -1722,7 +1722,8 @@ parse_rx_slots(VCHIQ_STATE_T *state)
 		case VCHIQ_MSG_CONNECT:
 			vchiq_log_info(vchiq_core_log_level,
 				"%d: prs CONNECT@%pK", state->id, header);
-			state->version_common = ((VCHIQ_SLOT_ZERO_T *)
+			state->version_common =
+					((struct vchiq_slot_zero_struct *)
 						 state->slot_data)->version;
 			complete(&state->connect);
 			break;
@@ -2113,13 +2114,13 @@ get_conn_state_name(VCHIQ_CONNSTATE_T conn_state)
 	return conn_state_names[conn_state];
 }
 
-VCHIQ_SLOT_ZERO_T *
+struct vchiq_slot_zero_struct *
 vchiq_init_slots(void *mem_base, int mem_size)
 {
 	int mem_align =
 		(int)((VCHIQ_SLOT_SIZE - (long)mem_base) & VCHIQ_SLOT_MASK);
-	VCHIQ_SLOT_ZERO_T *slot_zero =
-		(VCHIQ_SLOT_ZERO_T *)((char *)mem_base + mem_align);
+	struct vchiq_slot_zero_struct *slot_zero =
+		(struct vchiq_slot_zero_struct *)((char *)mem_base + mem_align);
 	int num_slots = (mem_size - mem_align)/VCHIQ_SLOT_SIZE;
 	int first_data_slot = VCHIQ_SLOT_ZERO_SLOTS;
 
@@ -2133,12 +2134,12 @@ vchiq_init_slots(void *mem_base, int mem_size)
 		return NULL;
 	}
 
-	memset(slot_zero, 0, sizeof(VCHIQ_SLOT_ZERO_T));
+	memset(slot_zero, 0, sizeof(struct vchiq_slot_zero_struct));
 
 	slot_zero->magic = VCHIQ_MAGIC;
 	slot_zero->version = VCHIQ_VERSION;
 	slot_zero->version_min = VCHIQ_VERSION_MIN;
-	slot_zero->slot_zero_size = sizeof(VCHIQ_SLOT_ZERO_T);
+	slot_zero->slot_zero_size = sizeof(struct vchiq_slot_zero_struct);
 	slot_zero->slot_size = VCHIQ_SLOT_SIZE;
 	slot_zero->max_slots = VCHIQ_MAX_SLOTS;
 	slot_zero->max_slots_per_side = VCHIQ_MAX_SLOTS_PER_SIDE;
@@ -2154,7 +2155,7 @@ vchiq_init_slots(void *mem_base, int mem_size)
 }
 
 VCHIQ_STATUS_T
-vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero)
+vchiq_init_state(VCHIQ_STATE_T *state, struct vchiq_slot_zero_struct *slot_zero)
 {
 	struct vchiq_shared_state_struct *local;
 	struct vchiq_shared_state_struct *remote;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index 6ea9be369da0..b5a041c36c48 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -89,7 +89,7 @@ vchiq_static_assert(IS_POW2(VCHIQ_MAX_SLOTS_PER_SIDE));
 
 #define VCHIQ_SLOT_MASK        (VCHIQ_SLOT_SIZE - 1)
 #define VCHIQ_SLOT_QUEUE_MASK  (VCHIQ_MAX_SLOTS_PER_SIDE - 1)
-#define VCHIQ_SLOT_ZERO_SLOTS  ((sizeof(VCHIQ_SLOT_ZERO_T) + \
+#define VCHIQ_SLOT_ZERO_SLOTS  ((sizeof(struct vchiq_slot_zero_struct) + \
 	VCHIQ_SLOT_SIZE - 1) / VCHIQ_SLOT_SIZE)
 
 #define VCHIQ_MSG_PADDING            0  /* -                                 */
@@ -382,7 +382,7 @@ struct vchiq_shared_state_struct {
 	int debug[DEBUG_MAX];
 };
 
-typedef struct vchiq_slot_zero_struct {
+struct vchiq_slot_zero_struct {
 	int magic;
 	short version;
 	short version_min;
@@ -394,7 +394,7 @@ typedef struct vchiq_slot_zero_struct {
 	struct vchiq_shared_state_struct master;
 	struct vchiq_shared_state_struct slave;
 	struct vchiq_slot_info_struct slots[VCHIQ_MAX_SLOTS];
-} VCHIQ_SLOT_ZERO_T;
+};
 
 struct vchiq_state_struct {
 	int id;
@@ -520,11 +520,12 @@ extern VCHIQ_STATE_T *vchiq_states[VCHIQ_MAX_STATES];
 extern const char *
 get_conn_state_name(VCHIQ_CONNSTATE_T conn_state);
 
-extern VCHIQ_SLOT_ZERO_T *
+extern struct vchiq_slot_zero_struct *
 vchiq_init_slots(void *mem_base, int mem_size);
 
 extern VCHIQ_STATUS_T
-vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero);
+vchiq_init_state(VCHIQ_STATE_T *state,
+		 struct vchiq_slot_zero_struct *slot_zero);
 
 extern VCHIQ_STATUS_T
 vchiq_connect_internal(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance);
-- 
2.17.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux