lkml.org 
[lkml]   [2010]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/19] Add ioctl() argument and attribute handling utils
Miloslav Trmač wrote:
> --- /dev/null
> +++ b/crypto/userspace/utils.c
[...]
> +#ifdef CONFIG_COMPAT
> +/* max() is too clever for compile-time constants */
> +#define CONST_MAX(A, B) ((A) > (B) ? (A) : (B))
> +
> +#define MAX_SESSION_INPUT_DATA_SIZE \
> + (CONST_MAX(sizeof(struct ncr_session_input_data), \
> + sizeof(struct compat_ncr_session_input_data)))
> +#define MAX_SESSION_OUTPUT_BUFFER_SIZE \
> + (CONST_MAX(sizeof(struct ncr_session_output_buffer), \
> + sizeof(struct compat_ncr_session_output_buffer)))
> +
> +#else /* !CONFIG_COMPAT */
> +
> +#define MAX_SESSION_INPUT_DATA_SIZE (sizeof(struct ncr_session_input_data))
> +#define MAX_SESSION_OUTPUT_BUFFER_SIZE \
> + (sizeof(struct ncr_session_output_buffer))
> +
> +#endif /* !CONFIG_COMPAT */

struct compat_xyz cannot be bigger than struct xyz, can it?
--
Stefan Richter
-=====-==-=- =--- =-=--
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-08-20 15:01    [W:0.224 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site