<div class="gmail_quote">On Tue, Jun 7, 2011 at 7:55 PM, Stefan Tauner <span dir="ltr"><<a href="mailto:stefan.tauner@student.tuwien.ac.at">stefan.tauner@student.tuwien.ac.at</a>></span> wrote:</div><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">+static uint32_t ich_hwseq_get_erase_block_size(unsigned int addr)</div>
+{<br>
<div class="im">+ REGWRITE32(ICH9_REG_FADDR, (addr & 0x00FFFFFF));<br>
</div><div class="im">+ uint8_t enc_berase = (REGREAD16(ICH9_REG_HSFS) & HSFS_BERASE) >><br>
+ HSFS_BERASE_OFF;<br>
+ const uint32_t dec_berase[4] = {<br>
+ 256,<br>
+ 4 * 1024,<br>
+ 8 * 1024,<br>
+ 64 * 1024<br>
+ }; </div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
+ return dec_berase[enc_berase];<br></div></blockquote><div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Others might want to comment, but I think you should avoid doing all that work in the variable declaration area.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
+}<br>
+<br>
+int ich_hwseq_probe(struct flashchip *flash)<br>
+{<br>
</div>+ uint32_t total_size, boundary;<br>
+ uint32_t erase_size_low, size_low, erase_size_high, size_high;<br>
+ struct block_eraser eraser;<br></blockquote><div><br></div><div>This should be a pointer, right? I am assuming you intended to directly update the flash->block_erasers[0] member later in this function.</div></div>
<br>-- <br>David Hendricks (dhendrix)<br>Systems Software Engineer, Google Inc.<br>