Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp108696ybx; Tue, 29 Oct 2019 15:11:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwI9/2SqZT+xR6BxVOdahGkBKBWGAcYmTn39RBIig1qrca50zD2NHoZEmldCfabOB4xX2r7 X-Received: by 2002:aa7:d714:: with SMTP id t20mr28941162edq.129.1572387060207; Tue, 29 Oct 2019 15:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572387060; cv=none; d=google.com; s=arc-20160816; b=h2ynVDYZlbzN1PeS68X8ZCRxXQePG32wXizFHg0qc8EzXYJGrgAjP5p+pcq6Vk/7y2 RfRjeZcuS79sGq5PDpEy8n+k4i6iRT+9hiId8BWBdXNkzGmk+Er38EQ04LLKCJzgfoyN r7uNwChRFiH5NIQL6uwPNy++7dOPvMtNmExGXe+ZtzEqwi3QVfbmbHGUl67s7mi09j3N KdK8MBQRUQj7zjQ76DPaQ3v5g486y6eFqFm7Ty21e5T7uRJruqI/LVF1SLkgtyFTgLF/ 5aV2i+cA9AAdJfe8eQTSlEhXZyNVOYk1dx8UWIFYOzlcBfoYWZPecdnAyNFeoKICUFOO ErGw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=mNLccYcZkIn8UAKxO85u+OA0TLw/V1dQswW4vxScbHs=; b=pcAQ4fJV0+a67/bR2AjOHmqq7ySo4qLgZWiTKGUTlE77J0F3cwQnXHfKSKHzOuecW4 s0ezMr4entCk9mfxIBmkRH6AejppVbmqMO5lWR7yfuEQrpNQyl4/B2Av6xsEuOm/H7NL L1pgK42moyjfJY+qIAbxEUKYiZYFJyfEUhwde2m7rYZfWDujuxc/mKvKmS3/9gCB2VEj BkiE83yBThS+puvqpCog4oiEgg2Er/eSRm+H1frdgztziKMdj2GqSIyFEBN/B54e4odm EM4JsHTzhI9J+hzXSyx34Vwt0QV8gbiqpF+UpGxOc53wjbber6zVy38Xiy7G/Cd1vLvx fjEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="g/YPCW/N"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id r9si93317edc.101.2019.10.29.15.10.37; Tue, 29 Oct 2019 15:11:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="g/YPCW/N"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729169AbfJ2UBe (ORCPT + 99 others); Tue, 29 Oct 2019 16:01:34 -0400 Received: from mail-il1-f193.google.com ([209.85.166.193]:39018 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbfJ2UBd (ORCPT ); Tue, 29 Oct 2019 16:01:33 -0400 Received: by mail-il1-f193.google.com with SMTP id i12so18197ils.6 for ; Tue, 29 Oct 2019 13:01:33 -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:mime-version :content-transfer-encoding; bh=mNLccYcZkIn8UAKxO85u+OA0TLw/V1dQswW4vxScbHs=; b=g/YPCW/NPci2VczE3231r3K0Ef9CBZuaxK9ZtXbkC8gP2dVtPqAztBq6ppjFAqtbFy r8jtspPHfswtsjCP8ULpRyehkcwFlEfiqMUoo4Fl8jmOCHGOzXtSH+6uwEGHRTQW6/Ub 4I3Hvh9v725BTDGMsmSUj1tw/kRsUPC5Xx4yUWVBYep73Ab/nITRXovNriYNvkS9+63t OTEOygBsV+wQV2CS2csf8HKzWiP9AmIY2SXoYUDanAWUca1j43oRSuvusO6oGQgNAtJr VuxWKc9uEq3L6eO2LvO3fdTEMx5eoq7KDoFiz3QYFtVuDHvUna84C0GC6AV2ysOeeMq6 cWDQ== 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:mime-version :content-transfer-encoding; bh=mNLccYcZkIn8UAKxO85u+OA0TLw/V1dQswW4vxScbHs=; b=EeLCdWz/USmWgb73HC3PaJo9R5EFffjaTviGGU6zHcSGJX6yyQbk+ErI/Cjj/M4EYX AtkqDn0ypqgqPQEEpYIhFDJv6GgEk7oskvWSqaS39IL/Rwxll1uRVAdg8yPCjvI2mbpN YeeCyA22zoP7uxqUXbDA+saHcSswgfCHLs5peWJE9BcWpi6fEDLpwlgAhXbtNJ9vaRXR 4/1xr5Vh/sS6/M1Rvy+4YvUh4AwF2IAynes9u4uaUM5ygeKouyA/8xXRNCA/wv4TThRz tyfhgx8NC+GmsAw2uskCCC4z8JmxyrXbA9Z/LCtPmaSKWGyVHEsJRIe26J7oXn+UaYMq dvZA== X-Gm-Message-State: APjAAAUbLDWK8AaOQCYCd9MJNPIVd3nLQMqx3/WMDfOkGqv42bQK1wpu miGrBkxN1XM1g7lnSKAaKW8= X-Received: by 2002:a05:6e02:d8b:: with SMTP id i11mr30934359ilj.81.1572379293050; Tue, 29 Oct 2019 13:01:33 -0700 (PDT) Received: from localhost.localdomain (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id t16sm2734iol.12.2019.10.29.13.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 13:01:32 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, linux-kernel@vger.kernel.org Cc: linux@rasmusvillemoes.dk, greg@kroah.com, Jim Cromie Subject: [PATCH 14/16] dyndbg: prefer declarative init in caller, to memset in callee Date: Tue, 29 Oct 2019 14:01:29 -0600 Message-Id: <20191029200129.10315-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.21.0 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 drop memset in ddebug_parse_query, instead initialize the stack variable in the caller. 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 c6273fabe52c..4369afeb52f0 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -358,7 +358,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= */ @@ -479,7 +478,7 @@ static int ddebug_exec_query(char *query_string, const char *modname) { struct flagsettings mods = {}; struct flagsettings filter = {}; - struct ddebug_query query; + struct ddebug_query query = {}; #define MAXWORDS 9 int nwords, nfound; char *words[MAXWORDS]; -- 2.21.0