Received: from eggs.gnu.org ([2001:4830:134:3::10]:35299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVHYD-0005Gv-KX for qemu-devel@nongnu.org; Tue, 10 Mar 2015 06:38:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVHY8-0002rs-Sn for qemu-devel@nongnu.org; Tue, 10 Mar 2015 06:38:13 -0400 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:39426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVHY8-0002ri-Mm for qemu-devel@nongnu.org; Tue, 10 Mar 2015 06:38:08 -0400 Received: by wghn12 with SMTP id n12so751698wgh.6 for ; Tue, 10 Mar 2015 03:38:08 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 10 Mar 2015 11:37:50 +0100 Message-Id: <1425983880-26906-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1425983880-26906-1-git-send-email-pbonzini@redhat.com> References: <1425983880-26906-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 01/11] iscsi: Fix check for username List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Weil From: Stefan Weil The variable user in struct iscsi_url is a character array, not a pointer. Therefore its address will never be NULL. clang reports this error: block/iscsi.c:1329:20: warning: comparison of array 'iscsi_url->user' not equal to a null pointer is always true [-Wtautological-pointer-compare] Reviewed-by: Peter Lieven Acked-by: Peter Lieven Signed-off-by: Stefan Weil Message-Id: <1425719670-5486-1-git-send-email-sw@weilnetz.de> Signed-off-by: Paolo Bonzini --- block/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index 1fa855a..3e34b1f 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1326,7 +1326,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, goto out; } - if (iscsi_url->user != NULL) { + if (iscsi_url->user[0] != '\0') { ret = iscsi_set_initiator_username_pwd(iscsi, iscsi_url->user, iscsi_url->passwd); if (ret != 0) { -- 2.3.0