Re: [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-11-04 Thread Hans Verkuil

On 03/11/16 21:54, SF Markus Elfring wrote:

From: Markus Elfring 
Date: Wed, 12 Oct 2016 09:56:56 +0200

* A function was called over the pointer "setup_if_config" in the data
  structure "venc_platform_data". But the return value was not used so far.
  Thus assign it to the local variable "ret" which will be checked with
  the next statement.

  Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add dm365 
VPBE display driver changes")

* Pass a value to this function call without storing it in an intermediate
  variable before.

* Delete the local variable "if_params" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring 
---
 drivers/media/platform/davinci/vpbe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 19611a2..6e7b0df 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
 vpbe_current_encoder_info(vpbe_dev);
 struct vpbe_config *cfg = vpbe_dev->cfg;
 struct venc_platform_data *venc_device = vpbe_dev->venc_device;
-u32 if_params;
 int enc_out_index;
 int sd_index;
 int ret = 0;
@@ -257,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
 goto out;
 }

-if_params = cfg->outputs[index].if_params;
-venc_device->setup_if_config(if_params);
+ret = venc_device->setup_if_config(cfg
+   ->outputs[index].if_params);


Either keep this as one line


Will you tolerate a line length of 82 characters then?


Yes, if it improves readability, which it does.





or keep the if_params temp variable.


My proposal was to get rid of it.



This odd linebreak is ugly.


I am curious on how the desired changes can be integrated after a couple of 
update
suggestions were accepted from this patch series.


See my previous reply to 17/34.

Regards,

Hans


Re: [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-11-04 Thread Hans Verkuil

On 03/11/16 21:54, SF Markus Elfring wrote:

From: Markus Elfring 
Date: Wed, 12 Oct 2016 09:56:56 +0200

* A function was called over the pointer "setup_if_config" in the data
  structure "venc_platform_data". But the return value was not used so far.
  Thus assign it to the local variable "ret" which will be checked with
  the next statement.

  Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add dm365 
VPBE display driver changes")

* Pass a value to this function call without storing it in an intermediate
  variable before.

* Delete the local variable "if_params" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring 
---
 drivers/media/platform/davinci/vpbe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 19611a2..6e7b0df 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
 vpbe_current_encoder_info(vpbe_dev);
 struct vpbe_config *cfg = vpbe_dev->cfg;
 struct venc_platform_data *venc_device = vpbe_dev->venc_device;
-u32 if_params;
 int enc_out_index;
 int sd_index;
 int ret = 0;
@@ -257,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
 goto out;
 }

-if_params = cfg->outputs[index].if_params;
-venc_device->setup_if_config(if_params);
+ret = venc_device->setup_if_config(cfg
+   ->outputs[index].if_params);


Either keep this as one line


Will you tolerate a line length of 82 characters then?


Yes, if it improves readability, which it does.





or keep the if_params temp variable.


My proposal was to get rid of it.



This odd linebreak is ugly.


I am curious on how the desired changes can be integrated after a couple of 
update
suggestions were accepted from this patch series.


See my previous reply to 17/34.

Regards,

Hans


Re: [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-11-03 Thread SF Markus Elfring
>> From: Markus Elfring 
>> Date: Wed, 12 Oct 2016 09:56:56 +0200
>>
>> * A function was called over the pointer "setup_if_config" in the data
>>   structure "venc_platform_data". But the return value was not used so far.
>>   Thus assign it to the local variable "ret" which will be checked with
>>   the next statement.
>>
>>   Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: 
>> add dm365 VPBE display driver changes")
>>
>> * Pass a value to this function call without storing it in an intermediate
>>   variable before.
>>
>> * Delete the local variable "if_params" which became unnecessary with
>>   this refactoring.
>>
>> Signed-off-by: Markus Elfring 
>> ---
>>  drivers/media/platform/davinci/vpbe.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/platform/davinci/vpbe.c 
>> b/drivers/media/platform/davinci/vpbe.c
>> index 19611a2..6e7b0df 100644
>> --- a/drivers/media/platform/davinci/vpbe.c
>> +++ b/drivers/media/platform/davinci/vpbe.c
>> @@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
>> int index)
>>  vpbe_current_encoder_info(vpbe_dev);
>>  struct vpbe_config *cfg = vpbe_dev->cfg;
>>  struct venc_platform_data *venc_device = vpbe_dev->venc_device;
>> -u32 if_params;
>>  int enc_out_index;
>>  int sd_index;
>>  int ret = 0;
>> @@ -257,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
>> int index)
>>  goto out;
>>  }
>>
>> -if_params = cfg->outputs[index].if_params;
>> -venc_device->setup_if_config(if_params);
>> +ret = venc_device->setup_if_config(cfg
>> +   ->outputs[index].if_params);
> 
> Either keep this as one line

Will you tolerate a line length of 82 characters then?


> or keep the if_params temp variable.

My proposal was to get rid of it.


> This odd linebreak is ugly.

I am curious on how the desired changes can be integrated after a couple of 
update
suggestions were accepted from this patch series.

Regards,
Markus


Re: [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-11-03 Thread SF Markus Elfring
>> From: Markus Elfring 
>> Date: Wed, 12 Oct 2016 09:56:56 +0200
>>
>> * A function was called over the pointer "setup_if_config" in the data
>>   structure "venc_platform_data". But the return value was not used so far.
>>   Thus assign it to the local variable "ret" which will be checked with
>>   the next statement.
>>
>>   Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: 
>> add dm365 VPBE display driver changes")
>>
>> * Pass a value to this function call without storing it in an intermediate
>>   variable before.
>>
>> * Delete the local variable "if_params" which became unnecessary with
>>   this refactoring.
>>
>> Signed-off-by: Markus Elfring 
>> ---
>>  drivers/media/platform/davinci/vpbe.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/platform/davinci/vpbe.c 
>> b/drivers/media/platform/davinci/vpbe.c
>> index 19611a2..6e7b0df 100644
>> --- a/drivers/media/platform/davinci/vpbe.c
>> +++ b/drivers/media/platform/davinci/vpbe.c
>> @@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
>> int index)
>>  vpbe_current_encoder_info(vpbe_dev);
>>  struct vpbe_config *cfg = vpbe_dev->cfg;
>>  struct venc_platform_data *venc_device = vpbe_dev->venc_device;
>> -u32 if_params;
>>  int enc_out_index;
>>  int sd_index;
>>  int ret = 0;
>> @@ -257,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
>> int index)
>>  goto out;
>>  }
>>
>> -if_params = cfg->outputs[index].if_params;
>> -venc_device->setup_if_config(if_params);
>> +ret = venc_device->setup_if_config(cfg
>> +   ->outputs[index].if_params);
> 
> Either keep this as one line

Will you tolerate a line length of 82 characters then?


> or keep the if_params temp variable.

My proposal was to get rid of it.


> This odd linebreak is ugly.

I am curious on how the desired changes can be integrated after a couple of 
update
suggestions were accepted from this patch series.

Regards,
Markus


Re: [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-11-03 Thread Hans Verkuil

On 12/10/16 16:47, SF Markus Elfring wrote:

From: Markus Elfring 
Date: Wed, 12 Oct 2016 09:56:56 +0200

* A function was called over the pointer "setup_if_config" in the data
  structure "venc_platform_data". But the return value was not used so far.
  Thus assign it to the local variable "ret" which will be checked with
  the next statement.

  Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add dm365 
VPBE display driver changes")

* Pass a value to this function call without storing it in an intermediate
  variable before.

* Delete the local variable "if_params" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring 
---
 drivers/media/platform/davinci/vpbe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 19611a2..6e7b0df 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
vpbe_current_encoder_info(vpbe_dev);
struct vpbe_config *cfg = vpbe_dev->cfg;
struct venc_platform_data *venc_device = vpbe_dev->venc_device;
-   u32 if_params;
int enc_out_index;
int sd_index;
int ret = 0;
@@ -257,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
goto out;
}

-   if_params = cfg->outputs[index].if_params;
-   venc_device->setup_if_config(if_params);
+   ret = venc_device->setup_if_config(cfg
+  ->outputs[index].if_params);


Either keep this as one line or keep the if_params temp variable. This 
odd linebreak

is ugly.

Regards,

Hans


if (ret)
goto out;
}



Re: [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-11-03 Thread Hans Verkuil

On 12/10/16 16:47, SF Markus Elfring wrote:

From: Markus Elfring 
Date: Wed, 12 Oct 2016 09:56:56 +0200

* A function was called over the pointer "setup_if_config" in the data
  structure "venc_platform_data". But the return value was not used so far.
  Thus assign it to the local variable "ret" which will be checked with
  the next statement.

  Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add dm365 
VPBE display driver changes")

* Pass a value to this function call without storing it in an intermediate
  variable before.

* Delete the local variable "if_params" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring 
---
 drivers/media/platform/davinci/vpbe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 19611a2..6e7b0df 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
vpbe_current_encoder_info(vpbe_dev);
struct vpbe_config *cfg = vpbe_dev->cfg;
struct venc_platform_data *venc_device = vpbe_dev->venc_device;
-   u32 if_params;
int enc_out_index;
int sd_index;
int ret = 0;
@@ -257,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
goto out;
}

-   if_params = cfg->outputs[index].if_params;
-   venc_device->setup_if_config(if_params);
+   ret = venc_device->setup_if_config(cfg
+  ->outputs[index].if_params);


Either keep this as one line or keep the if_params temp variable. This 
odd linebreak

is ugly.

Regards,

Hans


if (ret)
goto out;
}



[PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring 
Date: Wed, 12 Oct 2016 09:56:56 +0200

* A function was called over the pointer "setup_if_config" in the data
  structure "venc_platform_data". But the return value was not used so far.
  Thus assign it to the local variable "ret" which will be checked with
  the next statement.

  Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add 
dm365 VPBE display driver changes")

* Pass a value to this function call without storing it in an intermediate
  variable before.

* Delete the local variable "if_params" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring 
---
 drivers/media/platform/davinci/vpbe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 19611a2..6e7b0df 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
vpbe_current_encoder_info(vpbe_dev);
struct vpbe_config *cfg = vpbe_dev->cfg;
struct venc_platform_data *venc_device = vpbe_dev->venc_device;
-   u32 if_params;
int enc_out_index;
int sd_index;
int ret = 0;
@@ -257,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
goto out;
}
 
-   if_params = cfg->outputs[index].if_params;
-   venc_device->setup_if_config(if_params);
+   ret = venc_device->setup_if_config(cfg
+  ->outputs[index].if_params);
if (ret)
goto out;
}
-- 
2.10.1



[PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring 
Date: Wed, 12 Oct 2016 09:56:56 +0200

* A function was called over the pointer "setup_if_config" in the data
  structure "venc_platform_data". But the return value was not used so far.
  Thus assign it to the local variable "ret" which will be checked with
  the next statement.

  Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add 
dm365 VPBE display driver changes")

* Pass a value to this function call without storing it in an intermediate
  variable before.

* Delete the local variable "if_params" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring 
---
 drivers/media/platform/davinci/vpbe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 19611a2..6e7b0df 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
vpbe_current_encoder_info(vpbe_dev);
struct vpbe_config *cfg = vpbe_dev->cfg;
struct venc_platform_data *venc_device = vpbe_dev->venc_device;
-   u32 if_params;
int enc_out_index;
int sd_index;
int ret = 0;
@@ -257,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, 
int index)
goto out;
}
 
-   if_params = cfg->outputs[index].if_params;
-   venc_device->setup_if_config(if_params);
+   ret = venc_device->setup_if_config(cfg
+  ->outputs[index].if_params);
if (ret)
goto out;
}
-- 
2.10.1