Re: [PATCH 1/1 v1.1] arcmsr: Support Areca new SATA Raid AdapterARC1214/1224/1264/1284 (Resend renew)

From: James Bottomley
Date: Thu Aug 29 2013 - 07:59:54 EST


On Thu, 2013-08-29 at 12:55 +0800, éæé wrote:
> Update the patch code.
>
> From: Ching<ching2048@xxxxxxxxxxxx>
>
> Support Areca new SATA Raid Adapter ARC1214/1224/1264/1284.
> Modify maximum outstanding command number.
> Notify command complete with auto request sense.
> Fix bug of updating adapter firmware through ioctl(ARCHTTP) interface.
> Fix coding style warning.
> Fix compiling warning.
> Fix ARC1880 hardware reset.
> Fix coding style - indent

This patch is too big for the SCSI mailing list. We have a 400k limit.
Your patch is 292k, which would ordinarily be OK, but you attached it
twice (once inline and once as an attachment), which is why it's not
going through.

> - {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1380)},
> - {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1381)},

Why are you removing these adapters from the driver?

I agree with Dan, all these whitespace changes make the patch very hard
to read for the significant pieces; can't they be done separately?

Some of them, like this


> -static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb)
> +static void
> +arcmsr_hbaA_doorbell_isr(struct AdapterControlBlock *acb)
> {
> uint32_t outbound_doorbell;
> - struct MessageUnit_A __iomem *reg = acb->pmuA;
> + struct MessageUnit_A __iomem *reg = acb->pmuA;

Aren't even correct (last one introduces an extra spurious space).

Others, like this:

> + kfree((const void *)ver_addr);
[...]
> - kfree(ver_addr);

Are stylistically wrong: ver_addr is an unsigned char *; there's no
reason to cast it to anything before calling kfree (any pointer can be
passed without cast to a function taking a void *)

> - memcpy(ptmpuserbuffer, pcmdmessagefld->messagedatabuffer, user_len);
> + memcpy((void *)ptmpuserbuffer,
> + (const void *)pcmdmessagefld->messagedatabuffer, user_len);

You do a lot of this spurious casting to void *; please don't:

> - } while (((readl(&pmuC->host_diagnostic) & ARCMSR_ARC1880_DiagWrite_ENABLE) == 0) && (count < 5));
> - writel(ARCMSR_ARC1880_RESET_ADAPTER, &pmuC->host_diagnostic);
> + } while ((((temp = readl(&pmuC->host_diagnostic)) &
> + ARCMSR_ARC1880_DiagWrite_ENABLE) == 0) &&
> + (count < 5));

Why assign to temp? You never refer to it again.

I'm sure there are other issues, but the massive code reformat changes
mean I probably missed them.

James

¢éì®&Þ~º&¶¬–+-±éÝ¥Šw®žË±Êâmébžìdz¹Þ)í…æèw*jg¬±¨¶‰šŽŠÝj/êäz¹ÞŠà2ŠÞ¨è­Ú&¢)ß«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù>Wš±êÞiÛaxPjØm¶Ÿÿà -»+ƒùdš_