diff options
author | Eliot Blennerhassett <EBlennerhassett@audioscience.com> | 2010-04-21 21:44:08 +1200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-21 18:45:19 +0200 |
commit | 948e2425b82a266e791a1644eb4d4bf711675c7b (patch) | |
tree | 8ea1b2b197cb145773375e1003c4d8fecefe0e1c | |
parent | 030d6d1b976615e2e6515f9b8ec771524540daf3 (diff) | |
download | alsa-driver-build-unstable-948e2425b82a266e791a1644eb4d4bf711675c7b.tar.gz |
asihpi - Remove superfluous c++ only extern "C", and some unused macros.
Signed-off-by: Eliot Blennerhassett <EBlennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | pci/asihpi/hpi.h | 11 | ||||
-rw-r--r-- | pci/asihpi/hpi_internal.h | 37 | ||||
-rw-r--r-- | pci/asihpi/hpidebug.h | 11 | ||||
-rw-r--r-- | pci/asihpi/hpimsgx.h | 12 |
4 files changed, 2 insertions, 69 deletions
diff --git a/pci/asihpi/hpi.h b/pci/asihpi/hpi.h index 8d9104092..99400de6c 100644 --- a/pci/asihpi/hpi.h +++ b/pci/asihpi/hpi.h @@ -55,12 +55,6 @@ i.e 3.05.02 is a development version /* Library version as documented in hpi-api-versions.txt */ #define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0) -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - #include <linux/types.h> #define HPI_EXCLUDE_DEPRECATED @@ -1999,11 +1993,6 @@ u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format, /* Until it's verified, this function is for Windows OSs only */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif #endif /*_H_HPI_ */ /* /////////////////////////////////////////////////////////////////////////////// diff --git a/pci/asihpi/hpi_internal.h b/pci/asihpi/hpi_internal.h index 00b702fb3..f1cd6f1a0 100644 --- a/pci/asihpi/hpi_internal.h +++ b/pci/asihpi/hpi_internal.h @@ -89,41 +89,13 @@ struct hpi_response; typedef void hpi_handler_func(struct hpi_message *, struct hpi_response *); -/** init a buffer that can be sized, from a constant 'C'. -Note that all the sizeof and conditionals are evaluated at -compile time, so this reduces to a memcpy with constant count. -*/ -#define HPI_STRCPY_C(dst, src) do { \ - if (sizeof(src) <= sizeof(dst))\ - memcpy(dst, src, sizeof(src));\ - else {\ - memcpy(dst, src, sizeof(dst)-1);\ - dst[sizeof(dst)-1] = 0;\ - } \ -} while (0) - -/** strncpy with null terminator 'Z' insertion */ -#define HPI_STRNCPY_Z(dst, src, dst_len) do { \ - strncpy(dst, src, dst_len);\ - dst[dst_len-1] = 0;\ -} while (0) - -/* strncpy when dst is char array that gives correct sizeof (not char*) 'SD' -and with null terminator insertion 'Z' */ -#define HPI_STRNCPY_SDZ(dst, src) HPI_STRNCPY_Z(dst, src, sizeof(dst)) - /* If the assert fails, compiler complains - something like size of array `msg' is negative + something like size of array `msg' is negative. + Unlike linux BUILD_BUG_ON, this works outside function scope. */ #define compile_time_assert(cond, msg) \ typedef char ASSERT_##msg[(cond) ? 1 : -1] -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - /*/////////////////////////////////////////////////////////////////////////// */ /* Private HPI Entity related definitions */ @@ -1666,9 +1638,4 @@ hpi_handler_func HPI_6000; hpi_handler_func HPI_6205; hpi_handler_func HPI_COMMON; -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif #endif /* _HPI_INTERNAL_H_ */ diff --git a/pci/asihpi/hpidebug.h b/pci/asihpi/hpidebug.h index ef901924b..44dccadcc 100644 --- a/pci/asihpi/hpidebug.h +++ b/pci/asihpi/hpidebug.h @@ -25,12 +25,6 @@ Debug macros. #include "hpi_internal.h" -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - /* Define debugging levels. */ enum { HPI_DEBUG_LEVEL_ERROR = 0, /* always log errors */ HPI_DEBUG_LEVEL_WARNING = 1, @@ -388,9 +382,4 @@ compile_time_assert((HPI_DESTNODE_LAST_INDEX - HPI_DESTNODE_BASE + 1) == (8), "HPI_CHANNEL_MODE_RIGHT_ONLY" \ } -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif #endif /* _HPIDEBUG_H */ diff --git a/pci/asihpi/hpimsgx.h b/pci/asihpi/hpimsgx.h index dbace55ef..fd49e7542 100644 --- a/pci/asihpi/hpimsgx.h +++ b/pci/asihpi/hpimsgx.h @@ -26,12 +26,6 @@ #include "hpi_internal.h" -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - #define HPIMSGX_ALLADAPTERS (0xFFFF) void hpi_send_recv_ex(struct hpi_message *phm, struct hpi_response *phr, @@ -39,10 +33,4 @@ void hpi_send_recv_ex(struct hpi_message *phm, struct hpi_response *phr, #define HPI_MESSAGE_LOWER_LAYER hpi_send_recv_ex -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif - #endif /* _HPIMSGX_H_ */ |