From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Behun Date: Wed, 22 Apr 2020 10:26:53 +0200 Subject: [PATCH U-BOOT 03/26] fs: btrfs: Cross-port btrfs_read_dev_super() from btrfs-progs In-Reply-To: <20200422065009.69392-4-wqu@suse.com> References: <20200422065009.69392-1-wqu@suse.com> <20200422065009.69392-4-wqu@suse.com> Message-ID: <20200422102653.0dee168f@nic.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 22 Apr 2020 14:49:46 +0800 Qu Wenruo wrote: > +/* A simple wraper to for error() from btrfs-progs */ > +#define error(...) { printf(__VA_ARGS__); printf("\n"); } Is this from btrfs-progs? I don't like these macros much, I prefer to use static inline functions. static inline void error(const char *fmt, ...) { printf(fmt, __builtin_va_arg_pack()); printf("\n"); } Attribute for printf can be added to check printf specifiers: __attribute__((format (__printf__, 1, 2))) It is possible that this won't compile when optimizations are disabled. In that case more attributes are needed __always_inline __attribute__((__gnu_inline__)) These could be defined as a macro in include/linux/compiler-gcc.h #define __gnu_inline __always_inline __attribute__((__gnu_inline__)) Marek