Skip to content

Commit

Permalink
MIPS: math-emu: Cleanup ieee754si_indef() / ieee754di_indef().
Browse files Browse the repository at this point in the history
LONG_LONG_MAX is a symbol defined in <limits.h> which may not be available
so better rely on something provided by a kernel header.  While at it,
turn these function-like macros into inline functions.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed May 23, 2014
1 parent 92df0f8 commit e812a73
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions arch/mips/math-emu/ieee754.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <linux/compiler.h>
#include <asm/byteorder.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <asm/bitfield.h>
Expand Down Expand Up @@ -394,12 +395,15 @@ extern const struct ieee754sp_const __ieee754sp_spcvals[];
/*
* Indefinite integer value
*/
#define ieee754si_indef() INT_MAX
#ifdef LONG_LONG_MAX
#define ieee754di_indef() LONG_LONG_MAX
#else
#define ieee754di_indef() ((s64)(~0ULL>>1))
#endif
static inline int ieee754si_indef(void)
{
return INT_MAX;
}

static inline s64 ieee754di_indef(void)
{
return S64_MAX;
}

/* IEEE exception context, passed to handler */
struct ieee754xctx {
Expand Down

0 comments on commit e812a73

Please sign in to comment.