This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/6] Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 14 Aug 2015 10:42:06 -0700
- Subject: Re: [PATCH 1/6] Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN
- Authentication-results: sourceware.org; auth=none
- References: <20150814120014 dot GA28610 at gmail dot com> <87oaiavy2c dot fsf at igel dot home> <CAMe9rOoP9GPP+i6xbAXwHffwr+KOKNhV=FsJ5sx=G2bM_1SE+g at mail dot gmail dot com> <87oai9vkg7 dot fsf at igel dot home>
On Fri, Aug 14, 2015 at 10:39 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> +#define INLINE_SYSCALL_RETURN(name, nr, type, args...) \
>> + do \
>> + { \
>> + return (type) INLINE_SYSCALL (name, nr, args); \
>> + } \
>> + while (0)
>
> There is no point for using do while here.
I can use
#define INLINE_SYSCALL_RETURN(name, nr, type, args...) \
return (type) INLINE_SYSCALL (name, nr, args)
>
> Also, I don't like the hiding of return in the macro.
i386 version isn't a simple return:
#define INLINE_SYSCALL_RETURN(name, nr, type, args...) \
do \
{ \
unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args); \
if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, ))) \
INLINE_SYSCALL_ERROR_RETURN (resultvar, type, ); \
return (type) resultvar; \
} \
while (0)
What is your suggestion?
--
H.J.