From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF469C433F5 for ; Fri, 19 Nov 2021 16:25:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1B056124B for ; Fri, 19 Nov 2021 16:25:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A1B056124B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JmKMG+I9PxjJC+CpH9Am3BvOiE3H2kdjXW1ths1rIBA=; b=Ha6jpKLYbgKBIs vQtN0i8CURaNCCwYSgT16AM0vlNs1LAeX4SroOmzWbqKvtx0z2mIMSwf8Bi+wZ8rj1hMZB5U/L/e4 isYwo+MyBQbTZkQiHQwAN/X36Baqv3HmjVqaOp2Qg7Ai9VxhoVO5aiHotfw8+LCr1aBGhXfFjl2w7 1J5zCJDgDv8PqZ859SbNyzRQoulg5M4AP2tKle2l4weF0AnooyYLDwIISSE2e8YK0YbMY0XrB1YQN JSC0QPlRdhMadfKBwMPWVFUpFwLqhx8kqOTl2kkZ/dm4SyrJgxVGzedwMnxMOv9Ykoi3y2jnPWUVL cpbvOG2hiTPQle/N1jTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo6fB-00B05V-LB; Fri, 19 Nov 2021 16:22:57 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo6f7-00B044-Dw for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 16:22:55 +0000 Received: by mail-wr1-x42f.google.com with SMTP id n29so19006230wra.11 for ; Fri, 19 Nov 2021 08:22:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=gJ7nvh3PYL8XuI32u9B1gA3gTx9kf/bMqpXsk3AEZsU=; b=fpsj7+4SpFXqpTSemI06B9IcXVdlbuued/IQBN4FCqBdSC/xtpTgB2iz9UIQnOPSv5 7dinU35yvOUDiH/9vJWKbZ9GctdBbeB/cRDVHk0phW4F/NxhOCWoSFMTVcX26VVw3HMt GPKNYBxNtyTgnGx50kBrFXzcpurXEIcb4r3vdAScw53cOY82S+nnM1F4LxEs39YLMQ/S uDHYEpfJs9WPfjtx2YvKeV+ilwmoATVlGw8z6GW1nGOzQsTXfXgbQ/sMgtuNKtzjMgO+ m/GWqEfFdALvOcc/k4vNSzQQ8s1MyiSdciXJWtO0mjZ1O20qNFBqF7s2UCtRG1bgp0aS YbJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=gJ7nvh3PYL8XuI32u9B1gA3gTx9kf/bMqpXsk3AEZsU=; b=hyW4Mw2GlDg/EgOg0mwMjZGSHq7NcDH0fA+yHEHfsCR4KHChhP+d6PRa3XkHumVelN cKhih6TBSr3la4EVjB9hJqp+g+vIyAfXM7z2D4Cgkg2jQRHTQDZmJOS0v3BJEwAKaz+T rZEpJ7rNzO2sWVSVDuQ6Z/la9qDrZ0rYk5svJ11ploOHg6PedZgoXm2le0SIeypIIs6a L8D+V0cVhZCcGf8Sdtap8PBadLhvcZmHRvgQfs4IBy8PAXtnIzULX8bWLSsof44rEdkf b5o/AEEqtDrdSqIjwyWWY/rC2jzQuPm8aDpZvlRFQrwtcwAe9/wKXPGrRWK0/4ELfiC/ U0vA== X-Gm-Message-State: AOAM532/WXDSTJWFf6sSNRF+wVgLy1/oWzZMVRH45mVdOPcGWfYXhJ0E KFa2g2cDU6dZJATdC7yG5nQ= X-Google-Smtp-Source: ABdhPJz+RkhKg2oPM+DFfdJrmKTihG8D5yySz9/H4aR55REMYZ6fa+PNcb8l7yv++672VBes+PtaDw== X-Received: by 2002:a5d:5986:: with SMTP id n6mr9039788wri.297.1637338971943; Fri, 19 Nov 2021 08:22:51 -0800 (PST) Received: from [192.168.0.160] ([170.253.36.171]) by smtp.gmail.com with ESMTPSA id n2sm12993701wmi.36.2021.11.19.08.22.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 08:22:51 -0800 (PST) Message-ID: <2d790206-124b-f850-895f-a57a74c55f79@gmail.com> Date: Fri, 19 Nov 2021 17:22:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code Content-Language: en-US To: Arnd Bergmann , Andy Shevchenko Cc: LKML , Ajit Khaparde , Andrew Morton , Bjorn Andersson , Borislav Petkov , Corey Minyard , Chris Mason , Christian Brauner , David Sterba , Jani Nikula , Jason Wang , Jitendra Bhivare , John Hubbard , "John S . Gruber" , Jonathan Cameron , Joonas Lahtinen , Josef Bacik , Kees Cook , Ketan Mukadam , Len Brown , "Michael S. Tsirkin" , Miguel Ojeda , Mike Rapoport , Nick Desaulniers , "Rafael J. Wysocki" , Rasmus Villemoes , Rodrigo Vivi , Russell King , Somnath Kotur , Sriharsha Basavapatna , Subbu Seetharaman , Intel Graphics , ACPI Devel Maling List , Linux ARM , linux-btrfs , linux-scsi , Networking , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" References: <20211119113644.1600-1-alx.manpages@gmail.com> <434296d3-8fe1-f1d2-ee9d-ea25d6c4e43e@gmail.com> From: "Alejandro Colomar (man-pages)" In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_082253_524876_B405BCE5 X-CRM114-Status: GOOD ( 20.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/19/21 17:18, Arnd Bergmann wrote: > On Fri, Nov 19, 2021 at 5:10 PM Andy Shevchenko > wrote: >> On Fri, Nov 19, 2021 at 04:57:46PM +0100, Arnd Bergmann wrote: > >>> The main problem with this approach is that as soon as you start >>> actually reducing the unneeded indirect includes, you end up with >>> countless .c files that no longer build because they are missing a >>> direct include for something that was always included somewhere >>> deep underneath, so I needed a second set of scripts to add >>> direct includes to every .c file. >> >> Can't it be done with cocci support? > > There are many ways of doing it, but they all tend to suffer from the > problem of identifying which headers are actually needed based on > the contents of a file, and also figuring out where to put the extra > #include if there are complex #ifdefs. > > For reference, see below for the naive pattern matching I tried. > This is obviously incomplete and partially wrong. FYI, if you may not know the tool, theres include-what-you-use(1) (a.k.a. iwyu(1))[1], although it is still not mature, and I'm helping improve it a bit. If I understood better the kernel Makefiles, I'd try it. You can try it yourselves. I still can't use it for my own code, since it has a lot of false positives. Cheers, Alex [1]: -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel