Merge branch 'upstream'
[pandora-kernel.git] / include / linux / ata.h
index 94f77cc..a8155ca 100644 (file)
@@ -302,4 +302,16 @@ static inline int ata_ok(u8 status)
                        == ATA_DRDY);
 }
 
                        == 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__ */
 #endif /* __LINUX_ATA_H__ */