Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1839474pxb; Mon, 13 Sep 2021 06:41:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM1BlR1uVtwFMZVTgYpKhOMj0vT3DOLviIOC7LaG2HB20OOWfWXlsitfBKAQ8HxndbkOoX X-Received: by 2002:a6b:8e50:: with SMTP id q77mr8892032iod.96.1631540490661; Mon, 13 Sep 2021 06:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540490; cv=none; d=google.com; s=arc-20160816; b=GHD/eEsYL9HxYI7NrNR40SOd72mLD1w16MHlmPEzJ0aIbW4Okuq2WFvqrQWdcI8BI0 I9nrjqFp9vaCLoFrNpn7c3dV3/SS+YqzPagKh9vmlTx049/CP8lwq6rCh+P5RW54296I jva8OinH7d0HfJyby2rxf6FO43CpMjY08rmP6hETPai4nPT8ppFlFvnplhGMLJqLMuq9 Gk+N/2MdrZkSkCj19ePZpOXJgHe+kHo3z+dLPp3zhU3/01Waci+BKe94FVxENxo8ZyxF Q5JWS/0oHM77sC+z4LcbWbE4HHgYGt4Fn2r5LbKG3EChN9U69lPbWIfHxG+6SnyplHEF e2aw== 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=3sSIj4tVXZm/Hck7T91cVtsauoOhvpSiPEb7BhpVqxY=; b=D2QlpfFCimS4Pa/c4hdxdKEGVTqKXCcq8A4ae1iZzRLDK9gZjjxF7SBjyeva5aUPCC kCrq0yj1npMt+fh6twWt2o31Wqa8J3KEjsuY0xp0AD/AQ92oC/11q7K9/3HsgUrkbs9A D6w34bp0Kqxk7bwjzZIc8WnxLdA9mMqaeH23zd8lKiWNWl+x5XTvkNup5IyFVuqZtqI0 NtJDaIn5rrUzP9/cVeFhewZrPTgslldJX7Q887a6pnGcW3jvYxKd7BlyCWIRgfsV+aMH nk3pyXw9H/vckTIRDexgpLiQz9LpQI23OoND4TjTwMHhNsWmjLd6t3RyBvVXmvlWPHcn /p5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qtVWrI/a"; 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 n22si6826566ioo.36.2021.09.13.06.41.17; Mon, 13 Sep 2021 06:41:30 -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="qtVWrI/a"; 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 S241776AbhIMNkp (ORCPT + 99 others); Mon, 13 Sep 2021 09:40:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:35706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243128AbhIMNe6 (ORCPT ); Mon, 13 Sep 2021 09:34:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9B81610FB; Mon, 13 Sep 2021 13:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539625; bh=+6aVZkAa15Bnbpzpec7vES3nQAlUyQpFh+CuuHVxGDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qtVWrI/aZKED3P71pYTsn1/ignMpmErqn5fYaiP6VLmrGm5oJTTNb1b7CZFepVMHm OX1xDASPdhl0I3xDZYhm3+AU76NPyS5O7Le8PBjh8SyE2laA/ocmaRIyqTrFRXEl8x g+oMmCBwm7Fk9rkyiYism6mwD+5tvI9QtVLe8pRk= 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.10 095/236] media: go7007: remove redundant initialization Date: Mon, 13 Sep 2021 15:13:20 +0200 Message-Id: <20210913131103.588895477@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 f1767be9d868..6650eab913d8 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