Fix a few compiler messages issued when some extra warnings are enabled:

casting const to non-const
    uninitialized structure members
    non-static local function
    missing enumerated switch-value cases

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7122 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2017-04-13 23:58:32 +00:00
parent 9c7b816179
commit a2e0916fbf
9 changed files with 29 additions and 14 deletions
+3 -1
View File
@@ -1687,8 +1687,10 @@ static int tx_padding(struct iscsi_cmnd *cmnd, int state)
int res, rest = cmnd->conn->write_size;
struct msghdr msg = {.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT};
struct kvec iov;
static const uint32_t padding;
static uint32_t padding;
BUG_ON(rest < 1);
BUG_ON(rest >= sizeof(uint32_t));
iscsi_extracheck_is_wr_thread(cmnd->conn);
TRACE_DBG("Sending %d padding bytes (cmd %p)", rest, cmnd);
+3 -3
View File
@@ -41,9 +41,9 @@
* be the last to confirm expectations of __config_account_add()!!
*/
struct iscsi_key user_keys[] = {
{"IncomingUser",},
{"OutgoingUser",},
{NULL,},
{ .name = "IncomingUser",},
{ .name = "OutgoingUser",},
{ .name = NULL,},
};
static struct __qelem discovery_users_in = LIST_HEAD_INIT(discovery_users_in);
+9 -9
View File
@@ -37,15 +37,15 @@ static u32 get_next_ttt(struct connection *conn __attribute__((unused)))
}
static struct iscsi_key login_keys[] = {
{"InitiatorName",},
{"InitiatorAlias",},
{"SessionType",},
{"TargetName",},
{"InitiatorRecvDataSegmentLength",},
{"MaxAHSLength",},
{"TaggedBufferForSolicitedDataOnly",},
{"iSERHelloRequired",},
{NULL,},
{ .name = "InitiatorName",},
{ .name = "InitiatorAlias",},
{ .name = "SessionType",},
{ .name = "TargetName",},
{ .name = "InitiatorRecvDataSegmentLength",},
{ .name = "MaxAHSLength",},
{ .name = "TaggedBufferForSolicitedDataOnly",},
{ .name = "iSERHelloRequired",},
{ .name = NULL,},
};
char *text_key_find(struct connection *conn, const char *searchKey)
+1 -1
View File
@@ -25,7 +25,7 @@
#include "iscsid.h"
int driver_major(const char *dev)
static int driver_major(const char *dev)
{
FILE *f;
char devname[256];
+3
View File
@@ -2945,6 +2945,9 @@ static bool vdisk_parse_offset(struct vdisk_cmd_params *p, struct scst_cmd *cmd)
TRACE(TRACE_ORDER, "HQ cmd %p (op %s)", cmd,
scst_get_opcode_name(cmd));
break;
case SCST_CMD_QUEUE_ACA:
case SCST_CMD_QUEUE_SIMPLE:
case SCST_CMD_QUEUE_UNTAGGED:
default:
break;
}
+4
View File
@@ -5136,6 +5136,7 @@ int scst_tgt_dev_setup_threads(struct scst_tgt_dev *tgt_dev)
tgtt->threads_num);
break;
}
case SCST_THREADS_POOL_TYPE_INVALID:
default:
PRINT_CRIT_ERROR("Unknown threads pool type %d (dev %s)",
dev->threads_pool_type, dev->virt_name);
@@ -9265,6 +9266,9 @@ static int scst_do_dif(struct scst_cmd *cmd,
res = generate_fn(cmd);
break;
case SCST_DIF_CHECK_APP_TAG:
case SCST_DIF_CHECK_GUARD_TAG:
case SCST_DIF_CHECK_REF_TAG:
default:
EXTRACHECKS_BUG_ON(1);
/* go through */
+1
View File
@@ -2512,6 +2512,7 @@ static int scst_groups_addr_method_show(struct seq_file *seq, void *v)
case SCST_LUN_ADDR_METHOD_LUN:
seq_printf(seq, "%s\n", "LUN");
break;
case SCST_LUN_ADDR_METHOD_EXTENDED_LUN:
default:
seq_printf(seq, "%s\n", "UNKNOWN");
break;
+2
View File
@@ -906,6 +906,7 @@ active:
scst_schedule_tasklet(cmd);
break;
case SCST_CONTEXT_SAME:
default:
PRINT_ERROR("Context %x is undefined, using the thread one",
pref_context);
@@ -1904,6 +1905,7 @@ static void scst_process_redirect_cmd(struct scst_cmd *cmd,
scst_schedule_tasklet(cmd);
break;
case SCST_CONTEXT_SAME:
default:
PRINT_ERROR("Context %x is unknown, using the thread one",
context);
+3
View File
@@ -1757,6 +1757,9 @@ int scst_tg_set_group_info(struct scst_cmd *cmd)
case SCST_TG_STATE_UNAVAILABLE:
case SCST_TG_STATE_OFFLINE:
break;
case SCST_TG_STATE_LBA_DEPENDENT:
case SCST_TG_STATE_TRANSITIONING:
case SCST_TG_STATE_UNDEFINED:
default:
TRACE_MGMT_DBG("Incorrect new state %d", osi[j].new_state);
res = -EINVAL;