Staging: vc04_services: Remove typedef
Subsystems (3)
PATCH v2 1/1 Staging: vc04_services: Remove typedef
This patch removes typedef vchi_connection_t VCHI_CONNECTION_T. This results in cleaner syntax.
--- drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 4 ++-- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +- .../vc04_services/interface/vchi/connections/connection.h | 2 -- drivers/staging/vc04_services/interface/vchi/vchi.h | 10 +++++----- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c | 6 +++--- 5 files changed, 11 insertions(+), 13 deletions(-)
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +2 -2
@@ -262,7 +262,7 @@ static void audio_vchi_callback(void *param,static struct bcm2835_audio_instance *vc_vchi_audio_init (VCHI_INSTANCE_T vchi_instance, -VCHI_CONNECTION_T **vchi_connections, +vchi_connection_t **vchi_connections,unsigned int num_connections) {unsigned int i;
@@ -376,7 +376,7 @@ static int vc_vchi_audio_deinit(struct bcm2835_audio_instance *instance)static int bcm2835_audio_open_connection (struct bcm2835_alsa_stream *alsa_stream) {static VCHI_INSTANCE_T vchi_instance; -static VCHI_CONNECTION_T *vchi_connection; +static vchi_connection_t *vchi_connection;static int initted;struct bcm2835_audio_instance *instance = (struct bcm2835_audio_instance *)alsa_stream->instance;
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +1 -1
@@ -1980,7 +1980,7 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) {int status;struct vchiq_mmal_instance *instance; -static VCHI_CONNECTION_T *vchi_connection; +static vchi_connection_t *vchi_connection;static VCHI_INSTANCE_T vchi_instance;SERVICE_CREATION_T params = {
drivers/staging/vc04_services/interface/vchi/connections/connection.h +0 -2
@@ -52,8 +52,6 @@ typedef struct opaque_vchi_connection_connected_service_handle_t *VCHI_CONNECTIO// opaque handle to the connection state information typedef struct opaque_vchi_connection_info_t VCHI_CONNECTION_STATE_T ; -typedef struct vchi_connection_t VCHI_CONNECTION_T ; -/****************************************************************************** API
drivers/staging/vc04_services/interface/vchi/vchi.h +5 -5
@@ -120,7 +120,7 @@ typedef struct { typedef struct { struct vchi_version version; int32_t service_id; - VCHI_CONNECTION_T *connection; + vchi_connection_t *connection; uint32_t rx_fifo_size; uint32_t tx_fifo_size; VCHI_CALLBACK_T callback;
@@ -143,7 +143,7 @@ typedef struct opaque_vchi_instance_handle_t *VCHI_INSTANCE_T;typedef struct opaque_vchi_service_handle_t *VCHI_SERVICE_HANDLE_T ;// Service registration & startup -typedef void (*VCHI_SERVICE_INIT )(VCHI_INSTANCE_T initialise_instance,VCHI_CONNECTION_T **connections,uint32_t num_connections); +typedef void (*VCHI_SERVICE_INIT )(VCHI_INSTANCE_T initialise_instance,vchi_connection_t **connections,uint32_t num_connections); typedef struct service_info_tag { const char * const vll_filename; /* VLL to load to start this service. This is an empty string if VLL is "static" */
@@ -159,7 +159,7 @@ typedef struct service_info_tag {extern "C" {#endif -extern /*@observer@*/ VCHI_CONNECTION_T *vchi_create_connection (const VCHI_CONNECTION_API_T * function_table, +extern /*@observer@*/ vchi_connection_t *vchi_create_connection (const VCHI_CONNECTION_API_T * function_table,const VCHI_MESSAGE_DRIVER_T * low_level);
@@ -168,7 +168,7 @@ extern int32_t vchi_initialise( VCHI_INSTANCE_T *instance_handle );extern int32_t vchi_exit (void ); -extern int32_t vchi_connect (VCHI_CONNECTION_T **connections, +extern int32_t vchi_connect (vchi_connection_t **connections,const uint32_t num_connections,VCHI_INSTANCE_T instance_handle );
@@ -177,7 +177,7 @@ extern int32_t vchi_connect( VCHI_CONNECTION_T **connections,extern int32_t vchi_disconnect (VCHI_INSTANCE_T instance_handle );// Global control over bulk CRC checking -extern int32_t vchi_crc_control (VCHI_CONNECTION_T *connection, +extern int32_t vchi_crc_control (vchi_connection_t *connection,VCHI_CRC_CONTROL_T control );// helper functions
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c +3 -3
@@ -68,7 +68,7 @@ single_get_func_table(void)return NULL ; } -VCHI_CONNECTION_T *vchi_create_connection ( +vchi_connection_t *vchi_create_connection (const VCHI_CONNECTION_API_T *function_table,const VCHI_MESSAGE_DRIVER_T *low_level) {
@@ -518,7 +518,7 @@ EXPORT_SYMBOL(vchi_initialise);/*********************************************************** * Name: vchi_connect * -* Arguments: VCHI_CONNECTION_T **connections +* Arguments: vchi_connection_t **connections * const uint32_t num_connections * VCHI_INSTANCE_T instance_handle) *
@@ -528,7 +528,7 @@ EXPORT_SYMBOL(vchi_initialise);* Returns: 0 if successful, failure otherwise * ***********************************************************/ -int32_t vchi_connect (VCHI_CONNECTION_T **connections, +int32_t vchi_connect (vchi_connection_t **connections,const uint32_t num_connections,VCHI_INSTANCE_T instance_handle) {
Signature · 1 line
2.7.4
Quoted 1 line · Meghana Madhyastha
This patch removes typedef
vchi_connection_tVCHI_CONNECTION_T. This results in cleaner syntax.
I don't remember seeing a v1 of this. Perhaps I missed it.
The commit mesage should have well under 80 characters per line, because it will be slightly indented when the patch is commited to git.
The changes are all incorrect. It seems that you have not compiled the code. If you make a change in a .c file, you should be sure that a corresponding .o file is generated. If the change is in a .h file you need to find a .c file that includes it and check that that is actually compiled.
If you eliminate a typedef, you should also eliminate the _t on the type name, as that is used to indicate a typedef.
julia
Quoted 148 lines
Signed-off-by Meghana Madhyastha <[email protected]>--- drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 4 ++-- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +- .../vc04_services/interface/vchi/connections/connection.h | 2 -- drivers/staging/vc04_services/interface/vchi/vchi.h | 10 +++++----- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c | 6 +++--- 5 files changed, 11 insertions(+), 13 deletions(-)drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +2
-2@@ -262,7 +262,7 @@ static void audio_vchi_callback(void *param,static struct bcm2835_audio_instance *vc_vchi_audio_init (VCHI_INSTANCE_T vchi_instance, -VCHI_CONNECTION_T **vchi_connections, +vchi_connection_t **vchi_connections,unsigned int num_connections) {unsigned int i;@@ -376,7 +376,7 @@ static int vc_vchi_audio_deinit(struct bcm2835_audio_instance *instance)static int bcm2835_audio_open_connection (struct bcm2835_alsa_stream *alsa_stream) {static VCHI_INSTANCE_T vchi_instance; -static VCHI_CONNECTION_T *vchi_connection; +static vchi_connection_t *vchi_connection;static int initted;struct bcm2835_audio_instance *instance = (struct bcm2835_audio_instance *)alsa_stream->instance;drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +1
-1@@ -1980,7 +1980,7 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) {int status;struct vchiq_mmal_instance *instance; -static VCHI_CONNECTION_T *vchi_connection; +static vchi_connection_t *vchi_connection;static VCHI_INSTANCE_T vchi_instance;SERVICE_CREATION_T params = {drivers/staging/vc04_services/interface/vchi/connections/connection.h +0
-2@@ -52,8 +52,6 @@ typedef struct opaque_vchi_connection_connected_service_handle_t *VCHI_CONNECTIO// opaque handle to the connection state information typedef struct opaque_vchi_connection_info_t VCHI_CONNECTION_STATE_T ; -typedef struct vchi_connection_t VCHI_CONNECTION_T ; -/****************************************************************************** API drivers/staging/vc04_services/interface/vchi/vchi.h +5
-5@@ -120,7 +120,7 @@ typedef struct { typedef struct { struct vchi_version version; int32_t service_id; - VCHI_CONNECTION_T *connection; + vchi_connection_t *connection; uint32_t rx_fifo_size; uint32_t tx_fifo_size; VCHI_CALLBACK_T callback;@@ -143,7 +143,7 @@ typedef struct opaque_vchi_instance_handle_t *VCHI_INSTANCE_T;typedef struct opaque_vchi_service_handle_t *VCHI_SERVICE_HANDLE_T ;// Service registration & startup -typedef void (*VCHI_SERVICE_INIT )(VCHI_INSTANCE_T initialise_instance,VCHI_CONNECTION_T **connections,uint32_t num_connections); +typedef void (*VCHI_SERVICE_INIT )(VCHI_INSTANCE_T initialise_instance,vchi_connection_t **connections,uint32_t num_connections); typedef struct service_info_tag { const char * const vll_filename; /* VLL to load to start this service. This is an empty string if VLL is "static" */@@ -159,7 +159,7 @@ typedef struct service_info_tag {extern "C" {#endif -extern /*@observer@*/ VCHI_CONNECTION_T *vchi_create_connection (const VCHI_CONNECTION_API_T * function_table, +extern /*@observer@*/ vchi_connection_t *vchi_create_connection (const VCHI_CONNECTION_API_T * function_table,const VCHI_MESSAGE_DRIVER_T * low_level);@@ -168,7 +168,7 @@ extern int32_t vchi_initialise( VCHI_INSTANCE_T *instance_handle );extern int32_t vchi_exit (void ); -extern int32_t vchi_connect (VCHI_CONNECTION_T **connections, +extern int32_t vchi_connect (vchi_connection_t **connections,const uint32_t num_connections,VCHI_INSTANCE_T instance_handle );@@ -177,7 +177,7 @@ extern int32_t vchi_connect( VCHI_CONNECTION_T **connections,extern int32_t vchi_disconnect (VCHI_INSTANCE_T instance_handle );// Global control over bulk CRC checking -extern int32_t vchi_crc_control (VCHI_CONNECTION_T *connection, +extern int32_t vchi_crc_control (vchi_connection_t *connection,VCHI_CRC_CONTROL_T control );// helper functions drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c +3
-4@@ -68,7 +68,7 @@ single_get_func_table(void)return NULL ; } -VCHI_CONNECTION_T *vchi_create_connection ( +vchi_connection_t *vchi_create_connection (const VCHI_CONNECTION_API_T *function_table,const VCHI_MESSAGE_DRIVER_T *low_level) {@@ -518,7 +518,7 @@ EXPORT_SYMBOL(vchi_initialise);/*********************************************************** * Name: vchi_connect * -* Arguments: VCHI_CONNECTION_T **connections +* Arguments: vchi_connection_t **connections * const uint32_t num_connections * VCHI_INSTANCE_T instance_handle) * @@ -528,7 +528,7 @@ EXPORT_SYMBOL(vchi_initialise);* Returns: 0 if successful, failure otherwise * ***********************************************************/ -int32_t vchi_connect (VCHI_CONNECTION_T **connections, +int32_t vchi_connect (vchi_connection_t **connections,const uint32_t num_connections,VCHI_INSTANCE_T instance_handle) { --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170910160750.GA9376%40meghana-HP-Pavilion-Notebook.
For more options, visit https://groups.google.com/d/optout.
Hi Meghana,
Quoted 9 lines
Julia Lawall <[email protected]> hat am 10. September 2017 um 18:14 geschrieben:
Quoted 1 line · Meghana Madhyastha
This patch removes typedef
vchi_connection_tVCHI_CONNECTION_T. This results in cleaner syntax.
try to make your subject more unique. Unfortunately the vc04_services contains a lot of typedefs, so "Remove typedef" isn't very helpful. How about "replace VCHI_CONNECTION_T"?
These staging drivers aren't relevant to the Broadcom guys, so please do not send them to Florian, Ray, Scott or the bcm-kernel-feedback-list. But it's important to send a copy to [email protected].
Stefan