Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3260507rwb; Mon, 15 Aug 2022 22:35:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR7RUaiXsUZ3s78nmPTZnF1wmWEin56OHb0Lic58Y8LNhGxZiNGbN9MrnX2ipNqRiEAT6h8U X-Received: by 2002:a17:90b:198d:b0:1f3:f72:cfdc with SMTP id mv13-20020a17090b198d00b001f30f72cfdcmr31706142pjb.237.1660628102089; Mon, 15 Aug 2022 22:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628102; cv=none; d=google.com; s=arc-20160816; b=cBwcx9xEb8P89gq1mjwkgYCT4IX/tsi49BdSVYmw8CxihS5VoQ5mj/jsGwPOvH38TZ 5W0NktcoA4pkCOvkYDHXHfIuo7FzQwnk2+K5A3dJHoL/x0FZEgFI40wsTjcB6s5hMlzG bHLdEYUoT9zYWBamPofjuPS38rjoPEVo1YfLwL4ZR+wd/NC07U+nRP/RbWrR6mxRd/DJ csn8l6QUOMn+ho7dlzVnZ/XjasHMhGkrk+K1QIq2HWuZYx3p17tTzTMiiJwzn9O6KefU zF5msPPpPq7nbwANDrA7kWoZtJd04pbTjUroF4SPpbaj814huNbo0XKn2XP5Aey4vMHq r3rw== 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=oUpEtPLjd5lzB6PrtVjBb61iZmZBxSpE4KoB9sGMLSE=; b=UKZvq8NBYAittNHecJNsLziJhQ54lhNW0JwnCs/uCEDj0+WBh/fOSEWBJBqctTv5zC CYZ5BkHcq1gBb+ktoonCZCQlSQe1cq0qcY6qx41/xwApKXAcojYPpKeGdH6BbM4tnrph AvX+2qFOFBIoAFEWsR+BSt2eMyPyyTiJ1I05WdBbwCZrAs6JK1x0fO6Wa5LJnx8OHX2k UfKudCF78o8Y2ika4okXu5WMnaA15LFLkCb8oSsFaOcYHXJaLhsJJou3UdqesrhXsfr3 1M4hzD8t2BMg1SZQ3Rnhir2mE04e+fmx3MRJpKlU7CaJLc3S+sMEF8a1caRN2AEufbTD cZ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cUkQtYID; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w24-20020a17090a461800b001f27babb6fbsi10931550pjg.56.2022.08.15.22.34.51; Mon, 15 Aug 2022 22:35:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cUkQtYID; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232370AbiHPEyY (ORCPT + 99 others); Tue, 16 Aug 2022 00:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233761AbiHPEvt (ORCPT ); Tue, 16 Aug 2022 00:51:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9324B17CFA7; Mon, 15 Aug 2022 13:49:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ED91E6128E; Mon, 15 Aug 2022 20:49:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0BF5C433D6; Mon, 15 Aug 2022 20:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596550; bh=ZVE2RNHPOttuDHZ2xX2gbbcEhpFNhv9Nt5X6GeRZKSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cUkQtYIDzoOpYCzOKmbhgMMr5vl7QPNPhlItf34lzDhv3ryYDyHMbmMReGhlQxrlt km1KxFYXliLYUSXFtaeoQdZBkvfhgLipR378qM8LbRtoF+QmmIoayMDuE0h3p97vPz SDJtrzo9rjBMTHQcUKQn+1aJCbKC8ENgEPUVl0z8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Lindner , Ingo Molnar , Andrew Morton , Simon Wunderlich , Antonio Quartulli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org, Sven Eckelmann , "Steven Rostedt (Google)" , Sasha Levin Subject: [PATCH 5.19 1114/1157] batman-adv: tracing: Use the new __vstring() helper Date: Mon, 15 Aug 2022 20:07:50 +0200 Message-Id: <20220815180524.874593378@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steven Rostedt (Google) [ Upstream commit 9abc291812d784bd4a26c01af4ebdbf9f2dbf0bb ] Instead of open coding a __dynamic_array() with a fixed length (which defeats the purpose of the dynamic array in the first place). Use the new __vstring() helper that will use a va_list and only write enough of the string into the ring buffer that is needed. Link: https://lkml.kernel.org/r/20220724191650.236b1355@rorschach.local.home Cc: Marek Lindner Cc: Ingo Molnar Cc: Andrew Morton Cc: Simon Wunderlich Cc: Antonio Quartulli Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: b.a.t.m.a.n@lists.open-mesh.org Cc: netdev@vger.kernel.org Acked-by: Sven Eckelmann Signed-off-by: Steven Rostedt (Google) Signed-off-by: Sasha Levin --- net/batman-adv/trace.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/net/batman-adv/trace.h b/net/batman-adv/trace.h index d673ebdd0426..31c8f922651d 100644 --- a/net/batman-adv/trace.h +++ b/net/batman-adv/trace.h @@ -28,8 +28,6 @@ #endif /* CONFIG_BATMAN_ADV_TRACING */ -#define BATADV_MAX_MSG_LEN 256 - TRACE_EVENT(batadv_dbg, TP_PROTO(struct batadv_priv *bat_priv, @@ -40,16 +38,13 @@ TRACE_EVENT(batadv_dbg, TP_STRUCT__entry( __string(device, bat_priv->soft_iface->name) __string(driver, KBUILD_MODNAME) - __dynamic_array(char, msg, BATADV_MAX_MSG_LEN) + __vstring(msg, vaf->fmt, vaf->va) ), TP_fast_assign( __assign_str(device, bat_priv->soft_iface->name); __assign_str(driver, KBUILD_MODNAME); - WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), - BATADV_MAX_MSG_LEN, - vaf->fmt, - *vaf->va) >= BATADV_MAX_MSG_LEN); + __assign_vstr(msg, vaf->fmt, vaf->va); ), TP_printk( -- 2.35.1