You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2023/01/16 21:59:51 UTC

[nuttx] branch master updated: Fix warning in file included from chip/sam_clockconfig.c:34:

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 62c5afe655 Fix warning in file included from chip/sam_clockconfig.c:34:
62c5afe655 is described below

commit 62c5afe6550fa8b5fb98cee6fc4afc60c85e1a89
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jan 16 23:54:17 2023 +0800

    Fix warning in file included from chip/sam_clockconfig.c:34:
    
    chip/sam_clockconfig.c: In function 'sam_usbclockconfig':
    Error: /github/workspace/sources/nuttx/arch/arm/src/common/arm_internal.h:135:51: error: 'regval' is used uninitialized [-Werror=uninitialized]
      135 | #define putreg32(v,a)  (*(volatile uint32_t *)(a) = (v))
          |                                                   ^
    chip/sam_clockconfig.c:422:12: note: 'regval' was declared here
      422 |   uint32_t regval;
          |            ^~~~~~
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/arm/src/sama5/sam_clockconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/src/sama5/sam_clockconfig.c b/arch/arm/src/sama5/sam_clockconfig.c
index e7806eef11..2cafe8b675 100644
--- a/arch/arm/src/sama5/sam_clockconfig.c
+++ b/arch/arm/src/sama5/sam_clockconfig.c
@@ -466,10 +466,10 @@ static inline void sam_usbclockconfig(void)
   regval |= SFR_UTMICKTRIM_FREQ_48MHZ;
 #else
 #  error Board oscillator frequency not compatible with use of UPLL
-#endif
 #endif
 
   putreg32(regval, (SAM_SFR_VBASE + SAM_SFR_UTMICKTRIM_OFFSET));
+#endif
 
   regval = PMC_CKGR_UCKR_UPLLCOUNT(BOARD_CKGR_UCKR_UPLLCOUNT);
   putreg32(regval, SAM_PMC_CKGR_UCKR);