[PATCH v3] [media] staging: css2400: fix checkpatch error

2017-03-29 Thread Haim Daniel
isp_capture_defs.h: clean up ERROR: Macros with complex values should be 
enclosed in parentheses

Signed-off-by: Haim Daniel <haimdan...@gmail.com>
---
 .../pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
index aa413df..117c7a2 100644
--- 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
+++ 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
@@ -19,7 +19,7 @@
 #define _ISP_CAPTURE_BITS_PER_ELEM32  /* only for data, not 
SOP */
 #define _ISP_CAPTURE_BYTES_PER_ELEM   
(_ISP_CAPTURE_BITS_PER_ELEM/8)  
 #define _ISP_CAPTURE_BYTES_PER_WORD   32   /* 256/8 */ 
-#define _ISP_CAPTURE_ELEM_PER_WORD_ISP_CAPTURE_BYTES_PER_WORD 
/ _ISP_CAPTURE_BYTES_PER_ELEM   
+#define _ISP_CAPTURE_ELEM_PER_WORD(_ISP_CAPTURE_BYTES_PER_WORD 
/ _ISP_CAPTURE_BYTES_PER_ELEM)
 
 //#define CAPT_RCV_ACK  1
 //#define CAPT_WRT_ACK  2   
-- 
1.9.1



[PATCH v2] [media] staging: css2400: fix checkpatch error

2017-03-29 Thread Haim Daniel
isp_capture_defs.h:

fix checkpatch ERROR: 
Macros with complex values should be enclosed in parentheses

Signed-off-by: Haim Daniel <haimdan...@gmail.com>
---
 .../pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
index aa413df..78cbbf6 100644
--- 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
+++ 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
@@ -19,7 +19,7 @@
 #define _ISP_CAPTURE_BITS_PER_ELEM32  /* only for data, not 
SOP */
 #define _ISP_CAPTURE_BYTES_PER_ELEM   
(_ISP_CAPTURE_BITS_PER_ELEM/8)  
 #define _ISP_CAPTURE_BYTES_PER_WORD   32   /* 256/8 */ 
-#define _ISP_CAPTURE_ELEM_PER_WORD_ISP_CAPTURE_BYTES_PER_WORD 
/ _ISP_CAPTURE_BYTES_PER_ELEM   
+#define _ISP_CAPTURE_ELEM_PER_WORD(_ISP_CAPTURE_BYTES_PER_WORD 
/ _ISP_CAPTURE_BYTES_PER_ELEM) 
 
 //#define CAPT_RCV_ACK  1
 //#define CAPT_WRT_ACK  2   
-- 
1.9.1



[PATCH]: staging: media: css2400: fix checkpatch error

2017-03-28 Thread Haim Daniel
 >From 41d35b455f8eb139912909639e914469ef5e06fb Mon Sep 17 00:00:00 2001
From: Haim Daniel <haimdan...@gmail.com>
Date: Tue, 28 Mar 2017 19:27:57 +0300
Subject: [PATCH] [media] staging: css2400: fix checkpatch error

isp_capture_defs.h:

enclose macro with complex values in parentheses.

Signed-off-by: Haim Daniel <haimdan...@gmail.com>
---
 .../pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
index aa413df..78cbbf6 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp_capture_defs.h
@@ -19,7 +19,7 @@
 #define _ISP_CAPTURE_BITS_PER_ELEM32  /* only for data, not SOP */		   
 #define _ISP_CAPTURE_BYTES_PER_ELEM   (_ISP_CAPTURE_BITS_PER_ELEM/8	)   
 #define _ISP_CAPTURE_BYTES_PER_WORD   32		/* 256/8 */	
-#define _ISP_CAPTURE_ELEM_PER_WORD_ISP_CAPTURE_BYTES_PER_WORD / _ISP_CAPTURE_BYTES_PER_ELEM		   
+#define _ISP_CAPTURE_ELEM_PER_WORD(_ISP_CAPTURE_BYTES_PER_WORD / _ISP_CAPTURE_BYTES_PER_ELEM) 
 
 //#define CAPT_RCV_ACK  1
 //#define CAPT_WRT_ACK  2   
-- 
1.9.1



Re: [PATCH] [media] [pvrusb2]: remove dead retry cmd code

2015-01-16 Thread Haim Daniel
It looks that if (try_count  20) continue jumps to end of the  do ...
while(0) loop and goes out.

--hd.
On Fri, 2015-01-16 at 11:57 +0100, Hans Verkuil wrote:
 On 01/05/2015 11:38 PM, Haim Daniel wrote:
  In case a command is timed out, current flow sets the retry_flag
  and does nothing.
 
 Really? That's not how I read the code: it retries up to 20 times before
 bailing out.
 
 Perhaps you missed the if (try_count  20) continue; line?
 
 Regards,
 
   Hans
 
  
  Signed-off-by: Haim Daniel haim.dan...@gmail.com
  ---
   drivers/media/usb/pvrusb2/pvrusb2-encoder.c | 15 +--
   1 file changed, 1 insertion(+), 14 deletions(-)
  
  diff --git a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c 
  b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
  index f7702ae..02028aa 100644
  --- a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
  +++ b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
  @@ -145,8 +145,6 @@ static int pvr2_encoder_cmd(void *ctxt,
  u32 *argp)
   {
  unsigned int poll_count;
  -   unsigned int try_count = 0;
  -   int retry_flag;
  int ret = 0;
  unsigned int idx;
  /* These sizes look to be limited by the FX2 firmware implementation */
  @@ -213,8 +211,6 @@ static int pvr2_encoder_cmd(void *ctxt,
  break;
  }
   
  -   retry_flag = 0;
  -   try_count++;
  ret = 0;
  wrData[0] = 0;
  wrData[1] = cmd;
  @@ -245,11 +241,9 @@ static int pvr2_encoder_cmd(void *ctxt,
  }
  if (rdData[0]  (poll_count  1000)) continue;
  if (!rdData[0]) {
  -   retry_flag = !0;
  pvr2_trace(
  PVR2_TRACE_ERROR_LEGS,
  -   Encoder timed out waiting for us
  -   ; arranging to retry);
  +   Encoder timed out waiting for us);
  } else {
  pvr2_trace(
  PVR2_TRACE_ERROR_LEGS,
  @@ -269,13 +263,6 @@ static int pvr2_encoder_cmd(void *ctxt,
  ret = -EBUSY;
  break;
  }
  -   if (retry_flag) {
  -   if (try_count  20) continue;
  -   pvr2_trace(
  -   PVR2_TRACE_ERROR_LEGS,
  -   Too many retries...);
  -   ret = -EBUSY;
  -   }
  if (ret) {
  del_timer_sync(hdw-encoder_run_timer);
  hdw-state_encoder_ok = 0;
  
 


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] [pvrusb2]: remove dead retry cmd code

2015-01-16 Thread Haim Daniel
Removing 8 years old dead code seemed right to silly me.
On Fri, 2015-01-16 at 12:37 +0100, Hans Verkuil wrote:
 On 01/16/2015 12:29 PM, Haim Daniel wrote:
  It looks that if (try_count  20) continue jumps to end of the  do ...
  while(0) loop and goes out.
 
 Ah, you are right. But that is obviously not what was intended, so just 
 removing
 it is not a proper 'fix'.
 
 Mike, can you take a look at this?
 
 Regards,
 
   Hans
 
  
  --hd.
  On Fri, 2015-01-16 at 11:57 +0100, Hans Verkuil wrote:
  On 01/05/2015 11:38 PM, Haim Daniel wrote:
  In case a command is timed out, current flow sets the retry_flag
  and does nothing.
 
  Really? That's not how I read the code: it retries up to 20 times before
  bailing out.
 
  Perhaps you missed the if (try_count  20) continue; line?
 
  Regards,
 
 Hans
 
 
  Signed-off-by: Haim Daniel haim.dan...@gmail.com
  ---
   drivers/media/usb/pvrusb2/pvrusb2-encoder.c | 15 +--
   1 file changed, 1 insertion(+), 14 deletions(-)
 
  diff --git a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c 
  b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
  index f7702ae..02028aa 100644
  --- a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
  +++ b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
  @@ -145,8 +145,6 @@ static int pvr2_encoder_cmd(void *ctxt,
u32 *argp)
   {
unsigned int poll_count;
  - unsigned int try_count = 0;
  - int retry_flag;
int ret = 0;
unsigned int idx;
/* These sizes look to be limited by the FX2 firmware implementation */
  @@ -213,8 +211,6 @@ static int pvr2_encoder_cmd(void *ctxt,
break;
}
   
  - retry_flag = 0;
  - try_count++;
ret = 0;
wrData[0] = 0;
wrData[1] = cmd;
  @@ -245,11 +241,9 @@ static int pvr2_encoder_cmd(void *ctxt,
}
if (rdData[0]  (poll_count  1000)) continue;
if (!rdData[0]) {
  - retry_flag = !0;
pvr2_trace(
PVR2_TRACE_ERROR_LEGS,
  - Encoder timed out waiting for us
  - ; arranging to retry);
  + Encoder timed out waiting for us);
} else {
pvr2_trace(
PVR2_TRACE_ERROR_LEGS,
  @@ -269,13 +263,6 @@ static int pvr2_encoder_cmd(void *ctxt,
ret = -EBUSY;
break;
}
  - if (retry_flag) {
  - if (try_count  20) continue;
  - pvr2_trace(
  - PVR2_TRACE_ERROR_LEGS,
  - Too many retries...);
  - ret = -EBUSY;
  - }
if (ret) {
del_timer_sync(hdw-encoder_run_timer);
hdw-state_encoder_ok = 0;
 
 
  
  
 


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] [pvrusb2]: remove dead retry cmd code

2015-01-05 Thread Haim Daniel
In case a command is timed out, current flow sets the retry_flag
and does nothing.

Signed-off-by: Haim Daniel haim.dan...@gmail.com
---
 drivers/media/usb/pvrusb2/pvrusb2-encoder.c | 15 +--
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c 
b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
index f7702ae..02028aa 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c
@@ -145,8 +145,6 @@ static int pvr2_encoder_cmd(void *ctxt,
u32 *argp)
 {
unsigned int poll_count;
-   unsigned int try_count = 0;
-   int retry_flag;
int ret = 0;
unsigned int idx;
/* These sizes look to be limited by the FX2 firmware implementation */
@@ -213,8 +211,6 @@ static int pvr2_encoder_cmd(void *ctxt,
break;
}
 
-   retry_flag = 0;
-   try_count++;
ret = 0;
wrData[0] = 0;
wrData[1] = cmd;
@@ -245,11 +241,9 @@ static int pvr2_encoder_cmd(void *ctxt,
}
if (rdData[0]  (poll_count  1000)) continue;
if (!rdData[0]) {
-   retry_flag = !0;
pvr2_trace(
PVR2_TRACE_ERROR_LEGS,
-   Encoder timed out waiting for us
-   ; arranging to retry);
+   Encoder timed out waiting for us);
} else {
pvr2_trace(
PVR2_TRACE_ERROR_LEGS,
@@ -269,13 +263,6 @@ static int pvr2_encoder_cmd(void *ctxt,
ret = -EBUSY;
break;
}
-   if (retry_flag) {
-   if (try_count  20) continue;
-   pvr2_trace(
-   PVR2_TRACE_ERROR_LEGS,
-   Too many retries...);
-   ret = -EBUSY;
-   }
if (ret) {
del_timer_sync(hdw-encoder_run_timer);
hdw-state_encoder_ok = 0;
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html