From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Thu, 12 Jun 2014 23:20:20 +0200 Subject: [U-Boot] [PATCH v2] sandbox: change local_irq_save() to macro In-Reply-To: <1402543575-29150-1-git-send-email-yamada.m@jp.panasonic.com> References: <1402543575-29150-1-git-send-email-yamada.m@jp.panasonic.com> Message-ID: <1402608020.4590.5.camel@yellow> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On do, 2014-06-12 at 12:26 +0900, Masahiro Yamada wrote: > local_irq_save() should be a macro, not a function > because local_irq_save() saves flag to the given argument. > > GCC is silent about this issue, but Clang warns: > > In file included from lib/asm-offsets.c:15: > In file included from include/common.h:20: > In file included from include/linux/bitops.h:110: > arch/sandbox/include/asm/bitops.h:59:17: > warning: variable 'flags' is uninitialized when used here > [-Wuninitialized] > local_irq_save(flags); > ^~~~~ > > That change causes another warning: > > In file included from include/linux/bitops.h:110:0, > from include/common.h:20, > from lib/asm-offsets.c:15: > arch/sandbox/include/asm/bitops.h: In function ?test_and_set_bit?: > arch/sandbox/include/asm/bitops.h:56:16: warning: unused variable ?flags? [-Wunused-variable] > > So, flags should be set to __always_unused. > > Signed-off-by: Masahiro Yamada > Cc: Simon Glass > Cc: Jeroen Hofstee Acked-by: Jeroen Hofstee Regards, Jeroen