git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ALSA: asihpi - Use size_t for sizeof result
[pandora-kernel.git]
/
sound
/
pci
/
asihpi
/
hpicmn.c
diff --git
a/sound/pci/asihpi/hpicmn.c
b/sound/pci/asihpi/hpicmn.c
index
b15a02e
..
65b7ca1
100644
(file)
--- a/
sound/pci/asihpi/hpicmn.c
+++ b/
sound/pci/asihpi/hpicmn.c
@@
-57,7
+57,7
@@
u16 hpi_validate_response(struct hpi_message *phm, struct hpi_response *phr)
}
if (phr->function != phm->function) {
}
if (phr->function != phm->function) {
- HPI_DEBUG_LOG(ERROR, "header
type
%d invalid\n",
+ HPI_DEBUG_LOG(ERROR, "header
function
%d invalid\n",
phr->function);
return HPI_ERROR_INVALID_RESPONSE;
}
phr->function);
return HPI_ERROR_INVALID_RESPONSE;
}
@@
-315,8
+315,7
@@
short hpi_check_control_cache(struct hpi_control_cache *p_cache,
short found = 1;
struct hpi_control_cache_info *pI;
struct hpi_control_cache_single *pC;
short found = 1;
struct hpi_control_cache_info *pI;
struct hpi_control_cache_single *pC;
- struct hpi_control_cache_pad *p_pad;
-
+ size_t response_size;
if (!find_control(phm->obj_index, p_cache, &pI)) {
HPI_DEBUG_LOG(VERBOSE,
"HPICMN find_control() failed for adap %d\n",
if (!find_control(phm->obj_index, p_cache, &pI)) {
HPI_DEBUG_LOG(VERBOSE,
"HPICMN find_control() failed for adap %d\n",
@@
-326,11
+325,15
@@
short hpi_check_control_cache(struct hpi_control_cache *p_cache,
phr->error = 0;
phr->error = 0;
+ /* set the default response size */
+ response_size =
+ sizeof(struct hpi_response_header) +
+ sizeof(struct hpi_control_res);
+
/* pC is the default cached control strucure. May be cast to
something else in the following switch statement.
*/
pC = (struct hpi_control_cache_single *)pI;
/* pC is the default cached control strucure. May be cast to
something else in the following switch statement.
*/
pC = (struct hpi_control_cache_single *)pI;
- p_pad = (struct hpi_control_cache_pad *)pI;
switch (pI->control_type) {
switch (pI->control_type) {
@@
-529,9
+532,7
@@
short hpi_check_control_cache(struct hpi_control_cache *p_cache,
pI->control_index, pI->control_type, phm->u.c.attribute);
if (found)
pI->control_index, pI->control_type, phm->u.c.attribute);
if (found)
- phr->size =
- sizeof(struct hpi_response_header) +
- sizeof(struct hpi_control_res);
+ phr->size = (u16)response_size;
return found;
}
return found;
}
@@
-682,7
+683,7
@@
static void subsys_message(struct hpi_message *phm, struct hpi_response *phr)
void HPI_COMMON(struct hpi_message *phm, struct hpi_response *phr)
{
switch (phm->type) {
void HPI_COMMON(struct hpi_message *phm, struct hpi_response *phr)
{
switch (phm->type) {
- case HPI_TYPE_
MESSAGE
:
+ case HPI_TYPE_
REQUEST
:
switch (phm->object) {
case HPI_OBJ_SUBSYSTEM:
subsys_message(phm, phr);
switch (phm->object) {
case HPI_OBJ_SUBSYSTEM:
subsys_message(phm, phr);