Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1825067pxb; Mon, 13 Sep 2021 06:24:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz359xQp6+vmfOJTDfFoV4h8Imbadvv+any01CYr9yzifv2cDfXE/080woz1Wl7XxdDcRco X-Received: by 2002:a92:c5d2:: with SMTP id s18mr7702387ilt.31.1631539450346; Mon, 13 Sep 2021 06:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539450; cv=none; d=google.com; s=arc-20160816; b=UhU7bfK9nbNsboepzclu8snOja4iMJRe0tZkpqTHySzk04BaO9U5rxbOmv2fj1HuOc SiY5SynoZ3roWHFYOrTaXaC5d1flWmbEl/KPauUUzWnsI/diP+KrYDagXgk7EU1FS9JB 4muG7FwaLjW1NuWhZ/zhLbiTbb5Yl3vxZAxT+yjAwBlPA964qVukJolixAlKTrqsDj3v 7tiTObQxYltfO7O6GxoUcq8c3SzTJr0PWFINzB2s/pdo8vJhsm5e1iI5g73+0uJaJLjT xqW8TY3a3sMAgR2lXLTRKiAWmjAOUPrvrGed5Ox+WO80nWRRp4iFshwUEAPuIESJkjd6 Tigw== 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=dS1nj0ocrq4uvrB73ym8uLzAOGjxzN7Wds4GxEoicQ0=; b=fE9o9qTSYsJ4wVffnE7coXrDgSPWjGLfo6EyF4YPsb1rQR2hkV9Tr9xSye1c0Zn/xt ZWCAA3ZWHZxri2gDUEq5vVFuzHZUpOLHyccS2ypB0MW7m+i6ghTuI0JQ+S51XKpe7Ou1 5iep+C1+0s9jsI2ILOx/WdIfRGHfVeEpPtBuhQIn23JhnRmI2ePfGGzFky30pTz6W2jE qtmkEiZU7GpvNyQqjQXPxX8wkRF/hn05dB1il0U81R1S+uvGvWpDzLPQW0Vgm3vo5T/3 uq9EZ7h/AI3+GzlFRuwtyyquBJMFuJL1fWIBXYkgyTT4oyJ3kSKPplToj+wko2kibXX0 p2Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n6Pu4AB1; 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 s9si7670503jaj.98.2021.09.13.06.23.58; Mon, 13 Sep 2021 06:24:10 -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=n6Pu4AB1; 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 S241223AbhIMNXi (ORCPT + 99 others); Mon, 13 Sep 2021 09:23:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:35056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240431AbhIMNU5 (ORCPT ); Mon, 13 Sep 2021 09:20:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B494E610E7; Mon, 13 Sep 2021 13:19:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539165; bh=I0wYY4ttfS3dnJn5UM3ZkfaJayMzLgJRSj4gCb3aB5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n6Pu4AB1UhTorSsqAxr3nGvrnKdbGcYwo/L66XvZg3a1wVyiFe9NCLyDDG0d5x8fH jK2jNUkfmlqP8mZemrVPIoTTJ/3bJOsWbpqhWqUOMUtwiqxT8/zS/zTHFTnLS0HjfK BzcakMu6b1x4YN7jvZKdxJJhUEu/v2dfyu/IvlOs= 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 5.4 058/144] media: go7007: remove redundant initialization Date: Mon, 13 Sep 2021 15:13:59 +0200 Message-Id: <20210913131049.907169044@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 153a0c3e3da6..b9302d77d6c8 100644 --- a/drivers/media/usb/go7007/go7007-driver.c +++ b/drivers/media/usb/go7007/go7007-driver.c @@ -691,49 +691,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