mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-17 04:36:22 +00:00
usr/fileio: Make the coding style more consistent
This patch only changes whitespace. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+2
-2
@@ -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 };
|
||||
|
||||
+2
-2
@@ -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); \
|
||||
|
||||
+8
-7
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user