В Sat, 2 May 2015 20:15:45 +0300 Andrei Borzenkov <arvidj...@gmail.com> пишет:
> > + > > +static inline int > > +grub_generic_test_bit (int nr, const grub_uint32_t *addr) > > +{ > > + return 1UL & (addr[nr / 32] >> (nr & 31)); > > +} > > + > > This is used only in grub_f2fs_check_dentries() with on-disk bitmap. > On-disk bitmap is little-endian; code is wrong on big-endian system. > > Also dentry_bitmap is not multiple of 4 bytes as you replied earlier. > You should rather compute correct byte address instead and make all > parameters grub_uint8_t *. This will also avoid all those casts later. > > That's really just > > grub_uint8_t *addr; > > byte = nr >> 3; > #ifdef WORDS_BIGENDIAN > byte ^= 3; > #endif Scratch it. We do know that byte order is LE so it is fixed. Sorry. > return addr[byte] & (1 << nr & 7); > _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel