From nobody Fri Jun 12 22:50:16 2026 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AECE8384CF2 for ; Tue, 12 May 2026 07:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778571314; cv=none; b=NTxiTb2FlGMyos8oYC+1wPRouwye7MKVW/4GDIzfeYpu2MdswK224RlLDQu+LG+IYgRf/+OvGZP8Paeq+z+L/yzfz+/ZsIYupymobTvDP8bmc1UE2l1f9W+/cJl5DAuWO1TK8O5cOwudecKK/c763Bx756jyieiFdX+WEKuXABQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778571314; c=relaxed/simple; bh=fbdh9NQNpS4/2osYLzPXwMe0njkZEUnNjRMmIq7Gkgg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lfagvPEGZOhIw7ApHb7TGAXj5xiCjXRLxVpv/Q/idGkFd4lbuEQA8/5J6zwalvrfozlqz/MQ/iiusO7jVsl/9/SQU0drkV7rV1VRA+ZcuTZJ0tMvARcARAZG9SwYxXkfizeqJx86AYwMXqQSJwHBAIlRtUfyCw7WbbdMnqA9Zq8= 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.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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-f52.google.com with SMTP id 4fb4d7f45d1cf-6763cc8775cso11102067a12.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=WY037w+Wdm3poc/4vUUa1tYwwKwlvEqEyaHoIqAZjEwZncVY5PGRfMAi38zj7Xu5bC UWa+0k4eZc0opd4YvbtfMWBVLUoDRVECuZy074ng5nbg4WLBsCL49dmuttWqzOYeFuaL 2NiYqd/AzhAjf59+QdoRb/vcCQ/qlXhoxxdhhvrpctcJDOZwUVY/QpXv290Bfv8oo5q3 9I6rmbmq7xKGUuFGMqfVwIM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+danaNcHuu99+KvClA10BCkSmGNs0wudF6VCmA9RbRhv3CLW2+o MROG3F 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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", "", "pu= blic"] }, + { "include": ["\"linux/bits.h\"", "private", "", "public= "] }, + { "include": ["\"linux/byteorder/generic.h\"", "private", "", "public"] }, + { "include": ["\"linux/device.h\"", "private", "", "pu= blic"] }, + { "include": ["\"linux/ktime.h\"", "private", "", "publ= ic"] }, + { "include": ["\"linux/limits.h\"", "private", "", "pu= blic"] }, + { "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", "", "publ= ic"] }, + { "include": ["\"linux/sizes.h\"", "private", "", "publ= ic"] }, + { "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", "", "pu= blic"] }, + { "include": ["\"linux/stddef.h\"", "private", "", "pu= blic"] }, + { "include": ["\"linux/string.h\"", "private", "", "pu= blic"] }, + { "include": ["\"linux/stringify.h\"", "private", "= ", "public"] }, + { "include": ["\"linux/sysfs.h\"", "private", "", "publ= ic"] }, + { "include": ["\"linux/time.h\"", "private", "", "public= "] }, + { "include": ["\"linux/timer.h\"", "private", "", "publ= ic"] }, + { "include": ["\"linux/types.h\"", "private", "", "publ= ic"] }, + { "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", "", "publi= c"] }, + { "include": ["\"vdso/limits.h\"", "private", "", "pub= lic"] }, + { "include": ["\"vdso/time64.h\"", "private", "", "pub= lic"] }, + =20 + { "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"] } +] --=20 2.47.3