On 11/03/2014 06:19 PM, Wilcox, Matthew R wrote:
>> +config BLK_DEV_PMEM_COUNT
>> + int "Default number of PMEM disks"
>> + default "4"
> For real use I think a default of 1 would be better.
For real use, you need at least two to run xfstests. This whole configuration mechanism
is going away soon anyway.
>> + size_t page_offset = sector >> PAGE_SECTORS_SHIFT;
>> + size_t offset = page_offset << PAGE_SHIFT;
> Since page_offset is only used to calculate offset, they
> could be joined to avoid relying on the compiler to
> optimize it away:
> size_t offset = sector >> PAGE_SECTORS_SHIFT << PAGE_SHIFT;
If you insist on doing the compiler's job for it, why not:
size_t offset = sector >> (PAGE_SECTORS_SHIFT - PAGE_SHIFT);
I actually think the original is clearer.
I wish you guys would actually review the correct code.
In the actual good driver that has any shape of proper code all these issue
* config defaults gone, multiple-devices multiple-memory ranges fully supported
hot plug style.
* above shifts cruft completely gone it is left overs from brd.c and
its page usage.
* getgeo fixed to do what we realy want by the only application on earth
that still uses it, fdisk. All other partitioners do not call it at all.
Why are we reviewing dead code ?