* Fw: [PATCH] [media] s5p-mfc: Remove unreachable code
@ 2012-09-25 13:28 Mauro Carvalho Chehab
2012-09-25 14:07 ` Sylwester Nawrocki
0 siblings, 1 reply; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2012-09-25 13:28 UTC (permalink / raw)
To: Sylwester Nawrocki; +Cc: Linux Media Mailing List
Hi Sylwester,
Please review.
Thanks!
Mauro
Forwarded message:
Date: Fri, 14 Sep 2012 14:50:17 +0530
From: Sachin Kamat <sachin.kamat@linaro.org>
To: linux-media@vger.kernel.org
Cc: mchehab@infradead.org, s.nawrocki@samsung.com, k.debski@samsung.com, sachin.kamat@linaro.org, patches@linaro.org
Subject: [PATCH] [media] s5p-mfc: Remove unreachable code
Code after return statement never gets executed.
Hence can be deleted.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/media/platform/s5p-mfc/s5p_mfc.c | 21 +--------------------
1 files changed, 1 insertions(+), 20 deletions(-)
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index e3e616d..56876be 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1144,30 +1144,11 @@ static int s5p_mfc_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct s5p_mfc_dev *m_dev = platform_get_drvdata(pdev);
- int ret;
if (m_dev->num_inst == 0)
return 0;
- return s5p_mfc_sleep(m_dev);
- if (test_and_set_bit(0, &m_dev->enter_suspend) != 0) {
- mfc_err("Error: going to suspend for a second time\n");
- return -EIO;
- }
- /* Check if we're processing then wait if it necessary. */
- while (test_and_set_bit(0, &m_dev->hw_lock) != 0) {
- /* Try and lock the HW */
- /* Wait on the interrupt waitqueue */
- ret = wait_event_interruptible_timeout(m_dev->queue,
- m_dev->int_cond || m_dev->ctx[m_dev->curr_ctx]->int_cond,
- msecs_to_jiffies(MFC_INT_TIMEOUT));
-
- if (ret == 0) {
- mfc_err("Waiting for hardware to finish timed out\n");
- return -EIO;
- }
- }
- return 0;
+ return s5p_mfc_sleep(m_dev);
}
static int s5p_mfc_resume(struct device *dev)
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Regards,
Mauro
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: Fw: [PATCH] [media] s5p-mfc: Remove unreachable code
2012-09-25 13:28 Fw: [PATCH] [media] s5p-mfc: Remove unreachable code Mauro Carvalho Chehab
@ 2012-09-25 14:07 ` Sylwester Nawrocki
2012-09-25 15:25 ` Sachin Kamat
0 siblings, 1 reply; 4+ messages in thread
From: Sylwester Nawrocki @ 2012-09-25 14:07 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Linux Media Mailing List, Sachin Kamat, Kamil Debski
Hi Mauro, Sachin,
On 09/25/2012 03:28 PM, Mauro Carvalho Chehab wrote:
> Hi Sylwester,
>
> Please review.
I checked it with Kamil and it seems the code being removed
is required for proper driver operation. Thus please hold on
with this patch. We will prepare a different fix after testing.
Sachin, thanks for reporting that issue. The code below is needed
to make sure the MFC is fully suspended after s5p_mfc_suspend()
returns. The "return s5p_mfc_sleep(m_dev);" probably just needs
to be moved after the while loop.
> Thanks!
> Mauro
>
> Forwarded message:
>
> Date: Fri, 14 Sep 2012 14:50:17 +0530
> From: Sachin Kamat <sachin.kamat@linaro.org>
> To: linux-media@vger.kernel.org
> Cc: mchehab@infradead.org, s.nawrocki@samsung.com, k.debski@samsung.com, sachin.kamat@linaro.org, patches@linaro.org
> Subject: [PATCH] [media] s5p-mfc: Remove unreachable code
>
>
> Code after return statement never gets executed.
> Hence can be deleted.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/media/platform/s5p-mfc/s5p_mfc.c | 21 +--------------------
> 1 files changed, 1 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index e3e616d..56876be 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -1144,30 +1144,11 @@ static int s5p_mfc_suspend(struct device *dev)
> {
> struct platform_device *pdev = to_platform_device(dev);
> struct s5p_mfc_dev *m_dev = platform_get_drvdata(pdev);
> - int ret;
>
> if (m_dev->num_inst == 0)
> return 0;
> - return s5p_mfc_sleep(m_dev);
> - if (test_and_set_bit(0, &m_dev->enter_suspend) != 0) {
> - mfc_err("Error: going to suspend for a second time\n");
> - return -EIO;
> - }
>
> - /* Check if we're processing then wait if it necessary. */
> - while (test_and_set_bit(0, &m_dev->hw_lock) != 0) {
> - /* Try and lock the HW */
> - /* Wait on the interrupt waitqueue */
> - ret = wait_event_interruptible_timeout(m_dev->queue,
> - m_dev->int_cond || m_dev->ctx[m_dev->curr_ctx]->int_cond,
> - msecs_to_jiffies(MFC_INT_TIMEOUT));
> -
> - if (ret == 0) {
> - mfc_err("Waiting for hardware to finish timed out\n");
> - return -EIO;
> - }
> - }
> - return 0;
> + return s5p_mfc_sleep(m_dev);
> }
>
> static int s5p_mfc_resume(struct device *dev)
--
Thanks,
Sylwester
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Fw: [PATCH] [media] s5p-mfc: Remove unreachable code
2012-09-25 14:07 ` Sylwester Nawrocki
@ 2012-09-25 15:25 ` Sachin Kamat
2012-09-25 15:55 ` Sylwester Nawrocki
0 siblings, 1 reply; 4+ messages in thread
From: Sachin Kamat @ 2012-09-25 15:25 UTC (permalink / raw)
To: Sylwester Nawrocki
Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Kamil Debski
Hi Sylwester,
On 25 September 2012 19:37, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
> Hi Mauro, Sachin,
>
> On 09/25/2012 03:28 PM, Mauro Carvalho Chehab wrote:
>> Hi Sylwester,
>>
>> Please review.
>
> I checked it with Kamil and it seems the code being removed
> is required for proper driver operation. Thus please hold on
> with this patch. We will prepare a different fix after testing.
>
> Sachin, thanks for reporting that issue. The code below is needed
> to make sure the MFC is fully suspended after s5p_mfc_suspend()
> returns.
OK.
The "return s5p_mfc_sleep(m_dev);" probably just needs
> to be moved after the while loop.
Do you want me to make this change and re-send the patch?
>
>> Thanks!
>> Mauro
>>
>> Forwarded message:
>>
>> Date: Fri, 14 Sep 2012 14:50:17 +0530
>> From: Sachin Kamat <sachin.kamat@linaro.org>
>> To: linux-media@vger.kernel.org
>> Cc: mchehab@infradead.org, s.nawrocki@samsung.com, k.debski@samsung.com, sachin.kamat@linaro.org, patches@linaro.org
>> Subject: [PATCH] [media] s5p-mfc: Remove unreachable code
>>
>>
>> Code after return statement never gets executed.
>> Hence can be deleted.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> ---
>> drivers/media/platform/s5p-mfc/s5p_mfc.c | 21 +--------------------
>> 1 files changed, 1 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> index e3e616d..56876be 100644
>> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> @@ -1144,30 +1144,11 @@ static int s5p_mfc_suspend(struct device *dev)
>> {
>> struct platform_device *pdev = to_platform_device(dev);
>> struct s5p_mfc_dev *m_dev = platform_get_drvdata(pdev);
>> - int ret;
>>
>> if (m_dev->num_inst == 0)
>> return 0;
>> - return s5p_mfc_sleep(m_dev);
>> - if (test_and_set_bit(0, &m_dev->enter_suspend) != 0) {
>> - mfc_err("Error: going to suspend for a second time\n");
>> - return -EIO;
>> - }
>>
>> - /* Check if we're processing then wait if it necessary. */
>> - while (test_and_set_bit(0, &m_dev->hw_lock) != 0) {
>> - /* Try and lock the HW */
>> - /* Wait on the interrupt waitqueue */
>> - ret = wait_event_interruptible_timeout(m_dev->queue,
>> - m_dev->int_cond || m_dev->ctx[m_dev->curr_ctx]->int_cond,
>> - msecs_to_jiffies(MFC_INT_TIMEOUT));
>> -
>> - if (ret == 0) {
>> - mfc_err("Waiting for hardware to finish timed out\n");
>> - return -EIO;
>> - }
>> - }
>> - return 0;
>> + return s5p_mfc_sleep(m_dev);
>> }
>>
>> static int s5p_mfc_resume(struct device *dev)
>
> --
>
> Thanks,
> Sylwester
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-25 15:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-25 13:28 Fw: [PATCH] [media] s5p-mfc: Remove unreachable code Mauro Carvalho Chehab
2012-09-25 14:07 ` Sylwester Nawrocki
2012-09-25 15:25 ` Sachin Kamat
2012-09-25 15:55 ` Sylwester Nawrocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).