Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757069AbcJPR1F (ORCPT ); Sun, 16 Oct 2016 13:27:05 -0400 Received: from mail.osadl.at ([92.243.35.153]:52640 "EHLO mail.osadl.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751742AbcJPR07 (ORCPT ); Sun, 16 Oct 2016 13:26:59 -0400 Date: Sun, 16 Oct 2016 17:26:47 +0000 From: Nicholas Mc Guire To: dc395x@twibble.org Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: possible if/else bug in dc395x.c Message-ID: <20161016172647.GA26334@osadl.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1119 Lines: 26 Hi ! in drivers/scsi/dc395x.c:srb_done() 3387 if (srb->total_xfer_length 3388 && srb->total_xfer_length >= cmd->underflow) 3389 cmd->result = 3390 MK_RES_LNX(DRIVER_SENSE, DID_OK, 3391 srb->end_message, CHECK_CONDITION); 3392 /*SET_RES_DID(cmd->result,DID_OK) */ 3393 else 3394 cmd->result = 3395 MK_RES_LNX(DRIVER_SENSE, DID_OK, 3396 srb->end_message, CHECK_CONDITION); (line numbers from 4.9.0-rc1, localversion-next next-20161016) The if and else are identical, these lines date back to pre-git (so git blame assigns them to the initial 2.6.12-rc2 import). Not sure if it makes much sense trying to fix up something like this at all is it worth trying to figure out what this should be ? I would asume that given that this survived atleast 12 years in this form that the condition could be removed and the cmd-> result set unconditionally here. thx! hofrat