Chris Wright wrote: >* zach@xxxxxxxxxx (zach@xxxxxxxxxx) wrote: > >Generally nice cleanup. Couple comments below. > > > >>+ desc = &LDT_DESCRIPTOR(seg); >> } else { >> /* Must disable preemption while reading the GDT. */ >>- desc = (u32 *)&per_cpu(cpu_gdt_table, get_cpu()); >>- desc = (void *)desc + (seg & ~7); >>+ desc = &per_cpu(cpu_gdt_table, get_cpu())[desc_number(seg)]; >> >> > >Heh, glad you left the comment. This one is getting on the edge of >hiding that get_cpu() is needed for preempt disable. > > Yes, scarily so ;) > >Any compelling reason not to use _s * LDT_ENTRY_SIZE ? > > Actually, yes. That requires sizeof(*_s) == sizeof(char), which gives no type checking against struct desc_struct. The lack of type checking and easily wrong pointer path as a result is one of the things I've been cleaning up.