mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
drivers/: Fixes to spacing and alignement
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user