diff --git a/iscsi-scst/usr/chap.c b/iscsi-scst/usr/chap.c index 5c9c2fd13..9b7b1e054 100644 --- a/iscsi-scst/usr/chap.c +++ b/iscsi-scst/usr/chap.c @@ -171,7 +171,7 @@ static inline void encode_hex_string(u8 *intnum, long length, char *string) strptr = string; for (i = 0; i < length; i++, strptr += 2) - sprintf(strptr, "%.2hhx", intnum[i]); + sprintf(strptr, "%.2hhx", intnum[i]); } /* Base64 encoding, taken from UNH iSCSI "IntegerToBase64String()" */ @@ -339,15 +339,15 @@ static inline void chap_calc_digest_sha1(char chap_id, const char *secret, int s */ static int chap_rand(void) { - int fd; - int r; + int fd; + int r; - fd = open("/dev/urandom", O_RDONLY); - assert(fd != -1); - if (read(fd, &r, sizeof(r)) < sizeof(r)) { - } - close(fd); - return r; + fd = open("/dev/urandom", O_RDONLY); + assert(fd != -1); + if (read(fd, &r, sizeof(r)) < sizeof(r)) { + } + close(fd); + return r; } static int chap_initiator_auth_create_challenge(struct connection *conn) @@ -639,7 +639,7 @@ int cmnd_exec_auth_chap(struct connection *conn) { int res; - switch(conn->auth_state) { + switch (conn->auth_state) { case CHAP_AUTH_STATE_START: res = chap_initiator_auth_create_challenge(conn); break; diff --git a/iscsi-scst/usr/ctldev.c b/iscsi-scst/usr/ctldev.c index 38bbba576..08db4d72b 100644 --- a/iscsi-scst/usr/ctldev.c +++ b/iscsi-scst/usr/ctldev.c @@ -298,7 +298,7 @@ int kernel_params_get(u32 tid, u64 sid, int type, struct iscsi_param *params) if ((err = ioctl(ctrl_fd, ISCSI_PARAM_GET, &info)) < 0) { err = -errno; - log_debug(1, "Can't get session params for session 0x%" PRIx64 + log_debug(1, "Can't get session params for session 0x%" PRIx64 " (tid %u, err %d): %s\n", sid, tid, err, strerror(errno)); } diff --git a/iscsi-scst/usr/event.c b/iscsi-scst/usr/event.c index fef761a4f..7bbd1f418 100644 --- a/iscsi-scst/usr/event.c +++ b/iscsi-scst/usr/event.c @@ -57,7 +57,7 @@ static int nl_write(int fd, void *data, int len) nlh.nlmsg_type = 0; memset(&msg, 0, sizeof(msg)); - msg.msg_name= (void *)&dest_addr; + msg.msg_name = (void *)&dest_addr; msg.msg_namelen = sizeof(dest_addr); msg.msg_iov = iov; msg.msg_iovlen = 2; diff --git a/iscsi-scst/usr/iscsi_scstd.c b/iscsi-scst/usr/iscsi_scstd.c index a12c8dcb7..31bcc7f3a 100644 --- a/iscsi-scst/usr/iscsi_scstd.c +++ b/iscsi-scst/usr/iscsi_scstd.c @@ -40,7 +40,7 @@ #include "iscsid.h" #include "iscsi_adm.h" -static char* server_address; +static char *server_address; uint16_t server_port = ISCSI_LISTEN_PORT; struct pollfd poll_array[POLL_MAX]; @@ -620,7 +620,7 @@ again: switch (conn->state) { case STATE_KERNEL: conn_pass_to_kern(conn, pollfd->fd); - if(conn->passed_to_kern) + if (conn->passed_to_kern) conn->state = STATE_CLOSE; else conn->state = STATE_EXIT; diff --git a/iscsi-scst/usr/iscsid.c b/iscsi-scst/usr/iscsid.c index ef8f08fa2..85c33d10f 100644 --- a/iscsi-scst/usr/iscsid.c +++ b/iscsi-scst/usr/iscsid.c @@ -576,7 +576,7 @@ static void login_start(struct connection *conn) if (!config_initiator_access_allowed(conn->tid, conn->fd) || !target_portal_allowed(target, conn->target_portal, - conn->initiator) || + conn->initiator) || !isns_scn_access_allowed(conn->tid, name)) { log_info("Initiator %s not allowed to connect to " "target %s", name, target_name); @@ -698,21 +698,21 @@ static void cmnd_reject(struct connection *conn, u8 reason) static int cmnd_exec_auth(struct connection *conn) { - int res; + int res; - switch (conn->auth_method) { - case AUTH_CHAP: - res = cmnd_exec_auth_chap(conn); - break; - case AUTH_NONE: - res = 0; - break; - default: - log_error("Unknown auth. method %d", conn->auth_method); - res = -3; - } + switch (conn->auth_method) { + case AUTH_CHAP: + res = cmnd_exec_auth_chap(conn); + break; + case AUTH_NONE: + res = 0; + break; + default: + log_error("Unknown auth. method %d", conn->auth_method); + res = -3; + } - return res; + return res; } static void cmnd_exec_login(struct connection *conn)