diff options
author | Dan Carpenter <error27@gmail.com> | 2010-11-13 04:37:49 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-16 20:31:50 (GMT) |
commit | f05321cca53da7c7abad4bc726699e9f27bf4922 (patch) | |
tree | 7cef88782011584c9435741172ab4cf2081ec05f /drivers/staging/bcm/CmHost.c | |
parent | 0ebce2696305c3f49f54f3af25cb966ef1b24f71 (diff) | |
download | linux-fsl-qoriq-f05321cca53da7c7abad4bc726699e9f27bf4922.tar.xz |
Staging: bcm: signedness bug in StoreSFParam()
wrm() returns negative error codes so "ret" needs to be signed here.
There was place where wrm() returned positive EACCES instead of
negative -EACCES so I fixed that as well. Also a few checkpatch.pl
issues.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm/CmHost.c')
-rw-r--r-- | drivers/staging/bcm/CmHost.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c index a685cad..5ac4582 100644 --- a/drivers/staging/bcm/CmHost.c +++ b/drivers/staging/bcm/CmHost.c @@ -1649,17 +1649,17 @@ static inline ULONG RestoreSFParam(PMINI_ADAPTER Adapter, ULONG ulAddrSFParamSet static ULONG StoreSFParam(PMINI_ADAPTER Adapter,PUCHAR pucSrcBuffer,ULONG ulAddrSFParamSet) { UINT nBytesToWrite = sizeof(stServiceFlowParamSI); - UINT uiRetVal =0; + int ret = 0; if(ulAddrSFParamSet == 0 || NULL == pucSrcBuffer) { return 0; } - uiRetVal = wrm(Adapter,ulAddrSFParamSet,(PUCHAR)pucSrcBuffer, nBytesToWrite); - if(uiRetVal < 0) { + ret = wrm(Adapter, ulAddrSFParamSet, (u8 *)pucSrcBuffer, nBytesToWrite); + if (ret < 0) { BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s:%d WRM failed",__FUNCTION__, __LINE__); - return uiRetVal; + return ret; } return 1; } |