Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp70642lqb; Tue, 4 Jun 2024 05:33:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7qkDMGdHFonZz1Li6ii07eiM4pZl3E+x1k++jpH9V+O47mUJaN1SmAJ9BZsRK4ltDhcQNSPn7xV/swF1z32QxwFW/GME12QcAE0/8Fg== X-Google-Smtp-Source: AGHT+IEsgKJzVifgruHkw2p61QzKAozFBwFmN6IYUzYjVHzQ1PCLyMBBaeT1M84RBppw22c3yeKd X-Received: by 2002:a81:cf0c:0:b0:627:df2a:6306 with SMTP id 00721157ae682-62c796ee3e1mr111861297b3.21.1717504429632; Tue, 04 Jun 2024 05:33:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717504429; cv=pass; d=google.com; s=arc-20160816; b=gTV3sRNmjS6xOLhPYk26CR9M1eYOmIWGxbI2iW26qKi02OrSLyMnff09xwWj15i6IU 22iwI+fYIE7kMykgBZ7Uq4mbsFuNmRxuJBGc/KjVg/Nd6ilmBw/nFQLlwKPGg8h1S89N O3GLPwuLMuxkhY9+Chy4zHbA9aSVmNbqA/1h99YeCQI/py/xYhTNcFPQMH66m/yTVttk yKtJlLDCTI1QafWUZABDN7ycllI92qBWyLxorrpPenBC5iwGnL5JC+GdR5dCg+LD2JQc 6xvGsDX5bTYF4KqPkRS0f1L03P+tH48zbOampFKiv/JhvmoVVhrjxowIl8it9HHw9Wl8 LDOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3hm8JZD/Uu53KILH4Z+apiOCSWKZ89tmhz9RtA/wLq8=; fh=1Z3qhxo9nIzwygh9/KCIQYF9VynDMQL0l6HwDh/8HYs=; b=P0SQajmlQ0X0vPr+uHarBJkfvzeVjzH1MYd7is1kOjGOeRW1rawlAQCCxjl4d6vPzY G63FU4W/+IfKXLjwBX8nwGcDRuLqPMmoFRSWEx4Qd0NNbPKA0/bs2gQN6OFusVo0tM4c 856snjaRNRQNYT8KRkVnWU1yj6HqGLCCuRNzjEebNmN+BLlpmbr07YitGsjrNEl7Nfdi s5h18lATtRnF9NJ58SDhxEr4VtijN5JyXGESJD2HlVEL/GtwDyS0HdyXyaDmlCQ6hsXC d7bSx7hsdglpIgDFAPd7jMJpCB2eqHt+9FqW7AIMrwO/DplM2jKjQnCRBodAJ6LCvp6D 2G4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Xd+73NHF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200605-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200605-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42b760si111618136d6.488.2024.06.04.05.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:33:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200605-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Xd+73NHF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200605-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200605-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F39041C20F81 for ; Tue, 4 Jun 2024 12:33:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5602146D45; Tue, 4 Jun 2024 12:32:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xd+73NHF" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58EAC146A9B; Tue, 4 Jun 2024 12:32:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717504371; cv=none; b=dB5YXVyWkJ79Yjj1YBJgPYkcepkZaA8df9t2HSlBhdJ0KgHPrtWV9Pm2IQbN4unafQ5Le0GzJHHg18LNDgXFop/jXgWdGdH8AU6IapFbx2IHrSkdv4mOY4hoGkknQx6xb0l/5YzI8IrPwWR2emy7IesvIeZJvnwh+YyUOj3szSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717504371; c=relaxed/simple; bh=WwmjeOQu72FaUg1dfsnXq/tC9I4b3h2WVybb3KIPNKs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KrEDFfFUJFc/6Y3cm0UpgbhYVzm0rmCOYUsR7sHWx9t8P+6BfVBBni5zWgJo+snGztgWffXztmxfB6IYdf5vi0BL9JL0ZBZElsVoRpK1ueSpacCekcieo6t7jE4etopgsHQzeZAB8hB85DRwLY3Ec5teFaj3iYg3TE2e0/f5T8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Xd+73NHF; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42111da672eso6641635e9.0; Tue, 04 Jun 2024 05:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717504367; x=1718109167; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3hm8JZD/Uu53KILH4Z+apiOCSWKZ89tmhz9RtA/wLq8=; b=Xd+73NHFMjM8sSXy0Ss2BEK6Q7Ux4B6MUsNgNfmEbTK1ZX0xAzEsAx8sfYWIv01k6Y NjBrKJtdvWJffkDF43EEWvi0BA8RA2s75rUeT5Gd4RbEXe2isbHszW614C4W2MlcEGA1 6y1+T1YCh61l+tVKzubDtBDutGm8Mmo4l5UybwC83ncTYyaGxDCYVnWugm6g7RXVsvxf A5VVGp1sR5zUKAcNt01XFBjlsft9O9vKpSuqPt0/gCPY7Q+4m17ifoBF33rPeq6rCTmG 2h6aMHMuXT1cbv0eC/i8DnC04fK2q4OpqD1D2HowW5sMfD4lxdiCkl2uubJi8VcZIwif s5Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717504367; x=1718109167; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3hm8JZD/Uu53KILH4Z+apiOCSWKZ89tmhz9RtA/wLq8=; b=Z3VSAb03/eDnvkLQMsY9J4ywwwzXWrXTaW10qy4TEAN/yTq6MkSgNApEnIfsYtyhCh yaqe5dVFL9endE7FnNAN8fbJirVTG4+CWM86rFQ66//lQXVH6Fq/vsoFG8mI1+it4ykP ZRv5F/ZyXQRLDXkZpCpVmxbizNbDa20Wacj9przA0JZG1KbVZ+Dry99sBtKDSaR/ECl3 DZP3eHSe0YLsyQFaCuKBOZfeZLhX8C1Plz/397h3ya6uhmgj2sFAiMXk0fzC/S1FCOa/ Km3GBi1i3qCsVidjhKnnKYfMtKxgWtTsuFR42e1OCXuFAnDvw68iKkcTkNa+CABA20n0 6SeQ== X-Forwarded-Encrypted: i=1; AJvYcCXA4ar67y2fCCf4Mn3BM+HgtdGpLp+Q5kw7lrMXflHVRiECYnf/3v4JlcxbHKNrhbrkoOb5/NK5WjWjzwEPViJFtLU2paL9dJkTgjryYeH/W4Zq2T9+/Zei3XkJae49e8jhXD2CnDOS7LFMXHHF X-Gm-Message-State: AOJu0Yw/tpAnqW+bwuwg7UDkdrOQBUMp9UwmxiWmg0HHvqlJ+26Kwix/ gTA0iL/Q2Nng8jTlLlD3KPQQixmFQ4PA0I6n8oFbm3vqvomZRURX X-Received: by 2002:adf:e289:0:b0:359:79f1:bab4 with SMTP id ffacd0b85a97d-35e0f30c9c3mr7466982f8f.3.1717504367544; Tue, 04 Jun 2024 05:32:47 -0700 (PDT) Received: from ivan-HLYL-WXX9.guest.codethink.co.uk ([167.98.27.226]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35e535567e9sm7209179f8f.21.2024.06.04.05.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:32:47 -0700 (PDT) From: Ivan Orlov To: brendan.higgins@linux.dev, davidgow@google.com, rmoar@google.com Cc: Ivan Orlov , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] kunit: string-stream: export non-static functions Date: Tue, 4 Jun 2024 13:32:00 +0100 Message-Id: <20240604123204.10412-2-ivan.orlov0322@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604123204.10412-1-ivan.orlov0322@gmail.com> References: <20240604123204.10412-1-ivan.orlov0322@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Export non-static functions from the string-stream.c file into the KUnit namespace in order to be able to access them from the KUnit core tests (when they are loaded as modules). Signed-off-by: Ivan Orlov --- lib/kunit/string-stream.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/kunit/string-stream.c b/lib/kunit/string-stream.c index 54f4fdcbfac8..a5e3339854da 100644 --- a/lib/kunit/string-stream.c +++ b/lib/kunit/string-stream.c @@ -10,7 +10,7 @@ #include #include #include - +#include #include "string-stream.h" @@ -86,6 +86,7 @@ int string_stream_vadd(struct string_stream *stream, return 0; } +EXPORT_SYMBOL_IF_KUNIT(string_stream_vadd); int string_stream_add(struct string_stream *stream, const char *fmt, ...) { @@ -98,6 +99,7 @@ int string_stream_add(struct string_stream *stream, const char *fmt, ...) return result; } +EXPORT_SYMBOL_IF_KUNIT(string_stream_add); void string_stream_clear(struct string_stream *stream) { @@ -113,6 +115,7 @@ void string_stream_clear(struct string_stream *stream) stream->length = 0; spin_unlock(&stream->lock); } +EXPORT_SYMBOL_IF_KUNIT(string_stream_clear); char *string_stream_get_string(struct string_stream *stream) { @@ -131,6 +134,7 @@ char *string_stream_get_string(struct string_stream *stream) return buf; } +EXPORT_SYMBOL_IF_KUNIT(string_stream_get_string); int string_stream_append(struct string_stream *stream, struct string_stream *other) @@ -148,11 +152,13 @@ int string_stream_append(struct string_stream *stream, return ret; } +EXPORT_SYMBOL_IF_KUNIT(string_stream_append); bool string_stream_is_empty(struct string_stream *stream) { return list_empty(&stream->fragments); } +EXPORT_SYMBOL_IF_KUNIT(string_stream_is_empty); struct string_stream *alloc_string_stream(gfp_t gfp) { @@ -168,6 +174,7 @@ struct string_stream *alloc_string_stream(gfp_t gfp) return stream; } +EXPORT_SYMBOL_IF_KUNIT(alloc_string_stream); void string_stream_destroy(struct string_stream *stream) { @@ -179,6 +186,7 @@ void string_stream_destroy(struct string_stream *stream) string_stream_clear(stream); kfree(stream); } +EXPORT_SYMBOL_IF_KUNIT(string_stream_destroy); static void resource_free_string_stream(void *p) { @@ -200,8 +208,10 @@ struct string_stream *kunit_alloc_string_stream(struct kunit *test, gfp_t gfp) return stream; } +EXPORT_SYMBOL_IF_KUNIT(kunit_alloc_string_stream); void kunit_free_string_stream(struct kunit *test, struct string_stream *stream) { kunit_release_action(test, resource_free_string_stream, (void *)stream); } +EXPORT_SYMBOL_IF_KUNIT(kunit_free_string_stream); -- 2.34.1