Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1326785ybh; Sun, 19 Jul 2020 16:14:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMI5esx6I+6hPjeRXTTyK1+q3wZdGwbvh0pGJbLteVAVJhpIUsTGdJeWq19UZkAJ0gh4BF X-Received: by 2002:a17:906:9348:: with SMTP id p8mr19455794ejw.467.1595200489648; Sun, 19 Jul 2020 16:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595200489; cv=none; d=google.com; s=arc-20160816; b=imIBuYL/XaSBauKreIGKpGMI2qppt2EAqd25bdTqfBrhAX0EodOmIFuqxtsSYgkSFU 1R0YPwqY/6HKrYZI62/FrrsV5296+NA+ME6wCXNx1r6Z3etoUr922NDf4/CaLEIGy9WB zKZo5T6hcIh60Ywrmxm/vEr8HkIMbF+Hy2CKYNYUtSZovqr1ofV9cHPjRjE6mL2uBpel J1BwOKPpvMEYWojsNSkyrLKa2rAv6/4OB/LfXmQMqWv/NnRGPoWsiXp1F3s5W2MD/yq1 IpDc7qkgELe6OyUyUEMK+DwPDIiqaLuvwZiNv/xwr6IX09uAN4bfrd+lr2efNe04G0c9 odBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5dxLGInHWnF0fsK6AxTnYzixhFSHss/CD5LDV/6gHL4=; b=SGzBqtWWdRbx5d02njkma5QpVYsuqsrPowOwtPRnCVlQ3uR/lfMi9MO/BdaUx5EFmZ zkoPW9opDHURehSraORy9UjDyjOK+PPU4kHhfWghuOifmsoEghAIHCopJ9R9o8dZk2GG pLByn256720aDE6mTm+H0+o+oCz11P9luVaqJhsANHzBLI5njrmlNuP1XWt2XFjfj+D4 aOiVaN7vipfETkGvfj3ZcUhPEpxDRLdyM54lrUI8XoRdHi7jHVbfZMxVaO2TknxSIsFx 2cbqCoXQs1t0SMAEe1inayubIOTcnwvhm9msInvoVTbHQTr6utz/5fZQ0YplP9hfayW0 Cttg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ModsBH2f; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mh8si9668238ejb.245.2020.07.19.16.14.26; Sun, 19 Jul 2020 16:14:49 -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=@gmail.com header.s=20161025 header.b=ModsBH2f; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbgGSXLj (ORCPT + 99 others); Sun, 19 Jul 2020 19:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726996AbgGSXLh (ORCPT ); Sun, 19 Jul 2020 19:11:37 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E39FC0619D2 for ; Sun, 19 Jul 2020 16:11:37 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id t4so12995649oij.9 for ; Sun, 19 Jul 2020 16:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5dxLGInHWnF0fsK6AxTnYzixhFSHss/CD5LDV/6gHL4=; b=ModsBH2fmSAIozyWyRpog6ScetmIJCaHqmR1jW3ObJoEZv4h67LVRYFOsByXw5BUK0 iEZQhKyf+tPggGrirG+NOTJsnOdTNqQNeDncrit98VmvZchkgWHKize3EIJxM8uWqNZM ihpXmCTPl/L0VWms5O4YSiHjhbzcBaNwAapkgEWL3TYSF58vQNQu01uN7rkpDniz42md 5cz1ZLRJPNZpcXBURAvt9LWEwhFCoMcgMu1pQ0nwhwHCev55Cf0wVT4Oi3JSBH5qiYMi 8XCVTv2mm24Yk/ybs9uDOO/d9y7KH+u1BHR1f+acGx67UhX/sjZVKuDsHXjhZFA34dsD +DsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5dxLGInHWnF0fsK6AxTnYzixhFSHss/CD5LDV/6gHL4=; b=IdqaPMDOcwpqYxPiogncbBTJduZjN5ZBDv3FKDk7g9+uqDOKePAUrjkccPInNDtMRU EoVGk6B7y+ICqlJLYHWy2XzUiJe6wQdxPxlH6Isd6DyOoOYylkxiIARSfrmmq3M0wAeJ mVyjb+KESuOce77SZfSPj3c2JJIrHa9oHX5qUNRqBqew3+FA7zSFqOjLPicbinBZZzID 67eQTGABGuf4H6efJB8KR7yT1iVm6/JiW74wRm8mkoF6vD70/mqTIj7kURbE2cA97VSX m7pu8VsBsgfMZYpPnCNKl+R0Oja53FWUWptij/UOjkTm1IYSFPr4JWRDYhTm37VzY2bC 1STQ== X-Gm-Message-State: AOAM533+zI7In2CRSYqvtu/OMeDZ2CrVbRiUwqXVO/jl/G2h/N8K4cbg tcYQvh6Va4XprAhpksG7J6hAyjT4Ylg= X-Received: by 2002:aca:544d:: with SMTP id i74mr16523297oib.105.1595200296706; Sun, 19 Jul 2020 16:11:36 -0700 (PDT) Received: from frodo.hsd1.co.comcast.net ([2601:284:8204:6ba0::5e16]) by smtp.googlemail.com with ESMTPSA id q19sm2394680ooi.14.2020.07.19.16.11.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2020 16:11:36 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, linux-kernel@vger.kernel.org, akpm@linuxfoundation.org, gregkh@linuxfoundation.org Cc: linux@rasmusvillemoes.dk, Jim Cromie Subject: [PATCH v5 09/18] dyndbg: prefer declarative init in caller, to memset in callee Date: Sun, 19 Jul 2020 17:10:49 -0600 Message-Id: <20200719231058.1586423-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200719231058.1586423-1-jim.cromie@gmail.com> References: <20200719231058.1586423-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ddebug_exec_query declares an auto var, and passes it to ddebug_parse_query, which memsets it before using it. Drop that memset, instead initialize the variable in the caller; let the compiler decide how to do it. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 1d25a846553b..da3ed54a6521 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -330,7 +330,6 @@ static int ddebug_parse_query(char *words[], int nwords, pr_err("expecting pairs of match-spec \n"); return -EINVAL; } - memset(query, 0, sizeof(*query)); if (modname) /* support $modname.dyndbg= */ @@ -448,7 +447,7 @@ static int ddebug_parse_flags(const char *str, unsigned int *flagsp, static int ddebug_exec_query(char *query_string, const char *modname) { unsigned int flags = 0, mask = 0; - struct ddebug_query query; + struct ddebug_query query = {}; #define MAXWORDS 9 int nwords, nfound; char *words[MAXWORDS]; -- 2.26.2