* [PATCH 4/8] DSPBRIDGE: Remove unused hDrvObject in bridge_[open|release]
@ 2010-01-08 1:00 Omar Ramirez Luna
2010-01-08 2:19 ` Nishanth Menon
0 siblings, 1 reply; 4+ messages in thread
From: Omar Ramirez Luna @ 2010-01-08 1:00 UTC (permalink / raw)
To: linux-omap
Cc: Hiroshi Doyu, Ameya Palande, Felipe Contreras, Fernando Guzman,
Ernesto Ramos, Omar Ramirez Luna
This patch removes an unused variable in bridge_open
and bridge_release functions, which reduces indentation.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
drivers/dsp/bridge/rmgr/drv_interface.c | 25 +++++--------------------
1 files changed, 5 insertions(+), 20 deletions(-)
diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c
index 3a4d058..e551840 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -540,18 +540,10 @@ static void __exit bridge_exit(void)
static int bridge_open(struct inode *ip, struct file *filp)
{
int status = 0;
- DSP_STATUS dsp_status;
- HANDLE hDrvObject;
struct PROCESS_CONTEXT *pr_ctxt = NULL;
GT_0trace(driverTrace, GT_ENTER, "-> bridge_open\n");
- dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
- if (DSP_FAILED(dsp_status)) {
- status = -EIO;
- goto err;
- }
-
/*
* Allocate a new process context and insert it into global
* process context list.
@@ -564,7 +556,6 @@ static int bridge_open(struct inode *ip, struct file *filp)
filp->private_data = pr_ctxt;
-err:
GT_0trace(driverTrace, GT_ENTER, "<- bridge_open\n");
return status;
}
@@ -576,8 +567,6 @@ err:
static int bridge_release(struct inode *ip, struct file *filp)
{
int status = 0;
- DSP_STATUS dsp_status;
- HANDLE hDrvObject;
struct PROCESS_CONTEXT *pr_ctxt;
GT_0trace(driverTrace, GT_ENTER, "-> bridge_release\n");
@@ -588,15 +577,11 @@ static int bridge_release(struct inode *ip, struct file *filp)
}
pr_ctxt = filp->private_data;
- dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
- if (DSP_SUCCEEDED(dsp_status)) {
- flush_signals(current);
- DRV_RemoveAllResources(pr_ctxt);
- PROC_Detach(pr_ctxt);
- MEM_Free(pr_ctxt);
- } else {
- status = -EIO;
- }
+ flush_signals(current);
+ DRV_RemoveAllResources(pr_ctxt);
+ PROC_Detach(pr_ctxt);
+ MEM_Free(pr_ctxt);
+
filp->private_data = NULL;
err:
--
1.6.2.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 4/8] DSPBRIDGE: Remove unused hDrvObject in bridge_[open|release]
2010-01-08 1:00 [PATCH 4/8] DSPBRIDGE: Remove unused hDrvObject in bridge_[open|release] Omar Ramirez Luna
@ 2010-01-08 2:19 ` Nishanth Menon
2010-01-08 21:29 ` Ramirez Luna, Omar
0 siblings, 1 reply; 4+ messages in thread
From: Nishanth Menon @ 2010-01-08 2:19 UTC (permalink / raw)
To: Omar Ramirez Luna
Cc: linux-omap, Hiroshi Doyu, Ameya Palande, Felipe Contreras,
Guzman Lugo, Fernando, Ramos Falcon, Ernesto
Omar Ramirez Luna had written, on 01/07/2010 07:00 PM, the following:
> This patch removes an unused variable in bridge_open
> and bridge_release functions, which reduces indentation.
>
> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
> ---
> drivers/dsp/bridge/rmgr/drv_interface.c | 25 +++++--------------------
> 1 files changed, 5 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c
> index 3a4d058..e551840 100644
> --- a/drivers/dsp/bridge/rmgr/drv_interface.c
> +++ b/drivers/dsp/bridge/rmgr/drv_interface.c
> @@ -540,18 +540,10 @@ static void __exit bridge_exit(void)
> static int bridge_open(struct inode *ip, struct file *filp)
> {
> int status = 0;
> - DSP_STATUS dsp_status;
> - HANDLE hDrvObject;
> struct PROCESS_CONTEXT *pr_ctxt = NULL;
>
> GT_0trace(driverTrace, GT_ENTER, "-> bridge_open\n");
>
> - dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
> - if (DSP_FAILED(dsp_status)) {
is this some sort of verification if the hDrvObject is valid?
if so this is not an unused variable rt?
> - status = -EIO;
> - goto err;
> - }
> -
> /*
> * Allocate a new process context and insert it into global
> * process context list.
> @@ -564,7 +556,6 @@ static int bridge_open(struct inode *ip, struct file *filp)
>
> filp->private_data = pr_ctxt;
>
> -err:
> GT_0trace(driverTrace, GT_ENTER, "<- bridge_open\n");
> return status;
> }
> @@ -576,8 +567,6 @@ err:
> static int bridge_release(struct inode *ip, struct file *filp)
> {
> int status = 0;
> - DSP_STATUS dsp_status;
> - HANDLE hDrvObject;
> struct PROCESS_CONTEXT *pr_ctxt;
>
> GT_0trace(driverTrace, GT_ENTER, "-> bridge_release\n");
> @@ -588,15 +577,11 @@ static int bridge_release(struct inode *ip, struct file *filp)
> }
>
> pr_ctxt = filp->private_data;
> - dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
> - if (DSP_SUCCEEDED(dsp_status)) {
is this some sort of verification if the hDrvObject is valid?
if so this is not an unused variable rt?
> - flush_signals(current);
> - DRV_RemoveAllResources(pr_ctxt);
> - PROC_Detach(pr_ctxt);
> - MEM_Free(pr_ctxt);
> - } else {
> - status = -EIO;
> - }
> + flush_signals(current);
> + DRV_RemoveAllResources(pr_ctxt);
> + PROC_Detach(pr_ctxt);
> + MEM_Free(pr_ctxt);
> +
> filp->private_data = NULL;
>
> err:
--
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 4/8] DSPBRIDGE: Remove unused hDrvObject in bridge_[open|release]
2010-01-08 2:19 ` Nishanth Menon
@ 2010-01-08 21:29 ` Ramirez Luna, Omar
2010-01-08 21:37 ` Nishanth Menon
0 siblings, 1 reply; 4+ messages in thread
From: Ramirez Luna, Omar @ 2010-01-08 21:29 UTC (permalink / raw)
To: Menon, Nishanth
Cc: linux-omap, Hiroshi Doyu, Ameya Palande, Felipe Contreras,
Guzman Lugo, Fernando, Ramos Falcon, Ernesto
>From: Menon, Nishanth
>
>Omar Ramirez Luna had written, on 01/07/2010 07:00 PM, the following:
>> This patch removes an unused variable in bridge_open
>> and bridge_release functions, which reduces indentation.
>>
>> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
>> ---
>> drivers/dsp/bridge/rmgr/drv_interface.c | 25 +++++--------------------
>> 1 files changed, 5 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c
>> index 3a4d058..e551840 100644
>> --- a/drivers/dsp/bridge/rmgr/drv_interface.c
>> +++ b/drivers/dsp/bridge/rmgr/drv_interface.c
>> @@ -540,18 +540,10 @@ static void __exit bridge_exit(void)
>> static int bridge_open(struct inode *ip, struct file *filp)
>> {
>> int status = 0;
>> - DSP_STATUS dsp_status;
>> - HANDLE hDrvObject;
>> struct PROCESS_CONTEXT *pr_ctxt = NULL;
>>
>> GT_0trace(driverTrace, GT_ENTER, "-> bridge_open\n");
>>
>> - dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
>> - if (DSP_FAILED(dsp_status)) {
>is this some sort of verification if the hDrvObject is valid?
>if so this is not an unused variable rt?
No, this drv object was used for inserting and removing the process
context, it doesn't work as validation at least not in this place.
>
>> - status = -EIO;
>> - goto err;
>> - }
>> -
>> /*
>> * Allocate a new process context and insert it into global
>> * process context list.
>> @@ -564,7 +556,6 @@ static int bridge_open(struct inode *ip, struct file *filp)
>>
>> filp->private_data = pr_ctxt;
>>
>> -err:
>> GT_0trace(driverTrace, GT_ENTER, "<- bridge_open\n");
>> return status;
>> }
>> @@ -576,8 +567,6 @@ err:
>> static int bridge_release(struct inode *ip, struct file *filp)
>> {
>> int status = 0;
>> - DSP_STATUS dsp_status;
>> - HANDLE hDrvObject;
>> struct PROCESS_CONTEXT *pr_ctxt;
>>
>> GT_0trace(driverTrace, GT_ENTER, "-> bridge_release\n");
>> @@ -588,15 +577,11 @@ static int bridge_release(struct inode *ip, struct file *filp)
>> }
>>
>> pr_ctxt = filp->private_data;
>> - dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
>> - if (DSP_SUCCEEDED(dsp_status)) {
>is this some sort of verification if the hDrvObject is valid?
>if so this is not an unused variable rt?
No, this drv object was used for inserting and removing the process
context, it doesn't work as validation at least not in this place.
>> - flush_signals(current);
>> - DRV_RemoveAllResources(pr_ctxt);
>> - PROC_Detach(pr_ctxt);
>> - MEM_Free(pr_ctxt);
>> - } else {
>> - status = -EIO;
>> - }
>> + flush_signals(current);
>> + DRV_RemoveAllResources(pr_ctxt);
>> + PROC_Detach(pr_ctxt);
>> + MEM_Free(pr_ctxt);
>> +
>> filp->private_data = NULL;
>>
>> err:
>
- omar
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/8] DSPBRIDGE: Remove unused hDrvObject in bridge_[open|release]
2010-01-08 21:29 ` Ramirez Luna, Omar
@ 2010-01-08 21:37 ` Nishanth Menon
0 siblings, 0 replies; 4+ messages in thread
From: Nishanth Menon @ 2010-01-08 21:37 UTC (permalink / raw)
To: Ramirez Luna, Omar
Cc: linux-omap, Hiroshi Doyu, Ameya Palande, Felipe Contreras,
Guzman Lugo, Fernando, Ramos Falcon, Ernesto
Ramirez Luna, Omar had written, on 01/08/2010 03:29 PM, the following:
>> From: Menon, Nishanth
>>
>> Omar Ramirez Luna had written, on 01/07/2010 07:00 PM, the following:
>>> This patch removes an unused variable in bridge_open
>>> and bridge_release functions, which reduces indentation.
>>>
>>> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
>>> ---
>>> drivers/dsp/bridge/rmgr/drv_interface.c | 25 +++++--------------------
>>> 1 files changed, 5 insertions(+), 20 deletions(-)
>>>
>>> diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c
>>> index 3a4d058..e551840 100644
>>> --- a/drivers/dsp/bridge/rmgr/drv_interface.c
>>> +++ b/drivers/dsp/bridge/rmgr/drv_interface.c
>>> @@ -540,18 +540,10 @@ static void __exit bridge_exit(void)
>>> static int bridge_open(struct inode *ip, struct file *filp)
>>> {
>>> int status = 0;
>>> - DSP_STATUS dsp_status;
>>> - HANDLE hDrvObject;
>>> struct PROCESS_CONTEXT *pr_ctxt = NULL;
>>>
>>> GT_0trace(driverTrace, GT_ENTER, "-> bridge_open\n");
>>>
>>> - dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
>>> - if (DSP_FAILED(dsp_status)) {
>> is this some sort of verification if the hDrvObject is valid?
>> if so this is not an unused variable rt?
>
> No, this drv object was used for inserting and removing the process
> context, it doesn't work as validation at least not in this place.
thanks.
Acked-by: Nishanth Menon <nm@ti.com>
>
>>> - status = -EIO;
>>> - goto err;
>>> - }
>>> -
>>> /*
>>> * Allocate a new process context and insert it into global
>>> * process context list.
>>> @@ -564,7 +556,6 @@ static int bridge_open(struct inode *ip, struct file *filp)
>>>
>>> filp->private_data = pr_ctxt;
>>>
>>> -err:
>>> GT_0trace(driverTrace, GT_ENTER, "<- bridge_open\n");
>>> return status;
>>> }
>>> @@ -576,8 +567,6 @@ err:
>>> static int bridge_release(struct inode *ip, struct file *filp)
>>> {
>>> int status = 0;
>>> - DSP_STATUS dsp_status;
>>> - HANDLE hDrvObject;
>>> struct PROCESS_CONTEXT *pr_ctxt;
>>>
>>> GT_0trace(driverTrace, GT_ENTER, "-> bridge_release\n");
>>> @@ -588,15 +577,11 @@ static int bridge_release(struct inode *ip, struct file *filp)
>>> }
>>>
>>> pr_ctxt = filp->private_data;
>>> - dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
>>> - if (DSP_SUCCEEDED(dsp_status)) {
>> is this some sort of verification if the hDrvObject is valid?
>> if so this is not an unused variable rt?
>
> No, this drv object was used for inserting and removing the process
> context, it doesn't work as validation at least not in this place.
>
>>> - flush_signals(current);
>>> - DRV_RemoveAllResources(pr_ctxt);
>>> - PROC_Detach(pr_ctxt);
>>> - MEM_Free(pr_ctxt);
>>> - } else {
>>> - status = -EIO;
>>> - }
>>> + flush_signals(current);
>>> + DRV_RemoveAllResources(pr_ctxt);
>>> + PROC_Detach(pr_ctxt);
>>> + MEM_Free(pr_ctxt);
>>> +
>>> filp->private_data = NULL;
>>>
>>> err:
>
> - omar
--
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-08 21:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-08 1:00 [PATCH 4/8] DSPBRIDGE: Remove unused hDrvObject in bridge_[open|release] Omar Ramirez Luna
2010-01-08 2:19 ` Nishanth Menon
2010-01-08 21:29 ` Ramirez Luna, Omar
2010-01-08 21:37 ` Nishanth Menon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox