X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=include%2Flinux%2Fata.h;h=a8155ca4947fadfda0cc6c09f0b098c6f54628fc;hp=94f77cce27fa10d634b7ffdbeb415d31613833b5;hb=0825788ff27c7145e9d558cb2a26f3837d1f9be5;hpb=1bc4ccfff8675adc3d96f91245eb7e2dc0043ca9 diff --git a/include/linux/ata.h b/include/linux/ata.h index 94f77cce27fa..a8155ca4947f 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -302,4 +302,16 @@ static inline int ata_ok(u8 status) == ATA_DRDY); } +static inline int lba_28_ok(u64 block, u32 n_block) +{ + /* check the ending block number */ + return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); +} + +static inline int lba_48_ok(u64 block, u32 n_block) +{ + /* check the ending block number */ + return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); +} + #endif /* __LINUX_ATA_H__ */