From: Andy Grover <agrover@xxxxxxxxxx> The params are checked in the calling functions, so these ones in transport_get_sense_data and transport_map_sg_to_mem should be unnecessary, unless calling code becomes buggy. Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> Signed-off-by: Nicholas A. Bellinger <nab@xxxxxxxxxxxxxxx> --- drivers/target/target_core_transport.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index edf24b4..99b9e33 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2997,10 +2997,8 @@ static int transport_get_sense_data(struct se_cmd *cmd) unsigned long flags; u32 offset = 0; - if (!SE_LUN(cmd)) { - printk(KERN_ERR "SE_LUN(cmd) is NULL\n"); - return -1; - } + WARN_ON(!SE_LUN(cmd)); + spin_lock_irqsave(&T_TASK(cmd)->t_state_lock, flags); if (cmd->se_cmd_flags & SCF_SENT_CHECK_CONDITION) { spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock, flags); @@ -4595,10 +4593,8 @@ static int transport_map_sg_to_mem( struct scatterlist *sg; u32 sg_count = 1, cmd_size = cmd->data_length; - if (!in_mem) { - printk(KERN_ERR "No source scatterlist\n"); - return -1; - } + WARN_ON(!in_mem); + sg = (struct scatterlist *)in_mem; while (cmd_size) { -- 1.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html