From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (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 1D72D3672AE for ; Tue, 12 May 2026 07:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778571315; cv=none; b=glaHYgGK/YlbomTD/oEY7wssMAHc1cGdXtIpSqqnLH7GJENDsq7SjNrSpLapn9CfSC35gdSx1Ofkgq4CxNKBWdqGyitMe++XBKkAg+6hEzSZn1Pqg7O9NWCf1OY+lfVcVnysnoNGEP7nHk3rHInM07apwvKeuB8wtZDCjtRfXAs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778571315; c=relaxed/simple; bh=fbdh9NQNpS4/2osYLzPXwMe0njkZEUnNjRMmIq7Gkgg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=miy5XTDa7LtMXvyPFdUtg4GWv3736Gn6DMRRHTuG6Snrk01kho6LupSrJpuIxFg7MFcpJ6fQhhUJTnQjQIRgt3LWnlKk1tn+DkgXuxS+IAzcwiCJxV3pFdg2hr0WyqapzGv/DoS18QB3Mx4yRXV6aslNmkojKahO8OCJyDgBZyM= 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=OMyaYm+r; arc=none smtp.client-ip=209.85.208.51 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OMyaYm+r" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-6763cc8775cso11102066a12.0 for ; Tue, 12 May 2026 00:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778571309; x=1779176109; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GJ29S31AhqL1OZChggRVRngpT2QA4nmXZsLCEt5Ynts=; b=OMyaYm+r5XAf3yjPXIIw7KNJF3w8q+UmxB1WMSyIuaZ55FF1C7Pddy0CCZwpFWTvtl wkwmdhjdPGQY1JUkX7b3jLDdYSEuP2g7sI2QrZwNVI876P/ljiQjwkoPbciKbw7b4af3 gM1LuuaLyXwSWuUwvlsMNcbZQEzYt5m5Kjwz7JeKcG7tZQF+W3LgTd2a5vDF1qoxnSxe HTwgrDCFMNz5tYQd7l6zAnZu+ntpEdRa8rit6AOkbZ/XGigIseOLP45LJHzW2vuZuKGZ c63+byd0rOROCdHdCpoZd5ow0Z5/4QGdGHMt/P4h6zpm/aWlk+qMa5+WwyeFgDgMm97s bvpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778571309; x=1779176109; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GJ29S31AhqL1OZChggRVRngpT2QA4nmXZsLCEt5Ynts=; b=P6JWp8b0c8tM1obWIbWVdj/YX7FX8a0WnyHrYlrUilO0PZk1/yvbscEtS4LwBxsg+/ 6pizXzzYvrB1KW94pzBEVZzheXMg9NAbszuZJqIap+1sxW0ZJ+kenlBZG1CBoVRNDtEb GeBkrlrX0aMqtAT+gSirpZkQR6BmgM9GXahi8mm7hO5k8uX976dikc9R1WyV9Uc4yKj3 dTCRdGFrGM8gAcM+P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6gNgTzefjTye5zxPR2T83LDVAXWmEKkl41lUgHmTY9/CajMS40KwQjud XsGty6 X-Received: by 2002:a17:907:d388:b0:bd2:be3:572a with SMTP id a640c23a62f3a-bd23ae13deemr174038466b.6.1778571308354; Tue, 12 May 2026 00:35:08 -0700 (PDT) Received: from cs-280612103108-default.europe-west4-a.c.oa7bb030819b2a894-tp.internal (28.170.91.34.bc.googleusercontent.com. [34.91.170.28]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bcbb2b1c3adsm538796266b.35.2026.05.12.00.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2026 00:35:07 -0700 (PDT) From: Joshua Crofts To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] iio: mapping file for include-what-you-use tool Date: Tue, 12 May 2026 07:35:05 +0000 Message-ID: <20260512073505.1310-1-joshua.crofts1@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit As promised, I'm sending my IWYU mapping file, based on Jonathan's version with a few additional tweaks by me. Other than adding support for more assembly file business, I've also experimented with individual symbol definition (see BIT() and GENMASK() in the following file) - this is to prevent issues such as the tool wanting you to include when you already have in the source file (I agree, doing this symbol by symbol is tedious, but BIT() and GENMASK() are symbols that especially do this, and they're included in most, if not all drivers). Feel free to improve this file and pass it on. I wouldn't really fully rely on IWYU as even with the mapping file the results can be weird, but it definitely serves as a good starting point when doing driver cleanup. I'm making this patch an RFC - this is not intended for merging. Signed-off-by: Joshua Crofts --- tools/iio/iio.imp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tools/iio/iio.imp diff --git a/tools/iio/iio.imp b/tools/iio/iio.imp new file mode 100644 index 000000000000..c8e9c509bb93 --- /dev/null +++ b/tools/iio/iio.imp @@ -0,0 +1,46 @@ +[ + { "include": ["\"linux/bitops.h\"", "private", "", "public"] }, + { "include": ["\"linux/bits.h\"", "private", "", "public"] }, + { "include": ["\"linux/byteorder/generic.h\"", "private", "", "public"] }, + { "include": ["\"linux/device.h\"", "private", "", "public"] }, + { "include": ["\"linux/ktime.h\"", "private", "", "public"] }, + { "include": ["\"linux/limits.h\"", "private", "", "public"] }, + { "include": ["\"linux/mod_devicetable.h\"", "private", "", "public"] }, + { "include": ["\"linux/mutex_types.h\"", "private", "", "public"] }, + { "include": ["\"linux/pm.h\"", "private", "", "public"] }, + { "include": ["\"linux/sched.h\"", "private", "", "public"] }, + { "include": ["\"linux/sizes.h\"", "private", "", "public"] }, + { "include": ["\"linux/slab.h\"", "private", "", "public"] }, + { "include": ["\"linux/spi/spi.h\"", "private", "", "public"] }, + { "include": ["\"linux/spinlock_types.h\"", "private", "", "public"] }, + { "include": ["\"linux/spinlock.h\"", "private", "", "public"] }, + { "include": ["\"linux/stat.h\"", "private", "", "public"] }, + { "include": ["\"linux/stdarg.h\"", "private", "", "public"] }, + { "include": ["\"linux/stddef.h\"", "private", "", "public"] }, + { "include": ["\"linux/string.h\"", "private", "", "public"] }, + { "include": ["\"linux/stringify.h\"", "private", "", "public"] }, + { "include": ["\"linux/sysfs.h\"", "private", "", "public"] }, + { "include": ["\"linux/time.h\"", "private", "", "public"] }, + { "include": ["\"linux/timer.h\"", "private", "", "public"] }, + { "include": ["\"linux/types.h\"", "private", "", "public"] }, + { "include": ["\"linux/uuid.h\"", "private", "", "public"] }, + { "include": ["\"linux/wait.h\"", "private", "", "public"] }, + { "include": ["\"linux/workqueue.h\"", "private", "", "public"] }, + + { "include": ["\"vdso/bits.h\"", "private", "", "public"] }, + { "include": ["\"vdso/ktime.h\"", "private", "", "public"] }, + { "include": ["\"vdso/limits.h\"", "private", "", "public"] }, + { "include": ["\"vdso/time64.h\"", "private", "", "public"] }, + + { "include": ["\"asm-generic/div64.h\"", "private", "", "public"] }, + { "include": ["\"asm-generic/errno.h\"", "private", "", "public"] }, + { "include": ["\"asm-generic/errno-base.h\"", "private", "", "public"] }, + { "include": ["\"asm-generic/int-ll64.h\"", "private", "", "public"] }, + + { "include": ["\"linux/iio/types.h\"", "private", "", "public"] }, + + { "symbol": ["BIT", "private", "", "public"] }, + { "symbol": ["BIT", "private", "", "public"] }, + { "symbol": ["GENMASK", "private", "", "public"] }, + { "symbol": ["GENMASK", "private", "", "public"] } +] -- 2.47.3