Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3788908pxj; Tue, 11 May 2021 11:53:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEuEUd5FuW5YcrKI1PB8z/3PafkjoCEjvAWMdHIeUp7QmQgobLRi8AM2kKKl4D0grJQWQL X-Received: by 2002:a05:6402:1587:: with SMTP id c7mr37687501edv.181.1620759209568; Tue, 11 May 2021 11:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620759209; cv=none; d=google.com; s=arc-20160816; b=Nh+txIUihk1A5wjRP6uGGPf5FxUZ/Pz7rkX3U5kO5RhVSEQaveSm4VygVvF4Z1ong1 LNQiFdUPs57gpEQWydXHjC3AfzBV/iHsdsYw770KwysPbX6lupAmoNjVElVg0j7gWzRH 7lSVGXb83phrSJ2x1SNpEeafA3dEJuVW2PPH5seSA2W7Rw1x8fvX2gplFIaFTjfoPWJi HTGhfOl8VZ83L7XiJk5Fs+a2aQNUDxbVv45GIcUpn6zTvJSnqGKO0WetJuM5VJP+tqxK Mldb44baJEz3rzJPV8uAqWQh47Z27zR4Zqo3Y8u/jlYVpPTw6nv0utBzeydOoIfU+Ux2 lW2A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gKUtj5xFpWrKHzfDwNn5dlfDWlNqWpU9zICKw/jFmZs=; b=mAQ0HmNv5XrERPNiYgOEKSNsVHx3J44ztlnFVewgkzRMzLkXAfgTk7WDh+dNCMMcxa hDGnhoObvGMoExm3nq09D2ze8BVusiELr1zioqAyVaUNegOIXul+b/dFQCoV05OD+R/g rCgUiUwdu2//hrS4d+Lq/iZwH42U4oAftgHKA76E0i0jJ8anGrOJ8JlDcbyFaOHvWAdz UEfZcJyM69TYSsE7XfUdJLX93q3KYPuzWXuf6Y12k7gRNBWVBaMc2jjbwVFmdYoeJCKH U5Y/0dEOG6peUhnBCsZD41o4zKqvTyy8hKE1Zawg1dhqav+ut0N+u4gUc1D3NgDePR/d /6eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CVrTPF2f; 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 s24si17814114ejz.169.2021.05.11.11.53.06; Tue, 11 May 2021 11:53:29 -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=CVrTPF2f; 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 S232265AbhEKSwx (ORCPT + 99 others); Tue, 11 May 2021 14:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232149AbhEKSwi (ORCPT ); Tue, 11 May 2021 14:52:38 -0400 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03793C061763 for ; Tue, 11 May 2021 11:51:29 -0700 (PDT) Received: by mail-il1-x135.google.com with SMTP id w7so1343477ilg.13 for ; Tue, 11 May 2021 11:51:28 -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=gKUtj5xFpWrKHzfDwNn5dlfDWlNqWpU9zICKw/jFmZs=; b=CVrTPF2f0gSY3Mvjt3pelxNj53ot8zdyqZZbTQfRWrMBJp19Qxqm4SKP88OW7uKbfY 1HkgbTi2YK8eFOzk+PtWsULQP0gfQpauVrXbOPpyPiKb6GxsS1FF9aF7lDJqE2AeJ9bY C0A1Y5nzZehb5W38XwDPVgk1wI3WttvaoNfysLa+5sxU8zMCprgcWHs6OU7wLb92ocmB ge01Jgh40m+zG/NecEml74/4mIjVnOH9iMgxSA6fGBxD1/1/RSZCpEijyh8ETtXLpra9 GX4JGfqmj9ivdd6ys5386kxDpjDATJjv7SS8n/ZttZFRARae/qIv9HPiP0Rg6Fzy/LOX TKtA== 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=gKUtj5xFpWrKHzfDwNn5dlfDWlNqWpU9zICKw/jFmZs=; b=ebnGixiEIdGg/sOuhq8gT400v9OJmx6Ihw4SG3YwSaCg1huawUuX9x56Ya3LGXFAGY o4ndryj82yn4BE2szcyOVUVAG0YlyB16BxoioVMwUWLJDaN3DouSBEYBOldub8TuP/BV vowOG0iwC/1d8ZEX7jBz2BxPaqHb+FRuERac/Xrsn5s6VJgL+1vkxmO57PjVueUne7n2 EBJzMHpC9gUpKJ+elcIe1Z5MbwQjEliLem0uvO1saXdjoCi6S/gwqLU3G4mnWS0Nv6sa wUkT5M4/YGMAYBV0KJ0IIAjH5mtih+ruACDzgM9kSFPUXRY+Yi8DYvwatF9rvWnjwpKh KdRw== X-Gm-Message-State: AOAM53154Ib53LKzS/MLPGAP1HDFdEElKHEkgJ//Htl+VCPcXy45soo9 7YuQ857qn6rvJCdORi5eXFQ= X-Received: by 2002:a92:c50c:: with SMTP id r12mr27664795ilg.281.1620759088517; Tue, 11 May 2021 11:51:28 -0700 (PDT) Received: from frodo.mearth (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id t10sm405096ils.36.2021.05.11.11.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 11:51:28 -0700 (PDT) From: Jim Cromie To: Jason Baron , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Jim Cromie Subject: [RFC PATCH v5 09/28] dyndbg: accept null site in dynamic_emit_prefix Date: Tue, 11 May 2021 12:50:38 -0600 Message-Id: <20210511185057.3815777-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210511185057.3815777-1-jim.cromie@gmail.com> References: <20210511185057.3815777-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2 prints use site->member, protect them with if site. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index fa89d69dad4e..fb8547feb061 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -629,15 +629,19 @@ static char *__dynamic_emit_prefix(const struct _ddebug *dp, char *buf) task_pid_vnr(current)); } pos_after_tid = pos; - if (dp->flags & _DPRINTK_FLAGS_INCL_MODNAME) - pos += snprintf(buf + pos, remaining(pos), "%s:", - desc->modname); - if (dp->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) - pos += snprintf(buf + pos, remaining(pos), "%s:", - desc->function); + + if (desc) { + if (dp->flags & _DPRINTK_FLAGS_INCL_MODNAME) + pos += snprintf(buf + pos, remaining(pos), "%s:", + desc->modname); + if (dp->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) + pos += snprintf(buf + pos, remaining(pos), "%s:", + desc->function); + } if (dp->flags & _DPRINTK_FLAGS_INCL_LINENO) pos += snprintf(buf + pos, remaining(pos), "%d:", dp->lineno); + if (pos - pos_after_tid) pos += snprintf(buf + pos, remaining(pos), " "); if (pos >= PREFIX_SIZE) -- 2.31.1