* vim2m: small cleanup: use assignment instead of memcpy
@ 2015-09-15 6:49 Hans Verkuil
0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2015-09-15 6:49 UTC (permalink / raw)
To: Linux Media Mailing List
Use a type-safe assignment instead of memcpy. And it is easier to read as well.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index 295fde5..d47cfba 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -233,12 +233,9 @@ static int device_process(struct vim2m_ctx *ctx,
out_vb->v4l2_buf.sequence = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE)->sequence++;
in_vb->v4l2_buf.sequence = q_data->sequence++;
- memcpy(&out_vb->v4l2_buf.timestamp,
- &in_vb->v4l2_buf.timestamp,
- sizeof(struct timeval));
+ out_vb->v4l2_buf.timestamp = in_vb->v4l2_buf.timestamp;
if (in_vb->v4l2_buf.flags & V4L2_BUF_FLAG_TIMECODE)
- memcpy(&out_vb->v4l2_buf.timecode, &in_vb->v4l2_buf.timecode,
- sizeof(struct v4l2_timecode));
+ out_vb->v4l2_buf.timecode = in_vb->v4l2_buf.timecode;
out_vb->v4l2_buf.field = in_vb->v4l2_buf.field;
out_vb->v4l2_buf.flags = in_vb->v4l2_buf.flags &
(V4L2_BUF_FLAG_TIMECODE |
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-15 6:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-15 6:49 vim2m: small cleanup: use assignment instead of memcpy Hans Verkuil
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).