drivers/: Fixes to spacing and alignement

This commit is contained in:
Gregory Nutt
2015-10-10 10:41:00 -06:00
parent e675ddb813
commit cf14f8d1b5
108 changed files with 1131 additions and 1097 deletions
+1 -1
View File
@@ -322,7 +322,7 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
#if defined(CONFIG_BCH_ENCRYPTION)
else if (cmd == DIOC_SETKEY)
{
memcpy(bch->key, (void*)arg, CONFIG_BCH_ENCRYPTION_KEY_SIZE);
memcpy(bch->key, (FAR void *)arg, CONFIG_BCH_ENCRYPTION_KEY_SIZE);
ret = OK;
}
#endif
+5 -2
View File
@@ -91,13 +91,16 @@ static void bch_xor(uint32_t *R, uint32_t *A, uint32_t *B)
static int bch_cypher(FAR struct bchlib_s *bch, int encrypt)
{
int blocks = bch->sectsize / 16;
uint32_t *buffer = (uint32_t*)bch->buffer;
FAR uint32_t *buffer = (FAR uint32_t *)bch->buffer;
int i;
for (i = 0; i < blocks; i++, buffer += 16 / sizeof(uint32_t) )
{
uint32_t T[4];
uint32_t X[4] = {bch->sector, 0, 0, i};
uint32_t X[4] =
{
bch->sector, 0, 0, i
};
aes_cypher(X, X, 16, NULL, bch->key, CONFIG_BCH_ENCRYPTION_KEY_SIZE,
AES_MODE_ECB, CYPHER_ENCRYPT);
+1 -1
View File
@@ -148,7 +148,7 @@ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset, size_t le
* into the user buffer.
*/
if (len >= bch->sectsize )
if (len >= bch->sectsize)
{
nsectors = len / bch->sectsize;
if (sector + nsectors > bch->nsectors)
+1 -1
View File
@@ -93,7 +93,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
/* Allocate the BCH state structure */
bch = (FAR struct bchlib_s*)kmm_zalloc(sizeof(struct bchlib_s));
bch = (FAR struct bchlib_s *)kmm_zalloc(sizeof(struct bchlib_s));
if (!bch)
{
fdbg("Failed to allocate BCH structure\n");
+1 -1
View File
@@ -148,7 +148,7 @@ ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset, si
* directly from the user buffer.
*/
if (len >= bch->sectsize )
if (len >= bch->sectsize)
{
nsectors = len / bch->sectsize;
if (sector + nsectors > bch->nsectors)