linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hugues FRUCHET <hugues.fruchet@st.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Steve Longerbeam <slongerbeam@gmail.com>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
	Maxime Ripard <maxime.ripard@bootlin.com>
Subject: Re: [PATCH] media: ov5640: fix get_/set_fmt colorspace related fields
Date: Thu, 8 Mar 2018 08:48:18 +0000	[thread overview]
Message-ID: <15045540-2dca-b2fc-349d-04790b9efc4c@st.com> (raw)
In-Reply-To: <20180307081302.h47mjhlkeq72shw7@valkosipuli.retiisi.org.uk>

Hi Sakari,

This is the right one and it's OK to swap the lines for local variables, 
I'll keep this in mind for next changes.

Best regards,
Hugues.

On 03/07/2018 09:13 AM, Sakari Ailus wrote:
> Hi Hugues,
> 
> On Tue, Mar 06, 2018 at 06:04:39PM +0100, Hugues Fruchet wrote:
>> Fix set of missing colorspace related fields in get_/set_fmt.
>> Detected by v4l2-compliance tool.
>>
>> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
> 
> Could you confirm this is the one you intended to send? There are two
> others with similar content.
> 
> ...
> 
>> @@ -2497,16 +2504,22 @@ static int ov5640_probe(struct i2c_client *client,
>>   	struct fwnode_handle *endpoint;
>>   	struct ov5640_dev *sensor;
>>   	int ret;
>> +	struct v4l2_mbus_framefmt *fmt;
> 
> This one I'd arrange before ret. The local variable declarations should
> generally look like a Christmas tree but upside down.
> 
> If you're happy with that, I can swap the two lines as well (no need for
> v2).
> 
>>   
>>   	sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL);
>>   	if (!sensor)
>>   		return -ENOMEM;
>>   
>>   	sensor->i2c_client = client;
>> -	sensor->fmt.code = MEDIA_BUS_FMT_UYVY8_2X8;
>> -	sensor->fmt.width = 640;
>> -	sensor->fmt.height = 480;
>> -	sensor->fmt.field = V4L2_FIELD_NONE;
>> +	fmt = &sensor->fmt;
>> +	fmt->code = ov5640_formats[0].code;
>> +	fmt->colorspace = ov5640_formats[0].colorspace;
>> +	fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace);
>> +	fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE;
>> +	fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(fmt->colorspace);
>> +	fmt->width = 640;
>> +	fmt->height = 480;
>> +	fmt->field = V4L2_FIELD_NONE;
>>   	sensor->frame_interval.numerator = 1;
>>   	sensor->frame_interval.denominator = ov5640_framerates[OV5640_30_FPS];
>>   	sensor->current_fr = OV5640_30_FPS;
> 

  parent reply	other threads:[~2018-03-08  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 17:04 [PATCH] media: ov5640: fix get_/set_fmt colorspace related fields Hugues Fruchet
2018-03-07  8:13 ` Sakari Ailus
2018-03-07  9:51   ` Fabio Estevam
2018-03-07 11:28     ` Sakari Ailus
2018-03-08  8:48   ` Hugues FRUCHET [this message]
2018-03-07  9:14 [PATCH] media: dvbdev: fix building on ia64 Mauro Carvalho Chehab
2018-03-07  9:47 ` Fabio Estevam
2018-03-07 10:16   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15045540-2dca-b2fc-349d-04790b9efc4c@st.com \
    --to=hugues.fruchet@st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=slongerbeam@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).