Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2260323 authored by Nikola Pajkovsky's avatar Nikola Pajkovsky Committed by Martin K. Petersen
Browse files

scsi: aacraid: get rid of one level of indentation



  unsigned long byte_count = 0;
  nseg = scsi_dma_map(scsicmd);
  if (nseg < 0)
     return nseg;
  if (nseg) {
     ...
  }
  return byte_count;

is equal to

  unsigned long byte_count = 0;
  nseg = scsi_dma_map(scsicmd);
  if (nseg <= 0)
     return nseg;
  ...
  return byte_count;

No other code has changed.

[mkp: fix checkpatch complaints]

Signed-off-by: default avatarNikola Pajkovsky <npajkovsky@suse.cz>
Reviewed-by: default avatarRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 913e00a5
Loading
Loading
Loading
Loading
+131 −136
Original line number Diff line number Diff line
@@ -3757,6 +3757,8 @@ static long aac_build_sg(struct scsi_cmnd *scsicmd, struct sgmap *psg)
	struct aac_dev *dev;
	unsigned long byte_count = 0;
	int nseg;
	struct scatterlist *sg;
	int i;

	dev = (struct aac_dev *)scsicmd->device->host->hostdata;
	// Get rid of old data
@@ -3765,11 +3767,8 @@ static long aac_build_sg(struct scsi_cmnd *scsicmd, struct sgmap *psg)
	psg->sg[0].count = 0;

	nseg = scsi_dma_map(scsicmd);
	if (nseg < 0)
	if (nseg <= 0)
		return nseg;
	if (nseg) {
		struct scatterlist *sg;
		int i;

	psg->count = cpu_to_le32(nseg);

@@ -3790,7 +3789,7 @@ static long aac_build_sg(struct scsi_cmnd *scsicmd, struct sgmap *psg)
		printk(KERN_WARNING"aacraid: cmd len %08lX cmd underflow %08X\n",
		       byte_count, scsicmd->underflow);
	}
	}

	return byte_count;
}

@@ -3801,6 +3800,8 @@ static long aac_build_sg64(struct scsi_cmnd *scsicmd, struct sgmap64 *psg)
	unsigned long byte_count = 0;
	u64 addr;
	int nseg;
	struct scatterlist *sg;
	int i;

	dev = (struct aac_dev *)scsicmd->device->host->hostdata;
	// Get rid of old data
@@ -3810,11 +3811,8 @@ static long aac_build_sg64(struct scsi_cmnd *scsicmd, struct sgmap64 *psg)
	psg->sg[0].count = 0;

	nseg = scsi_dma_map(scsicmd);
	if (nseg < 0)
	if (nseg <= 0)
		return nseg;
	if (nseg) {
		struct scatterlist *sg;
		int i;

	scsi_for_each_sg(scsicmd, sg, nseg, i) {
		int count = sg_dma_len(sg);
@@ -3837,7 +3835,7 @@ static long aac_build_sg64(struct scsi_cmnd *scsicmd, struct sgmap64 *psg)
		printk(KERN_WARNING"aacraid: cmd len %08lX cmd underflow %08X\n",
		       byte_count, scsicmd->underflow);
	}
	}

	return byte_count;
}

@@ -3845,6 +3843,8 @@ static long aac_build_sgraw(struct scsi_cmnd *scsicmd, struct sgmapraw *psg)
{
	unsigned long byte_count = 0;
	int nseg;
	struct scatterlist *sg;
	int i;

	// Get rid of old data
	psg->count = 0;
@@ -3856,11 +3856,8 @@ static long aac_build_sgraw(struct scsi_cmnd *scsicmd, struct sgmapraw *psg)
	psg->sg[0].flags = 0;

	nseg = scsi_dma_map(scsicmd);
	if (nseg < 0)
	if (nseg <= 0)
		return nseg;
	if (nseg) {
		struct scatterlist *sg;
		int i;

	scsi_for_each_sg(scsicmd, sg, nseg, i) {
		int count = sg_dma_len(sg);
@@ -3886,7 +3883,7 @@ static long aac_build_sgraw(struct scsi_cmnd *scsicmd, struct sgmapraw *psg)
		printk(KERN_WARNING"aacraid: cmd len %08lX cmd underflow %08X\n",
		       byte_count, scsicmd->underflow);
	}
	}

	return byte_count;
}

@@ -3895,15 +3892,14 @@ static long aac_build_sgraw2(struct scsi_cmnd *scsicmd,
{
	unsigned long byte_count = 0;
	int nseg;

	nseg = scsi_dma_map(scsicmd);
	if (nseg < 0)
		return nseg;
	if (nseg) {
	struct scatterlist *sg;
	int i, conformable = 0;
	u32 min_size = PAGE_SIZE, cur_size;

	nseg = scsi_dma_map(scsicmd);
	if (nseg <= 0)
		return nseg;

	scsi_for_each_sg(scsicmd, sg, nseg, i) {
		int count = sg_dma_len(sg);
		u64 addr = sg_dma_address(sg);
@@ -3964,7 +3960,6 @@ static long aac_build_sgraw2(struct scsi_cmnd *scsicmd,
		printk(KERN_WARNING"aacraid: cmd len %08lX cmd underflow %08X\n",
		       byte_count, scsicmd->underflow);
	}
	}

	return byte_count;
}