Re: [PATCH] scsi: csiostor: update csio_get_flash_params()

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

 



Arjun,

> +		switch (density) {
> +		case 0x14: /* 1MB */
> +			size = 1 << 20;
> +			break;

It seems a bit silly to have a switch statement for this. Why not just
do:

        size = 1 << density;

?

> +		case 0x15: /* 2MB */
> +			size = 1 << 21;
> +			break;
> +		case 0x16: /* 4MB */
> +			size = 1 << 22;
> +			break;
> +		case 0x17: /* 8MB */
> +			size = 1 << 23;
> +			break;
> +		case 0x18: /* 16MB */
> +			size = 1 << 24;
> +			break;
> +		case 0x19: /* 32MB */
> +			size = 1 << 25;
> +			break;
> +		case 0x20: /* 64MB */
> +			size = 1 << 26;
> +			break;
> +		case 0x21: /* 128MB */
> +			size = 1 << 27;
> +			break;
> +		case 0x22: /* 256MB */
> +			size = 1 << 28;
> +			break;

-- 
Martin K. Petersen	Oracle Linux Engineering



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux