Updates based on coding style review of PR 755

This commit is contained in:
Gregory Nutt 2018-11-09 07:51:43 -06:00
parent 96da659c0b
commit 31485356b8
2 changed files with 12 additions and 4 deletions

View File

@ -54,6 +54,7 @@
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/clock.h> #include <nuttx/clock.h>
#include <nuttx/signal.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/mmcsd.h> #include <nuttx/mmcsd.h>
@ -445,8 +446,9 @@ static int mmcsd_waitready(FAR struct mmcsd_slot_s *slot)
if (elapsed > MMCSD_DELAY_10MS) if (elapsed > MMCSD_DELAY_10MS)
{ {
// Give other threads time to run /* Give other threads time to run */
usleep(10000);
nxsig_usleep(10000);
} }
} }
while (elapsed < MMCSD_DELAY_500MS); while (elapsed < MMCSD_DELAY_500MS);

View File

@ -758,7 +758,9 @@ static inline int fat_createalias(struct fat_dirinfo_s *dirinfo)
#if defined(CONFIG_FAT_LFN_ALIAS_TRAILCHARS) && CONFIG_FAT_LFN_ALIAS_TRAILCHARS > 0 #if defined(CONFIG_FAT_LFN_ALIAS_TRAILCHARS) && CONFIG_FAT_LFN_ALIAS_TRAILCHARS > 0
/* Take first 6-N characters from beginning of filename and last N /* Take first 6-N characters from beginning of filename and last N
* characters from end of the filename. Useful for filenames like * characters from end of the filename. Useful for filenames like
* "datafile123.txt". */ * "datafile123.txt".
*/
if (ndx == 6 - CONFIG_FAT_LFN_ALIAS_TRAILCHARS if (ndx == 6 - CONFIG_FAT_LFN_ALIAS_TRAILCHARS
&& namechars > CONFIG_FAT_LFN_ALIAS_TRAILCHARS) && namechars > CONFIG_FAT_LFN_ALIAS_TRAILCHARS)
{ {
@ -849,10 +851,14 @@ static inline int fat_uniquealias(struct fat_mountpt_s *fs,
DEBUGASSERT(dirinfo->fd_name[lsdigit] == '1'); DEBUGASSERT(dirinfo->fd_name[lsdigit] == '1');
#ifdef CONFIG_FAT_LFN_ALIAS_HASH #ifdef CONFIG_FAT_LFN_ALIAS_HASH
/* Add a hash of the long filename to the short filename, to reduce collisions. */ /* Add a hash of the long filename to the short filename, to reduce
* collisions.
*/
if ((ret = fat_findalias(fs, dirinfo)) == OK) if ((ret = fat_findalias(fs, dirinfo)) == OK)
{ {
uint16_t hash = dirinfo->fd_seq.ds_offset; uint16_t hash = dirinfo->fd_seq.ds_offset;
for (i = 0; dirinfo->fd_lfname[i] != '\0'; i++) for (i = 0; dirinfo->fd_lfname[i] != '\0'; i++)
{ {
hash = ((hash << 5) + hash) ^ dirinfo->fd_lfname[i]; hash = ((hash << 5) + hash) ^ dirinfo->fd_lfname[i];