From patchwork Mon Jun 6 09:41:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 69397 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1392130qgf; Mon, 6 Jun 2016 02:41:27 -0700 (PDT) X-Received: by 10.98.7.71 with SMTP id b68mr12627686pfd.71.1465206087604; Mon, 06 Jun 2016 02:41:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si27490846pfi.230.2016.06.06.02.41.27; Mon, 06 Jun 2016 02:41:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751137AbcFFJl0 (ORCPT + 2 others); Mon, 6 Jun 2016 05:41:26 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:34857 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbcFFJlZ (ORCPT ); Mon, 6 Jun 2016 05:41:25 -0400 X-Greylist: delayed 18712 seconds by postgrey-1.27 at vger.kernel.org; Mon, 06 Jun 2016 05:41:25 EDT Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id u569e1aG006920; Mon, 6 Jun 2016 18:40:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u569e1aG006920 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1465206005; bh=hmOOwO3AWyd1UmLL+x3AjhR6YOzaEGSI0G6WfSvsSTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aSNYvseq0mGZJU63J2ruDreJpl3KZwvYxGdhjTzSleExQsu49of9xHbkI4MIQU0Yy +t0u0We52GmqJ/8nk1FeuYkCGvuIzwxQI/cZk2EfYWuM8GzCV6n1ooztnfhCg2pc4t VNNTB698HQoAhHp+zohcxRw5cz0miGhLJ6Ya1p+JfN/J2UNfcFbyN7o7ptoeyF/gzF pzCZst34jAL+uPvwxSvgSF+kmabtu7JP2tA6ImUogEMuGFOb8LI5oqeN4refXcioVK cBhmBbThez3hHzq6QuqbjPivIgRc1txxZPhWO3iMmTTZL1WyNnWzFeHEtRVnVpSPHv uM5/VZXQh0JMQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-serial@vger.kernel.org Cc: Arnd Bergmann , Peter Hurley , Rob Herring , Paul Burton , Greg Kroah-Hartman , Matthias Brugger , Masahiro Yamada , linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 1/4] earlycon: mark earlycon code as __used iif the caller is built-in Date: Mon, 6 Jun 2016 18:41:00 +0900 Message-Id: <1465206063-1018-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465206063-1018-1-git-send-email-yamada.masahiro@socionext.com> References: <1465206063-1018-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Keep earlycon related symbols only when CONFIG_SERIAL_EARLYCON is enabled and the driver is built-in. This will be helpful to clean up ifdefs surrounding earlycon code in serial drivers. Signed-off-by: Masahiro Yamada --- include/linux/serial_core.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index a3d7c0d..2f44e20 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -352,9 +352,15 @@ struct earlycon_id { extern const struct earlycon_id __earlycon_table[]; extern const struct earlycon_id __earlycon_table_end[]; +#if defined(CONFIG_SERIAL_EARLYCON) && !defined(MODULE) +#define EARLYCON_USED_OR_UNUSED __used +#else +#define EARLYCON_USED_OR_UNUSED __maybe_unused +#endif + #define OF_EARLYCON_DECLARE(_name, compat, fn) \ static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name) \ - __used __section(__earlycon_table) \ + EARLYCON_USED_OR_UNUSED __section(__earlycon_table) \ = { .name = __stringify(_name), \ .compatible = compat, \ .setup = fn }