Re: [PATCH v3] libata: support the ata host which implements a queue depth less than 32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 11, 2014 at 03:57:01PM +0400, Sergei Shtylyov wrote:
> >-	for (i = 0; i < ATA_MAX_QUEUE; i++) {
> >-		tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE;
> >+	for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) {
> >+		tag = tag < max_queue ? tag : 0;
> 
>    Assigning 'tag' back to 'tag' is quite stupid, don't you think? Why not:
> 
> 		if (tag >= max_queue)
> 			tag = 0;

Since I am an idiot, it is very possible for me to write stupid code.
But I don't believe this is one. I don't think the above code is more readable.

Thanks,
Kevin

Attachment: pgphXBp8PpgFi.pgp
Description: PGP signature


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux