Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205985
b: refs/heads/master
c: bf968b0
h: refs/heads/master
i:
  205983: 7c5b23d
v: v3
  • Loading branch information
Armando Uribe authored and Greg Kroah-Hartman committed Jul 26, 2010
1 parent 4fc5a50 commit 563dd9e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 803cd75eff2d560d622da69569f0bf66a3ea4ed1
refs/heads/master: bf968b0a521fc5fd3faf66afa315d8183246c72f
32 changes: 9 additions & 23 deletions trunk/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,29 +110,15 @@
#define DSPTYPE64 0x99

/* Handy Macros */
#define IS_VALID_PROC_EVENT(x) (((x) == 0) || (((x) & \
(DSP_PROCESSORSTATECHANGE | \
DSP_PROCESSORATTACH | \
DSP_PROCESSORDETACH | \
DSP_PROCESSORRESTART | \
DSP_NODESTATECHANGE | \
DSP_STREAMDONE | \
DSP_STREAMIOCOMPLETION | \
DSP_MMUFAULT | \
DSP_SYSERROR | \
DSP_WDTOVERFLOW | \
DSP_PWRERROR)) && \
!((x) & ~(DSP_PROCESSORSTATECHANGE | \
DSP_PROCESSORATTACH | \
DSP_PROCESSORDETACH | \
DSP_PROCESSORRESTART | \
DSP_NODESTATECHANGE | \
DSP_STREAMDONE | \
DSP_STREAMIOCOMPLETION | \
DSP_MMUFAULT | \
DSP_SYSERROR | \
DSP_WDTOVERFLOW | \
DSP_PWRERROR))))
#define VALID_PROC_EVENT (DSP_PROCESSORSTATECHANGE | DSP_PROCESSORATTACH | \
DSP_PROCESSORDETACH | DSP_PROCESSORRESTART | DSP_NODESTATECHANGE | \
DSP_STREAMDONE | DSP_STREAMIOCOMPLETION | DSP_MMUFAULT | \
DSP_SYSERROR | DSP_WDTOVERFLOW | DSP_PWRERROR)

static inline bool is_valid_proc_event(u32 x)
{
return (x == 0 || (x & VALID_PROC_EVENT && !(x & ~VALID_PROC_EVENT)));
}

#define IS_VALID_NODE_EVENT(x) (((x) == 0) || \
(((x) & (DSP_NODESTATECHANGE | DSP_NODEMESSAGEREADY)) && \
Expand Down
20 changes: 9 additions & 11 deletions trunk/drivers/staging/tidspbridge/rmgr/nldr.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,11 @@
#define PDELETE "delete"
#define PEXECUTE "execute"

#define IS_EQUAL_UUID(uuid1, uuid2) (\
((uuid1).ul_data1 == (uuid2).ul_data1) && \
((uuid1).us_data2 == (uuid2).us_data2) && \
((uuid1).us_data3 == (uuid2).us_data3) && \
((uuid1).uc_data4 == (uuid2).uc_data4) && \
((uuid1).uc_data5 == (uuid2).uc_data5) && \
(strncmp((void *)(uuid1).uc_data6, (void *)(uuid2).uc_data6, 6)) == 0)
static inline bool is_equal_uuid(struct dsp_uuid *uuid1,
struct dsp_uuid *uuid2)
{
return !memcmp(uuid1, uuid2, sizeof(struct dsp_uuid));
}

/*
* ======== mem_seg_info ========
Expand Down Expand Up @@ -1487,8 +1485,8 @@ static int load_ovly(struct nldr_nodeobject *nldr_node_obj,

/* Find the node in the table */
for (i = 0; i < nldr_obj->ovly_nodes; i++) {
if (IS_EQUAL_UUID
(nldr_node_obj->uuid, nldr_obj->ovly_table[i].uuid)) {
if (is_equal_uuid
(&nldr_node_obj->uuid, &nldr_obj->ovly_table[i].uuid)) {
/* Found it */
po_node = &(nldr_obj->ovly_table[i]);
break;
Expand Down Expand Up @@ -1825,8 +1823,8 @@ static void unload_ovly(struct nldr_nodeobject *nldr_node_obj,

/* Find the node in the table */
for (i = 0; i < nldr_obj->ovly_nodes; i++) {
if (IS_EQUAL_UUID
(nldr_node_obj->uuid, nldr_obj->ovly_table[i].uuid)) {
if (is_equal_uuid
(&nldr_node_obj->uuid, &nldr_obj->ovly_table[i].uuid)) {
/* Found it */
po_node = &(nldr_obj->ovly_table[i]);
break;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/tidspbridge/rmgr/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ int proc_notify_clients(void *proc, u32 events)
struct proc_object *p_proc_object = (struct proc_object *)proc;

DBC_REQUIRE(p_proc_object);
DBC_REQUIRE(IS_VALID_PROC_EVENT(events));
DBC_REQUIRE(is_valid_proc_event(events));
DBC_REQUIRE(refs > 0);
if (!p_proc_object) {
status = -EFAULT;
Expand All @@ -1902,7 +1902,7 @@ int proc_notify_all_clients(void *proc, u32 events)
int status = 0;
struct proc_object *p_proc_object = (struct proc_object *)proc;

DBC_REQUIRE(IS_VALID_PROC_EVENT(events));
DBC_REQUIRE(is_valid_proc_event(events));
DBC_REQUIRE(refs > 0);

if (!p_proc_object) {
Expand Down

0 comments on commit 563dd9e

Please sign in to comment.