From patchwork Tue Apr 23 15:48:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 10913279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C7D21390 for ; Tue, 23 Apr 2019 15:52:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CCA828915 for ; Tue, 23 Apr 2019 15:52:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A48928972; Tue, 23 Apr 2019 15:52:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B1D928968 for ; Tue, 23 Apr 2019 15:52:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727467AbfDWPwA (ORCPT ); Tue, 23 Apr 2019 11:52:00 -0400 Received: from mail5.windriver.com ([192.103.53.11]:40470 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728233AbfDWPwA (ORCPT ); Tue, 23 Apr 2019 11:52:00 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id x3NFmwNQ005137 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 23 Apr 2019 08:49:08 -0700 Received: from yow-cube1.wrs.com (128.224.56.98) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Apr 2019 08:48:48 -0700 From: Paul Gortmaker To: Wim Van Sebroeck , Guenter Roeck CC: , Paul Gortmaker , Benjamin Fair , Linus Walleij , Nancy Yuen , , Patrick Venture , Tali Perry , Tomer Maimon , Wim Van Sebroeck Subject: [PATCH 0/5] wdt: clean up unused modular infrastructure Date: Tue, 23 Apr 2019 11:48:30 -0400 Message-ID: <1556034515-28792-1-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP People can embed modular includes and modular exit functions into code that never use any of it, and they won't get any errors or warnings. Using modular infrastructure in non-modules might seem harmless, but some of the downfalls this leads to are: (1) it is easy to accidentally write unused module_exit/remove code (2) it can be misleading when reading the source, thinking a driver can be modular when the Makefile and/or Kconfig prohibit it (3) an unused include of the module.h header file will in turn include nearly everything else; adding a lot to CPP overhead. (4) it gets copied/replicated into other drivers and can spread. As a data point for #3 above, an empty C file that just includes the module.h header generates over 750kB of CPP output. Repeating the same experiment with init.h and the result is less than 12kB; with export.h it is only about 1/2kB; with both it still is less than 12kB. Here, In this series, we do what has been done for other subsystems, like, net, x86, mfd, iommu.... and audit for uses of modular infrastructure inside code that currently can't be built as a module. As always, the option exists for driver authors to convert their code to tristate, if there is a valid use case for it to be so. But since I don't have the context for each driver to know if such a use case exists, I limit myself to simply removing the unused code in order to make the driver consistent with the Makefile/Kconfig settings that control it. Paul. --- Cc: Benjamin Fair Cc: Guenter Roeck Cc: Linus Walleij Cc: linux-watchdog@vger.kernel.org Cc: Nancy Yuen Cc: openbmc@lists.ozlabs.org Cc: Patrick Venture Cc: Tali Perry Cc: Tomer Maimon Cc: Wim Van Sebroeck Cc: Wim Van Sebroeck Paul Gortmaker (5): watchdog: rtd119x: drop unused module.h include watchdog: watchdog_core: make it explicitly non-modular watchdog: npcm: make it explicitly non-modular watchdog: intel_scu: make it explicitly non-modular watchdog: coh901327: make it explicitly non-modular drivers/watchdog/coh901327_wdt.c | 24 ++++-------------------- drivers/watchdog/intel_scu_watchdog.c | 18 ------------------ drivers/watchdog/npcm_wdt.c | 13 ++++++------- drivers/watchdog/rtd119x_wdt.c | 1 - drivers/watchdog/watchdog_core.c | 15 +-------------- 5 files changed, 11 insertions(+), 60 deletions(-)