On (03/27/18 15:50), Minchan Kim wrote: [..] > > + char flags[__NR_ZRAM_PAGEFLAGS - ZRAM_FLAG_SHIFT]; >
Technically, you don't need this buffer... > + snprintf(flags, sizeof(flags), "%c%c%c", > + zram_test_flag(zram, index, ZRAM_SAME) ? 's' : '.', > + zram_test_flag(zram, index, ZRAM_WB) ? 'w' : '.', > + zram_test_flag(zram, index, ZRAM_HUGE) ? 'h' : '.'); > + > + last_access = get_seconds() - zram->table[index].ac_time; > + copied = snprintf(kbuf + written, count, "%12lu %6s %12lu\n", > + index, flags, last_access); ... if you'll do flags decoding in place. But if you prefer it this way then OK. -ss