From: Anton Leontiev <bunder@t-25.ru>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling
Date: Sat, 29 Mar 2014 09:28:02 +0400 [thread overview]
Message-ID: <533659E2.4010001@t-25.ru> (raw)
In-Reply-To: <1459346.J1YUbuH55p@avalon>
28.03.2014 20:12, Laurent Pinchart пишет:
>>>> + * Set error flag for incomplete buffer.
>>>> + */
>>>> +static void uvc_buffer_check_bytesused(const struct uvc_streaming *const
>>>> stream,
>
> No need for the second const keyword here.
>
> I would have used "uvc_video_" as a prefix, to be in sync with the surrounding
> functions. What would you think of uvc_video_validate_buffer() ?
>
>>>> + struct uvc_buffer *const buf)
>
> And no need for const at all here.
>
>>>> +{
>>>> + if (buf->length != buf->bytesused &&
>>>> + !(stream->cur_format->flags & UVC_FMT_FLAG_COMPRESSED))
>
> The indentation is wrong here, the ! on the second line should be aligned to
> the first 'buf' of the first line.
>
> If you agree with these changes I can perform them while applying, there's no
> need to resubmit the patch.
>
Thank you for reviewing my first patch to Linux kernel. I completely
agree with your changes.
Just want to ask why there is no need for the second 'const' after
pointer character '*'? I thought it marks pointer itself as constant for
type-checking opposite to first 'const', which marks memory it points to
as constant for type-checking. I understand that the function is simple
enough to verify it by hand but it's better to add more information for
automatic checking.
Is there any guidelines on 'const' keyword usage in Linux kernel code?
Regards,
--
Anton Leontiev
next prev parent reply other threads:[~2014-03-29 5:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 4:40 [PATCH] [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling Anton Leontiev
2014-03-26 17:41 ` Laurent Pinchart
2014-03-28 3:58 ` Anton Leontiev
2014-03-28 16:12 ` Laurent Pinchart
2014-03-29 5:28 ` Anton Leontiev [this message]
2014-04-01 15:24 ` Laurent Pinchart
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=533659E2.4010001@t-25.ru \
--to=bunder@t-25.ru \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.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