Received: by 2002:a25:d80d:0:0:0:0:0 with SMTP id p13csp115900ybg; Sat, 23 May 2020 08:56:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1sW79bT+VHsMeeduK1fXR5/bIfZY3+KRuUuuuOJg1175kIJqniG/oxrilFh0kpCjAsEUB X-Received: by 2002:a17:906:6094:: with SMTP id t20mr13329883ejj.359.1590249361692; Sat, 23 May 2020 08:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590249361; cv=none; d=google.com; s=arc-20160816; b=Bw0sHXlvxKhb0mDkb0azho3UaDr7nngtwI66QDWzQWb5Narh9f8gsas0fWr7P4fOCm 04cljMZBgHt3nepMQ1YwcIIBOhOwWin+srHXsNDK3ftnM7QIf7rFK08HP87wVNQVFXHv D6X9YDtbUoW72FBx+XG6OEQwg2Y5ixeWgxNwm6dTKLn1qsaBUtYH1Zc4TJ2g8cKoRoiK Pt6ov67rUVUuChqWAu6sVsaXQuhsANMJgbGwGnOGUM7LYJCrrU9oHEDdmV83w3joAe/P 11pnA5Cf+OlqWyaP9E4qezbvz8fPSnvOJJ62OwhMTGCC8UbhiT0K6Bp3j3pldkeeVJfb JSAg== 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=esmMd/5Lzy1U7WGPOxHUeyLgPwXqqxfhbjwryYCGedo=; b=dCVRXErgffcGFNFIeMZEgstg/U7RBG2uQoL7Ja09jKIm8bx4FNf8febFQoU+48IuDH UaG/YcCNyBWcoc4rCC7hkiTS3A+6MUGsBWEqv7SJzJ2vDLgPfFd0QBD4SFsggLc3nd9x cQ+4D9Q2YNgysjesxlesAkdR5TpTN0xkN9E8mw8U0OomGCQAvmpWPJNYqdI05gwEqR46 lYjzXVLRZC1tF3T738nS+mV+N07ajDc8mZ8gbINczBdfmmNGqGRZCVDLrUO/gSLvSDpl 1VAs0L4/CHeYAGL0NgOizRFj3d3D7yDAHI+iy/IkASkfJvDakch5Cy9r3LHND8Lf3+Lc BNMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mRSRzUUC; 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 cd12si1998592ejb.219.2020.05.23.08.55.38; Sat, 23 May 2020 08:56:01 -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=mRSRzUUC; 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 S1728000AbgEWPxM (ORCPT + 99 others); Sat, 23 May 2020 11:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbgEWPxL (ORCPT ); Sat, 23 May 2020 11:53:11 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D91BFC061A0E for ; Sat, 23 May 2020 08:53:11 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id ci21so6298325pjb.3 for ; Sat, 23 May 2020 08:53:11 -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=esmMd/5Lzy1U7WGPOxHUeyLgPwXqqxfhbjwryYCGedo=; b=mRSRzUUCFMthEgMPFMtMpWoLmzuRI5h9o1Ru3nBuMijJVGbxroEXc/ovQafRIBiftT tyKL1TOt0VlvbLDzKlCzdbJLfk4nLvEiah//zC8kSR3nomghfojPP+R6NLYrbzx78jIq TndmKMWIAnVp9iheqh00TDUUzQyqeTJzJilA/Fv3/cifQt1J72GC7qQcG0cH3i9wiT/j MDFOe8qYWHDbgzND5QY8l6si/NytdozMdmmDDu1wUzpxRRyS4bLBp4bF/B0GLMZaAGr7 VT2f9tNrbaQ0GsYrEOE1HUpwD28oYu4oIsekCVti+8TUwm40plz7CMsshhkELPQODHsk 5bpA== 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=esmMd/5Lzy1U7WGPOxHUeyLgPwXqqxfhbjwryYCGedo=; b=rdgmWMfDkw8HU1Jgq5yjoX4BNqR2AjexIjxKvJNGnkTJq3T/Qcqml4HjgvVVBit8IE pZw/FJCItXrZgHggpKKBtscmf0VVdsEM915pIiolS32vjrNjffkJeBE5OwGHZ4fasDof cMDPK3V6hoEYlJn9UKhLgAC6Sq3bXvWNpGa80zhXSIUYr/YtS4AjNemqGYXFFuH3brdI eoi/14ycCq5g0K6OiO4rXQJ5lH2mAu4bqqa4bdOKMNQUV01PbsZtTY7i343c9VQIau1D PSXIpVXNLSgdtMkUwnm7i5VWtrhuVImwWJZO99NglKFUs2LeBsP8C8lbqjWM3MU9xx8y ZJkA== X-Gm-Message-State: AOAM532s9wS+pfy4rX7bXSJc6HAwu+pdG5wUiohZOu7KdZdBiv781O8S 80v68sZzA56ItG0KbsDkAl4= X-Received: by 2002:a17:90a:9606:: with SMTP id v6mr11398023pjo.20.1590249191425; Sat, 23 May 2020 08:53:11 -0700 (PDT) Received: from Smcdef-MBP.lan ([103.136.220.68]) by smtp.gmail.com with ESMTPSA id n21sm9265061pjo.25.2020.05.23.08.53.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 May 2020 08:53:11 -0700 (PDT) From: Kaitao Cheng To: rostedt@goodmis.org Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, songmuchun@bytedance.com, Kaitao Cheng Subject: [PATCH] trace/ftrace: fix maybe-uninitialized compiler warning Date: Sat, 23 May 2020 23:53:04 +0800 Message-Id: <20200523155304.29554-1-pilgrimtao@gmail.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) 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 During build compiler reports some 'false positive' warnings about variables {'seq_ops', 'filtered_pids', 'other_pids'} may be used uninitialized. This patch silences these warnings. Also delete some useless spaces Signed-off-by: Kaitao Cheng --- kernel/trace/ftrace.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 7d0ebd104706..01a61bdc4e63 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2260,7 +2260,7 @@ ftrace_find_tramp_ops_next(struct dyn_ftrace *rec, if (hash_contains_ip(ip, op->func_hash)) return op; - } + } return NULL; } @@ -3599,7 +3599,7 @@ static int t_show(struct seq_file *m, void *v) if (direct) seq_printf(m, "\n\tdirect-->%pS", (void *)direct); } - } + } seq_putc(m, '\n'); @@ -7151,6 +7151,9 @@ static int pid_open(struct inode *inode, struct file *file, int type) case TRACE_NO_PIDS: seq_ops = &ftrace_no_pid_sops; break; + default: + trace_array_put(tr); + return -EINVAL; } ret = seq_open(file, seq_ops); @@ -7229,6 +7232,9 @@ pid_write(struct file *filp, const char __user *ubuf, other_pids = rcu_dereference_protected(tr->function_pids, lockdep_is_held(&ftrace_lock)); break; + default: + ret = -EINVAL; + goto out; } ret = trace_pid_write(filtered_pids, &pid_list, ubuf, cnt); -- 2.20.1