summaryrefslogtreecommitdiff
path: root/drivers/media/test-drivers/vidtv/vidtv_s302m.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-22 17:43:56 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-11-26 10:05:23 +0300
commita8bd461ca3b32468777d054d9a0e050be5a418e9 (patch)
treedb23731dd2a4a3678e366401b7c4d691fec0f6d8 /drivers/media/test-drivers/vidtv/vidtv_s302m.c
parent163d72a2d3ec7e0bc41b943fed7667f7cbfc760f (diff)
downloadlinux-a8bd461ca3b32468777d054d9a0e050be5a418e9.tar.xz
media: vidtv: do some cleanups at the driver
Do some cleanups at the coding style of the driver: - remove "inline" declarations; - use reverse xmas-tree for local var declarations; - Adjust some indent to avoid breaking 80-cols; - Cleanup some comments. No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/test-drivers/vidtv/vidtv_s302m.c')
-rw-r--r--drivers/media/test-drivers/vidtv/vidtv_s302m.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/test-drivers/vidtv/vidtv_s302m.c b/drivers/media/test-drivers/vidtv/vidtv_s302m.c
index 569e7a50129f..ce7dd6cafc8b 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_s302m.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_s302m.c
@@ -201,10 +201,10 @@ static void vidtv_s302m_alloc_au(struct vidtv_encoder *e)
static void
vidtv_s302m_compute_sample_count_from_video(struct vidtv_encoder *e)
{
- struct vidtv_access_unit *au = e->access_units;
struct vidtv_access_unit *sync_au = e->sync->access_units;
- u32 vau_duration_usecs;
+ struct vidtv_access_unit *au = e->access_units;
u32 sample_duration_usecs;
+ u32 vau_duration_usecs;
u32 s;
vau_duration_usecs = USEC_PER_SEC / e->sync->sampling_rate_hz;
@@ -290,9 +290,9 @@ static u16 vidtv_s302m_get_sample(struct vidtv_encoder *e)
static u32 vidtv_s302m_write_frame(struct vidtv_encoder *e,
u16 sample)
{
- u32 nbytes = 0;
- struct vidtv_s302m_frame_16 f = {};
struct vidtv_s302m_ctx *ctx = e->ctx;
+ struct vidtv_s302m_frame_16 f = {};
+ u32 nbytes = 0;
/* from ffmpeg: see s302enc.c */
@@ -389,6 +389,8 @@ static void vidtv_s302m_write_frames(struct vidtv_encoder *e)
static void *vidtv_s302m_encode(struct vidtv_encoder *e)
{
+ struct vidtv_s302m_ctx *ctx = e->ctx;
+
/*
* According to SMPTE 302M, an audio access unit is specified as those
* AES3 words that are associated with a corresponding video frame.
@@ -402,8 +404,6 @@ static void *vidtv_s302m_encode(struct vidtv_encoder *e)
* ffmpeg
*/
- struct vidtv_s302m_ctx *ctx = e->ctx;
-
vidtv_s302m_access_unit_destroy(e);
vidtv_s302m_alloc_au(e);
@@ -441,9 +441,9 @@ static u32 vidtv_s302m_clear(struct vidtv_encoder *e)
struct vidtv_encoder
*vidtv_s302m_encoder_init(struct vidtv_s302m_encoder_init_args args)
{
- struct vidtv_encoder *e;
u32 priv_sz = sizeof(struct vidtv_s302m_ctx);
struct vidtv_s302m_ctx *ctx;
+ struct vidtv_encoder *e;
e = kzalloc(sizeof(*e), GFP_KERNEL);
if (!e)