From patchwork Tue Jul 28 22:46:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 37920 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6SMn6CU029718 for ; Tue, 28 Jul 2009 22:49:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755734AbZG1WsQ (ORCPT ); Tue, 28 Jul 2009 18:48:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755518AbZG1WsL (ORCPT ); Tue, 28 Jul 2009 18:48:11 -0400 Received: from mail-bw0-f221.google.com ([209.85.218.221]:36637 "EHLO mail-bw0-f221.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753453AbZG1WsK (ORCPT ); Tue, 28 Jul 2009 18:48:10 -0400 Received: by bwz21 with SMTP id 21so366592bwz.37 for ; Tue, 28 Jul 2009 15:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:mime-version:content-type:content-transfer-encoding :content-disposition:message-id; bh=KhrKj/7fcusD3lu9HhLn/vT204c5QNo/buas46gj2FU=; b=HXE2kYWbJ8O9mxynXvMTJsPjWu7TXLlGUFz73xklTqSE6/ywoLjl+IQ+fRhoiuzKXh /7IXXzPdN9G6wiiju+W6QMSlvcAul79y39dYbuXfXcikut/AV6aE4E5FDYqTIqIg5F9R 7zDA3lpK4Ow5Ii3XLThWTbEXUpYQ+xgWFpXBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; b=NJh/I6wz6bqVVjWEmqM+MYnNBC++3gQjU4RUCzua+fBN1F9K7VOw4+dbWp7Jq3RXZZ QydEf7rsHJh1MDyi+XCe6PpaZctJOCUXpMWEads/pcxENMwrP19tShYvVEDDDc1Q+w7E aJiZ/rMP3jIHlN47mgkf5cTA3az+KAZhxsSGQ= Received: by 10.103.2.1 with SMTP id e1mr4310121mui.91.1248821288548; Tue, 28 Jul 2009 15:48:08 -0700 (PDT) Received: from localhost.localdomain (chello089077034197.chello.pl [89.77.34.197]) by mx.google.com with ESMTPS id t10sm1632754muh.0.2009.07.28.15.48.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 28 Jul 2009 15:48:06 -0700 (PDT) From: Bartlomiej Zolnierkiewicz To: Avi Kivity Subject: [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs() Date: Wed, 29 Jul 2009 00:46:38 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc4-next-20090728-04869-gdae50fe-dirty; KDE/4.2.4; i686; ; ) Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Carpenter , corbet@lwn.net, eteo@redhat.com, Julia Lawall MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907290046.40596.bzolnier@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Bartlomiej Zolnierkiewicz Subject: [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs() This takes care of the following entries from Dan's list: arch/x86/kvm/i8254.c +714 kvm_inject_pit_timer_irqs(6) warning: variable derefenced in initializer 'vcpu' arch/x86/kvm/i8254.c +714 kvm_inject_pit_timer_irqs(6) warning: variable derefenced before check 'vcpu' Reported-by: Dan Carpenter Cc: corbet@lwn.net Cc: eteo@redhat.com Cc: Julia Lawall Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Sheng Yang --- arch/x86/kvm/i8254.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/arch/x86/kvm/i8254.c =================================================================== --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -713,7 +713,7 @@ void kvm_inject_pit_timer_irqs(struct kv struct kvm *kvm = vcpu->kvm; struct kvm_kpit_state *ps; - if (vcpu && pit) { + if (pit) { int inject = 0; ps = &pit->pit_state;