All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] drivers: dream: Code style fix
@ 2010-02-10  9:59 Jochen Maes
  2010-02-11  7:20 ` Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Jochen Maes @ 2010-02-10  9:59 UTC (permalink / raw)
  To: gregkh; +Cc: pavel, linux-kernel, Jochen Maes

Removed parenthesis from return statements,
split up assignment and if condition

Signed-off-by: Jochen Maes <jochen.maes@sejo.be>
---
 drivers/staging/dream/camera/s5k3e2fx.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dream/camera/s5k3e2fx.c b/drivers/staging/dream/camera/s5k3e2fx.c
index edba198..5cb22c8 100644
--- a/drivers/staging/dream/camera/s5k3e2fx.c
+++ b/drivers/staging/dream/camera/s5k3e2fx.c
@@ -743,12 +743,14 @@ static int s5k3e2fx_sensor_open_init(const struct msm_camera_sensor_info *data)
 	}
 
 	/* initialize AF */
-	if ((rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
-			0x3146, 0x3A)) < 0)
+	rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
+			0x3146, 0x3A)
+	if rc < 0
 		goto init_fail1;
 
-	if ((rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
-			0x3130, 0x03)) < 0)
+	rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
+			0x3130, 0x03)
+	rc < 0
 		goto init_fail1;
 
 	goto init_done;
@@ -814,20 +816,20 @@ static uint16_t s5k3e2fx_get_prev_lines_pf(void)
 
 static uint16_t s5k3e2fx_get_prev_pixels_pl(void)
 {
-	return (s5k3e2fx_reg_pat[S_RES_PREVIEW].size_w +
-		s5k3e2fx_reg_pat[S_RES_PREVIEW].blk_p);
+	return s5k3e2fx_reg_pat[S_RES_PREVIEW].size_w +
+		s5k3e2fx_reg_pat[S_RES_PREVIEW].blk_p;
 }
 
 static uint16_t s5k3e2fx_get_pict_lines_pf(void)
 {
-	return (s5k3e2fx_reg_pat[S_RES_CAPTURE].size_h +
-		s5k3e2fx_reg_pat[S_RES_CAPTURE].blk_l);
+	return s5k3e2fx_reg_pat[S_RES_CAPTURE].size_h +
+		s5k3e2fx_reg_pat[S_RES_CAPTURE].blk_l;
 }
 
 static uint16_t s5k3e2fx_get_pict_pixels_pl(void)
 {
-	return (s5k3e2fx_reg_pat[S_RES_CAPTURE].size_w +
-		s5k3e2fx_reg_pat[S_RES_CAPTURE].blk_p);
+	return s5k3e2fx_reg_pat[S_RES_CAPTURE].size_w +
+		s5k3e2fx_reg_pat[S_RES_CAPTURE].blk_p;
 }
 
 static uint32_t s5k3e2fx_get_pict_max_exp_lc(void)
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 4/4] drivers: dream: Code style fix
  2010-02-10  9:59 [PATCH 4/4] drivers: dream: Code style fix Jochen Maes
@ 2010-02-11  7:20 ` Pavel Machek
  2010-02-11  8:22   ` Pekka Enberg
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2010-02-11  7:20 UTC (permalink / raw)
  To: Jochen Maes; +Cc: gregkh, linux-kernel

On Wed 2010-02-10 10:59:37, Jochen Maes wrote:
> Removed parenthesis from return statements,
> split up assignment and if condition
> 
> Signed-off-by: Jochen Maes <jochen.maes@sejo.be>
> ---
>  drivers/staging/dream/camera/s5k3e2fx.c |   22 ++++++++++++----------
>  1 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/dream/camera/s5k3e2fx.c b/drivers/staging/dream/camera/s5k3e2fx.c
> index edba198..5cb22c8 100644
> --- a/drivers/staging/dream/camera/s5k3e2fx.c
> +++ b/drivers/staging/dream/camera/s5k3e2fx.c
> @@ -743,12 +743,14 @@ static int s5k3e2fx_sensor_open_init(const struct msm_camera_sensor_info *data)
>  	}
>  
>  	/* initialize AF */
> -	if ((rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
> -			0x3146, 0x3A)) < 0)
> +	rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
> +			0x3146, 0x3A)
> +	if rc < 0
>  		goto init_fail1;
>  

I do not think this is valid C.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4/4] drivers: dream: Code style fix
  2010-02-11  7:20 ` Pavel Machek
@ 2010-02-11  8:22   ` Pekka Enberg
  0 siblings, 0 replies; 4+ messages in thread
From: Pekka Enberg @ 2010-02-11  8:22 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Jochen Maes, gregkh, linux-kernel

On Thu, Feb 11, 2010 at 9:20 AM, Pavel Machek <pavel@ucw.cz> wrote:
> On Wed 2010-02-10 10:59:37, Jochen Maes wrote:
>> Removed parenthesis from return statements,
>> split up assignment and if condition
>>
>> Signed-off-by: Jochen Maes <jochen.maes@sejo.be>
>> ---
>>  drivers/staging/dream/camera/s5k3e2fx.c |   22 ++++++++++++----------
>>  1 files changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/staging/dream/camera/s5k3e2fx.c b/drivers/staging/dream/camera/s5k3e2fx.c
>> index edba198..5cb22c8 100644
>> --- a/drivers/staging/dream/camera/s5k3e2fx.c
>> +++ b/drivers/staging/dream/camera/s5k3e2fx.c
>> @@ -743,12 +743,14 @@ static int s5k3e2fx_sensor_open_init(const struct msm_camera_sensor_info *data)
>>       }
>>
>>       /* initialize AF */
>> -     if ((rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
>> -                     0x3146, 0x3A)) < 0)
>> +     rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
>> +                     0x3146, 0x3A)
>> +     if rc < 0
>>               goto init_fail1;
>
> I do not think this is valid C.

Yeah, please compile-test trivial cleanups like this before sending them.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 4/4] drivers: dream: Code style fix
@ 2010-02-11 16:10 Jochen Maes
  0 siblings, 0 replies; 4+ messages in thread
From: Jochen Maes @ 2010-02-11 16:10 UTC (permalink / raw)
  To: gregkh; +Cc: pavel, linux-kernel, Jochen Maes

Removed parenthesis from return statements,
split up assignment and if condition

Signed-off-by: Jochen Maes <jochen.maes@sejo.be>
---
 drivers/staging/dream/camera/s5k3e2fx.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dream/camera/s5k3e2fx.c b/drivers/staging/dream/camera/s5k3e2fx.c
index edba198..689b70f 100644
--- a/drivers/staging/dream/camera/s5k3e2fx.c
+++ b/drivers/staging/dream/camera/s5k3e2fx.c
@@ -743,12 +743,14 @@ static int s5k3e2fx_sensor_open_init(const struct msm_camera_sensor_info *data)
 	}
 
 	/* initialize AF */
-	if ((rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
-			0x3146, 0x3A)) < 0)
+	rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
+			0x3146, 0x3A)
+	if (rc < 0)
 		goto init_fail1;
 
-	if ((rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
-			0x3130, 0x03)) < 0)
+	rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
+			0x3130, 0x03)
+	if (rc < 0)
 		goto init_fail1;
 
 	goto init_done;
@@ -814,20 +816,20 @@ static uint16_t s5k3e2fx_get_prev_lines_pf(void)
 
 static uint16_t s5k3e2fx_get_prev_pixels_pl(void)
 {
-	return (s5k3e2fx_reg_pat[S_RES_PREVIEW].size_w +
-		s5k3e2fx_reg_pat[S_RES_PREVIEW].blk_p);
+	return s5k3e2fx_reg_pat[S_RES_PREVIEW].size_w +
+		s5k3e2fx_reg_pat[S_RES_PREVIEW].blk_p;
 }
 
 static uint16_t s5k3e2fx_get_pict_lines_pf(void)
 {
-	return (s5k3e2fx_reg_pat[S_RES_CAPTURE].size_h +
-		s5k3e2fx_reg_pat[S_RES_CAPTURE].blk_l);
+	return s5k3e2fx_reg_pat[S_RES_CAPTURE].size_h +
+		s5k3e2fx_reg_pat[S_RES_CAPTURE].blk_l;
 }
 
 static uint16_t s5k3e2fx_get_pict_pixels_pl(void)
 {
-	return (s5k3e2fx_reg_pat[S_RES_CAPTURE].size_w +
-		s5k3e2fx_reg_pat[S_RES_CAPTURE].blk_p);
+	return s5k3e2fx_reg_pat[S_RES_CAPTURE].size_w +
+		s5k3e2fx_reg_pat[S_RES_CAPTURE].blk_p;
 }
 
 static uint32_t s5k3e2fx_get_pict_max_exp_lc(void)
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-11 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-10  9:59 [PATCH 4/4] drivers: dream: Code style fix Jochen Maes
2010-02-11  7:20 ` Pavel Machek
2010-02-11  8:22   ` Pekka Enberg
2010-02-11 16:10 Jochen Maes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.