diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-05-21 03:52:16 -0400 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-05-21 03:52:16 -0400 |
| commit | e1b73cba13a0cc68dd4f746eced15bd6bb24cda4 (patch) | |
| tree | b1c9e10730724024a700031ad56c20419dabb500 /include/linux/ceph/decode.h | |
| parent | 98304ad186296dc1e655399e28d5973c21db6a73 (diff) | |
| parent | c7788792a5e7b0d5d7f96d0766b4cb6112d47d75 (diff) | |
Merge tag 'v3.10-rc2' into drm-intel-next-queued
Backmerge Linux 3.10-rc2 since the various (rather trivial) conflicts
grew a bit out of hand. intel_dp.c has the only real functional
conflict since the logic changed while dev_priv->edp.bpp was moved
around.
Also squash in a whitespace fixup from Ben Widawsky for
i915_gem_gtt.c, git seems to do something pretty strange in there
(which I don't fully understand tbh).
Conflicts:
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_dp.c
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/linux/ceph/decode.h')
| -rw-r--r-- | include/linux/ceph/decode.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 360d9d08ca9e..379f71508995 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h | |||
| @@ -8,6 +8,23 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/ceph/types.h> | 9 | #include <linux/ceph/types.h> |
| 10 | 10 | ||
| 11 | /* This seemed to be the easiest place to define these */ | ||
| 12 | |||
| 13 | #define U8_MAX ((u8)(~0U)) | ||
| 14 | #define U16_MAX ((u16)(~0U)) | ||
| 15 | #define U32_MAX ((u32)(~0U)) | ||
| 16 | #define U64_MAX ((u64)(~0ULL)) | ||
| 17 | |||
| 18 | #define S8_MAX ((s8)(U8_MAX >> 1)) | ||
| 19 | #define S16_MAX ((s16)(U16_MAX >> 1)) | ||
| 20 | #define S32_MAX ((s32)(U32_MAX >> 1)) | ||
| 21 | #define S64_MAX ((s64)(U64_MAX >> 1LL)) | ||
| 22 | |||
| 23 | #define S8_MIN ((s8)(-S8_MAX - 1)) | ||
| 24 | #define S16_MIN ((s16)(-S16_MAX - 1)) | ||
| 25 | #define S32_MIN ((s32)(-S32_MAX - 1)) | ||
| 26 | #define S64_MIN ((s64)(-S64_MAX - 1LL)) | ||
| 27 | |||
| 11 | /* | 28 | /* |
| 12 | * in all cases, | 29 | * in all cases, |
| 13 | * void **p pointer to position pointer | 30 | * void **p pointer to position pointer |
| @@ -137,14 +154,19 @@ bad: | |||
| 137 | static inline void ceph_decode_timespec(struct timespec *ts, | 154 | static inline void ceph_decode_timespec(struct timespec *ts, |
| 138 | const struct ceph_timespec *tv) | 155 | const struct ceph_timespec *tv) |
| 139 | { | 156 | { |
| 140 | ts->tv_sec = le32_to_cpu(tv->tv_sec); | 157 | ts->tv_sec = (__kernel_time_t)le32_to_cpu(tv->tv_sec); |
| 141 | ts->tv_nsec = le32_to_cpu(tv->tv_nsec); | 158 | ts->tv_nsec = (long)le32_to_cpu(tv->tv_nsec); |
| 142 | } | 159 | } |
| 143 | static inline void ceph_encode_timespec(struct ceph_timespec *tv, | 160 | static inline void ceph_encode_timespec(struct ceph_timespec *tv, |
| 144 | const struct timespec *ts) | 161 | const struct timespec *ts) |
| 145 | { | 162 | { |
| 146 | tv->tv_sec = cpu_to_le32(ts->tv_sec); | 163 | BUG_ON(ts->tv_sec < 0); |
| 147 | tv->tv_nsec = cpu_to_le32(ts->tv_nsec); | 164 | BUG_ON(ts->tv_sec > (__kernel_time_t)U32_MAX); |
| 165 | BUG_ON(ts->tv_nsec < 0); | ||
| 166 | BUG_ON(ts->tv_nsec > (long)U32_MAX); | ||
| 167 | |||
| 168 | tv->tv_sec = cpu_to_le32((u32)ts->tv_sec); | ||
| 169 | tv->tv_nsec = cpu_to_le32((u32)ts->tv_nsec); | ||
| 148 | } | 170 | } |
| 149 | 171 | ||
| 150 | /* | 172 | /* |
