Commit c635fd3d authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.infradead.org/users/dwmw2/random-2.6

* git://git.infradead.org/users/dwmw2/random-2.6:
  drivers/video/console/promcon.c: fix build error
  Fix IHEX firmware generation/loading
parents 82e68f7f cf368d2f
...@@ -250,19 +250,19 @@ static void file_record(struct ihex_binrec *record) ...@@ -250,19 +250,19 @@ static void file_record(struct ihex_binrec *record)
static int output_records(int outfd) static int output_records(int outfd)
{ {
unsigned char zeroes[5] = {0, 0, 0, 0, 0}; unsigned char zeroes[6] = {0, 0, 0, 0, 0, 0};
struct ihex_binrec *p = records; struct ihex_binrec *p = records;
while (p) { while (p) {
uint16_t writelen = (p->len + 9) & ~3; uint16_t writelen = (p->len + 9) & ~3;
p->addr = htonl(p->addr); p->addr = htonl(p->addr);
p->len = htonl(p->len); p->len = htons(p->len);
write(outfd, &p->addr, writelen); write(outfd, &p->addr, writelen);
p = p->next; p = p->next;
} }
/* EOF record is zero length, since we don't bother to represent /* EOF record is zero length, since we don't bother to represent
the type field in the binary version */ the type field in the binary version */
write(outfd, zeroes, 5); write(outfd, zeroes, 6);
return 0; return 0;
} }
...@@ -18,7 +18,7 @@ struct ihex_binrec { ...@@ -18,7 +18,7 @@ struct ihex_binrec {
__be32 addr; __be32 addr;
__be16 len; __be16 len;
uint8_t data[0]; uint8_t data[0];
} __attribute__((aligned(4))); } __attribute__((packed));
/* Find the next record, taking into account the 4-byte alignment */ /* Find the next record, taking into account the 4-byte alignment */
static inline const struct ihex_binrec * static inline const struct ihex_binrec *
......
...@@ -86,6 +86,7 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); ...@@ -86,6 +86,7 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
#define con_copy_unimap(d, s) (0) #define con_copy_unimap(d, s) (0)
#define con_get_unimap(vc, ct, uct, list) (-EINVAL) #define con_get_unimap(vc, ct, uct, list) (-EINVAL)
#define con_free_unimap(vc) do { ; } while (0) #define con_free_unimap(vc) do { ; } while (0)
#define con_protect_unimap(vc, rdonly) do { ; } while (0)
#define vc_translate(vc, c) (c) #define vc_translate(vc, c) (c)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment