scst: Remove unused private helpers and arguments

Manual source review found no callers of scst_acg_sess_is_empty(),
scst_devt_cleanup(), sgv_pool_sg() or scst_store_sense(). Remove those
private definitions and the matching sense-helper declaration. The last
sense-helper caller was removed by ae72c4193 after an infinite loop.

Also remove the unused local isblank fallback. Preserve
scst_zero_write_rest() and its disabled caller for separate debug-code
review. These removals are source-review findings, not reported runtime
failures.

For TTT allocation, remove the unused connection argument from the
helper and its sole caller instead of const-qualifying an input it never
reads.

Cppcheck reports constParameterPointer:

  Parameter 'conn' can be declared as pointer to const
This commit is contained in:
Gleb Chesnokov
2026-10-21 22:12:25 +03:00
parent 80ba29ee60
commit e4b0591754
5 changed files with 2 additions and 51 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ int logins_suspended;
static u32 ttt;
static u32 get_next_ttt(struct connection *conn __attribute__((unused)))
static u32 get_next_ttt(void)
{
ttt += 1;
return (ttt == ISCSI_RESERVED_TAG) ? ++ttt : ttt;
@@ -1295,7 +1295,7 @@ static void cmnd_exec_text(struct connection *conn)
goto out;
if (!list_empty(&conn->rsp_buf_list) &&
!list_length_is_one(&conn->rsp_buf_list))
conn->ttt = get_next_ttt(conn);
conn->ttt = get_next_ttt();
else
conn->ttt = ISCSI_RESERVED_TAG;
} else if (list_empty(&conn->rsp_buf_list) || conn->ttt != req->ttt) {
-29
View File
@@ -14022,35 +14022,6 @@ out:
TRACE_EXIT();
}
void scst_store_sense(struct scst_cmd *cmd)
{
TRACE_ENTRY();
if (scst_sense_valid(cmd->sense) &&
!test_bit(SCST_CMD_NO_RESP, &cmd->cmd_flags) &&
(cmd->tgt_dev != NULL)) {
struct scst_tgt_dev *tgt_dev = cmd->tgt_dev;
TRACE_DBG("Storing sense (cmd %p)", cmd);
spin_lock_bh(&tgt_dev->tgt_dev_lock);
if (cmd->sense_valid_len <= sizeof(tgt_dev->tgt_dev_sense))
tgt_dev->tgt_dev_valid_sense_len = cmd->sense_valid_len;
else {
tgt_dev->tgt_dev_valid_sense_len = sizeof(tgt_dev->tgt_dev_sense);
PRINT_ERROR("Stored sense truncated to size %d (needed %d)",
tgt_dev->tgt_dev_valid_sense_len,
cmd->sense_valid_len);
}
memcpy(tgt_dev->tgt_dev_sense, cmd->sense,
tgt_dev->tgt_dev_valid_sense_len);
spin_unlock_bh(&tgt_dev->tgt_dev_lock);
}
TRACE_EXIT();
}
/* dev_lock supposed to be locked and BHs off */
static void scst_abort_cmds_tgt_dev(struct scst_tgt_dev *tgt_dev,
-5
View File
@@ -134,11 +134,6 @@ struct sgv_pool {
extern bool scst_force_global_sgv_pool;
static inline struct scatterlist *sgv_pool_sg(struct sgv_pool_obj *obj)
{
return obj->sg_entries;
}
int __init scst_sgv_pools_init(unsigned long mem_hwmark, unsigned long mem_lwmark);
void scst_sgv_pools_deinit(void);
-4
View File
@@ -68,10 +68,6 @@
#define FILE_BUFFER_SIZE 512
#ifndef isblank
#define isblank(c) ((c) == ' ' || (c) == '\t')
#endif
#if defined(CONFIG_LOCKDEP)
#define scst_assert_pr_mutex_held(dev) \
do { \
-11
View File
@@ -383,17 +383,10 @@ int scst_acg_add_acn(struct scst_acg *acg, const char *name);
void scst_del_free_acn(struct scst_acn *acn, bool reassign);
struct scst_acn *scst_find_acn(struct scst_acg *acg, const char *name);
/* The activity supposed to be suspended and scst_mutex held */
static inline bool scst_acg_sess_is_empty(struct scst_acg *acg)
{
return list_empty(&acg->acg_sess_list);
}
int scst_prepare_request_sense(struct scst_cmd *orig_cmd);
int scst_finish_internal_cmd(struct scst_cmd *cmd);
int scst_set_cmd_error_sense(struct scst_cmd *cmd, uint8_t *sense, unsigned int len);
void scst_store_sense(struct scst_cmd *cmd);
int scst_process_check_condition(struct scst_cmd *cmd);
@@ -431,10 +424,6 @@ void scst_free_mgmt_cmd(struct scst_mgmt_cmd *mcmd);
void scst_done_cmd_mgmt(struct scst_cmd *cmd);
void scst_finish_cmd_mgmt(struct scst_cmd *cmd);
static inline void scst_devt_cleanup(struct scst_dev_type *devt)
{
}
void scst_tg_init(void);
void scst_tg_cleanup(void);
int scst_dg_add(struct kobject *parent, const char *name);