From commits-return-9216-archive-asf-public=cust-asf.ponee.io@nuttx.apache.org Thu May 7 19:49:24 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id EC81D18062B for ; Thu, 7 May 2020 21:49:23 +0200 (CEST) Received: (qmail 53683 invoked by uid 500); 7 May 2020 19:49:23 -0000 Mailing-List: contact commits-help@nuttx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nuttx.apache.org Delivered-To: mailing list commits@nuttx.apache.org Received: (qmail 53674 invoked by uid 99); 7 May 2020 19:49:23 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2020 19:49:23 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id E85F58BFAB; Thu, 7 May 2020 19:49:22 +0000 (UTC) Date: Thu, 07 May 2020 19:49:22 +0000 To: "commits@nuttx.apache.org" Subject: [incubator-nuttx] branch master updated: sched/init/nx_start.c: Reinstate logic to remove compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <158888096279.27449.12923173444548419656@gitbox.apache.org> From: gnutt@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-nuttx X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 1ad03a5a13c81d15c70ba3969b4f6145986a510d X-Git-Newrev: 930a446a7b8e218942f9d9c0c02daf01b2c3856c X-Git-Rev: 930a446a7b8e218942f9d9c0c02daf01b2c3856c X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. gnutt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git The following commit(s) were added to refs/heads/master by this push: new 930a446 sched/init/nx_start.c: Reinstate logic to remove compiler warning 930a446 is described below commit 930a446a7b8e218942f9d9c0c02daf01b2c3856c Author: Nathan Hartman <59230071+hartmannathan@users.noreply.github.com> AuthorDate: Thu May 7 15:06:05 2020 -0400 sched/init/nx_start.c: Reinstate logic to remove compiler warning Revert a portion of eca70597858bc619d3114901d16e4a30f1ebffbe that causes compiler warnings about unused variables if nx_start() is not initializing any of the user-mode heap, kernel-mode heap, or page allocator: init/nx_start.c: In function 'nx_start': init/nx_start.c:552:14: warning: unused variable 'heap_size' [-Wunused-variable] size_t heap_size; ^~~~~~~~~ init/nx_start.c:551:17: warning: unused variable 'heap_start' [-Wunused-variable] FAR void *heap_start; ^~~~~~~~~~ See dev@nuttx.apache.org mailing list discussion "New unused variables warning in nx_start()" starting 6 May 2020, archived here: https://lists.apache.org/thread.html/r3900727e6a06f4445d6eb881d065119ba6647daab89600c3d45d1424%40%3Cdev.nuttx.apache.org%3E sched/init/nx_start.c: * If none of MM_KERNEL_USRHEAP_INIT, CONFIG_MM_KERNEL_HEAP, or CONFIG_MM_PGALLOC are defined, the variables heap_start and heap_size were declared but never used. * This change reinstates wrapping the block with a preprocessor conditional to prevent the variables being declared if they will not be used. This preprocessor condition was removed in the above-mentioned commit. --- sched/init/nx_start.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index 75abadd..b1c4d46 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -545,6 +545,8 @@ void nx_start(void) nxsem_initialize(); +#if defined(MM_KERNEL_USRHEAP_INIT) || defined(CONFIG_MM_KERNEL_HEAP) || \ + defined(CONFIG_MM_PGALLOC) /* Initialize the memory manager */ { @@ -579,6 +581,7 @@ void nx_start(void) mm_pginitialize(heap_start, heap_size); #endif } +#endif #ifdef CONFIG_ARCH_USE_MODULE_TEXT up_module_text_init();