[OPW,kernel,1/4] Staging: crystalhd: Typedef Cleanups in crystalhd_misc.h
diff mbox

Message ID 6fcb555cb2d35c0c8ed8fb1752392a9c7dfea151.1382092572.git.rashika.kheria@gmail.com
State Rejected
Headers show

Commit Message

Rashika Oct. 18, 2013, 11:13 a.m. UTC
This patch removes typdef for function pointers and updates the code
accordingly in crystalhd_misc.h

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
---
 drivers/staging/crystalhd/crystalhd_misc.h |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Waskiewicz Jr, Peter P Oct. 19, 2013, 2:08 a.m. UTC | #1
On Fri, 2013-10-18 at 16:43 +0530, Rashika Kheria wrote:
> This patch removes typdef for function pointers and updates the code
> accordingly in crystalhd_misc.h
> 
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>

Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>

> ---
>  drivers/staging/crystalhd/crystalhd_misc.h |   10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/crystalhd/crystalhd_misc.h b/drivers/staging/crystalhd/crystalhd_misc.h
> index aa736c8..99bb964 100644
> --- a/drivers/staging/crystalhd/crystalhd_misc.h
> +++ b/drivers/staging/crystalhd/crystalhd_misc.h
> @@ -101,8 +101,6 @@ struct crystalhd_elem {
>  	uint32_t		tag;
>  };
>  
> -typedef void (*crystalhd_data_free_cb)(void *context, void *data);
> -
>  struct crystalhd_dioq {
>  	uint32_t		sig;
>  	struct crystalhd_adp	*adp;
> @@ -111,13 +109,10 @@ struct crystalhd_dioq {
>  	uint32_t		count;
>  	spinlock_t		lock;
>  	wait_queue_head_t	event;
> -	crystalhd_data_free_cb	data_rel_cb;
> +	void (*data_rel_cb)(void *context, void *data);
>  	void			*cb_context;
>  };
>  
> -typedef void (*hw_comp_callback)(struct crystalhd_dio_req *,
> -				 wait_queue_head_t *event, enum BC_STATUS sts);
> -
>  /*========= Decoder (7412) register access routines.================= */
>  uint32_t bc_dec_reg_rd(struct crystalhd_adp *, uint32_t);
>  void bc_dec_reg_wr(struct crystalhd_adp *, uint32_t, uint32_t);
> @@ -182,7 +177,8 @@ extern enum BC_STATUS crystalhd_unmap_dio(struct crystalhd_adp *,
>  
>  /*================ General Purpose Queues ==================*/
>  extern enum BC_STATUS crystalhd_create_dioq(struct crystalhd_adp *,
> -		 struct crystalhd_dioq **, crystalhd_data_free_cb , void *);
> +		 struct crystalhd_dioq **,
> +		 void (*)(void *context, void *data), void *);
>  extern void crystalhd_delete_dioq(struct crystalhd_adp *,
>  		 struct crystalhd_dioq *);
>  extern enum BC_STATUS crystalhd_dioq_add(struct crystalhd_dioq *ioq,
> -- 
> 1.7.9.5
>
Greg Kroah-Hartman Oct. 19, 2013, 9:40 p.m. UTC | #2
On Fri, Oct 18, 2013 at 04:43:24PM +0530, Rashika Kheria wrote:
> This patch removes typdef for function pointers and updates the code
> accordingly in crystalhd_misc.h
> 
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
> ---
>  drivers/staging/crystalhd/crystalhd_misc.h |   10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/crystalhd/crystalhd_misc.h b/drivers/staging/crystalhd/crystalhd_misc.h
> index aa736c8..99bb964 100644
> --- a/drivers/staging/crystalhd/crystalhd_misc.h
> +++ b/drivers/staging/crystalhd/crystalhd_misc.h
> @@ -101,8 +101,6 @@ struct crystalhd_elem {
>  	uint32_t		tag;
>  };
>  
> -typedef void (*crystalhd_data_free_cb)(void *context, void *data);

Sadly, function typedefs are really the only type of typedef that we
allow in the kernel, so I don't think this is needed at all for this
driver, sorry.

It usually makes things easier to understand, so I'm going to leave it
as-is for now.

thanks,

greg k-h

Patch
diff mbox

diff --git a/drivers/staging/crystalhd/crystalhd_misc.h b/drivers/staging/crystalhd/crystalhd_misc.h
index aa736c8..99bb964 100644
--- a/drivers/staging/crystalhd/crystalhd_misc.h
+++ b/drivers/staging/crystalhd/crystalhd_misc.h
@@ -101,8 +101,6 @@  struct crystalhd_elem {
 	uint32_t		tag;
 };
 
-typedef void (*crystalhd_data_free_cb)(void *context, void *data);
-
 struct crystalhd_dioq {
 	uint32_t		sig;
 	struct crystalhd_adp	*adp;
@@ -111,13 +109,10 @@  struct crystalhd_dioq {
 	uint32_t		count;
 	spinlock_t		lock;
 	wait_queue_head_t	event;
-	crystalhd_data_free_cb	data_rel_cb;
+	void (*data_rel_cb)(void *context, void *data);
 	void			*cb_context;
 };
 
-typedef void (*hw_comp_callback)(struct crystalhd_dio_req *,
-				 wait_queue_head_t *event, enum BC_STATUS sts);
-
 /*========= Decoder (7412) register access routines.================= */
 uint32_t bc_dec_reg_rd(struct crystalhd_adp *, uint32_t);
 void bc_dec_reg_wr(struct crystalhd_adp *, uint32_t, uint32_t);
@@ -182,7 +177,8 @@  extern enum BC_STATUS crystalhd_unmap_dio(struct crystalhd_adp *,
 
 /*================ General Purpose Queues ==================*/
 extern enum BC_STATUS crystalhd_create_dioq(struct crystalhd_adp *,
-		 struct crystalhd_dioq **, crystalhd_data_free_cb , void *);
+		 struct crystalhd_dioq **,
+		 void (*)(void *context, void *data), void *);
 extern void crystalhd_delete_dioq(struct crystalhd_adp *,
 		 struct crystalhd_dioq *);
 extern enum BC_STATUS crystalhd_dioq_add(struct crystalhd_dioq *ioq,