Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2318849pxb; Mon, 20 Sep 2021 18:41:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsk+jPZbMJ7WA5o4kTAAcittV1mglDNkkguxFxl2CCricL2YAj2Jz4xvSif8+qijUmA8PL X-Received: by 2002:a6b:6a08:: with SMTP id x8mr6668599iog.89.1632188484172; Mon, 20 Sep 2021 18:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188484; cv=none; d=google.com; s=arc-20160816; b=p/E0tSdins4mqWmF2pOWGjZGdKB4Pss/ILAsPokkHd0juyeFSr/9X5DfhL6Dp6cFhG hG9UAGh8frtvrx+YcReoJIMyZoX5OUfH7ubYgxf8Xou4ry21ykbJtgD7pnS5s9L/Lrk8 vy+TvrVV8vQ4j+6g7nrInuerzieBpT4n6rh+k+qkmLrxQ8aNGPlgWq07OMpcVlSBxHpr teBgYs6RnKVpyTALoZ4QfjcNvGJGqdoyQHxl+uJsa5UgZJKQYbcb4IlvTSI6HS3sUpyL bhE4TfU9ZjpgceUmGInGXtG92yfqPcIuIEmA531mw4o1Y7D9ptYQy6zcnPZpbWHI55UI E6Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=//fbIVBvTao1+gGZGC5yWcmBvHVe6c5iIuHVwLM1Xf4=; b=nVquh7352+s4VH9JurFiBaThRy9s3lCg5onANEFC3DgIq6hoXUb6BAT50MO8wREpvO BDKcTORmaT6dOel6lHyo5ATTFWn4xwupRfqz15hKrCk2CFH6At1qulRINO/zWkuAdR21 w/ZsyfW07RHBH0RPqUs7oxvAi7cxWe+FSBA2BQP88HiD8rO+9MyAekHXAButK/JGUcRO A9QcsDdsabW7xcROHemuUWqdKf6YaAGPJ+ND1OUHjJSmivxlj5S1TF6MVUZk3rq2oBzP xZkgj5+06/7vaex1N34EYNvpX4PE/ieB8qFzzcBVzM69fyqvy9zia/8igrGCIhr2Gb2f JKaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DVSkVYx5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si13931372jab.92.2021.09.20.18.41.13; Mon, 20 Sep 2021 18:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DVSkVYx5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243609AbhITQs4 (ORCPT + 99 others); Mon, 20 Sep 2021 12:48:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:36602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243148AbhITQsE (ORCPT ); Mon, 20 Sep 2021 12:48:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 648D961252; Mon, 20 Sep 2021 16:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156397; bh=RDXPhV+XhK+KSulAbJypG6MW1JMnxdbZe8aVEVQvtW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DVSkVYx5V2Iji66xu9/ZTm+GyEhAM24N+Kz/Rchr9aGfDKa7GLHORfhpuacs4e6X5 2xcC0GQh9pzrFXcbZ+/YGRlPOrS0UPt0rxLVNSHd2BQFVpKlRI3mT0hSNoToqebs/d QykgUaHWVS80OQ2TtKpWJcE3wokqXOCjQN7oLeLw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Skripkin , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.4 040/133] media: go7007: remove redundant initialization Date: Mon, 20 Sep 2021 18:41:58 +0200 Message-Id: <20210920163913.964733082@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Skripkin [ Upstream commit 6f5885a7750545973bf1a942d2f0f129aef0aa06 ] 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: 866b8695d67e8 ("Staging: add the go7007 video driver") Signed-off-by: Pavel Skripkin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/go7007/go7007-driver.c | 26 ------------------------ 1 file changed, 26 deletions(-) diff --git a/drivers/media/usb/go7007/go7007-driver.c b/drivers/media/usb/go7007/go7007-driver.c index ae1cfa792c58..11429bf28c8a 100644 --- a/drivers/media/usb/go7007/go7007-driver.c +++ b/drivers/media/usb/go7007/go7007-driver.c @@ -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; } -- 2.30.2