diff mbox series

[v6,2/4] media: stm32-dcmi: trace the supported fourcc/mbus_code

Message ID 1565790533-10043-3-git-send-email-hugues.fruchet@st.com (mailing list archive)
State New, archived
Headers show
Series DCMI bridge support | expand

Commit Message

Hugues FRUCHET Aug. 14, 2019, 1:48 p.m. UTC
Add a trace of the set of supported fourcc/mbus_code which
intersect between DCMI and source sub-device.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
---
 drivers/media/platform/stm32/stm32-dcmi.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Sakari Ailus Aug. 16, 2019, 8:15 a.m. UTC | #1
Hi Hugues,

On Wed, Aug 14, 2019 at 03:48:51PM +0200, Hugues Fruchet wrote:
> Add a trace of the set of supported fourcc/mbus_code which
> intersect between DCMI and source sub-device.
> 
> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
> ---
>  drivers/media/platform/stm32/stm32-dcmi.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
> index b462f71..18acecf 100644
> --- a/drivers/media/platform/stm32/stm32-dcmi.c
> +++ b/drivers/media/platform/stm32/stm32-dcmi.c
> @@ -1447,12 +1447,20 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi)
>  			/* Code supported, have we got this fourcc yet? */
>  			for (j = 0; j < num_fmts; j++)
>  				if (sd_fmts[j]->fourcc ==
> -						dcmi_formats[i].fourcc)
> +						dcmi_formats[i].fourcc) {
>  					/* Already available */
> +					dev_dbg(dcmi->dev, "Skipping fourcc/code: %4.4s/0x%x\n",
> +						(char *)&sd_fmts[j]->fourcc,
> +						mbus_code.code);
>  					break;
> -			if (j == num_fmts)
> +				}
> +			if (j == num_fmts) {
>  				/* New */
>  				sd_fmts[num_fmts++] = dcmi_formats + i;
> +				dev_dbg(dcmi->dev, "Supported fourcc/code: %4.4s/0x%x\n",

Over 80 characters per line.

> +					(char *)&sd_fmts[num_fmts - 1]->fourcc,
> +					sd_fmts[num_fmts - 1]->mbus_code);
> +			}
>  		}
>  		mbus_code.index++;
>  	}
Hugues FRUCHET Aug. 19, 2019, 7:23 a.m. UTC | #2
Hi Sakari,

On 8/16/19 10:15 AM, Sakari Ailus wrote:
> Hi Hugues,
> 
> On Wed, Aug 14, 2019 at 03:48:51PM +0200, Hugues Fruchet wrote:
>> Add a trace of the set of supported fourcc/mbus_code which
>> intersect between DCMI and source sub-device.
>>
>> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
>> ---
>>   drivers/media/platform/stm32/stm32-dcmi.c | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
>> index b462f71..18acecf 100644
>> --- a/drivers/media/platform/stm32/stm32-dcmi.c
>> +++ b/drivers/media/platform/stm32/stm32-dcmi.c
>> @@ -1447,12 +1447,20 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi)
>>   			/* Code supported, have we got this fourcc yet? */
>>   			for (j = 0; j < num_fmts; j++)
>>   				if (sd_fmts[j]->fourcc ==
>> -						dcmi_formats[i].fourcc)
>> +						dcmi_formats[i].fourcc) {
>>   					/* Already available */
>> +					dev_dbg(dcmi->dev, "Skipping fourcc/code: %4.4s/0x%x\n",
>> +						(char *)&sd_fmts[j]->fourcc,
>> +						mbus_code.code);
>>   					break;
>> -			if (j == num_fmts)
>> +				}
>> +			if (j == num_fmts) {
>>   				/* New */
>>   				sd_fmts[num_fmts++] = dcmi_formats + i;
>> +				dev_dbg(dcmi->dev, "Supported fourcc/code: %4.4s/0x%x\n",
> 
> Over 80 characters per line.
> 

This an exception of the "80 chars" in order to be able to grep in 
kernel messages:
https://www.kernel.org/doc/html/v4.10/process/coding-style.html
"However, never break user-visible strings such as printk messages, 
because that breaks the ability to grep for them."

This exception is managed in checkpatch.pl (--strict).

>> +					(char *)&sd_fmts[num_fmts - 1]->fourcc,
>> +					sd_fmts[num_fmts - 1]->mbus_code);
>> +			}
>>   		}
>>   		mbus_code.index++;
>>   	}
> 

BR,
Hugues.
Sakari Ailus Aug. 19, 2019, 7:26 a.m. UTC | #3
Hi Hugues,

On Mon, Aug 19, 2019 at 07:23:17AM +0000, Hugues FRUCHET wrote:
> Hi Sakari,
> 
> On 8/16/19 10:15 AM, Sakari Ailus wrote:
> > Hi Hugues,
> > 
> > On Wed, Aug 14, 2019 at 03:48:51PM +0200, Hugues Fruchet wrote:
> >> Add a trace of the set of supported fourcc/mbus_code which
> >> intersect between DCMI and source sub-device.
> >>
> >> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
> >> ---
> >>   drivers/media/platform/stm32/stm32-dcmi.c | 12 ++++++++++--
> >>   1 file changed, 10 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
> >> index b462f71..18acecf 100644
> >> --- a/drivers/media/platform/stm32/stm32-dcmi.c
> >> +++ b/drivers/media/platform/stm32/stm32-dcmi.c
> >> @@ -1447,12 +1447,20 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi)
> >>   			/* Code supported, have we got this fourcc yet? */
> >>   			for (j = 0; j < num_fmts; j++)
> >>   				if (sd_fmts[j]->fourcc ==
> >> -						dcmi_formats[i].fourcc)
> >> +						dcmi_formats[i].fourcc) {
> >>   					/* Already available */
> >> +					dev_dbg(dcmi->dev, "Skipping fourcc/code: %4.4s/0x%x\n",
> >> +						(char *)&sd_fmts[j]->fourcc,
> >> +						mbus_code.code);
> >>   					break;
> >> -			if (j == num_fmts)
> >> +				}
> >> +			if (j == num_fmts) {
> >>   				/* New */
> >>   				sd_fmts[num_fmts++] = dcmi_formats + i;
> >> +				dev_dbg(dcmi->dev, "Supported fourcc/code: %4.4s/0x%x\n",
> > 
> > Over 80 characters per line.
> > 
> 
> This an exception of the "80 chars" in order to be able to grep in 
> kernel messages:
> https://www.kernel.org/doc/html/v4.10/process/coding-style.html
> "However, never break user-visible strings such as printk messages, 
> because that breaks the ability to grep for them."
> 
> This exception is managed in checkpatch.pl (--strict).

This exception is for cases where wrapping the line in the usual way, e.g.
at argument boundaries, does not prevent it exceeding 80 characters. But it is
not the case here.
Hugues FRUCHET Aug. 19, 2019, 7:40 a.m. UTC | #4
Hi Sakari,

OK, I will change.

Have you some other remarks on this serie in order that I group changes 
in the next version ?

On 8/19/19 9:26 AM, Sakari Ailus wrote:
> Hi Hugues,
> 
> On Mon, Aug 19, 2019 at 07:23:17AM +0000, Hugues FRUCHET wrote:
>> Hi Sakari,
>>
>> On 8/16/19 10:15 AM, Sakari Ailus wrote:
>>> Hi Hugues,
>>>
>>> On Wed, Aug 14, 2019 at 03:48:51PM +0200, Hugues Fruchet wrote:
>>>> Add a trace of the set of supported fourcc/mbus_code which
>>>> intersect between DCMI and source sub-device.
>>>>
>>>> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
>>>> ---
>>>>    drivers/media/platform/stm32/stm32-dcmi.c | 12 ++++++++++--
>>>>    1 file changed, 10 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
>>>> index b462f71..18acecf 100644
>>>> --- a/drivers/media/platform/stm32/stm32-dcmi.c
>>>> +++ b/drivers/media/platform/stm32/stm32-dcmi.c
>>>> @@ -1447,12 +1447,20 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi)
>>>>    			/* Code supported, have we got this fourcc yet? */
>>>>    			for (j = 0; j < num_fmts; j++)
>>>>    				if (sd_fmts[j]->fourcc ==
>>>> -						dcmi_formats[i].fourcc)
>>>> +						dcmi_formats[i].fourcc) {
>>>>    					/* Already available */
>>>> +					dev_dbg(dcmi->dev, "Skipping fourcc/code: %4.4s/0x%x\n",
>>>> +						(char *)&sd_fmts[j]->fourcc,
>>>> +						mbus_code.code);
>>>>    					break;
>>>> -			if (j == num_fmts)
>>>> +				}
>>>> +			if (j == num_fmts) {
>>>>    				/* New */
>>>>    				sd_fmts[num_fmts++] = dcmi_formats + i;
>>>> +				dev_dbg(dcmi->dev, "Supported fourcc/code: %4.4s/0x%x\n",
>>>
>>> Over 80 characters per line.
>>>
>>
>> This an exception of the "80 chars" in order to be able to grep in
>> kernel messages:
>> https://www.kernel.org/doc/html/v4.10/process/coding-style.html
>> "However, never break user-visible strings such as printk messages,
>> because that breaks the ability to grep for them."
>>
>> This exception is managed in checkpatch.pl (--strict).
> 
> This exception is for cases where wrapping the line in the usual way, e.g.
> at argument boundaries, does not prevent it exceeding 80 characters. But it is
> not the case here.
> 

BR,
Hugues.
Sakari Ailus Aug. 19, 2019, 8:10 a.m. UTC | #5
On Mon, Aug 19, 2019 at 07:40:53AM +0000, Hugues FRUCHET wrote:
> Hi Sakari,
> 
> OK, I will change.
> 
> Have you some other remarks on this serie in order that I group changes 
> in the next version ?

No other comments.

Thanks.
diff mbox series

Patch

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index b462f71..18acecf 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -1447,12 +1447,20 @@  static int dcmi_formats_init(struct stm32_dcmi *dcmi)
 			/* Code supported, have we got this fourcc yet? */
 			for (j = 0; j < num_fmts; j++)
 				if (sd_fmts[j]->fourcc ==
-						dcmi_formats[i].fourcc)
+						dcmi_formats[i].fourcc) {
 					/* Already available */
+					dev_dbg(dcmi->dev, "Skipping fourcc/code: %4.4s/0x%x\n",
+						(char *)&sd_fmts[j]->fourcc,
+						mbus_code.code);
 					break;
-			if (j == num_fmts)
+				}
+			if (j == num_fmts) {
 				/* New */
 				sd_fmts[num_fmts++] = dcmi_formats + i;
+				dev_dbg(dcmi->dev, "Supported fourcc/code: %4.4s/0x%x\n",
+					(char *)&sd_fmts[num_fmts - 1]->fourcc,
+					sd_fmts[num_fmts - 1]->mbus_code);
+			}
 		}
 		mbus_code.index++;
 	}