diff --git a/usr/fileio/common.c b/usr/fileio/common.c index c6e33c8e9..cc010b5a2 100644 --- a/usr/fileio/common.c +++ b/usr/fileio/common.c @@ -1561,7 +1561,7 @@ static void exec_read_capacity16(struct vdisk_cmd *vcmd) buffer[4] = (nblocks >> 24) & 0xFF; buffer[5] = (nblocks >> 16) & 0xFF; buffer[6] = (nblocks >> 8) & 0xFF; - buffer[7] = nblocks& 0xFF; + buffer[7] = nblocks & 0xFF; buffer[8] = (blocksize >> (BYTE * 3)) & 0xFF; buffer[9] = (blocksize >> (BYTE * 2)) & 0xFF; @@ -1602,7 +1602,7 @@ static void exec_read_toc(struct vdisk_cmd *vcmd) struct scst_user_scsi_cmd_reply_exec *reply = &vcmd->reply->exec_reply; int32_t off = 0; int length = cmd->bufflen; - uint8_t *address = (uint8_t*)(unsigned long)cmd->pbuf; + uint8_t *address = (uint8_t *)(unsigned long)cmd->pbuf; uint32_t nblocks; uint8_t buffer[4+8+8] = { 0x00, 0x0a, 0x01, 0x01, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/usr/fileio/common.h b/usr/fileio/common.h index 5977580ab..9b6e1d2c7 100644 --- a/usr/fileio/common.h +++ b/usr/fileio/common.h @@ -107,13 +107,13 @@ struct vdisk_cmd * strict type-checking.. See the * "unnecessary" pointer comparison. */ -#define min(x,y) ({ \ +#define min(x, y) ({ \ typeof(x) _x = (x); \ typeof(y) _y = (y); \ (void) (&_x == &_y); \ _x < _y ? _x : _y; }) -#define max(x,y) ({ \ +#define max(x, y) ({ \ typeof(x) _x = (x); \ typeof(y) _y = (y); \ (void) (&_x == &_y); \ diff --git a/usr/fileio/crc32.c b/usr/fileio/crc32.c index d87bc6d2e..4f0d4ac58 100644 --- a/usr/fileio/crc32.c +++ b/usr/fileio/crc32.c @@ -92,17 +92,18 @@ static uint32_t crc_32_tab[] = { /* CRC polynomial 0xedb88320 */ 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; -#define UPDC32(octet,crc) (crc_32_tab[((crc) ^ ((uint8_t)octet)) & 0xff] ^ ((crc) >> 8)) +#define UPDC32(octet, crc) \ + (crc_32_tab[((crc) ^ ((uint8_t)octet)) & 0xff] ^ ((crc) >> 8)) uint32_t crc32buf(const char *buf, size_t len) { - register uint32_t oldcrc32; + register uint32_t oldcrc32; - oldcrc32 = 0xFFFFFFFF; + oldcrc32 = 0xFFFFFFFF; - for ( ; len; --len, ++buf) { - oldcrc32 = UPDC32(*buf, oldcrc32); - } + for ( ; len; --len, ++buf) { + oldcrc32 = UPDC32(*buf, oldcrc32); + } - return ~oldcrc32; + return ~oldcrc32; }