It's just a wrapper around strlen(), so call that instead.
Also add a few #include <linux/string.h> to fix up the build with this
change.
Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
void CsrCharStringDes(char **value, u8 *buffer, size_t *offset)
{
*value = kstrdup((char *) &buffer[*offset], GFP_KERNEL);
- *offset += CsrStrLen(*value) + 1;
+ *offset += strlen(*value) + 1;
}
EXPORT_SYMBOL_GPL(CsrCharStringDes);
void CsrUtf8StringDes(u8 **value, u8 *buffer, size_t *offset)
{
*value = (u8 *)kstrdup((char *) &buffer[*offset], GFP_KERNEL);
- *offset += CsrStrLen((char *) *value) + 1;
+ *offset += strlen((char *) *value) + 1;
}
void CsrUtf16StringDes(u16 **value, u8 *buffer, size_t *offset)
if (value)
{
strcpy(((char *) &buffer[*offset]), value);
- *offset += CsrStrLen(value) + 1;
+ *offset += strlen(value) + 1;
}
else
{
{
if (str)
{
- return (u32) (CsrStrLen(str) + sizeof(*str));
+ return (u32)(strlen(str) + sizeof(*str));
}
else
{
{
if (str)
{
- return (u32) (CsrStrLen((char *) str) + sizeof(*str));
+ return (u32)(strlen((char *) str) + sizeof(*str));
}
else
{
size_t CsrEventCsrUint16CsrCharStringSizeof(void *msg)
{
CsrEventCsrUint16CsrCharString *primitive = (CsrEventCsrUint16CsrCharString *) msg;
- return 4 + CsrStrLen(primitive->value2) + 1;
+ return 4 + strlen(primitive->value2) + 1;
}
u8 *CsrEventCsrUint16CsrCharStringSer(u8 *ptr, size_t *len, void *msg)
size_t CsrEventCsrUint32CsrCharStringSizeof(void *msg)
{
CsrEventCsrUint32CsrCharString *primitive = (CsrEventCsrUint32CsrCharString *) msg;
- return 6 + CsrStrLen(primitive->value2) + 1;
+ return 6 + strlen(primitive->value2) + 1;
}
u8 *CsrEventCsrUint32CsrCharStringSer(u8 *ptr, size_t *len, void *msg)
{
return NULL;
}
- sourceLength = CsrStrLen((char *) utf8String);
+ sourceLength = strlen((char *)utf8String);
for (i = 0; i < sourceLength; i++)
{
size_t length = 0;
if (string)
{
- length = CsrStrLen((const char *) string);
+ length = strlen((const char *)string);
}
return (u32) length;
}
EXPORT_SYMBOL_GPL(CsrMemCpy);
#endif
-#ifndef CSR_USE_STDC_LIB
-size_t CsrStrLen(const char *string)
-{
- return strlen(string);
-}
-EXPORT_SYMBOL_GPL(CsrStrLen);
-#endif
-
MODULE_DESCRIPTION("CSR Operating System Kernel Abstraction");
MODULE_AUTHOR("Cambridge Silicon Radio Ltd.");
MODULE_LICENSE("GPL and additional rights");
/*------------------------------------------------------------------*/
#ifdef CSR_USE_STDC_LIB
#define CsrMemCpy memcpy
-#define CsrStrLen strlen
#else /* !CSR_USE_STDC_LIB */
void *CsrMemCpy(void *dest, const void *src, size_t count);
-size_t CsrStrLen(const char *string);
#endif /* !CSR_USE_STDC_LIB */
#define CsrOffsetOf(st, m) ((size_t) & ((st *) 0)->m)
*****************************************************************************/
/* Note: this is an auto-generated file. */
-
+#include <linux/string.h>
#include "csr_pmem.h"
#include "csr_msgconv.h"
#include "csr_unicode.h"
break;
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
bufferSize += 2; /* u16 primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.encryptionMode */
- bufferSize += (primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase?CsrStrLen(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase) : 0) + 1; /* char* primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase (0 byte len + 1 for NULL Term) */
+ bufferSize += (primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase ? strlen(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase) : 0) + 1; /* char* primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase (0 byte len + 1 for NULL Term) */
break;
default:
break;
*****************************************************************************/
/* Note: this is an auto-generated file. */
-
+#include <linux/string.h>
#include "csr_pmem.h"
#include "csr_msgconv.h"
#include "csr_unicode.h"
}
}
bufferSize += 4; /* u32 primitive->smeVersions.firmwarePatch */
- bufferSize += (primitive->smeVersions.smeBuild?CsrStrLen(primitive->smeVersions.smeBuild) : 0) + 1; /* char* primitive->smeVersions.smeBuild (0 byte len + 1 for NULL Term) */
+ bufferSize += (primitive->smeVersions.smeBuild ? strlen(primitive->smeVersions.smeBuild) : 0) + 1; /* char* primitive->smeVersions.smeBuild (0 byte len + 1 for NULL Term) */
bufferSize += 4; /* u32 primitive->smeVersions.smeHip */
bufferSize += 1; /* u8 primitive->scheduledInterrupt */
return bufferSize;
bufferSize += 4; /* u32 primitive->versions.chipVersion */
bufferSize += 4; /* u32 primitive->versions.firmwareBuild */
bufferSize += 4; /* u32 primitive->versions.firmwareHip */
- bufferSize += (primitive->versions.routerBuild?CsrStrLen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
+ bufferSize += (primitive->versions.routerBuild ? strlen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
bufferSize += 4; /* u32 primitive->versions.routerHip */
return bufferSize;
}
*****************************************************************************/
/* Note: this is an auto-generated file. */
-
+#include <linux/string.h>
#include "csr_pmem.h"
#include "csr_msgconv.h"
#include "csr_unicode.h"
bufferSize += 4; /* u32 primitive->versions.firmwareBuild */
bufferSize += 4; /* u32 primitive->versions.firmwarePatch */
bufferSize += 4; /* u32 primitive->versions.firmwareHip */
- bufferSize += (primitive->versions.routerBuild?CsrStrLen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
+ bufferSize += (primitive->versions.routerBuild ? strlen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
bufferSize += 4; /* u32 primitive->versions.routerHip */
- bufferSize += (primitive->versions.smeBuild?CsrStrLen(primitive->versions.smeBuild) : 0) + 1; /* char* primitive->versions.smeBuild (0 byte len + 1 for NULL Term) */
+ bufferSize += (primitive->versions.smeBuild ? strlen(primitive->versions.smeBuild) : 0) + 1; /* char* primitive->versions.smeBuild (0 byte len + 1 for NULL Term) */
bufferSize += 4; /* u32 primitive->versions.smeHip */
return bufferSize;
}
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 3) */
- bufferSize += (primitive->errorMessage?CsrStrLen(primitive->errorMessage) : 0) + 1; /* char* primitive->errorMessage (0 byte len + 1 for NULL Term) */
+ bufferSize += (primitive->errorMessage ? strlen(primitive->errorMessage) : 0) + 1; /* char* primitive->errorMessage (0 byte len + 1 for NULL Term) */
return bufferSize;
}
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 3) */
- bufferSize += (primitive->infoMessage?CsrStrLen(primitive->infoMessage) : 0) + 1; /* char* primitive->infoMessage (0 byte len + 1 for NULL Term) */
+ bufferSize += (primitive->infoMessage ? strlen(primitive->infoMessage) : 0) + 1; /* char* primitive->infoMessage (0 byte len + 1 for NULL Term) */
return bufferSize;
}