Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3086797rwb; Mon, 15 Aug 2022 17:48:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4X44KGN2r2lvwHGhJvmpDVYSV4Ng6fnoVI/IoeKwwLX1Sw9h7DmYI9nM6YVHw/7WdEHg4t X-Received: by 2002:aa7:d58e:0:b0:443:9d64:5877 with SMTP id r14-20020aa7d58e000000b004439d645877mr8700415edq.18.1660610905885; Mon, 15 Aug 2022 17:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610905; cv=none; d=google.com; s=arc-20160816; b=JFQdoXh4uNtFmNMRSfsV+WunxMU4NJa/b2NGdP1Se6iyUmvmgt7u95ic7J1hWtHMkE UJLfzm1VuhZ5pCu3SZLuBino0DEIBMXZM9tPJK9IbGF78mVqJTTy6BuuM9MVgK93Lif1 yf6VcCFGkys5m4v4BLc8kVSUMlOz4zKFPZWqsjO2ec9yulORlPF7vg1Y29TPy5BII++1 GiRDD1exCKs/GL5Scp3y1rNo/KEuwDdDM+aF98SFpXOxxtm1ioXEMg5iqUHTc8MfReE2 eFIff2J8jeQsMHDe8AoK0drDvi+QZ6VSdb00o0b8Rr7XFuJiJGsqiKuDyzJ/YXQxSf5j lTDg== 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=geImZ7DK0VeUmjJ/n+934W6z47RMVH9UxhBckAoC9GIK8JSLw0EbKuqrRyidR4JgJp 1LSx9bUBSLxm0l5xu9+sudG+YPYPkdR3BbHrXm/5JuiraW4hzaVhw5rFnjdhMFNRhHu2 lDVXPaBh6Pag5JzCvIFxBFjmxw9sN0UAyRiIZaaxFkAhAxVVKnIvA2Q54cRjBp5SO6jc 9pZSnjjbNGWlW7OEObxxkFNOQM4Vqz3pUmKkPDte0dKWIbbkefxZT5q6/ZL1fQR82H2/ j8E4mn1lWABX/Sw2dMNmEsQ3+7EwQMiu8gDZIU/b3lmCQ3js97i+qesCWKWGZz7e8Kx+ GB2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VkWP08OR; 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 dt20-20020a170907729400b00734bc2f6bb1si9979781ejc.801.2022.08.15.17.48.01; Mon, 15 Aug 2022 17:48:25 -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=VkWP08OR; 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 S1353370AbiHOXe0 (ORCPT + 99 others); Mon, 15 Aug 2022 19:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352832AbiHOX1h (ORCPT ); Mon, 15 Aug 2022 19:27:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0BFC14D722; Mon, 15 Aug 2022 13:07:22 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2366FB80EAD; Mon, 15 Aug 2022 20:07:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ECA9C433D6; Mon, 15 Aug 2022 20:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594039; bh=ZVE2RNHPOttuDHZ2xX2gbbcEhpFNhv9Nt5X6GeRZKSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VkWP08ORQ9PtPN7Mzdle9M/hAVKlXcelGbkgd0qOqBUhS/EKcrgG5f3IWAfpXKAGY pih3xQvWhJm3AYZWXY/s5d3qU2h8eROXz505NQ878M4N4Hq04+8PbSuCpalfnC1Z0T mJkappOehipy8pTdlE63bt+8qC3lCLRgTij/AmDY= 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.18 1046/1095] batman-adv: tracing: Use the new __vstring() helper Date: Mon, 15 Aug 2022 20:07:25 +0200 Message-Id: <20220815180512.360819821@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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