Skip to content

Commit

Permalink
staging: tidspbridge: set10 remove hungarian from structs
Browse files Browse the repository at this point in the history
hungarian notation will be removed from the elements inside
structures, the next varibles will be renamed:

Original:               Replacement:
hnext                   next
hnode                   node
hprev                   prev
hroot                   root
hstream                 stream
pbuf                    buf
pcb_arg                 cb_arg
pdspheap_list           dspheap_list
pmsg                    msg
ps_name                 name
pstr_create_phase_fxn   str_create_phase_fxn
pstr_delete_phase_fxn   str_delete_phase_fxn
pstr_dev_name           str_dev_name
pstr_event_name         str_event_name
pstr_execute_phase_fxn  str_execute_phase_fxn
pstr_i_alg_name         str_i_alg_name
udma_chnl_id            dma_chnl_id
un_bufs_in_strm         bufs_in_strm
usm_buf_size            sm_buf_size

Signed-off-by: Rene Sapiens <rene.sapiens@ti.com>
Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
  • Loading branch information
Rene Sapiens authored and Omar Ramirez Luna committed Feb 5, 2011
1 parent a534f17 commit ee4317f
Show file tree
Hide file tree
Showing 18 changed files with 220 additions and 220 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/tidspbridge/core/chnl_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
* translated to user's virtual addr later.
*/
host_sys_buf = chnl_packet_obj->host_sys_buf;
ioc.pbuf = chnl_packet_obj->host_user_buf;
ioc.buf = chnl_packet_obj->host_user_buf;
ioc.byte_size = chnl_packet_obj->byte_size;
ioc.buf_size = chnl_packet_obj->buf_size;
ioc.arg = chnl_packet_obj->arg;
Expand All @@ -613,7 +613,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
list_add_tail(&chnl_packet_obj->link,
&pchnl->free_packets_list);
} else {
ioc.pbuf = NULL;
ioc.buf = NULL;
ioc.byte_size = 0;
ioc.arg = 0;
ioc.buf_size = 0;
Expand All @@ -640,19 +640,19 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
spin_unlock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock);
if (dequeue_ioc
&& (pchnl->chnl_type == CHNL_PCPY && pchnl->chnl_id > 1)) {
if (!(ioc.pbuf < (void *)USERMODE_ADDR))
if (!(ioc.buf < (void *)USERMODE_ADDR))
goto func_cont;

/* If the addr is in user mode, then copy it */
if (!host_sys_buf || !ioc.pbuf) {
if (!host_sys_buf || !ioc.buf) {
status = -EFAULT;
goto func_cont;
}
if (!CHNL_IS_INPUT(pchnl->chnl_mode))
goto func_cont1;

/*host_user_buf */
status = copy_to_user(ioc.pbuf, host_sys_buf, ioc.byte_size);
status = copy_to_user(ioc.buf, host_sys_buf, ioc.byte_size);
if (status) {
if (current->flags & PF_EXITING)
status = 0;
Expand Down Expand Up @@ -806,7 +806,7 @@ int bridge_chnl_open(struct chnl_object **chnl,
pchnl->sync_event = sync_event;
/* Get the process handle */
pchnl->process = current->tgid;
pchnl->pcb_arg = 0;
pchnl->cb_arg = 0;
pchnl->bytes_moved = 0;
/* Default to proc-copy */
pchnl->chnl_type = CHNL_PCPY;
Expand Down
32 changes: 16 additions & 16 deletions drivers/staging/tidspbridge/core/io_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct io_mgr {
struct msg_ctrl *msg_output_ctrl;
u8 *msg_input; /* Address of input messages */
u8 *msg_output; /* Address of output messages */
u32 usm_buf_size; /* Size of a shared memory I/O channel */
u32 sm_buf_size; /* Size of a shared memory I/O channel */
bool shared_irq; /* Is this IRQ shared? */
u32 word_size; /* Size in bytes of DSP word */
u16 intr_val; /* Interrupt value */
Expand All @@ -119,7 +119,7 @@ struct io_mgr {
u32 trace_buffer_end; /* Trace message end address */
u32 trace_buffer_current; /* Trace message current address */
u32 gpp_read_pointer; /* GPP Read pointer to Trace buffer */
u8 *pmsg;
u8 *msg;
u32 gpp_va;
u32 dsp_va;
#endif
Expand Down Expand Up @@ -247,7 +247,7 @@ int bridge_io_destroy(struct io_mgr *hio_mgr)
tasklet_kill(&hio_mgr->dpc_tasklet);

#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
kfree(hio_mgr->pmsg);
kfree(hio_mgr->msg);
#endif
dsp_wdt_exit();
/* Free this IO manager object */
Expand Down Expand Up @@ -705,7 +705,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
hio_mgr->input = (u8 *) hio_mgr->shared_mem + sizeof(struct shm);
hio_mgr->output = hio_mgr->input + (ul_shm_length -
sizeof(struct shm)) / 2;
hio_mgr->usm_buf_size = hio_mgr->output - hio_mgr->input;
hio_mgr->sm_buf_size = hio_mgr->output - hio_mgr->input;

/* Set up Shared memory addresses for messaging. */
hio_mgr->msg_input_ctrl = (struct msg_ctrl *)((u8 *) hio_mgr->shared_mem
Expand Down Expand Up @@ -764,11 +764,11 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
(ul_gpp_va + ul_seg1_size + ul_pad_size) +
(hio_mgr->trace_buffer_current - ul_dsp_va);
/* Calculate the size of trace buffer */
kfree(hio_mgr->pmsg);
hio_mgr->pmsg = kmalloc(((hio_mgr->trace_buffer_end -
kfree(hio_mgr->msg);
hio_mgr->msg = kmalloc(((hio_mgr->trace_buffer_end -
hio_mgr->trace_buffer_begin) *
hio_mgr->word_size) + 2, GFP_KERNEL);
if (!hio_mgr->pmsg)
if (!hio_mgr->msg)
status = -ENOMEM;

hio_mgr->dsp_va = ul_dsp_va;
Expand All @@ -786,7 +786,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
u32 io_buf_size(struct io_mgr *hio_mgr)
{
if (hio_mgr)
return hio_mgr->usm_buf_size;
return hio_mgr->sm_buf_size;
else
return 0;
}
Expand Down Expand Up @@ -1361,7 +1361,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
chnl_mgr_obj->output_mask &= ~(1 << chnl_id);

/* Transfer buffer to DSP side */
chnl_packet_obj->byte_size = min(pio_mgr->usm_buf_size,
chnl_packet_obj->byte_size = min(pio_mgr->sm_buf_size,
chnl_packet_obj->byte_size);
memcpy(pio_mgr->output, chnl_packet_obj->host_sys_buf,
chnl_packet_obj->byte_size);
Expand Down Expand Up @@ -1704,30 +1704,30 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr)
ul_new_message_length =
ul_gpp_cur_pointer - hio_mgr->gpp_read_pointer;

memcpy(hio_mgr->pmsg,
memcpy(hio_mgr->msg,
(char *)hio_mgr->gpp_read_pointer,
ul_new_message_length);
hio_mgr->pmsg[ul_new_message_length] = '\0';
hio_mgr->msg[ul_new_message_length] = '\0';
/*
* Advance the GPP trace pointer to DSP current
* pointer.
*/
hio_mgr->gpp_read_pointer += ul_new_message_length;
/* Print the trace messages */
pr_info("DSPTrace: %s\n", hio_mgr->pmsg);
pr_info("DSPTrace: %s\n", hio_mgr->msg);
} else if (ul_gpp_cur_pointer < hio_mgr->gpp_read_pointer) {
/* Handle trace buffer wraparound */
memcpy(hio_mgr->pmsg,
memcpy(hio_mgr->msg,
(char *)hio_mgr->gpp_read_pointer,
hio_mgr->trace_buffer_end -
hio_mgr->gpp_read_pointer);
ul_new_message_length =
ul_gpp_cur_pointer - hio_mgr->trace_buffer_begin;
memcpy(&hio_mgr->pmsg[hio_mgr->trace_buffer_end -
memcpy(&hio_mgr->msg[hio_mgr->trace_buffer_end -
hio_mgr->gpp_read_pointer],
(char *)hio_mgr->trace_buffer_begin,
ul_new_message_length);
hio_mgr->pmsg[hio_mgr->trace_buffer_end -
hio_mgr->msg[hio_mgr->trace_buffer_end -
hio_mgr->gpp_read_pointer +
ul_new_message_length] = '\0';
/*
Expand All @@ -1738,7 +1738,7 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr)
hio_mgr->trace_buffer_begin +
ul_new_message_length;
/* Print the trace messages */
pr_info("DSPTrace: %s\n", hio_mgr->pmsg);
pr_info("DSPTrace: %s\n", hio_mgr->msg);
}
}
}
Expand Down
42 changes: 21 additions & 21 deletions drivers/staging/tidspbridge/dynload/cload.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ static void allocate_sections(struct dload_state *dlthis)
return;
}
/* initialize the handle header */
hndl->dm.hnext = hndl->dm.hprev = hndl; /* circular list */
hndl->dm.hroot = NULL;
hndl->dm.next = hndl->dm.prev = hndl; /* circular list */
hndl->dm.root = NULL;
hndl->dm.dbthis = 0;
dlthis->myhandle = hndl; /* save away for return */
/* pointer to the section list of allocated sections */
Expand Down Expand Up @@ -1626,7 +1626,7 @@ static void init_module_handle(struct dload_state *dlthis)
DL_ERROR(err_alloc, sizeof(struct dbg_mirror_root));
return;
}
mlst->hnext = NULL;
mlst->next = NULL;
mlst->changes = 0;
mlst->refcount = 0;
mlst->dbthis = TDATA_TO_TADDR(dlmodsym->value);
Expand All @@ -1651,7 +1651,7 @@ static void init_module_handle(struct dload_state *dlthis)
#else
mlist = (struct dbg_mirror_root *)&debug_list_header;
#endif
hndl->dm.hroot = mlist; /* set pointer to root into our handle */
hndl->dm.root = mlist; /* set pointer to root into our handle */
if (!dlthis->allocated_secn_count)
return; /* no load addresses to be recorded */
/* reuse temporary symbol storage */
Expand Down Expand Up @@ -1702,9 +1702,9 @@ static void init_module_handle(struct dload_state *dlthis)
dllview_info.context = 0;
hndl->dm.context = 0;
/* fill in next pointer and size */
if (mlist->hnext) {
dbmod->next_module = TADDR_TO_TDATA(mlist->hnext->dm.dbthis);
dbmod->next_module_size = mlist->hnext->dm.dbsiz;
if (mlist->next) {
dbmod->next_module = TADDR_TO_TDATA(mlist->next->dm.dbthis);
dbmod->next_module_size = mlist->next->dm.dbsiz;
} else {
dbmod->next_module_size = 0;
dbmod->next_module = 0;
Expand Down Expand Up @@ -1750,11 +1750,11 @@ static void init_module_handle(struct dload_state *dlthis)
}
/* Add the module handle to this processor's list
of handles with debug info */
hndl->dm.hnext = mlist->hnext;
if (hndl->dm.hnext)
hndl->dm.hnext->dm.hprev = hndl;
hndl->dm.hprev = (struct my_handle *)mlist;
mlist->hnext = hndl; /* insert after root */
hndl->dm.next = mlist->next;
if (hndl->dm.next)
hndl->dm.next->dm.prev = hndl;
hndl->dm.prev = (struct my_handle *)mlist;
mlist->next = hndl; /* insert after root */
} /* init_module_handle */

/*************************************************************************
Expand Down Expand Up @@ -1810,7 +1810,7 @@ int dynamic_unload_module(void *mhandle,
asecs->name = NULL;
alloc->dload_deallocate(alloc, asecs++);
}
root = hndl->dm.hroot;
root = hndl->dm.root;
if (!root) {
/* there is a debug list containing this module */
goto func_end;
Expand All @@ -1820,20 +1820,20 @@ int dynamic_unload_module(void *mhandle,
}
/* Retrieve memory context in which .dllview was allocated */
dllview_info.context = hndl->dm.context;
if (hndl->dm.hprev == hndl)
if (hndl->dm.prev == hndl)
goto exitunltgt;

/* target-side dllview record is in list */
/* dequeue this record from our GPP-side mirror list */
hndl->dm.hprev->dm.hnext = hndl->dm.hnext;
if (hndl->dm.hnext)
hndl->dm.hnext->dm.hprev = hndl->dm.hprev;
hndl->dm.prev->dm.next = hndl->dm.next;
if (hndl->dm.next)
hndl->dm.next->dm.prev = hndl->dm.prev;
/* Update next_module of previous entry in target list
* We are using mhdr here as a surrogate for either a
struct modules_header or a dll_module */
if (hndl->dm.hnext) {
mhdr.first_module = TADDR_TO_TDATA(hndl->dm.hnext->dm.dbthis);
mhdr.first_module_size = hndl->dm.hnext->dm.dbsiz;
if (hndl->dm.next) {
mhdr.first_module = TADDR_TO_TDATA(hndl->dm.next->dm.dbthis);
mhdr.first_module_size = hndl->dm.next->dm.dbsiz;
} else {
mhdr.first_module = 0;
mhdr.first_module_size = 0;
Expand All @@ -1851,7 +1851,7 @@ int dynamic_unload_module(void *mhandle,
swap_words(&mhdr, sizeof(struct modules_header) - sizeof(u16),
MODULES_HEADER_BITMAP);
}
if (!init->writemem(init, &mhdr, hndl->dm.hprev->dm.dbthis,
if (!init->writemem(init, &mhdr, hndl->dm.prev->dm.dbthis,
&dllview_info, sizeof(struct modules_header) -
sizeof(mhdr.update_flag))) {
dload_syms_error(syms, dlvwrite);
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/tidspbridge/dynload/dload_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ struct my_handle;
struct dbg_mirror_root {
/* must be same as dbg_mirror_list; __DLModules address on target */
u32 dbthis;
struct my_handle *hnext; /* must be same as dbg_mirror_list */
struct my_handle *next; /* must be same as dbg_mirror_list */
u16 changes; /* change counter */
u16 refcount; /* number of modules referencing this root */
};

struct dbg_mirror_list {
u32 dbthis;
struct my_handle *hnext, *hprev;
struct dbg_mirror_root *hroot;
struct my_handle *next, *prev;
struct dbg_mirror_root *root;
u16 dbsiz;
u32 context; /* Save context for .dllview memory allocation */
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ struct chnl_object {
/* Abstract syncronization object */
struct sync_object *sync_event;
u32 process; /* Process which created this channel */
u32 pcb_arg; /* Argument to use with callback */
u32 cb_arg; /* Argument to use with callback */
struct list_head pio_requests; /* List of IOR's to driver */
s32 cio_cs; /* Number of IOC's in queue */
s32 cio_reqs; /* Number of IORequests in queue */
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/tidspbridge/include/dspbridge/chnldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@
struct chnl_attr {
u32 uio_reqs; /* Max # of preallocated I/O requests. */
void *event_obj; /* User supplied auto-reset event object. */
char *pstr_event_name; /* Ptr to name of user event object. */
char *str_event_name; /* Ptr to name of user event object. */
void *reserved1; /* Reserved for future use. */
u32 reserved2; /* Reserved for future use. */

};

/* I/O completion record: */
struct chnl_ioc {
void *pbuf; /* Buffer to be filled/emptied. */
void *buf; /* Buffer to be filled/emptied. */
u32 byte_size; /* Bytes transferred. */
u32 buf_size; /* Actual buffer size in bytes */
u32 status; /* Status of IO completion. */
u32 arg; /* User argument associated with pbuf. */
u32 arg; /* User argument associated with buf. */
};

#endif /* CHNLDEFS_ */
8 changes: 4 additions & 4 deletions drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ struct dcd_nodeprops {
struct dsp_ndbprops ndb_props;
u32 msg_segid;
u32 msg_notify_type;
char *pstr_create_phase_fxn;
char *pstr_delete_phase_fxn;
char *pstr_execute_phase_fxn;
char *pstr_i_alg_name;
char *str_create_phase_fxn;
char *str_delete_phase_fxn;
char *str_execute_phase_fxn;
char *str_i_alg_name;

/* Dynamic load properties */
u16 load_type; /* Static, dynamic, overlay */
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/tidspbridge/include/dspbridge/dbdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ struct dsp_strmattr {
u32 timeout; /* Timeout for blocking STRM calls */
enum dsp_strmmode strm_mode; /* mode of stream when opened */
/* DMA chnl id if dsp_strmmode is LDMA or RDMA */
u32 udma_chnl_id;
u32 dma_chnl_id;
u32 dma_priority; /* DMA channel priority 0=lowest, >0=high */
};

Expand Down Expand Up @@ -340,7 +340,7 @@ struct dsp_nodeattr {
* window handle.
*/
struct dsp_notification {
char *ps_name;
char *name;
void *handle;
};

Expand Down Expand Up @@ -406,7 +406,7 @@ struct dsp_streamattrin {
u32 buf_alignment;
u32 num_bufs;
enum dsp_strmmode strm_mode;
u32 udma_chnl_id;
u32 dma_chnl_id;
u32 dma_priority;
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/tidspbridge/include/dspbridge/drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct drv_object;

/* New structure (member of process context) abstracts NODE resource info */
struct node_res_object {
void *hnode;
void *node;
s32 node_allocated; /* Node status */
s32 heap_allocated; /* Heap status */
s32 streams_allocated; /* Streams status */
Expand Down Expand Up @@ -101,7 +101,7 @@ struct dmm_rsv_object {
/* New structure (member of process context) abstracts stream resource info */
struct strm_res_object {
s32 stream_allocated; /* Stream status */
void *hstream;
void *stream;
u32 num_bufs;
u32 dir;
int id;
Expand Down
Loading

0 comments on commit ee4317f

Please sign in to comment.