From patchwork Wed Apr 17 12:31:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1924623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=l2dDpgQL; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=EeiTrnUN; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=h4ozlpGf; dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=fhrXPCvh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VKKyy5fnZz1yPv for ; Wed, 17 Apr 2024 22:31:38 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id BC6793CFBA5 for ; Wed, 17 Apr 2024 14:31:36 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 08A4E3CFA00 for ; Wed, 17 Apr 2024 14:31:18 +0200 (CEST) Authentication-Results: in-7.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.cz (client-ip=195.135.223.130; helo=smtp-out1.suse.de; envelope-from=pvorel@suse.cz; receiver=lists.linux.it) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id E261D201167 for ; Wed, 17 Apr 2024 14:31:17 +0200 (CEST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CE1B333C39; Wed, 17 Apr 2024 12:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1713357077; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CvJS9AuGLxxauzG4fmJDjhpr57x6FDhbkTb0W0eCEqo=; b=l2dDpgQLE27ziAxFTBzInssQLQUzp8z24EcMPUPbVS1PmA7rEPFfuD7t3U3MkFP8o7wkN5 vsl27+cGBy5wPa53CCPtmA+EZqja3Mmm6zWy00T9clgOys8cXXghKeOnaZ5DGYidx0yeFV +25P4lwtHdWX7FIK3LUp8j7jRxDko3U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1713357077; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CvJS9AuGLxxauzG4fmJDjhpr57x6FDhbkTb0W0eCEqo=; b=EeiTrnUNv7PQAbUu8mB2LtTJbIUKZqvSergMI0k7h/JtJAyuClzltHPLgmIvTj2BYX5ok7 bW4yBcrHEBAeOVAQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=h4ozlpGf; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=fhrXPCvh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1713357076; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CvJS9AuGLxxauzG4fmJDjhpr57x6FDhbkTb0W0eCEqo=; b=h4ozlpGfIYs/WP222AlPQs2q3KjYVAVIc0G3yq7kr5gPiz2P4dM5G4IIINyD2IztDoI8A4 HKV8iZD9nw/2RRAmDll65HbGSx8/mL9KtgcxvL4dFRw1qowC/d0wLiQ7e97+J7cOx86Ko2 eiRwLgkDnj3++HwNdo63XDXxon1LN3Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1713357076; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CvJS9AuGLxxauzG4fmJDjhpr57x6FDhbkTb0W0eCEqo=; b=fhrXPCvhG/VO1B8SeluMY1GBhlFJdclGh9WUzX2dYl5sPWS+Oai85t4M3FEFKFe2BDFuL1 Fe3yR+WDHRVq5wBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5C8E51384C; Wed, 17 Apr 2024 12:31:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id X+uEFRTBH2aiHgAAD6G6ig (envelope-from ); Wed, 17 Apr 2024 12:31:16 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Wed, 17 Apr 2024 14:31:12 +0200 Message-ID: <20240417123113.731780-1-pvorel@suse.cz> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: CE1B333C39 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.cz:dkim,suse.cz:email]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[suse.cz:+] X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-7.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-7.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH 1/2] libswap: Move file & line macros to macros X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Having __FILE__ and __LINE__ in C function does not help, they must be in macros to help identify the caller. Therefore make_swapfile_() wrapper is not needed. Fixes: f987ffff5 ("libswap: add two methods to create swapfile") Signed-off-by: Petr Vorel Reviewed-by: Li Wang Reviewed-by: Cyril Hrubis --- include/libswap.h | 16 +++++----------- libs/libltpswap/libswap.c | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/libswap.h b/include/libswap.h index 96e718542..87e32328e 100644 --- a/include/libswap.h +++ b/include/libswap.h @@ -19,41 +19,35 @@ enum swapfile_method { /* * Create a swapfile of a specified size or number of blocks. */ -int make_swapfile_(const char *file, const int lineno, +int make_swapfile(const char *file, const int lineno, const char *swapfile, unsigned int num, int safe, enum swapfile_method method); -static inline int make_swapfile(const char *swapfile, unsigned int num, - int safe, enum swapfile_method method) -{ - return make_swapfile_(__FILE__, __LINE__, swapfile, num, safe, method); -} - /** * Macro to create swapfile size in megabytes (MB). */ #define MAKE_SWAPFILE_SIZE(swapfile, size) \ - make_swapfile(swapfile, size, 0, SWAPFILE_BY_SIZE) + make_swapfile(__FILE__, __LINE__, swapfile, size, 0, SWAPFILE_BY_SIZE) /** * Macro to create swapfile size in block numbers. */ #define MAKE_SWAPFILE_BLKS(swapfile, blocks) \ - make_swapfile(swapfile, blocks, 0, SWAPFILE_BY_BLKS) + make_swapfile(__FILE__, __LINE__, swapfile, blocks, 0, SWAPFILE_BY_BLKS) /** * Macro to safely create swapfile size in megabytes (MB). * Includes safety checks to handle potential errors. */ #define SAFE_MAKE_SWAPFILE_SIZE(swapfile, size) \ - make_swapfile(swapfile, size, 1, SWAPFILE_BY_SIZE) + make_swapfile(__FILE__, __LINE__, swapfile, size, 1, SWAPFILE_BY_SIZE) /** * Macro to safely create swapfile size in block numbers. * Includes safety checks to handle potential errors. */ #define SAFE_MAKE_SWAPFILE_BLKS(swapfile, blocks) \ - make_swapfile(swapfile, blocks, 1, SWAPFILE_BY_BLKS) + make_swapfile(__FILE__, __LINE__, swapfile, blocks, 1, SWAPFILE_BY_BLKS) /* * Check swapon/swapoff support status of filesystems or files diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c index 313a15f24..b4233be0d 100644 --- a/libs/libltpswap/libswap.c +++ b/libs/libltpswap/libswap.c @@ -133,7 +133,7 @@ out: return contiguous; } -int make_swapfile_(const char *file, const int lineno, +int make_swapfile(const char *file, const int lineno, const char *swapfile, unsigned int num, int safe, enum swapfile_method method) { From patchwork Wed Apr 17 12:31:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1924622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=Fpsr7uNH; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=OLocFwd0; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=Fpsr7uNH; dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=OLocFwd0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VKKyg09yhz1yPv for ; Wed, 17 Apr 2024 22:31:23 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 98C173CFB8E for ; Wed, 17 Apr 2024 14:31:20 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 6EA903CFA00 for ; Wed, 17 Apr 2024 14:31:18 +0200 (CEST) Authentication-Results: in-4.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.cz (client-ip=195.135.223.130; helo=smtp-out1.suse.de; envelope-from=pvorel@suse.cz; receiver=lists.linux.it) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id E190A100114B for ; Wed, 17 Apr 2024 14:31:17 +0200 (CEST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5E21033C33; Wed, 17 Apr 2024 12:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1713357077; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+f1JHNz7oiUppdNkKvT1qPhA4l17qio33LxHsaFGt2g=; b=Fpsr7uNHiaO1Pcm3wd9huiKFQwYJdcFkqNrii9L0NXrp99neNJa6YccDIAtUquqHkCsZ3J RI2+K7Ht6t8WNSPIF7kNwdgvF2WvcpeacCrxiUf3cDmWXSJmK1XD1fXwV5YqwcDA12LwYW XWBEeT/SbKGkOlJZ7p+XcbyIZtEmd9c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1713357077; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+f1JHNz7oiUppdNkKvT1qPhA4l17qio33LxHsaFGt2g=; b=OLocFwd0D7qxzNBzhNNtCx3Il7kRAG8Lf2ZqanXSMeyKWlcUZbXdFMPNYQuEHiBatJp0K8 D+0OfVZaUJrAfqCQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Fpsr7uNH; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=OLocFwd0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1713357077; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+f1JHNz7oiUppdNkKvT1qPhA4l17qio33LxHsaFGt2g=; b=Fpsr7uNHiaO1Pcm3wd9huiKFQwYJdcFkqNrii9L0NXrp99neNJa6YccDIAtUquqHkCsZ3J RI2+K7Ht6t8WNSPIF7kNwdgvF2WvcpeacCrxiUf3cDmWXSJmK1XD1fXwV5YqwcDA12LwYW XWBEeT/SbKGkOlJZ7p+XcbyIZtEmd9c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1713357077; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+f1JHNz7oiUppdNkKvT1qPhA4l17qio33LxHsaFGt2g=; b=OLocFwd0D7qxzNBzhNNtCx3Il7kRAG8Lf2ZqanXSMeyKWlcUZbXdFMPNYQuEHiBatJp0K8 D+0OfVZaUJrAfqCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E979513976; Wed, 17 Apr 2024 12:31:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id +Ju+NBTBH2aiHgAAD6G6ig (envelope-from ); Wed, 17 Apr 2024 12:31:16 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Wed, 17 Apr 2024 14:31:13 +0200 Message-ID: <20240417123113.731780-2-pvorel@suse.cz> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240417123113.731780-1-pvorel@suse.cz> References: <20240417123113.731780-1-pvorel@suse.cz> MIME-Version: 1.0 X-Spam-Level: X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:dkim,suse.cz:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[suse.cz:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 5E21033C33 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: -3.01 X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-4.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-4.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH 2/2] libswap: Use tst_res_() instead of tst_res() X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" That allows to identify the caller of the function. That is the reason why tst_brk_() was already used instead of tst_brk(). Fixes: f987ffff5 ("libswap: add two methods to create swapfile") Signed-off-by: Petr Vorel Reviewed-by: Li Wang --- libs/libltpswap/libswap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c index b4233be0d..aed76dfe2 100644 --- a/libs/libltpswap/libswap.c +++ b/libs/libltpswap/libswap.c @@ -149,18 +149,18 @@ int make_swapfile(const char *file, const int lineno, blk_size = fs_info.f_bsize; if (method == SWAPFILE_BY_SIZE) { - tst_res(TINFO, "create a swapfile size of %u megabytes (MB)", num); + tst_res_(file, lineno, TINFO, "create a swapfile size of %u megabytes (MB)", num); blocks = num * 1024 * 1024 / blk_size; } else if (method == SWAPFILE_BY_BLKS) { blocks = num; - tst_res(TINFO, "create a swapfile with %u block numbers", blocks); + tst_res_(file, lineno, TINFO, "create a swapfile with %u block numbers", blocks); } else { tst_brk_(file, lineno, TBROK, "Invalid method, please see include/libswap.h"); } /* To guarantee at least one page can be swapped out */ if (blk_size * blocks < pg_size) { - tst_res(TWARN, "Swapfile size is less than the system page size. " + tst_res_(file, lineno, TWARN, "Swapfile size is less than the system page size. " "Using page size (%lu bytes) instead of block size (%lu bytes).", (unsigned long)pg_size, blk_size); blk_size = pg_size;