mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
media: go7007: remove redundant initialization
[ Upstream commit6f5885a775] In go7007_alloc() kzalloc() is used for struct go7007 allocation. It means that there is no need in zeroing any members, because kzalloc will take care of it. Removing these reduntant initialization steps increases execution speed a lot: Before: + 86.802 us | go7007_alloc(); After: + 29.595 us | go7007_alloc(); Fixes:866b8695d6("Staging: add the go7007 video driver") Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a715a58207
commit
ad611c0902
@@ -698,49 +698,23 @@ struct go7007 *go7007_alloc(const struct go7007_board_info *board,
|
||||
struct device *dev)
|
||||
{
|
||||
struct go7007 *go;
|
||||
int i;
|
||||
|
||||
go = kzalloc(sizeof(struct go7007), GFP_KERNEL);
|
||||
if (go == NULL)
|
||||
return NULL;
|
||||
go->dev = dev;
|
||||
go->board_info = board;
|
||||
go->board_id = 0;
|
||||
go->tuner_type = -1;
|
||||
go->channel_number = 0;
|
||||
go->name[0] = 0;
|
||||
mutex_init(&go->hw_lock);
|
||||
init_waitqueue_head(&go->frame_waitq);
|
||||
spin_lock_init(&go->spinlock);
|
||||
go->status = STATUS_INIT;
|
||||
memset(&go->i2c_adapter, 0, sizeof(go->i2c_adapter));
|
||||
go->i2c_adapter_online = 0;
|
||||
go->interrupt_available = 0;
|
||||
init_waitqueue_head(&go->interrupt_waitq);
|
||||
go->input = 0;
|
||||
go7007_update_board(go);
|
||||
go->encoder_h_halve = 0;
|
||||
go->encoder_v_halve = 0;
|
||||
go->encoder_subsample = 0;
|
||||
go->format = V4L2_PIX_FMT_MJPEG;
|
||||
go->bitrate = 1500000;
|
||||
go->fps_scale = 1;
|
||||
go->pali = 0;
|
||||
go->aspect_ratio = GO7007_RATIO_1_1;
|
||||
go->gop_size = 0;
|
||||
go->ipb = 0;
|
||||
go->closed_gop = 0;
|
||||
go->repeat_seqhead = 0;
|
||||
go->seq_header_enable = 0;
|
||||
go->gop_header_enable = 0;
|
||||
go->dvd_mode = 0;
|
||||
go->interlace_coding = 0;
|
||||
for (i = 0; i < 4; ++i)
|
||||
go->modet[i].enable = 0;
|
||||
for (i = 0; i < 1624; ++i)
|
||||
go->modet_map[i] = 0;
|
||||
go->audio_deliver = NULL;
|
||||
go->audio_enabled = 0;
|
||||
|
||||
return go;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user