lkml.org 
[lkml]   [2018]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3] efi: take size of partition entry from GPT header
> > Please rearrange this like:
> >
> > for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) &&
> > i < state->limit-1; i++)
>
> Better still cache le32_to_cpu(gpt->num_partition_entries) to a local
> so that it only has to be calculated once (even if it gets spilled
> to the stack).
> It can be bounded by state->limit-1 at the same time.

This is block I/O, slow path. No need for such micro optimizations here.
GCC is capable to do such optimizations automatically, and it does as
I can see from disassembly.
Anyway this would be a subject for another patch.

--
Eugene

\
 
 \ /
  Last update: 2018-09-13 21:45    [W:0.075 / U:1.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site