intel/gen_decoder: Fix parsing of small genxml file.
authorRafael Antognolli <rafael.antognolli@intel.com>
Tue, 16 Jul 2019 17:00:18 +0000 (10:00 -0700)
committerRafael Antognolli <rafael.antognolli@intel.com>
Tue, 23 Jul 2019 17:45:19 +0000 (17:45 +0000)
commit1f2b22a6bd3f75770e2d787c0524cdeebafdcab2
treee233e19069421d32ebb92dbda8f0c04f6c247bb9
parent85996567f5cfe9bf55d364798a2214422b95591c
intel/gen_decoder: Fix parsing of small genxml file.

When using gen_spec_load_from path, only abort decoding if the read
length is 0. Previously, we were aborting if finding an EOF, even if
something was read from the file.

Also only kill the decoded file if no commands or structs were found,
and print a message in such case.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/common/gen_decoder.c