On 一, 2011-12-12 at 18:58 +0800, Pekka Enberg wrote: > On Mon, 12 Dec 2011, Kevin Wolf wrote: > >> @@ -667,14 +722,11 @@ static struct qcow_refcount_block *qcow_read_refcount_block(struct qcow *q, u64 > >> > >> rft_idx = clust_idx >> (header->cluster_bits - QCOW_REFCOUNT_BLOCK_SHIFT); > >> if (rft_idx >= rft->rf_size) > >> - return NULL; > >> + return (void *)-ENOSPC; > > > > Is this allowed style in kvm-tool? :-/ > > It needs to use ERR_PTR() and related macros but otherwise I don't see a > big problem with it. > > Pekka I have tried to use ERR_PTR(). But when I included linux/err.h, a compile error was following. CC disk/qcow.o In file included from disk/qcow.c:20: ../../include/linux/err.h:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ERR_PTR' ../../include/linux/err.h:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PTR_ERR' ../../include/linux/err.h:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'IS_ERR' ../../include/linux/err.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'IS_ERR_OR_NULL' ../../include/linux/err.h:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ERR_CAST' ../../include/linux/err.h:55: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PTR_RET' in the linux/err.h static inline void * __must_check ERR_PTR(long error) { return (void *) error; } when I comment "__must_check", the error disappear. Finally I did cast myself rather than use ERR_PTR(). Are there some substitutions of ERR_PTR in the user space or choices? -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html