linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
To: JBottomley@odin.com, linux-scsi@vger.kernel.org,
	martin.petersen@oracle.com
Cc: aacraid@pmc-sierra.com, gana.sridaran@microsemi.com,
	scott.benesh@microsemi.com, vishal.josemannanal@microsemi.com,
	RaghavaAditya.Renukunta@microsemi.com
Subject: [PATCH 01/10] aacraid: Removed unnecessary checks for NULL
Date: Mon, 25 Apr 2016 23:30:55 -0700	[thread overview]
Message-ID: <20160426063055.28402.80755.stgit@pmcuser-System-Product-Name> (raw)
In-Reply-To: <20160426062414.28402.69178.stgit@pmcuser-System-Product-Name>

Current driver checks for NULL return from aac_fib_alloc_tag, but it not
possible for it to return NULL.

Fixed by: Remove all the checks for NULL returns from aac_fib_alloc_tag

Suggested-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
---
 drivers/scsi/aacraid/aachba.c |   22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 7dfd0fa..6678d1f 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -555,8 +555,6 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd)
 	dev = (struct aac_dev *)scsicmd->device->host->hostdata;
 
 	cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
-	if (!cmd_fibcontext)
-		return -ENOMEM;
 
 	aac_fib_init(cmd_fibcontext);
 	dinfo = (struct aac_get_name *) fib_data(cmd_fibcontext);
@@ -1037,8 +1035,6 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd)
 	dev = (struct aac_dev *)scsicmd->device->host->hostdata;
 
 	cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
-	if (!cmd_fibcontext)
-		return -ENOMEM;
 
 	aac_fib_init(cmd_fibcontext);
 	dinfo = (struct aac_get_serial *) fib_data(cmd_fibcontext);
@@ -1950,10 +1946,6 @@ static int aac_read(struct scsi_cmnd * scsicmd)
 	 *	Alocate and initialize a Fib
 	 */
 	cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
-	if (!cmd_fibcontext) {
-		printk(KERN_WARNING "aac_read: fib allocation failed\n");
-		return -1;
-	}
 
 	status = aac_adapter_read(cmd_fibcontext, scsicmd, lba, count);
 
@@ -2048,16 +2040,6 @@ static int aac_write(struct scsi_cmnd * scsicmd)
 	 *	Allocate and initialize a Fib then setup a BlockWrite command
 	 */
 	cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
-	if (!cmd_fibcontext) {
-		/* FIB temporarily unavailable,not catastrophic failure */
-
-		/* scsicmd->result = DID_ERROR << 16;
-		 * scsicmd->scsi_done(scsicmd);
-		 * return 0;
-		 */
-		printk(KERN_WARNING "aac_write: fib allocation failed\n");
-		return -1;
-	}
 
 	status = aac_adapter_write(cmd_fibcontext, scsicmd, lba, count, fua);
 
@@ -2283,8 +2265,6 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd)
 	 *	Allocate and initialize a Fib
 	 */
 	cmd_fibcontext = aac_fib_alloc_tag(aac, scsicmd);
-	if (!cmd_fibcontext)
-		return SCSI_MLQUEUE_HOST_BUSY;
 
 	aac_fib_init(cmd_fibcontext);
 
@@ -3184,8 +3164,6 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
 	 *	Allocate and initialize a Fib then setup a BlockWrite command
 	 */
 	cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
-	if (!cmd_fibcontext)
-		return -1;
 
 	status = aac_adapter_scsi(cmd_fibcontext, scsicmd);
 


  reply	other threads:[~2016-04-26  6:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26  6:30 [PATCH 00/10] aacraid: Patchset for aacraid driver version 41066 Raghava Aditya Renukunta
2016-04-26  6:30 ` Raghava Aditya Renukunta [this message]
2016-04-26  6:31 ` [PATCH 02/10] aacraid: Fix incorrectly named MACRO Raghava Aditya Renukunta
2016-04-27  9:14   ` Johannes Thumshirn
2016-04-26  6:31 ` [PATCH 03/10] aacraid: Start adapter after updating number of MSIX vectors Raghava Aditya Renukunta
2016-04-27  9:14   ` Johannes Thumshirn
2016-04-26  6:31 ` [PATCH 04/10] aacraid: Relinquish CPU during timeout wait Raghava Aditya Renukunta
2016-04-27  9:31   ` Johannes Thumshirn
2016-04-26  6:31 ` [PATCH 05/10] aacraid: Disable MSI mode for series 6, 7, 8 cards Raghava Aditya Renukunta
2016-04-27  9:16   ` Johannes Thumshirn
2016-04-26  6:31 ` [PATCH 06/10] aacraid: Fix for aac_command_thread hang Raghava Aditya Renukunta
2016-04-27  9:32   ` Johannes Thumshirn
2016-04-26  6:32 ` [PATCH 07/10] aacraid: Log firmware AIF messages Raghava Aditya Renukunta
2016-04-27  9:21   ` Johannes Thumshirn
2016-04-26  6:32 ` [PATCH 08/10] aacraid: Remove code to needlessly complete fib Raghava Aditya Renukunta
2016-04-27  9:24   ` Johannes Thumshirn
2016-04-27 16:34     ` Raghava Aditya Renukunta
2016-04-28  7:47       ` Johannes Thumshirn
2016-04-26  6:32 ` [PATCH 09/10] aacraid: Fix for KDUMP driver hang Raghava Aditya Renukunta
2016-04-27  9:29   ` Johannes Thumshirn
2016-04-27 16:49     ` Raghava Aditya Renukunta
2016-04-28  7:49       ` Johannes Thumshirn
2016-04-26  6:32 ` [PATCH 10/10] aacraid: Update driver version Raghava Aditya Renukunta
2016-04-27  9:30   ` Johannes Thumshirn
2016-04-29 23:15 ` [PATCH 00/10] aacraid: Patchset for aacraid driver version 41066 Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160426063055.28402.80755.stgit@pmcuser-System-Product-Name \
    --to=raghavaaditya.renukunta@microsemi.com \
    --cc=JBottomley@odin.com \
    --cc=aacraid@pmc-sierra.com \
    --cc=gana.sridaran@microsemi.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=scott.benesh@microsemi.com \
    --cc=vishal.josemannanal@microsemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).