From patchwork Thu Feb 6 21:19:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13963791 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8ED031CEAC8 for ; Thu, 6 Feb 2025 21:21:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876914; cv=none; b=Qt4s0m3ExonrbQdv6YsBx3FVmwWdwDlKCtJkOX2OGKLzhhFGl/CeEtBV+S5pLXTEiZE4/h+C0U6KpwD/06B5kBQycwQuhxsW6LMv/sE6uBDPW1f51LcI3O83e934ZGenXynlOt0+B76ndM9gt8XPQxR7VpEPKT32rtFj9xq2M80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876914; c=relaxed/simple; bh=JUV36Ey7mkf9flasEnSj/dEVwniRaxehflYNZPYCaek=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qOvNoFIEq9fyBt1ZjqEIq/6eIeFpauZihb2EOHdne8oxh2eSs8yT+Xz1W5IBif8gN3vIwOoo2ZHCpbkXd0x3N9Ex1gUAwvGawgcu631sA1HztO5irJw92z0kaqjlf//H+j6MWcuF2XnEvi2CQ36QPxvlD2nb6OJ8PAVN0muu1k4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=NXvRxfb4; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NXvRxfb4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738876911; h=from:from:reply-to:subject:subject: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=lKwjKVNejs6w3Hw0cmKUpZYv+RNLmLTojt4wHh6J1t0=; b=NXvRxfb4aO11BXdBKCAZOB3+qynskHpGAMsrOImReFEoFYOPhadftQbFZ7Wz1lc6nFjLk9 jy2qg3J8JVW44eCsbsI0NilxybkS0yfiKPAsnJYahBEue64dQsRkmJ7KstW7v6tKY+raYL pKgkmTdexwFBqOf7wM6N7+kvnMoJ/Lw= Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-PHsI0m7EO5aQXTBVLyCqPQ-1; Thu, 06 Feb 2025 16:21:50 -0500 X-MC-Unique: PHsI0m7EO5aQXTBVLyCqPQ-1 X-Mimecast-MFC-AGG-ID: PHsI0m7EO5aQXTBVLyCqPQ Received: by mail-il1-f200.google.com with SMTP id e9e14a558f8ab-3ce7a0ec1easo9975815ab.0 for ; Thu, 06 Feb 2025 13:21:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738876909; x=1739481709; 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=lKwjKVNejs6w3Hw0cmKUpZYv+RNLmLTojt4wHh6J1t0=; b=wD10CYzTQEm8AgE0uoE5wxSyj+yVzuvHszsquVOW0F4RyKHHm1Z9NgBpaNP0fS0HJK Qwn2MfyQqOdl47xfClLmbDFBtxgkxolnMXciVnn9drfojBW0WC0EWYes4DkriRH8i5yt R7jM4579gxIMXp5BIbyy7L9W2/OB1hfpV+o4TEY4iyqvb8VUBvrnyPI7hHEnOsVgWrV2 zeOSi+97EW2tJJ/HF9ebax+uus+m1ySd0AjuM01EU+u4FlGGHflGOu+u4y+ALI9deDY8 zMM4Q8VORndPOWVUR3aTXvKpnJpvbFx3jOxP1H954R0FHYRKc0o7boN/fw0qY7VsQSVJ T9aw== X-Gm-Message-State: AOJu0YwZeunOxe+pqatd5iEjBdLi7SGFFpvNX1FGtyG1ltjvAotIWoIs nzemTsKaNvATvk8A6MWCNOB8tGbo6SfrdijAAt2mGvpMEKFECaLEH8bLS6C/1FaHKRV+nnccn1I YT82HsCKrBP9fdcJPAhRsNO/ltgax4BOE88oL7DrD2QbQC+3ZgK2wblUEBDe8giZiRNc1Vqv7W3 ghrOG6vSD0+zAlfBO+OpjHeDVQKVRqcFVh3D5/YAmQ X-Gm-Gg: ASbGncsH0WWWMm/LkvpjXTE17XVUiWRO6gcDfLydrTcFAv2mafDneD40kbHx6cTPhZx RGgo9zlBLvm6vwwGdo83Bt2fOQYxsN5b4nPX1tDSEhCnoWP7EOE8TO0RH5dPCaEbiF2X9litxn2 itYBeVswSGf7XP96t4uBBnVXu2cssWZ4UaBVVR7DNWZE/Ot/3SbTuTkrXZyv9Lefyv+y/3nxrP5 U81Cpv0fv92jCSYYkTjqU4nlukiXu/cue0YmVawOQFAii/Uir5kTj3wHyxhhXBX8ew3iHEQiO3V AkgU0O/sHBrKQMFOlnxfOdI9afVzRDXXGCFBTC9iqPbafKYAoP/41Q== X-Received: by 2002:a05:6e02:1a0d:b0:3d0:137a:8c9d with SMTP id e9e14a558f8ab-3d13dd13f7emr5950165ab.8.1738876909067; Thu, 06 Feb 2025 13:21:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9Jfa1UGfrBA9GWTTl0dB7FwgXfnuG59VU6axbFSkIH9qBPyIoOtJtMkft8DxWjcvSXBC3Dg== X-Received: by 2002:a05:6e02:1a0d:b0:3d0:137a:8c9d with SMTP id e9e14a558f8ab-3d13dd13f7emr5949955ab.8.1738876908688; Thu, 06 Feb 2025 13:21:48 -0800 (PST) Received: from fedora-rawhide.sandeen.net (97-116-166-216.mpls.qwest.net. [97.116.166.216]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4eccf9afe8bsm435133173.6.2025.02.06.13.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 13:21:48 -0800 (PST) From: Eric Sandeen To: fstests@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 1/7] fstests: enable sparse checking with make C=[12] Date: Thu, 6 Feb 2025 15:19:56 -0600 Message-ID: <20250206212145.7732-2-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250206212145.7732-1-sandeen@redhat.com> References: <20250206212145.7732-1-sandeen@redhat.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Enable "make C=1" sparse checking when files get rebuilt. To check all files, run "make clean" first. Enable "make C=2" sparse checking of all files without rebuilding them. Signed-off-by: Eric Sandeen Reviewed-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- Makefile | 14 ++++++++++++++ include/buildrules | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/Makefile b/Makefile index f6f91a4d..79779d5e 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,20 @@ else Q = @ endif +CHECK=sparse +CHECK_OPTS=-Wsparse-all -Wbitwise -Wno-transparent-union -Wno-return-void -Wno-undef \ + -Wno-non-pointer-null -D__CHECK_ENDIAN__ -D__linux__ + +ifeq ("$(origin C)", "command line") + CHECK_CMD=$(CHECK) $(CHECK_OPTS) + CHECKSRC=$(C) +else + CHECK_CMD=@true + CHECKSRC=0 +endif + +export CHECK_CMD CHECKSRC + MAKEOPTS = --no-print-directory Q=$(Q) TOPDIR = . diff --git a/include/buildrules b/include/buildrules index bf187662..6c2b7e18 100644 --- a/include/buildrules +++ b/include/buildrules @@ -35,6 +35,21 @@ endif # Standard targets # +ifeq ($(CHECKSRC),2) + +# Check every .c file with sparse CHECK_CMD, do not call compiler +$(LTCOMMAND) $(LTLIBRARY) : $(SUBDIRS) $(OBJECTS) +.PHONY: $(LTCOMMAND) $(LTLIBRARY) + +%.lo %.o : %.c FORCE + @echo " [CHECK] $<" + $(Q)$(CHECK_CMD) $(CFLAGS) $< + +FORCE: + +else +# Regular build, possibly calling sparse CHECK_CMD as well + ifdef LTCOMMAND $(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES) @echo " [LD] $*" @@ -49,12 +64,16 @@ $(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS) %.lo: %.c @echo " [CC] $@" $(Q)$(LTCOMPILE) -c $< + $(Q)$(CHECK_CMD) $(CFLAGS) $< else + %.o: %.c @echo " [CC] $@" $(Q)$(CC) $(CFLAGS) -c $< + $(Q)$(CHECK_CMD) $(CFLAGS) $< endif +endif ifdef POTHEAD %.pot: $(XGETTEXTFILES) From patchwork Thu Feb 6 21:19:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13963793 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EEBC1DF96F for ; Thu, 6 Feb 2025 21:21:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876914; cv=none; b=Sc1sH1eQElKZ+fPVvFKWnF6bbSUNciSh8LLeXPOsRYmpwpJjLDs4DOXFjAk8js0NIEbKL1XR4wHyRR+3910ylLcaowWnsScLUkDdza/fHRpCPiQKX7++84YUjFljbxm2adYSMC/3meR9TVSW4TpQh/51Z6q1re7TX1xBcLaIQRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876914; c=relaxed/simple; bh=2r92bRjaC0yhtEPXbWclHLXSmtabqHGp6bqVZo4hKh4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gGAaBZzUFq30LtXs1FwsCWIFugMqBN5h6fPljXnY7g5xUckyTAZlVh9F6MlH+SMO7sTwQB9sO7EVLSe5fwtvYu0Ic6FP4XL8bpJZrlXzvwOr9810z5wEJGEU25Rhhk7GKNyM5XnSVl9Zn4kO09urItpH+3gsFWaQaDHeAjArEAk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BLtDIu7L; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BLtDIu7L" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738876912; h=from:from:reply-to:subject:subject: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=lA8i/oRdyCBlDg773iCwg2jTsbIUKoN2kaiGlFn877g=; b=BLtDIu7LaA0j9t3ZqqVcvizravHqKSOnKwDBygC2WcT6uReI2Sk+wUIRWj9PnsGdhzX3Cz wRofJcJELwsfSEs7HRGO8bgc0ImJ6YIYKUssODZT5Uoo1Vx+zjZnmeD0t8g0K4glfqISFN GfUNBZ1z5WkIbL47/uf1hcaKvnWDqfQ= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-175-gy8uYDDVNuevmErYDcQEJg-1; Thu, 06 Feb 2025 16:21:51 -0500 X-MC-Unique: gy8uYDDVNuevmErYDcQEJg-1 X-Mimecast-MFC-AGG-ID: gy8uYDDVNuevmErYDcQEJg Received: by mail-il1-f199.google.com with SMTP id e9e14a558f8ab-3d058142573so13433325ab.1 for ; Thu, 06 Feb 2025 13:21:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738876910; x=1739481710; 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=lA8i/oRdyCBlDg773iCwg2jTsbIUKoN2kaiGlFn877g=; b=C5M7j3PXRC092qRt788DuNQNWMtTb3VIa1wjBI0gpzXcS/Xj+ZVCD8a6U+alZfEFtH YFuydinFx5vhVndCl1NtOEoNcaWfOx+fP7FAmZq6T06FBL6QN1isdoFo4tF9w9n7U0Q0 B1DQ5akNQZo1MNMVKkZ+b/geAqKXjZIyiEnpREC+NpM5m7BzremP8mATQDm6JRPQo+6z z7/PSrS6g7m1pAmg8poYKGpFAwhHjpMqUgWuy4KDiPNFnFTfbgZOb+NDTlCqVOpXSYwl XTHxYRD/NWxsq3QfDWttVdzee5BqMNy9IxmIIg6ULfyM5JM4ycXlNsz7moYtfsMZPANB JnBg== X-Gm-Message-State: AOJu0YzApxDvBuyod33kQerEUDffeYDtgus69nXxPilXJSR+o1ZNLuvi 9hq8Vo08QeWR+7LgW3dWnf5cBH0vWHrcGWjuV+QOvNafIBmeL8fRKpkeOB+83ImpDrcCHOgKUZE 2FHSggkdrG9JuIznBYZ8s3Ab3t3mQaaf+RG1vcHn7taltcJiGESZ4j84PBEPGfwjjRkbovhcC/0 49b3rRw4RWeIIj/dmAaft1GcemJv+D6cnLQAvrw9GS X-Gm-Gg: ASbGncusQln9j3CsIM3/tJW+eBtKJr7ipi1X8qqIwWe2rVbk02HI7RyXlEWkNV3iYBS oXW+l20vzWb2uOII/NPJRjPJF/beeHrU0nY0zhfnIr6RGyT8SMmZ0ITSsT2X4mQ4MRKvPKyh3zp kZ8Sez7QBjPfAiAXE7cgd1vspAShnodeNMYYtBENPgso/kc9V2mkcVf82kcNzgrjOQqSIh1N0U9 k6guiijFJkLaoAhrf8EMwzbCVIFOPjIvE2eNO+EbWWtvKqe9lP+U+koWxl5PKVLSdlDd3+fQIXI VmFOokZFd+/lKjv6Jpgz0vpbfYalH/j4+wZnvLzy0HI6/bjubRinaQ== X-Received: by 2002:a05:6e02:20e8:b0:3ce:7a41:d885 with SMTP id e9e14a558f8ab-3d05a540706mr43220705ab.1.1738876910195; Thu, 06 Feb 2025 13:21:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZGL36BNOjat4wnL/U/JW6jVjbcBpOAI6xGXLK/jxiQD9pb755doCGlV3HuT7mgU/Hffjetg== X-Received: by 2002:a05:6e02:20e8:b0:3ce:7a41:d885 with SMTP id e9e14a558f8ab-3d05a540706mr43220555ab.1.1738876909876; Thu, 06 Feb 2025 13:21:49 -0800 (PST) Received: from fedora-rawhide.sandeen.net (97-116-166-216.mpls.qwest.net. [97.116.166.216]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4eccf9afe8bsm435133173.6.2025.02.06.13.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 13:21:49 -0800 (PST) From: Eric Sandeen To: fstests@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 2/7] builddefs: define linux Date: Thu, 6 Feb 2025 15:19:57 -0600 Message-ID: <20250206212145.7732-3-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250206212145.7732-1-sandeen@redhat.com> References: <20250206212145.7732-1-sandeen@redhat.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There are several #ifdef linux guards in the code, but nothing defined it. This caused several sparse warnings, so define it when building on linux. Signed-off-by: Eric Sandeen --- include/builddefs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/builddefs.in b/include/builddefs.in index 7274cde8..00dec0ea 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -78,7 +78,7 @@ HAVE_FICLONE = @have_ficlone@ GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall ifeq ($(PKG_PLATFORM),linux) -PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(GCCFLAGS) +PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -Dlinux $(GCCFLAGS) endif ifeq ($(PKG_PLATFORM),darwin) PCFLAGS = -traditional-cpp $(GCCFLAGS) From patchwork Thu Feb 6 21:19:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13963796 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E6F11DF99C for ; Thu, 6 Feb 2025 21:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876917; cv=none; b=XzzrO3FqtYsPKAY/3VCVZ+I9pCcoMlMEWQq5jbmAWCRnxRVl6/qavql/l7ZWQa+ejymrUbfNWivIRsDLJJUMZioOlmlg8MMEqM/v7HJFs75Vd1Ozb3foxIR78OT8ify7Ti1u+t0WKkt8HX+H79JHfCU+7NJ/paOucF9lWRc1p3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876917; c=relaxed/simple; bh=+6ceStr1pwa93vSTqO1+JxmhyghFa7UHh4dZyvMWuMw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rRFEH+COVlihVSxFLPZ/ER7Ee+7zFPP5sXhaTlX4l8x7yTDtDs0UpO7X1sAotQ6oSgQhskze50z3nm5ddcZe31akJvLHEmLdj9BfznkSq4MzmTDFTKYS9ChG4rzcD0gKgEOLE3X+sQ3EnsAdFC+wDT3dDwXt1ChIxJTA9mNqkyM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gAit6mE8; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gAit6mE8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738876913; h=from:from:reply-to:subject:subject: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=kRZdQCp2QG2WlZHDNniYpt/U4I7+MZLg527LTl2mfgM=; b=gAit6mE8kgeoLM1D59xCdX13ekIy6d2A3e/K3FB5yyJ/tLzStMTeewYGxKFMlN+XasnAiu P3cgSHZ80vOEZB24ydh9kP30t3nNsn4dXCJdFawIQD/gghKJxpjGu0BBmsgShYlDMdBUtE oAKedno1sliU8LaOqYHIwuvvSktoMkM= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-283-PGjMFrvzM7O-RjL1lRPf3A-1; Thu, 06 Feb 2025 16:21:52 -0500 X-MC-Unique: PGjMFrvzM7O-RjL1lRPf3A-1 X-Mimecast-MFC-AGG-ID: PGjMFrvzM7O-RjL1lRPf3A Received: by mail-il1-f198.google.com with SMTP id e9e14a558f8ab-3d13d1f8420so2105995ab.1 for ; Thu, 06 Feb 2025 13:21:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738876911; x=1739481711; 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=kRZdQCp2QG2WlZHDNniYpt/U4I7+MZLg527LTl2mfgM=; b=a7fTD2KutYG6MRisPBneVyOHfNDhPxedn8IPs7LvVMR6wI1WbJAms/n+6Yy9jSrLwP eMUlR/VHxbikgAgQ/mX4HG36kEerUwJ3Ycp/uMAaXgAFdSzFewo8mZRQifj69SYzytwu ph9rfKuiK+bebYiEqj13VWzhJ7yAz5BNR8Nnfs3ubvMKFMiHrZULkdoV4PGPBKOT/Q32 L9RnqMygN3uqVUfYPvyXE0yHXDPht9kx7+eGf0PYNRQEHG1ZkHnszG5g03TQwlPqj0hl 3+Vk/73zGBtAAZt7Hf4I0ydHo6235x6xk4IJM1wBSZa5E3XwJRNmiibrWH5nO6+fNgE9 bgGQ== X-Gm-Message-State: AOJu0YxMR+qbD66XKiwleze09hXimuMcuUa7BWRZixj7gKVyEm6mZra1 O1z5LXQ6UWrzHmGbW2YcjrOZ4oEGE5MD/dgsUjnd5bbDxJOQgJ0uBP8fsJZ6FrnblcsKcXFVh88 hjH1k2uV9f1X1zJBHscz4wBMvaF0mRSfh7ncGiIxTegIP67Cq6u9Sp+iVAX1deweK6iSKIsdnbm u2Mqmn6UV9F70y51QdQbrIEuCMOnJ2a4J6J+qfN6u9 X-Gm-Gg: ASbGnctkCQGLAmArd8WCwtHz2zJW5OprDoy6x8iC1423Y1m03dvJtGtZGZLJkYWde6R s9YUbtQVqC8eotcIy5HI/20ghTV3ljrHyN87K5Mk5gJnpRFFLvQrP9WsHPKyCw658mxnbS7Z8PQ uiJ6hRgFHLFMuoqz5qN4AMRKmXwfqWXaQ4nbKV+HMG+3SxZhuxtKriob07w6THVHKN4QnZ0alnN tFHqZMKFMzwiBr1yeJ4zmy24uxl2svEOrG/IlLaUThVxrEH119LgwZ/IH1PF3n7wnvb4OzyZtDv wjXCcJI0ML930iSbXGhMN6+zN3Au9QiwWFHozyAJesWp7BnuPORzQw== X-Received: by 2002:a05:6e02:12c1:b0:3cf:b9b8:5052 with SMTP id e9e14a558f8ab-3d13dcd8ffamr5404995ab.3.1738876911134; Thu, 06 Feb 2025 13:21:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUV5m7HDJuLHkvHNZTGs2zNdIQLGXh5K+HXV5CVrIH00fDOyboBC2VbwWh52Xn0BqyrMwNmg== X-Received: by 2002:a05:6e02:12c1:b0:3cf:b9b8:5052 with SMTP id e9e14a558f8ab-3d13dcd8ffamr5404755ab.3.1738876910571; Thu, 06 Feb 2025 13:21:50 -0800 (PST) Received: from fedora-rawhide.sandeen.net (97-116-166-216.mpls.qwest.net. [97.116.166.216]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4eccf9afe8bsm435133173.6.2025.02.06.13.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 13:21:50 -0800 (PST) From: Eric Sandeen To: fstests@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 3/7] lib: Fix non-ANSI function declarations Date: Thu, 6 Feb 2025 15:19:58 -0600 Message-ID: <20250206212145.7732-4-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250206212145.7732-1-sandeen@redhat.com> References: <20250206212145.7732-1-sandeen@redhat.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 lib/ was full of non-ANSI function declarations, fix them to make sparse happier. Signed-off-by: Eric Sandeen Reviewed-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- lib/dataascii.c | 59 +++++++++++++++++++++----------------------- lib/databin.c | 28 ++++++++++----------- lib/datapid.c | 32 +++++++++--------------- lib/file_lock.c | 12 ++------- lib/forker.c | 19 ++++++--------- lib/pattern.c | 14 ++--------- lib/random_range.c | 61 ++++++++++++++-------------------------------- lib/str_to_bytes.c | 9 +++---- lib/tlibio.c | 50 ++++++++++++++++++------------------- lib/write_log.c | 32 ++++++++---------------- 10 files changed, 119 insertions(+), 197 deletions(-) diff --git a/lib/dataascii.c b/lib/dataascii.c index e2509f8d..d11609ee 100644 --- a/lib/dataascii.c +++ b/lib/dataascii.c @@ -17,18 +17,18 @@ static char Errmsg[80]; int -dataasciigen(listofchars, buffer, bsize, offset) -char *listofchars; /* a null terminated list of characters */ -char *buffer; -int bsize; -int offset; +dataasciigen( + char *listofchars, /* a null terminated list of characters */ + char *buffer, + int bsize, + int offset) { - int cnt; - int total; - int ind; /* index into CHARS array */ - char *chr; - int chars_size; - char *charlist; + int cnt; + int total; + int ind; /* index into CHARS array */ + char *chr; + int chars_size; + char *charlist; chr=buffer; total=offset+bsize; @@ -52,19 +52,19 @@ int offset; } /* end of dataasciigen */ int -dataasciichk(listofchars, buffer, bsize, offset, errmsg) -char *listofchars; /* a null terminated list of characters */ -char *buffer; -int bsize; -int offset; -char **errmsg; +dataasciichk( + char *listofchars, /* a null terminated list of characters */ + char *buffer, + int bsize, + int offset, + char **errmsg) { - int cnt; - int total; - int ind; /* index into CHARS array */ - char *chr; - int chars_size; - char *charlist; + int cnt; + int total; + int ind; /* index into CHARS array */ + char *chr; + int chars_size; + char *charlist; chr=buffer; total=offset+bsize; @@ -104,15 +104,12 @@ char **errmsg; * main for doing unit testing ***********************************************************************/ int -main(ac, ag) -int ac; -char **ag; +main(int ac, char **ag) { - -int size=1023; -char *buffer; -int ret; -char *errmsg; + int size=1023; + char *buffer; + int ret; + char *errmsg; if ((buffer=(char *)malloc(size)) == NULL ) { perror("malloc"); diff --git a/lib/databin.c b/lib/databin.c index 8a36dff3..000d0d1a 100644 --- a/lib/databin.c +++ b/lib/databin.c @@ -16,13 +16,13 @@ static char Errmsg[80]; void -databingen (mode, buffer, bsize, offset) -int mode; /* either a, c, r, o, z or C */ -unsigned char *buffer; /* buffer pointer */ -int bsize; /* size of buffer */ -int offset; /* offset into the file where buffer starts */ +databingen( + int mode, /* either a, c, r, o, z or C */ + unsigned char *buffer, /* buffer pointer */ + int bsize, /* size of buffer */ + int offset) /* offset into the file where buffer starts */ { -int ind; + int ind; switch (mode) { @@ -63,12 +63,12 @@ int ind; * < 0 : no error ***********************************************************************/ int -databinchk(mode, buffer, bsize, offset, errmsg) -int mode; /* either a, c, r, z, o, or C */ -unsigned char *buffer; /* buffer pointer */ -int bsize; /* size of buffer */ -int offset; /* offset into the file where buffer starts */ -char **errmsg; +databinchk( + int mode, /* either a, c, r, z, o, or C */ + unsigned char *buffer, /* buffer pointer */ + int bsize, /* size of buffer */ + int offset, /* offset into the file where buffer starts */ + char **errmsg) { int cnt; unsigned char *chr; @@ -138,9 +138,7 @@ char **errmsg; * main for doing unit testing ***********************************************************************/ int -main(ac, ag) -int ac; -char **ag; +main(int ac, char **ag) { int size=1023; diff --git a/lib/datapid.c b/lib/datapid.c index 15af8871..6786323d 100644 --- a/lib/datapid.c +++ b/lib/datapid.c @@ -57,15 +57,13 @@ static char Errmsg[80]; * Thus, offset 8 is in middle of word 1 ***********************************************************************/ int -datapidgen(pid, buffer, bsize, offset) -int pid; -char *buffer; -int bsize; -int offset; +datapidgen( + int pid, + char *buffer, + int bsize, + int offset) { return -1; /* not support on non-64 bits word machines */ - - } /*********************************************************************** @@ -73,12 +71,7 @@ int offset; * ***********************************************************************/ int -datapidchk(pid, buffer, bsize, offset, errmsg) -int pid; -char *buffer; -int bsize; -int offset; -char **errmsg; +datapidchk(int pid, char *buffer, int bsize, int offset, char **errmsg) { if ( errmsg != NULL ) { *errmsg = Errmsg; @@ -94,15 +87,12 @@ char **errmsg; * main for doing unit testing ***********************************************************************/ int -main(ac, ag) -int ac; -char **ag; +main( int ac, char **ag) { - -int size=1234; -char *buffer; -int ret; -char *errmsg; + int size=1234; + char *buffer; + int ret; + char *errmsg; if ((buffer=(char *)malloc(size)) == NULL ) { perror("malloc"); diff --git a/lib/file_lock.c b/lib/file_lock.c index f0791489..6d87e281 100644 --- a/lib/file_lock.c +++ b/lib/file_lock.c @@ -34,10 +34,7 @@ static char errmsg[256]; * It will loop if the LOCK_NB flags is NOT set. ***********************************************************************/ int -file_lock(fd, flags, errormsg) -int fd; -int flags; -char **errormsg; +file_lock(int fd, int flags, char **errormsg) { register int cmd, ret; struct flock flocks; @@ -109,12 +106,7 @@ char **errormsg; * It will loop if the LOCK_NB flags is NOT set. ***********************************************************************/ int -record_lock(fd, flags, start, len, errormsg) -int fd; -int flags; -int start; -int len; -char **errormsg; +record_lock(int fd, int flags, int start, int len, char **errormsg) { register int cmd, ret; struct flock flocks; diff --git a/lib/forker.c b/lib/forker.c index 63d8fcdb..10920ddb 100644 --- a/lib/forker.c +++ b/lib/forker.c @@ -105,8 +105,7 @@ int Forker_npids=0; /* number of entries in Forker_pids */ * !0 : if fork failed, the return value will be the errno. ***********************************************************************/ int -background(prefix) -char *prefix; +background(char *prefix) { switch (fork()) { case -1: @@ -131,12 +130,12 @@ char *prefix; * ***********************************************************************/ int -forker(ncopies, mode, prefix) -int ncopies; -int mode; /* 0 - all childern of parent, 1 - only 1 direct child */ -char *prefix; /* if ! NULL, an message will be printed to stderr */ - /* if fork fails. The prefix (program name) will */ - /* preceed the message */ +forker( + int ncopies, + int mode, /* 0: all childern of parent, 1: only 1 direct child */ + char *prefix) /* if ! NULL, an message will be printed to stderr */ + /* if fork fails. The prefix (program name) will */ + /* preceed the message */ { int cnt; int pid; @@ -210,9 +209,7 @@ char *prefix; /* if ! NULL, an message will be printed to stderr */ */ int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { int ncopies=1; int mode=0; diff --git a/lib/pattern.c b/lib/pattern.c index d622b935..20bbdc97 100644 --- a/lib/pattern.c +++ b/lib/pattern.c @@ -12,12 +12,7 @@ */ int -pattern_check(buf, buflen, pat, patlen, patshift) -char *buf; -int buflen; -char *pat; -int patlen; -int patshift; +pattern_check(char *buf, int buflen, char *pat, int patlen, int patshift) { int nb, ncmp, nleft; char *cp; @@ -79,12 +74,7 @@ int patshift; } int -pattern_fill(buf, buflen, pat, patlen, patshift) -char *buf; -int buflen; -char *pat; -int patlen; -int patshift; +pattern_fill(char *buf, int buflen, char *pat, int patlen, int patshift) { int trans, ncopied, nleft; char *cp; diff --git a/lib/random_range.c b/lib/random_range.c index 3fa01f0d..680bf71c 100644 --- a/lib/random_range.c +++ b/lib/random_range.c @@ -73,14 +73,14 @@ static int str_to_int(); static long long divider(long long, long long, long long, long long); int -parse_ranges(str, defmin, defmax, defmult, parse_func, rangeptr, errptr) -char *str; -int defmin; -int defmax; -int defmult; -int (*parse_func)(); -char **rangeptr; -char **errptr; +parse_ranges( + char *str, + int defmin, + int defmax, + int defmult, + int (*parse_func)(), + char **rangeptr, + char **errptr) { int ncommas; char *tmpstr, *cp, *tok, *n1str, *n2str, *multstr; @@ -194,9 +194,7 @@ char **errptr; */ static int -str_to_int(str, ip) -char *str; -int *ip; +str_to_int(char *str, int *ip) { char c; @@ -214,25 +212,19 @@ int *ip; */ int -range_min(rbuf, r) -char *rbuf; -int r; +range_min(char *rbuf, int r) { return ((struct range *)rbuf)[r].min; } int -range_max(rbuf, r) -char *rbuf; -int r; +range_max(char *rbuf, int r) { return ((struct range *)rbuf)[r].max; } int -range_mult(rbuf, r) -char *rbuf; -int r; +range_mult(char *rbuf, int r) { return ((struct range *)rbuf)[r].mult; } @@ -263,11 +255,7 @@ int r; *****************************************************************************/ long -random_range(min, max, mult, errp) -int min; -int max; -int mult; -char **errp; +random_range(int min, int max, int mult, char **errp) { int r, nmults, orig_min, orig_max, orig_mult, tmp; extern long lrand48(); @@ -333,11 +321,7 @@ char **errp; * Just like random_range, but all values are longs. */ long -random_rangel(min, max, mult, errp) -long min; -long max; -long mult; -char **errp; +random_range1(long min, long max, long mult, char **errp) { long r, nmults, orig_min, orig_max, orig_mult, tmp; extern long lrand48(); @@ -424,11 +408,7 @@ char **errp; * Attempts to be just like random_range, but everything is long long (64 bit) */ long long -random_rangell(min, max, mult, errp) -long long min; -long long max; -long long mult; -char **errp; +random_rangell(long long min, long long max, long long mult, char **errp) { long long r, nmults, orig_min, orig_max, orig_mult, tmp; long long randnum; @@ -588,8 +568,7 @@ printf(" diff = %lld, half = %lld, med = %lld\n", diff, half, med); *****************************************************************************/ void -random_range_seed(s) -long s; +random_range_seed(long s) { extern void srand48(); @@ -652,9 +631,7 @@ random_bit(long mask) /* * The following is a unit test main function for random_bit(). */ -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { int ind; int cnt, iter; @@ -695,9 +672,7 @@ char **argv; #define MEG 1024*1024*1024 #define GIG 1073741824 int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { int ind; int cnt, iter=10; diff --git a/lib/str_to_bytes.c b/lib/str_to_bytes.c index 2f6b2b92..20cd2a0f 100644 --- a/lib/str_to_bytes.c +++ b/lib/str_to_bytes.c @@ -42,8 +42,7 @@ #define T_MULT 1099511627776 /* tera or 2^40 */ int -str_to_bytes(s) -char *s; +str_to_bytes(char *s) { char mult, junk; int nconv; @@ -77,8 +76,7 @@ char *s; } long -str_to_lbytes(s) -char *s; +str_to_lbytes(char *s) { char mult, junk; long nconv; @@ -117,8 +115,7 @@ char *s; */ long long -str_to_llbytes(s) -char *s; +str_to_llbytes(char *s) { char mult, junk; long nconv; diff --git a/lib/tlibio.c b/lib/tlibio.c index f7259734..3c23bf4d 100644 --- a/lib/tlibio.c +++ b/lib/tlibio.c @@ -143,13 +143,13 @@ static int Debug_level = 0; ***********************************************************************/ int -stride_bounds(offset, stride, nstrides, bytes_per_stride, min, max) -int offset; -int stride; -int nstrides; -int bytes_per_stride; -int *min; -int *max; +stride_bounds( + int offset, + int stride, + int nstrides, + int bytes_per_stride, + int *min, + int *max) { int nbytes, min_byte, max_byte; @@ -443,14 +443,14 @@ lio_random_methods(long curr_mask) * (rrl 04/96) ***********************************************************************/ int -lio_write_buffer(fd, method, buffer, size, sig, errmsg, wrd) -int fd; /* open file descriptor */ -int method; /* contains io type and wait method bitmask */ -char *buffer; /* pointer to buffer */ -int size; /* the size of the io */ -int sig; /* signal to use if async io */ -char **errmsg; /* char pointer that will be updated to point to err message */ -long wrd; /* to allow future features, use zero for now */ +lio_write_buffer( + int fd, /* open file descriptor */ + int method, /* contains io type and wait method bitmask */ + char *buffer, /* pointer to buffer */ + int size, /* the size of the io */ + int sig, /* signal to use if async io */ + char **errmsg, /* char pointer that will be updated to point to err message */ + long wrd) /* to allow future features, use zero for now */ { int ret = 0; /* syscall return or used to get random method */ #ifndef linux @@ -640,14 +640,14 @@ long wrd; /* to allow future features, use zero for now */ * (rrl 04/96) ***********************************************************************/ int -lio_read_buffer(fd, method, buffer, size, sig, errmsg, wrd) -int fd; /* open file descriptor */ -int method; /* contains io type and wait method bitmask */ -char *buffer; /* pointer to buffer */ -int size; /* the size of the io */ -int sig; /* signal to use if async io */ -char **errmsg; /* char pointer that will be updated to point to err message */ -long wrd; /* to allow future features, use zero for now */ +lio_read_buffer( + int fd, /* open file descriptor */ + int method, /* contains io type and wait method bitmask */ + char *buffer, /* pointer to buffer */ + int size, /* the size of the io */ + int sig, /* signal to use if async io */ + char **errmsg, /* char pointer that will be updated to point to err message */ + long wrd) /* to allow future features, use zero for now */ { int ret = 0; /* syscall return or used to get random method */ #ifndef linux @@ -1031,9 +1031,7 @@ struct unit_info_t { }; int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { extern char *optarg; extern int optind; diff --git a/lib/write_log.c b/lib/write_log.c index cdc72593..c82cc1f4 100644 --- a/lib/write_log.c +++ b/lib/write_log.c @@ -87,10 +87,7 @@ static int wlog_rec_unpack(); */ int -wlog_open(wfile, trunc, mode) -struct wlog_file *wfile; -int trunc; -int mode; +wlog_open(struct wlog_file *wfile, int trunc, int mode) { int omask, oflags; @@ -138,8 +135,7 @@ int mode; */ int -wlog_close(wfile) -struct wlog_file *wfile; +wlog_close(struct wlog_file *wfile) { close(wfile->w_afd); close(wfile->w_rfd); @@ -173,10 +169,7 @@ struct wlog_file *wfile; */ int -wlog_record_write(wfile, wrec, offset) -struct wlog_file *wfile; -struct wlog_rec *wrec; -long offset; +wlog_record_write(struct wlog_file *wfile, struct wlog_rec *wrec, long offset) { int reclen; char wbuf[WLOG_REC_MAX_SIZE + 2]; @@ -221,11 +214,11 @@ long offset; */ int -wlog_scan_backward(wfile, nrecs, func, data) -struct wlog_file *wfile; -int nrecs; -int (*func)(); -long data; +wlog_scan_backward( + struct wlog_file *wfile, + int nrecs, + int (*func)(), + long data) { int fd, leftover, nbytes, offset, recnum, reclen; char buf[BSIZE*32], *bufend, *cp, *bufstart; @@ -351,10 +344,7 @@ long data; */ static int -wlog_rec_pack(wrec, buf, flag) -struct wlog_rec *wrec; -char *buf; -int flag; +wlog_rec_pack(struct wlog_rec *wrec, char *buf, int flag) { char *file, *host, *pattern; struct wlog_rec_disk *wrecd; @@ -400,9 +390,7 @@ int flag; } static int -wlog_rec_unpack(wrec, buf) -struct wlog_rec *wrec; -char *buf; +wlog_rec_unpack(struct wlog_rec *wrec, char *buf) { char *file, *host, *pattern; struct wlog_rec_disk *wrecd; From patchwork Thu Feb 6 21:19:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13963794 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E74A1DFD84 for ; Thu, 6 Feb 2025 21:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876916; cv=none; b=XHxoUlaHCao0q/+sO6m7J1xGYkBYM4UOrWeHjUScuOW5FS3UXt7o7vLEwgnoJpHg5x5Stobpm7ewpA/qtV1nX2+8rKnGGZZHTYlHPwrHjKcf+VAL2t4gtO0SsBaVqAlo0YNUorre6LF/P40AXARmLKXPS6gQG5gs7z9g9x2tmuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876916; c=relaxed/simple; bh=z9lGMSHQ78g772E8GogNFFZQYFBCIgIevaF/yZDEHWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RU2jC0Ymz+UltKEKdWtDS1uwBIlky6L2w3+0t/fhch818DWcllGU+9NHU5M3VRsV56ZmQNsKsXzkC8vI7lMfN0F4jxUBW+gl4meD6sRocPd5wtQlp3esjzrY/9ruS7doxAcFSoLAewM5brZbKPzPqI61TQXOMM1lG4twi4HlRSo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PEdJg0VX; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PEdJg0VX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738876913; h=from:from:reply-to:subject:subject: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=YzSGFhL31AUY779ljL+xTCHmICNVaLEkmDk5MRhfzaw=; b=PEdJg0VXcDAsaqLefB2Nhmz+oAYa5RqHq4ytlm1psUf2RoGwwxgu4LudTEEaNePNM28YSP PLb4wPCbf2xnwasx0Bl54kAwmMxdYyk5wK0WINlZNJd0/+DoyuIbC7B09hejwnpxMaHZmI xOsuHUyPH7NYkT+zFzgk0U0xB8zJNUo= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-345-9gR8U1CqPiWLzb0eF6m-oA-1; Thu, 06 Feb 2025 16:21:52 -0500 X-MC-Unique: 9gR8U1CqPiWLzb0eF6m-oA-1 X-Mimecast-MFC-AGG-ID: 9gR8U1CqPiWLzb0eF6m-oA Received: by mail-il1-f197.google.com with SMTP id e9e14a558f8ab-3ce7a0ec1easo9976025ab.0 for ; Thu, 06 Feb 2025 13:21:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738876912; x=1739481712; 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=YzSGFhL31AUY779ljL+xTCHmICNVaLEkmDk5MRhfzaw=; b=hswNbDvbfdehcuOB1PIzx2G648NGO19vdYyxdd9lkpRUuOdtjlF+XF7dkDXGwpS592 K9QeAPR7dgaAB/uM0xED7SlsoGoziPK6umJn7W/dUJW9NpCnOoc/2pbqmxnjMBTMgjyF VxU7vv7uuK7Ciq2HkUdnCKwdX2/yahppZMS4JcL+QKtSBA+IG/T3Z0/wltOadGE0psmc IYauwUDG1lJwXnBzjMLrvrIPqSqJkfxG2EI93FWGbxMiAGfKSjIrGuCd8w65cO1pT1se 1+ZtP9E2qTjT0RMnSdywp9T0i8fVflrmho2ogZLLt+L72WRsDYAEVNDFk6zX+rslfNt7 SZ6Q== X-Gm-Message-State: AOJu0YwLggE+ouq5HbmTICySanGpEKE4zHqEIA2jQ+8idjiGscsrkjzh sb5EHScFl22Svj57MokcoaEG9df5XSnhcPYkjxbLzfZL9SoBIhUKUs6chOqL748Vrw93Bc/7G3Q LQ3XntvyWkFJHLN2OGFQ2N2HXzRxVJ9VtmBTAazEXsuYG9U7QbW6Ym60XwWWbWmJHxtMM5sY0B9 gtkjcaiC8nlv+8SwNtXVfzeqJBPoNPLQFzp34caF0i X-Gm-Gg: ASbGnctDGwKvsX/0ZACMz0fJfC00CKy4uEZQ88EwDJU0KgTP9Gv9i1Rjf0pAKQr/K7l ViJ5owgc4bXEPdKdVYv8ZbAPhb0MtuZpXBj8pOIOEKk0sf0jXJRYBpxZAmkvjRSIrCV+pN7M/xi B8wULtRo6qVMq5D0HCG5MVlb8U5Pk7LepkV7O6skoz3QoVfDaqyUowCtyLouexWgZMqxV9xz222 jgzUq5/m3yAhNGKlnR/0iim5ho30FNtMKLcBo1T62KcNdLv7r4COflN6RqhP8iOz0ddlwLjmYGL eSZ9jgVBL96L+ZLB/DAsw1woVImTdC9KSRCwIsCfwm0ZAtwffAQvGg== X-Received: by 2002:a05:6e02:1fe3:b0:3cf:c7d3:e4b with SMTP id e9e14a558f8ab-3d13df17868mr5671545ab.21.1738876911860; Thu, 06 Feb 2025 13:21:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFs/ybREdbhzX3Edy0EKkVRpAjC6a5s8cCJfmGcbm7HrjdGMLCAbUO4moxHUkTFnpco62wIlQ== X-Received: by 2002:a05:6e02:1fe3:b0:3cf:c7d3:e4b with SMTP id e9e14a558f8ab-3d13df17868mr5671335ab.21.1738876911345; Thu, 06 Feb 2025 13:21:51 -0800 (PST) Received: from fedora-rawhide.sandeen.net (97-116-166-216.mpls.qwest.net. [97.116.166.216]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4eccf9afe8bsm435133173.6.2025.02.06.13.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 13:21:51 -0800 (PST) From: Eric Sandeen To: fstests@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 4/7] lib: fix empty arg function prototypes Date: Thu, 6 Feb 2025 15:19:59 -0600 Message-ID: <20250206212145.7732-5-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250206212145.7732-1-sandeen@redhat.com> References: <20250206212145.7732-1-sandeen@redhat.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Several function prototypes used () when in fact they take arguments. Fix those to make sparse happy. Signed-off-by: Eric Sandeen Reviewed-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- include/random_range.h | 2 +- include/write_log.h | 2 +- lib/random_range.c | 6 ++---- lib/string_to_tokens.c | 1 - lib/tlibio.c | 2 +- lib/write_log.c | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/random_range.h b/include/random_range.h index b47aef9e..c352c5a9 100644 --- a/include/random_range.h +++ b/include/random_range.h @@ -6,7 +6,7 @@ #ifndef _RANDOM_RANGE_H_ #define _RANDOM_RANGE_H_ -int parse_ranges ( char *, int, int, int, int (*)(), char **, char ** ); +int parse_ranges ( char *, int, int, int, int (*)(char *, int *), char **, char ** ); int range_min ( char *, int ); int range_max ( char *, int ); int range_mult ( char *, int ); diff --git a/include/write_log.h b/include/write_log.h index 025ebac0..d02f898a 100644 --- a/include/write_log.h +++ b/include/write_log.h @@ -125,7 +125,7 @@ extern int wlog_close(struct wlog_file *wfile); extern int wlog_record_write(struct wlog_file *wfile, struct wlog_rec *wrec, long offset); extern int wlog_scan_backward(struct wlog_file *wfile, int nrecs, - int (*func)(struct wlog_rec *rec), + int (*func)(struct wlog_rec *rec, long data), long data); #else int wlog_open(); diff --git a/lib/random_range.c b/lib/random_range.c index 680bf71c..0b38eb7f 100644 --- a/lib/random_range.c +++ b/lib/random_range.c @@ -69,7 +69,7 @@ struct range { * parse_range() returns -1 on error, or the number of ranges parsed. */ -static int str_to_int(); +static int str_to_int(char *str, int *ip); static long long divider(long long, long long, long long, long long); int @@ -78,7 +78,7 @@ parse_ranges( int defmin, int defmax, int defmult, - int (*parse_func)(), + int (*parse_func)(char *str, int *ip), char **rangeptr, char **errptr) { @@ -570,8 +570,6 @@ printf(" diff = %lld, half = %lld, med = %lld\n", diff, half, med); void random_range_seed(long s) { - extern void srand48(); - srand48(s); } diff --git a/lib/string_to_tokens.c b/lib/string_to_tokens.c index 08df9fcc..8383ed4c 100644 --- a/lib/string_to_tokens.c +++ b/lib/string_to_tokens.c @@ -54,7 +54,6 @@ int string_to_tokens(char *arg_string, char *arg_array[], int array_size, char *separator) { int num_toks = 0; /* number of tokens found */ - char *strtok(); if ( arg_array == NULL || array_size <= 1 || separator == NULL ) return -1; diff --git a/lib/tlibio.c b/lib/tlibio.c index 3c23bf4d..19192b38 100644 --- a/lib/tlibio.c +++ b/lib/tlibio.c @@ -75,7 +75,7 @@ #ifndef linux -static void lio_async_signal_handler(); +static void lio_async_signal_handler(int sig); #endif /* diff --git a/lib/write_log.c b/lib/write_log.c index c82cc1f4..e04fed4b 100644 --- a/lib/write_log.c +++ b/lib/write_log.c @@ -217,7 +217,7 @@ int wlog_scan_backward( struct wlog_file *wfile, int nrecs, - int (*func)(), + int (*func)(struct wlog_rec *, long data), long data) { int fd, leftover, nbytes, offset, recnum, reclen; From patchwork Thu Feb 6 21:20:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13963795 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BC5F1D61A1 for ; Thu, 6 Feb 2025 21:21:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876917; cv=none; b=jixGnCkfuNfw7/4cakASzwMPr/TFDORQsG3J/gJhyIntBaHE+tKKF3kzdB3rFUTGp3DcStCffGSx+s54sMdzYled54K52HeF4hfqNxwcQyb82NZxyN/g8kQEhaKqWsgKWJWYLEpEUstzE+gxOaMXn37K2ublyDSvsaZC6YBMViU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876917; c=relaxed/simple; bh=AicclmB2sRoP/EDpIgd/7SciCzg3e/WnxEzLHRiFsw8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X6eBEpfX9ko1fV4w5TCaROqb3JVgynIDGJlVOuzkU2OFE8dytpFl4geEQEJW2wkpuRt/omBkESwOoEocdXZyWPO1h/GprDVuBUQiM2Z4KMYhRPMUsUmpsyLjO2+iJ3A1gwkMWb0R7TlSeSj4ke28v2ZqAXWB+/BKSwPIhwyvOxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IlWFMDLo; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IlWFMDLo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738876914; h=from:from:reply-to:subject:subject: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=e6lXaCMKFu4tHvUP4wEoX9HgIfpy5RxL4ebQs25fjnY=; b=IlWFMDLoeVo3DkXUr/+E6B+vebS3lbnL1VsbiVfOQhmmrz0Px0uOnEwZzJvhcDjd0baGkb 9r/z6iayhEXOb7uGotCMX89lu7FbFIkQmUQ2cRo6xRZ5yAUML3ZlAUdwYrL/q9dQtxxbUk hBAcEGs9BoA9qXVSnaDo4Qd3n2VzKn0= Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-264-xub8CcTjOzSuZAIQ753Zqw-1; Thu, 06 Feb 2025 16:21:53 -0500 X-MC-Unique: xub8CcTjOzSuZAIQ753Zqw-1 X-Mimecast-MFC-AGG-ID: xub8CcTjOzSuZAIQ753Zqw Received: by mail-il1-f200.google.com with SMTP id e9e14a558f8ab-3d04f44a8eeso26935375ab.3 for ; Thu, 06 Feb 2025 13:21:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738876912; x=1739481712; 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=e6lXaCMKFu4tHvUP4wEoX9HgIfpy5RxL4ebQs25fjnY=; b=HBrxLJ23WEJoqACxv5lXBdbhXVZ/hOugLLPlrsw3FrAkFp29tXGwKx7wp6UF3/ovIX 0oyITmbuC/+Ym2GvKuq4gXIFSmI/cXRF5jSHs2HQWaUd9AeDLQngH6Ctnn5KpAYCJHQt 190n3lgWjwn8ZTKzWX5LNetakcNYp7Rfip1UKUFVqiWWB6+tRQ7Q+lqMmX/V479l6ECN 0t/8dj9KG2LLarhuIfh3ylsHVKpLM9+7pTD8yqi0wcROl3quTHpVVk2SoP/bsUqT1/Hx yl4rm2XfkxZ5lJ9dFZjIFA7gEG9YWvRBz6d881eMhYJ/K4oKsesYxCnACBqU9qYpc5uf 3qvA== X-Gm-Message-State: AOJu0YwEpFrPMhVPpydSo4nvhJYQX6ZHcoHO05xKXSpw2F/P3VK/cdOP /BT5WzJku9zO87PwN3ZMc7m7yL3XMAYhkc2HM8A4DrhuWWlPNtV3NqpKCHyh0golR4AmWzvPfsh iZVTKVAW/RGxBzDd2JQpFts3qBKxsayWXWeCMjBAnBRgbSpif3Z4v2ZPGLP0KCvTd2rK2QLMjmT y1RN26HPizLoIW1hFWGTbLs9iYn1yqB0+dgNnUNg3R X-Gm-Gg: ASbGncumfdzQNMa75uAltc/Pg9ZCCJak48/7x3Ghfw9XAVDaLpcL+AWPlsH0QG6HyUX jE3TJtUwlCJKQvbh2RjdVKuu9P5T1qPGEx1sko4ng14kiVRnCvpXuKO5gAOyC79rm9149ua9aC+ xOn7laQgtabvI/KY6XQGmXSXy09x6uZDynnOLUdh2hLR31j2eJccdq4q27eWXw5yfSTPhxL+3Zp +j9lS3fy34s4d/NLdpycTQSBF99tNSlpLnLz0rXNVPwvOYg7X4wyOaZb/ZQ2JnOkgOiJRpg5tZP nru5YlZqY1t5KIZS/GC2kcS12Ww+ttvUMS+WoI/kahhlMlJIOBkHaQ== X-Received: by 2002:a05:6e02:20c9:b0:3cf:cdb8:78fb with SMTP id e9e14a558f8ab-3d13df0fb5fmr4825385ab.16.1738876912413; Thu, 06 Feb 2025 13:21:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4lBtPFOgehijg2gxSNaB3MKmnHbgcQ5yABdVgxD+Og5vA8OpSpvKVcJnPVxrkyFbg6Fh1cg== X-Received: by 2002:a05:6e02:20c9:b0:3cf:cdb8:78fb with SMTP id e9e14a558f8ab-3d13df0fb5fmr4825275ab.16.1738876912087; Thu, 06 Feb 2025 13:21:52 -0800 (PST) Received: from fedora-rawhide.sandeen.net (97-116-166-216.mpls.qwest.net. [97.116.166.216]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4eccf9afe8bsm435133173.6.2025.02.06.13.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 13:21:51 -0800 (PST) From: Eric Sandeen To: fstests@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 5/7] lib: replace aiocb_t with struct aiocb Date: Thu, 6 Feb 2025 15:20:00 -0600 Message-ID: <20250206212145.7732-6-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250206212145.7732-1-sandeen@redhat.com> References: <20250206212145.7732-1-sandeen@redhat.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 aiocb_t isn't defined anywhere, use struct aiocb instead, to make sparse happy. Signed-off-by: Eric Sandeen Reviewed-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- lib/tlibio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/tlibio.c b/lib/tlibio.c index 19192b38..22ff1adc 100644 --- a/lib/tlibio.c +++ b/lib/tlibio.c @@ -42,6 +42,7 @@ * */ +#include #include #include #include @@ -810,7 +811,7 @@ lio_read_buffer( * (rrl 04/96) ***********************************************************************/ int -lio_check_asyncio(char *io_type, int size, aiocb_t *aiocbp, int method) +lio_check_asyncio(char *io_type, int size, const struct aiocb *aiocbp, int method) { int ret; int cnt = 1; @@ -895,9 +896,10 @@ lio_check_asyncio(char *io_type, int size, aiocb_t *aiocbp, int method) * (rrl 04/96) ***********************************************************************/ int -lio_wait4asyncio(int method, int fd, aiocb_t *aiocbp) +lio_wait4asyncio(int method, int fd, const struct aiocb *aiocbp) { - int cnt; + struct aiocb *const aioary[1]; + int cnt, ret; if ( (method & LIO_WAIT_RECALL) || ((method & LIO_WAIT_TYPES) == 0) ){ From patchwork Thu Feb 6 21:20:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13963797 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E77C1DF98C for ; Thu, 6 Feb 2025 21:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876917; cv=none; b=I/mgbCqlFMS1FcGSVxbI560oQTBYR+mCcVCuItYOLCbJZczAEQ6+RH4duDY5lQt/ES87xEO3ODrck2sqBbnkZfS2ClHvUVroGVq+kAVP0dzytOtsbANSO3+4P9GBOgjrWkIOHZmCyvU2EW5IlA+FiFBQrTe7jqGcA8XxlJP7lk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876917; c=relaxed/simple; bh=CaH9yhAqnQtSElYQ0bAQqyWKf1eIQlzt0U36jXRT6Rs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hISoQH3Ba0Er7TvpxOq+TMJm8lpz8tZlKcG1x6JQCQDVmgdRcdb1viuBzJWaMw1ZYFmvb8U2Hr130RydbBiYXpf+V9RL+BtOoy3PgXnCp42dg3cKvWS4jUldbEeoxuspQrLiNl6U9vwFBfSeUWmESCL27ZuZ84cN9PTF4I65Wj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DhdDdmuJ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DhdDdmuJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738876915; h=from:from:reply-to:subject:subject: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=rNaGm6uyZjVQMnJPAzPDKthK/tV5qvJZ1ClfruL6hYs=; b=DhdDdmuJjrw2f5rgGJ3AfjOeIyy8e6Whg5AoP6JJ3w8gMuxTqphuaokVqwt8uM+L5zXC93 JLK7fUfuJAAX6gM83ic2ccdPSWxFFN5WVlNztdEAB+YrZ3jIAd4BHtmHFrJZRQ+VqM1YDU JJjeQDtBaUuOetjplLyJu08pFI+zFXk= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-427-WH0HLB4zMrqhmS-weSH4NA-1; Thu, 06 Feb 2025 16:21:54 -0500 X-MC-Unique: WH0HLB4zMrqhmS-weSH4NA-1 X-Mimecast-MFC-AGG-ID: WH0HLB4zMrqhmS-weSH4NA Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-84cdae60616so95661339f.3 for ; Thu, 06 Feb 2025 13:21:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738876913; x=1739481713; 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=rNaGm6uyZjVQMnJPAzPDKthK/tV5qvJZ1ClfruL6hYs=; b=NVIYCsYWOBXYLl2J0jZt6pMe4wPqNQ6wZHmPEvYhxP19eBhLQpr8BA5Hb5N7ZHRCu/ visi1PAnDBDuQobMcxPd516MZFApFEgBUiTmZrqO4k5f/hI3c02tGDsUJaTP1iH7rkpr o3VLYHBCS3fT/zp4hBN2uyRy5nXHXDEO8KazN5kEEtrT3AeF74IbLyn+d0on65ARxYOU PQHRtxAOtXsNrbToD2WXEA8iVap+1BAFYQ2gT1XLuo9MS0t9tWKg3akFudqePx5XTp2O gHVz3jUhaq4NuVv2W05YwMrBA9B4c/ZNkqXNwaRdnsNycEDTGFeuxTk+68ZJC7NimOmM UXYw== X-Gm-Message-State: AOJu0Yz7gnk2mU23VO9Ak2etxVZgZ7u6gsDWSiYfSuHOC2YPniKX5K0U MOsdq3K3MRBVNjvE7X73RaM9Gs6jPzyynQfn3AtFG4lU7GOfz9m4MRx4wWzv1+Y35xtBXZ4Mvqs eQtDO45mzJOvgtNHxwubaNTwarQRDL4nkmadl1c9CLftyngAJmzU3qkKHsS7XiE8H0iaR4aTMDt /uWdrv0NWPbRoWjSVR2xFdphoPrKmpfptFNRxc7EmD X-Gm-Gg: ASbGncs9BaYzYXC1oMY1YHv7VbJ6G4Honx7O0/M2CBpWnITXILJ1P/hAIfBNfztl4c/ fVrAdu2epnuC3eXTAChTMGiqA09iNVoNnDiV9Js6+R9E/md12GoNPGdYWLGPZ4wvWe4JdXc9A7i 3OFczVa2/G84Qbz9B29OAonw2qW/7WhjIT8RYGEoTSCE+ePcn9BClDvAZTuFq1ACzD/D359mcIj qLVDt1k3s48Ulm+SAkAU/rBZlWquabVOA/9iZhjTinAci2NfJz0oansDfiYaf1AzNHKjrPa8az5 cGl7CxLTnCRrsFvByjOGnF//waDmq7e92hJm4fi+ydX2PZnJd+Z3EQ== X-Received: by 2002:a05:6602:4008:b0:851:f176:9827 with SMTP id ca18e2360f4ac-854fd89ba0bmr126969139f.5.1738876913472; Thu, 06 Feb 2025 13:21:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJmSwmqEpQ83w99rZujW2flu+d6p8H9xKBimCrn+bo7OD5PY537eRwh6mPEKP/soydPNIUEw== X-Received: by 2002:a05:6602:4008:b0:851:f176:9827 with SMTP id ca18e2360f4ac-854fd89ba0bmr126966839f.5.1738876913042; Thu, 06 Feb 2025 13:21:53 -0800 (PST) Received: from fedora-rawhide.sandeen.net (97-116-166-216.mpls.qwest.net. [97.116.166.216]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4eccf9afe8bsm435133173.6.2025.02.06.13.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 13:21:52 -0800 (PST) From: Eric Sandeen To: fstests@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 6/7] lib: make a few symbols static Date: Thu, 6 Feb 2025 15:20:01 -0600 Message-ID: <20250206212145.7732-7-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250206212145.7732-1-sandeen@redhat.com> References: <20250206212145.7732-1-sandeen@redhat.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There are a few symbols in lib/tlibio.c which should be static, and sparse notices this so fix it. Signed-off-by: Eric Sandeen Reviewed-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- lib/tlibio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tlibio.c b/lib/tlibio.c index 22ff1adc..2aa8175b 100644 --- a/lib/tlibio.c +++ b/lib/tlibio.c @@ -82,6 +82,7 @@ static void lio_async_signal_handler(int sig); /* * Define the structure as used in lio_parse_arg1 and lio_help1 */ +static struct lio_info_type Lio_info1[] = { { "s", LIO_IO_SYNC, "sync i/o" }, { "p", LIO_IO_ASYNC|LIO_WAIT_SIGACTIVE, "async i/o using a loop to wait for a signal" }, @@ -101,6 +102,7 @@ struct lio_info_type Lio_info1[] = { /* * Define the structure used by lio_parse_arg2 and lio_help2 */ +static struct lio_info_type Lio_info2[] = { { "sync", LIO_IO_SYNC, "sync i/o (read/write)"}, { "async", LIO_IO_ASYNC, "async i/o (reada/writea/aio_read/aio_write)" }, @@ -120,7 +122,7 @@ struct lio_info_type Lio_info2[] = { "all random i/o types and wait methods (except nowait)" }, }; -char Lio_SysCall[PATH_MAX]; /* string containing last i/o system call */ +static char Lio_SysCall[PATH_MAX]; /* string containing last i/o system call */ static volatile int Received_signal = 0; /* number of signals received */ static volatile int Rec_signal; From patchwork Thu Feb 6 21:20:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13963798 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F194B1DFDA2 for ; Thu, 6 Feb 2025 21:21:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876920; cv=none; b=nOVHUv3JdOnUmDqYVxYVozGi/sb+yyBHTuvR83VoydSxdzqwkt8USjVyvXROpeS3UIoPFN+QEcEuRXEeulHWEVnSiDYXEGpwJw5F8EkPt+vhWaBHod6b/7Lst7wZWgc8xcwUFpSDt4VCpx8r3j7AV2xw8qkTkrpQg3sR/nDLQqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876920; c=relaxed/simple; bh=TW7H/K0yTxj3uSLhwEymo0Hu9PfeuSVIsg/MNPO7leY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cfKL+qc4407mnYtiBJx7FagW6lEqjYre0pPCGwTs0xhp06GQck1IJN6dkreOY7FjkXNn2BfWzJ8ghPkB/L0CUUFU8f8X40CvAoE6fWSrm+uM/nrWYRQUbiG4H1jHeQgg0zYcEkGlCg9VfTSyYKbbRNjrqlVpHSTqCdZ3NdKWj2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ngjp447l; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ngjp447l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738876916; h=from:from:reply-to:subject:subject: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=TbBmy7pg6XqoKn7LEhb8ZeCHLebEcwdi76wy5EF5IJI=; b=Ngjp447lEsAyEZQbYZU09KEEWWrLfTIFCZkfo0Zpa7S/P+4aa9hNMoVklzCKB/oZHJboeV y20lL54xN/1g4zpY8gLh7hr+wlNTX5Dq/fGVvCkyo1ySSrp9nqNueezhIyZEkR6HqIYCpm NF4JV5mMNczWwrek3WxHEPFJPD5diR8= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-dXpmlkt8MoO1L1rm6NHu3Q-1; Thu, 06 Feb 2025 16:21:55 -0500 X-MC-Unique: dXpmlkt8MoO1L1rm6NHu3Q-1 X-Mimecast-MFC-AGG-ID: dXpmlkt8MoO1L1rm6NHu3Q Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-844dadd9bdcso249235239f.2 for ; Thu, 06 Feb 2025 13:21:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738876914; x=1739481714; 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=TbBmy7pg6XqoKn7LEhb8ZeCHLebEcwdi76wy5EF5IJI=; b=nJVw63ldMgz3YLGRbN8T895lIlS3xqG0vMg6XxUr72fST4Ua0Rm7sHh6KQC0JzY6GM Q3tEx5uTYc06tYc3TT1Wa98dzBMQkqUF9dkEyjBlV5Q7Q5xG4HkepiTRIh+y5+zJ1qDL s9Kdz+RdPfZ4k29r48P1jDXUE5rKFumiGokVMOhzqB2ln2pc4sq00P0CNqTMDIg3x81Z L3gtPznE8kDdFMz010aABH3EN7WfwBdB2pEsy1XQyusfvGC8k6D2nEjcm8WEH+e5qDK9 3T4Z7+UQITw7Nsqy3L9oHQ3YeF4UL1OJdmHP33YJxzD8NqM8uD9ZQyqauGYeBQDOt1GM +hmw== X-Gm-Message-State: AOJu0Yz8tOcd87nxBpgT8fFr+gs3lWtw9pF7DzpnUxk8MY6rxpmIud/k nx7eSxXw9I/BWIcuiKDDdJ5r6lopKqirQ3y9dvoD88wda9CT1jBJ7GGv+KJuemjjdpK6LKZV+Ym 4wZSsiPOHZpVqfUuTx6I2PKGa+p3chWu0fNqk/SHZRYCGa5n1VBwh8VGByTrsCYvgFBFISe0u9m EcyHLUUJPyfiDmXliZNBJE/0WovowotJO+JWbB27AA X-Gm-Gg: ASbGncvjQ9BXtPWaA7uzC1WD52voGseetPsEehZxIAJ26i+/kAZjQhikfalrejnjanA mqmF90tyvCT70EusteJGKYjrNjlM8lcPwRGUT70kwBjmCbgs6LnMCKciymWbq6u4LClhCCbCgGy oFKufnFq7C85yd9xaLv3XBd15KbRpAOKwdftIqkj8jxSbM0IGshxlRHBX5VTjZMNsX+Q9i502ff IJqLGrkAXDKNNljJ2VU3g1UtRULLWly5zt95K5mEfMrP8lGjCkgWrGLvnssKyIB+lpIs2Xl16rP MsTJ6ltvCsaZDIESiE2oAyyE3W/STDGDNuvmRPTOpYdlplNqnss2YQ== X-Received: by 2002:a05:6602:6cc2:b0:83a:a746:68a6 with SMTP id ca18e2360f4ac-854fd89d459mr131276239f.5.1738876914482; Thu, 06 Feb 2025 13:21:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMEy+Bzvg88QKSY9fxDsWkCpizPLjvAT9hnWO9Q9ZIDyckms9WdPNc+rJ2aqAv+q8XJEwwUw== X-Received: by 2002:a05:6602:6cc2:b0:83a:a746:68a6 with SMTP id ca18e2360f4ac-854fd89d459mr131273539f.5.1738876914075; Thu, 06 Feb 2025 13:21:54 -0800 (PST) Received: from fedora-rawhide.sandeen.net (97-116-166-216.mpls.qwest.net. [97.116.166.216]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4eccf9afe8bsm435133173.6.2025.02.06.13.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 13:21:53 -0800 (PST) From: Eric Sandeen To: fstests@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 7/7] lib: remove random.c Date: Thu, 6 Feb 2025 15:20:02 -0600 Message-ID: <20250206212145.7732-8-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250206212145.7732-1-sandeen@redhat.com> References: <20250206212145.7732-1-sandeen@redhat.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 sparse points out that lots of things in random.c could be static, and upon doing so we realize that nothing in this file is used. Which is unsurprising since these are all part of the standard C library ... so just remove the file. Signed-off-by: Eric Sandeen Reviewed-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- lib/Makefile | 5 +- lib/random.c | 224 --------------------------------------------------- 2 files changed, 2 insertions(+), 227 deletions(-) delete mode 100644 lib/random.c diff --git a/lib/Makefile b/lib/Makefile index 53540ca7..ce4381a2 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -11,13 +11,12 @@ LT_REVISION = 0 LT_AGE = 0 # -# Everything (except for random.c) copied directly from LTP. +# Everything copied directly from LTP. # Refer to http://ltp.sourceforge.net/ for complete source. # CFILES = dataascii.c databin.c datapid.c file_lock.c forker.c \ pattern.c open_flags.c random_range.c string_to_tokens.c \ - str_to_bytes.c tlibio.c write_log.c \ - random.c + str_to_bytes.c tlibio.c write_log.c default: depend $(LTLIBRARY) diff --git a/lib/random.c b/lib/random.c deleted file mode 100644 index d5c81be8..00000000 --- a/lib/random.c +++ /dev/null @@ -1,224 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * random.c -- pseudo random number generator - * Copyright (C) 1994 Chris Wallace (csw@bruce.cs.monash.edu.au) - */ - -#include - -/* - * modified by dxm@sgi.com so that this file acts as a drop in replacement - * for srandom and random. - */ - -/* - * A random number generator called as a function by - * random (iseed) or irandm (iseed) - * The parameter should be a pointer to a 2-element int32_t vector. - * The first function returns a double uniform in 0 .. 1. - * The second returns a int32_t integer uniform in 0 .. 2**31-1 - * Both update iseed[] in exactly the same way. - * iseed[] must be a 2-element integer vector. - * The initial value of the second element may be anything. - * - * The period of the random sequence is 2**32 * (2**32-1) - * The table mt[0:127] is defined by mt[i] = 69069 ** (128-i) - */ - -#define MASK ((int32_t) 593970775) -/* or in hex, 23674657 */ - -#define SCALE ((double) 1.0 / (1024.0 * 1024.0 * 1024.0 * 2.0)) -/* i.e. 2 to power -31 */ - -static int32_t mt [128] = { - 902906369, - 2030498053, - -473499623, - 1640834941, - 723406961, - 1993558325, - -257162999, - -1627724755, - 913952737, - 278845029, - 1327502073, - -1261253155, - 981676113, - -1785280363, - 1700077033, - 366908557, - -1514479167, - -682799163, - 141955545, - -830150595, - 317871153, - 1542036469, - -946413879, - -1950779155, - 985397153, - 626515237, - 530871481, - 783087261, - -1512358895, - 1031357269, - -2007710807, - -1652747955, - -1867214463, - 928251525, - 1243003801, - -2132510467, - 1874683889, - -717013323, - 218254473, - -1628774995, - -2064896159, - 69678053, - 281568889, - -2104168611, - -165128239, - 1536495125, - -39650967, - 546594317, - -725987007, - 1392966981, - 1044706649, - 687331773, - -2051306575, - 1544302965, - -758494647, - -1243934099, - -75073759, - 293132965, - -1935153095, - 118929437, - 807830417, - -1416222507, - -1550074071, - -84903219, - 1355292929, - -380482555, - -1818444007, - -204797315, - 170442609, - -1636797387, - 868931593, - -623503571, - 1711722209, - 381210981, - -161547783, - -272740131, - -1450066095, - 2116588437, - 1100682473, - 358442893, - -1529216831, - 2116152005, - -776333095, - 1265240893, - -482278607, - 1067190005, - 333444553, - 86502381, - 753481377, - 39000101, - 1779014585, - 219658653, - -920253679, - 2029538901, - 1207761577, - -1515772851, - -236195711, - 442620293, - 423166617, - -1763648515, - -398436623, - -1749358155, - -538598519, - -652439379, - 430550625, - -1481396507, - 2093206905, - -1934691747, - -962631983, - 1454463253, - -1877118871, - -291917555, - -1711673279, - 201201733, - -474645415, - -96764739, - -1587365199, - 1945705589, - 1303896393, - 1744831853, - 381957665, - 2135332261, - -55996615, - -1190135011, - 1790562961, - -1493191723, - 475559465, - 69069 - }; - -double -_random (int32_t is [2]) -{ - int32_t it, leh, nit; - - it = is [0]; - leh = is [1]; - if (it <= 0) - it = (it + it) ^ MASK; - else - it = it + it; - nit = it - 1; -/* to ensure all-ones pattern omitted */ - leh = leh * mt[nit & 127] + nit; - is [0] = it; is [1] = leh; - if (leh < 0) leh = ~leh; - return (SCALE * ((int32_t) (leh | 1))); -} - - - -int32_t -_irandm (int32_t is [2]) -{ - int32_t it, leh, nit; - - it = is [0]; - leh = is [1]; - if (it <= 0) - it = (it + it) ^ MASK; - else - it = it + it; - nit = it - 1; -/* to ensure all-ones pattern omitted */ - leh = leh * mt[nit & 127] + nit; - is [0] = it; is [1] = leh; - if (leh < 0) leh = ~leh; - return (leh); -} - -/* - * make this a drop in replacement for random and srandom - * - * XXX not thread safe I guess. - */ - -static int32_t saved_seed[2]; - -long random(void) -{ - return _irandm(saved_seed); -} - -void srandom(unsigned seed) -{ - saved_seed[0]=seed; - saved_seed[1]=0; - _irandm(saved_seed); -} -