]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commit
extras/mini-os/tpmback.c: fix compilation error.
authorDushyant Behl <myselfdushyantbehl@gmail.com>
Sun, 20 Jul 2014 20:52:59 +0000 (02:22 +0530)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 21 Jul 2014 11:10:46 +0000 (12:10 +0100)
commit6fcd1e03dc3d7d1b20cf3a577343622f4e83ed6c
tree286ddfb27f9d5239217cd085ba9cedb546f2039f
parent10e6e726a1b39a0ab3e55af47fc32c1eac4b801c
extras/mini-os/tpmback.c: fix compilation error.

This patch is with respect to the following discussion on xen-devel -
http://lists.xenproject.org/archives/html/xen-devel/2014-07/msg01991.html

The file extras/mini-os/tpmback.c was failing compilation on certain compilers
because of size mismatch between enum and int. Earlier the code used to read
value of enum using %d format, which failed compilation on some compilers:

tpmback.c: In function ‘tpmif_change_state’:
tpmback.c:350:4: error: format ‘%d’ expects argument of type ‘int *’,
but argument 3 has type ‘enum xenbus_state *’ [-Werror=format=]
    if(sscanf(value, "%d", &readst) != 1) {
    ^

Now the value is read into an actual int variable and then assigned to the
enum.

Signed-off-by:- Dushyant Behl <myselfdushyantbehl@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[ ijc -- added the actual error to the commit log ]
tpmback.c