staging: vc04_services: Replace VCHIQ_SERVICE_HANDLE_T typedef with unsigned int

Replaces VCHIQ_SERVICE_HANDLE_T typedef with unsigned int to match kernel code style. Issue found by checkpatch.

Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com>
Link: https://lore.kernel.org/r/9d35b9fea684d18cc1e989621808d77eef3081c6.1572994235.git.jamal.k.shareef@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jamal Shareef 2019-11-05 14:55:29 -08:00 committed by Greg Kroah-Hartman
parent c8bf4d3db9
commit 9ce46d5551
6 changed files with 61 additions and 63 deletions

View File

@ -173,7 +173,7 @@ vchiq_static_assert(ARRAY_SIZE(ioctl_names) ==
(VCHIQ_IOC_MAX + 1));
static enum vchiq_status
vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data,
vchiq_blocking_bulk_transfer(unsigned int handle, void *data,
unsigned int size, enum vchiq_bulk_dir dir);
#define VCHIQ_INIT_RETRIES 10
@ -304,7 +304,7 @@ EXPORT_SYMBOL(vchiq_connect);
enum vchiq_status vchiq_add_service(
VCHIQ_INSTANCE_T instance,
const struct vchiq_service_params *params,
VCHIQ_SERVICE_HANDLE_T *phandle)
unsigned int *phandle)
{
enum vchiq_status status;
struct vchiq_state *state = instance->state;
@ -343,7 +343,7 @@ EXPORT_SYMBOL(vchiq_add_service);
enum vchiq_status vchiq_open_service(
VCHIQ_INSTANCE_T instance,
const struct vchiq_service_params *params,
VCHIQ_SERVICE_HANDLE_T *phandle)
unsigned int *phandle)
{
enum vchiq_status status = VCHIQ_ERROR;
struct vchiq_state *state = instance->state;
@ -381,7 +381,7 @@ failed:
EXPORT_SYMBOL(vchiq_open_service);
enum vchiq_status
vchiq_bulk_transmit(VCHIQ_SERVICE_HANDLE_T handle, const void *data,
vchiq_bulk_transmit(unsigned int handle, const void *data,
unsigned int size, void *userdata, enum vchiq_bulk_mode mode)
{
enum vchiq_status status;
@ -406,7 +406,7 @@ vchiq_bulk_transmit(VCHIQ_SERVICE_HANDLE_T handle, const void *data,
EXPORT_SYMBOL(vchiq_bulk_transmit);
enum vchiq_status
vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_T handle, void *data,
vchiq_bulk_receive(unsigned int handle, void *data,
unsigned int size, void *userdata, enum vchiq_bulk_mode mode)
{
enum vchiq_status status;
@ -430,7 +430,7 @@ vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_T handle, void *data,
EXPORT_SYMBOL(vchiq_bulk_receive);
static enum vchiq_status
vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data,
vchiq_blocking_bulk_transfer(unsigned int handle, void *data,
unsigned int size, enum vchiq_bulk_dir dir)
{
VCHIQ_INSTANCE_T instance;
@ -584,7 +584,7 @@ add_completion(VCHIQ_INSTANCE_T instance, enum vchiq_reason reason,
static enum vchiq_status
service_callback(enum vchiq_reason reason, struct vchiq_header *header,
VCHIQ_SERVICE_HANDLE_T handle, void *bulk_userdata)
unsigned int handle, void *bulk_userdata)
{
/* How do we ensure the callback goes to the right client?
** The service_user data points to a user_service record
@ -773,7 +773,7 @@ static ssize_t vchiq_ioc_copy_element_data(void *context, void *dest,
*
**************************************************************************/
static enum vchiq_status
vchiq_ioc_queue_message(VCHIQ_SERVICE_HANDLE_T handle,
vchiq_ioc_queue_message(unsigned int handle,
struct vchiq_element *elements,
unsigned long count)
{
@ -952,7 +952,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case VCHIQ_IOC_CLOSE_SERVICE:
case VCHIQ_IOC_REMOVE_SERVICE: {
VCHIQ_SERVICE_HANDLE_T handle = (VCHIQ_SERVICE_HANDLE_T)arg;
unsigned int handle = (unsigned int)arg;
struct user_service *user_service;
service = find_service_for_instance(instance, handle);
@ -985,7 +985,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case VCHIQ_IOC_USE_SERVICE:
case VCHIQ_IOC_RELEASE_SERVICE: {
VCHIQ_SERVICE_HANDLE_T handle = (VCHIQ_SERVICE_HANDLE_T)arg;
unsigned int handle = (unsigned int)arg;
service = find_service_for_instance(instance, handle);
if (service) {
@ -1368,7 +1368,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} break;
case VCHIQ_IOC_GET_CLIENT_ID: {
VCHIQ_SERVICE_HANDLE_T handle = (VCHIQ_SERVICE_HANDLE_T)arg;
unsigned int handle = (unsigned int)arg;
ret = vchiq_get_client_id(handle);
} break;
@ -1423,7 +1423,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} break;
case VCHIQ_IOC_CLOSE_DELIVERED: {
VCHIQ_SERVICE_HANDLE_T handle = (VCHIQ_SERVICE_HANDLE_T)arg;
unsigned int handle = (unsigned int)arg;
service = find_closed_service_for_instance(instance, handle);
if (service) {
@ -2273,7 +2273,7 @@ vchiq_videocore_wanted(struct vchiq_state *state)
static enum vchiq_status
vchiq_keepalive_vchiq_callback(enum vchiq_reason reason,
struct vchiq_header *header,
VCHIQ_SERVICE_HANDLE_T service_user,
unsigned int service_user,
void *bulk_user)
{
vchiq_log_error(vchiq_susp_log_level,
@ -2289,7 +2289,7 @@ vchiq_keepalive_thread_func(void *v)
enum vchiq_status status;
VCHIQ_INSTANCE_T instance;
VCHIQ_SERVICE_HANDLE_T ka_handle;
unsigned int ka_handle;
struct vchiq_service_params params = {
.fourcc = VCHIQ_MAKE_FOURCC('K', 'E', 'E', 'P'),
@ -2970,7 +2970,7 @@ static void suspend_timer_callback(struct timer_list *t)
}
enum vchiq_status
vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle)
vchiq_use_service(unsigned int handle)
{
enum vchiq_status ret = VCHIQ_ERROR;
struct vchiq_service *service = find_service_by_handle(handle);
@ -2984,7 +2984,7 @@ vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle)
}
enum vchiq_status
vchiq_release_service(VCHIQ_SERVICE_HANDLE_T handle)
vchiq_release_service(unsigned int handle)
{
enum vchiq_status ret = VCHIQ_ERROR;
struct vchiq_service *service = find_service_by_handle(handle);

View File

@ -125,10 +125,10 @@ vchiq_check_resume(struct vchiq_state *state);
extern void
vchiq_check_suspend(struct vchiq_state *state);
enum vchiq_status
vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle);
vchiq_use_service(unsigned int handle);
extern enum vchiq_status
vchiq_release_service(VCHIQ_SERVICE_HANDLE_T handle);
vchiq_release_service(unsigned int handle);
extern enum vchiq_status
vchiq_check_service(struct vchiq_service *service);

View File

@ -132,7 +132,7 @@ vchiq_set_service_state(struct vchiq_service *service, int newstate)
}
struct vchiq_service *
find_service_by_handle(VCHIQ_SERVICE_HANDLE_T handle)
find_service_by_handle(unsigned int handle)
{
struct vchiq_service *service;
@ -178,7 +178,7 @@ find_service_by_port(struct vchiq_state *state, int localport)
struct vchiq_service *
find_service_for_instance(VCHIQ_INSTANCE_T instance,
VCHIQ_SERVICE_HANDLE_T handle)
unsigned int handle)
{
struct vchiq_service *service;
@ -202,7 +202,7 @@ find_service_for_instance(VCHIQ_INSTANCE_T instance,
struct vchiq_service *
find_closed_service_for_instance(VCHIQ_INSTANCE_T instance,
VCHIQ_SERVICE_HANDLE_T handle)
unsigned int handle)
{
struct vchiq_service *service;
@ -295,7 +295,7 @@ unlock:
}
int
vchiq_get_client_id(VCHIQ_SERVICE_HANDLE_T handle)
vchiq_get_client_id(unsigned int handle)
{
struct vchiq_service *service = find_service_by_handle(handle);
int id;
@ -308,7 +308,7 @@ vchiq_get_client_id(VCHIQ_SERVICE_HANDLE_T handle)
}
void *
vchiq_get_service_userdata(VCHIQ_SERVICE_HANDLE_T handle)
vchiq_get_service_userdata(unsigned int handle)
{
struct vchiq_service *service = handle_to_service(handle);
@ -316,7 +316,7 @@ vchiq_get_service_userdata(VCHIQ_SERVICE_HANDLE_T handle)
}
int
vchiq_get_service_fourcc(VCHIQ_SERVICE_HANDLE_T handle)
vchiq_get_service_fourcc(unsigned int handle)
{
struct vchiq_service *service = handle_to_service(handle);
@ -2828,7 +2828,7 @@ vchiq_shutdown_internal(struct vchiq_state *state, VCHIQ_INSTANCE_T instance)
}
enum vchiq_status
vchiq_close_service(VCHIQ_SERVICE_HANDLE_T handle)
vchiq_close_service(unsigned int handle)
{
/* Unregister the service */
struct vchiq_service *service = find_service_by_handle(handle);
@ -2887,7 +2887,7 @@ vchiq_close_service(VCHIQ_SERVICE_HANDLE_T handle)
}
enum vchiq_status
vchiq_remove_service(VCHIQ_SERVICE_HANDLE_T handle)
vchiq_remove_service(unsigned int handle)
{
/* Unregister the service */
struct vchiq_service *service = find_service_by_handle(handle);
@ -2952,7 +2952,7 @@ vchiq_remove_service(VCHIQ_SERVICE_HANDLE_T handle)
* When called in blocking mode, the userdata field points to a bulk_waiter
* structure.
*/
enum vchiq_status vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle,
enum vchiq_status vchiq_bulk_transfer(unsigned int handle,
void *offset, int size, void *userdata,
enum vchiq_bulk_mode mode,
enum vchiq_bulk_dir dir)
@ -3101,7 +3101,7 @@ error_exit:
}
enum vchiq_status
vchiq_queue_message(VCHIQ_SERVICE_HANDLE_T handle,
vchiq_queue_message(unsigned int handle,
ssize_t (*copy_callback)(void *context, void *dest,
size_t offset, size_t maxsize),
void *context,
@ -3153,7 +3153,7 @@ error_exit:
}
void
vchiq_release_message(VCHIQ_SERVICE_HANDLE_T handle,
vchiq_release_message(unsigned int handle,
struct vchiq_header *header)
{
struct vchiq_service *service = find_service_by_handle(handle);
@ -3193,7 +3193,7 @@ release_message_sync(struct vchiq_state *state, struct vchiq_header *header)
}
enum vchiq_status
vchiq_get_peer_version(VCHIQ_SERVICE_HANDLE_T handle, short *peer_version)
vchiq_get_peer_version(unsigned int handle, short *peer_version)
{
enum vchiq_status status = VCHIQ_ERROR;
struct vchiq_service *service = find_service_by_handle(handle);
@ -3222,7 +3222,7 @@ void vchiq_get_config(struct vchiq_config *config)
}
enum vchiq_status
vchiq_set_service_option(VCHIQ_SERVICE_HANDLE_T handle,
vchiq_set_service_option(unsigned int handle,
enum vchiq_service_option option, int value)
{
struct vchiq_service *service = find_service_by_handle(handle);

View File

@ -250,7 +250,7 @@ struct vchiq_slot_info {
struct vchiq_service {
struct vchiq_service_base base;
VCHIQ_SERVICE_HANDLE_T handle;
unsigned int handle;
unsigned int ref_count;
int srvstate;
vchiq_userdata_term userdata_term;
@ -522,7 +522,7 @@ extern void
remote_event_pollall(struct vchiq_state *state);
extern enum vchiq_status
vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *offset, int size,
vchiq_bulk_transfer(unsigned int handle, void *offset, int size,
void *userdata, enum vchiq_bulk_mode mode,
enum vchiq_bulk_dir dir);
@ -543,7 +543,7 @@ request_poll(struct vchiq_state *state, struct vchiq_service *service,
int poll_type);
static inline struct vchiq_service *
handle_to_service(VCHIQ_SERVICE_HANDLE_T handle)
handle_to_service(unsigned int handle)
{
struct vchiq_state *state = vchiq_states[(handle / VCHIQ_MAX_SERVICES) &
(VCHIQ_MAX_STATES - 1)];
@ -554,18 +554,18 @@ handle_to_service(VCHIQ_SERVICE_HANDLE_T handle)
}
extern struct vchiq_service *
find_service_by_handle(VCHIQ_SERVICE_HANDLE_T handle);
find_service_by_handle(unsigned int handle);
extern struct vchiq_service *
find_service_by_port(struct vchiq_state *state, int localport);
extern struct vchiq_service *
find_service_for_instance(VCHIQ_INSTANCE_T instance,
VCHIQ_SERVICE_HANDLE_T handle);
unsigned int handle);
extern struct vchiq_service *
find_closed_service_for_instance(VCHIQ_INSTANCE_T instance,
VCHIQ_SERVICE_HANDLE_T handle);
unsigned int handle);
extern struct vchiq_service *
next_service_by_instance(struct vchiq_state *state, VCHIQ_INSTANCE_T instance,

View File

@ -61,11 +61,9 @@ struct vchiq_element {
unsigned int size;
};
typedef unsigned int VCHIQ_SERVICE_HANDLE_T;
typedef enum vchiq_status (*vchiq_callback)(enum vchiq_reason,
struct vchiq_header *,
VCHIQ_SERVICE_HANDLE_T, void *);
unsigned int, void *);
struct vchiq_service_base {
int fourcc;
@ -100,49 +98,49 @@ extern enum vchiq_status vchiq_shutdown(VCHIQ_INSTANCE_T instance);
extern enum vchiq_status vchiq_connect(VCHIQ_INSTANCE_T instance);
extern enum vchiq_status vchiq_add_service(VCHIQ_INSTANCE_T instance,
const struct vchiq_service_params *params,
VCHIQ_SERVICE_HANDLE_T *pservice);
unsigned int *pservice);
extern enum vchiq_status vchiq_open_service(VCHIQ_INSTANCE_T instance,
const struct vchiq_service_params *params,
VCHIQ_SERVICE_HANDLE_T *pservice);
extern enum vchiq_status vchiq_close_service(VCHIQ_SERVICE_HANDLE_T service);
extern enum vchiq_status vchiq_remove_service(VCHIQ_SERVICE_HANDLE_T service);
extern enum vchiq_status vchiq_use_service(VCHIQ_SERVICE_HANDLE_T service);
extern enum vchiq_status vchiq_release_service(VCHIQ_SERVICE_HANDLE_T service);
unsigned int *pservice);
extern enum vchiq_status vchiq_close_service(unsigned int service);
extern enum vchiq_status vchiq_remove_service(unsigned int service);
extern enum vchiq_status vchiq_use_service(unsigned int service);
extern enum vchiq_status vchiq_release_service(unsigned int service);
extern enum vchiq_status
vchiq_queue_message(VCHIQ_SERVICE_HANDLE_T handle,
vchiq_queue_message(unsigned int handle,
ssize_t (*copy_callback)(void *context, void *dest,
size_t offset, size_t maxsize),
void *context,
size_t size);
extern void vchiq_release_message(VCHIQ_SERVICE_HANDLE_T service,
extern void vchiq_release_message(unsigned int service,
struct vchiq_header *header);
extern enum vchiq_status vchiq_bulk_transmit(VCHIQ_SERVICE_HANDLE_T service,
extern enum vchiq_status vchiq_bulk_transmit(unsigned int service,
const void *data, unsigned int size, void *userdata,
enum vchiq_bulk_mode mode);
extern enum vchiq_status vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_T service,
extern enum vchiq_status vchiq_bulk_receive(unsigned int service,
void *data, unsigned int size, void *userdata,
enum vchiq_bulk_mode mode);
extern enum vchiq_status vchiq_bulk_transmit_handle(VCHIQ_SERVICE_HANDLE_T service,
extern enum vchiq_status vchiq_bulk_transmit_handle(unsigned int service,
const void *offset, unsigned int size,
void *userdata, enum vchiq_bulk_mode mode);
extern enum vchiq_status vchiq_bulk_receive_handle(VCHIQ_SERVICE_HANDLE_T service,
extern enum vchiq_status vchiq_bulk_receive_handle(unsigned int service,
void *offset, unsigned int size, void *userdata,
enum vchiq_bulk_mode mode);
extern int vchiq_get_client_id(VCHIQ_SERVICE_HANDLE_T service);
extern void *vchiq_get_service_userdata(VCHIQ_SERVICE_HANDLE_T service);
extern int vchiq_get_service_fourcc(VCHIQ_SERVICE_HANDLE_T service);
extern int vchiq_get_client_id(unsigned int service);
extern void *vchiq_get_service_userdata(unsigned int service);
extern int vchiq_get_service_fourcc(unsigned int service);
extern void vchiq_get_config(struct vchiq_config *config);
extern enum vchiq_status vchiq_set_service_option(VCHIQ_SERVICE_HANDLE_T service,
extern enum vchiq_status vchiq_set_service_option(unsigned int service,
enum vchiq_service_option option, int value);
extern enum vchiq_status vchiq_remote_use(VCHIQ_INSTANCE_T instance,
vchiq_remote_callback callback, void *cb_arg);
extern enum vchiq_status vchiq_remote_release(VCHIQ_INSTANCE_T instance);
extern enum vchiq_status vchiq_dump_phys_mem(VCHIQ_SERVICE_HANDLE_T service,
extern enum vchiq_status vchiq_dump_phys_mem(unsigned int service,
void *ptr, size_t num_bytes);
extern enum vchiq_status vchiq_get_peer_version(VCHIQ_SERVICE_HANDLE_T handle,
extern enum vchiq_status vchiq_get_peer_version(unsigned int handle,
short *peer_version);
#endif /* VCHIQ_IF_H */

View File

@ -12,7 +12,7 @@
#define vchiq_status_to_vchi(status) ((int32_t)status)
struct shim_service {
VCHIQ_SERVICE_HANDLE_T handle;
unsigned int handle;
struct vchiu_queue queue;
@ -360,13 +360,13 @@ int32_t vchi_held_msg_release(struct vchi_held_msg *message)
{
/*
* Convert the service field pointer back to an
* VCHIQ_SERVICE_HANDLE_T which is an int.
* unsigned int which is an int.
* This pointer is opaque to everything except
* vchi_msg_hold which simply upcasted the int
* to a pointer.
*/
vchiq_release_message((VCHIQ_SERVICE_HANDLE_T)(long)message->service,
vchiq_release_message((unsigned int)(long)message->service,
(struct vchiq_header *)message->message);
return 0;
@ -410,7 +410,7 @@ int32_t vchi_msg_hold(struct vchi_service_handle *handle, void **data,
*msg_size = header->size;
/*
* upcast the VCHIQ_SERVICE_HANDLE_T which is an int
* upcast the unsigned int which is an int
* to a pointer and stuff it in the held message.
* This pointer is opaque to everything except
* vchi_held_msg_release which simply downcasts it back
@ -505,7 +505,7 @@ EXPORT_SYMBOL(vchi_disconnect);
static enum vchiq_status shim_callback(enum vchiq_reason reason,
struct vchiq_header *header,
VCHIQ_SERVICE_HANDLE_T handle,
unsigned int handle,
void *bulk_user)
{
struct shim_service *service =