Fix bad dev[u]random_register() function return value.

This commit is contained in:
Gregory Nutt 2016-07-18 12:25:05 -06:00
parent d9fbf4c90f
commit d36da2b560
5 changed files with 66 additions and 20 deletions

View File

@ -400,7 +400,7 @@ static int sam_rng_initialize(void)
****************************************************************************/
#ifdef CONFIG_DEV_RANDOM
int devrandom_register(void)
void devrandom_register(void)
{
int ret;
@ -413,8 +413,6 @@ int devrandom_register(void)
ferr("ERROR: Failed to register /dev/random\n");
}
}
return ret;
}
#endif
@ -424,10 +422,16 @@ int devrandom_register(void)
* Description:
* Register /dev/urandom
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_DEV_URANDOM_ARCH
int devurandom_register(void)
void devurandom_register(void)
{
int ret;
@ -442,8 +446,6 @@ int devurandom_register(void)
ferr("ERROR: Failed to register /dev/urandom\n");
}
}
return ret;
}
#endif

View File

@ -401,7 +401,7 @@ static int sam_rng_initialize(void)
****************************************************************************/
#ifdef CONFIG_DEV_RANDOM
int devrandom_register(void)
void devrandom_register(void)
{
int ret;
@ -414,8 +414,6 @@ int devrandom_register(void)
ferr("ERROR: Failed to register /dev/random\n");
}
}
return ret;
}
#endif
@ -425,10 +423,16 @@ int devrandom_register(void)
* Description:
* Register /dev/urandom
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_DEV_URANDOM_ARCH
int devurandom_register(void)
void devurandom_register(void)
{
int ret;
@ -443,8 +447,6 @@ int devurandom_register(void)
ferr("ERROR: Failed to register /dev/urandom\n");
}
}
return ret;
}
#endif

View File

@ -277,10 +277,10 @@ static ssize_t stm32_read(struct file *filep, char *buffer, size_t buflen)
****************************************************************************/
#ifdef CONFIG_DEV_RANDOM
int devrandom_register(void)
void devrandom_register(void)
{
stm32_rng_initialize();
return register_driver("/dev/random", &g_rngops, 0444, NULL);
(void)register_driver("/dev/random", &g_rngops, 0444, NULL);
}
#endif
@ -290,15 +290,21 @@ int devrandom_register(void)
* Description:
* Register /dev/urandom
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_DEV_URANDOM_ARCH
int devurandom_register(void)
void devurandom_register(void)
{
#ifndef CONFIG_DEV_RANDOM
stm32l4_rnginitialize();
#endif
return register_driver("/dev/urandom", &g_rngops, 0444, NULL);
(void)register_driver("/dev/urandom", &g_rngops, 0444, NULL);
}
#endif

View File

@ -306,10 +306,10 @@ static ssize_t stm32l4_rngread(struct file *filep, char *buffer, size_t buflen)
****************************************************************************/
#ifdef CONFIG_DEV_RANDOM
int devrandom_register(void)
void devrandom_register(void)
{
stm32l4_rng_initialize();
return register_driver("/dev/random", &g_rngops, 0444, NULL);
(void)register_driver("/dev/random", &g_rngops, 0444, NULL);
}
#endif
@ -319,15 +319,21 @@ int devrandom_register(void)
* Description:
* Register /dev/urandom
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_DEV_URANDOM_ARCH
int devurandom_register(void)
void devurandom_register(void)
{
#ifndef CONFIG_DEV_RANDOM
stm32l4_rng_initialize();
#endif
return register_driver("/dev/urandom", &g_rngops, 0444, NULL);
(void)register_driver("/dev/urandom", &g_rngops, 0444, NULL);
}
#endif

View File

@ -1009,6 +1009,12 @@ int fdesc_poll(int fd, FAR struct pollfd *fds, bool setup);
* Description:
* Register /dev/null
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void devnull_register(void);
@ -1019,6 +1025,12 @@ void devnull_register(void);
* Description:
* Initialize the RNG hardware and register the /dev/random driver.
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_DEV_RANDOM
@ -1031,6 +1043,12 @@ void devrandom_register(void);
* Description:
* Register /dev/urandom
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_DEV_URANDOM
@ -1043,6 +1061,12 @@ void devurandom_register(void);
* Description:
* Register /dev/crypto
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void devcrypto_register(void);
@ -1053,6 +1077,12 @@ void devcrypto_register(void);
* Description:
* Register /dev/zero
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void devzero_register(void);