From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751788AbdJRPkR (ORCPT ); Wed, 18 Oct 2017 11:40:17 -0400 Received: from mga07.intel.com ([134.134.136.100]:9607 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbdJRPkO (ORCPT ); Wed, 18 Oct 2017 11:40:14 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,397,1503385200"; d="scan'208";a="164095112" From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Dan Williams , linux-nvdimm@lists.01.org Subject: [PATCH 1/2] dev/dax: fix uninitialized variable build warning Date: Wed, 18 Oct 2017 09:40:05 -0600 Message-Id: <20171018154006.15431-1-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix this build warning: warning: 'phys' may be used uninitialized in this function [-Wuninitialized] As reported here: https://lkml.org/lkml/2017/10/16/152 This should have no functional change because you can only get into the if statement in dax_pgoff_to_phys() that is complaining about 'phys' being uninitialized if you broke out early in the above loop, in which case 'phys' will be set. Signed-off-by: Ross Zwisler --- drivers/dax/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dax/device.c b/drivers/dax/device.c index e9f3b3e..4aca0a2 100644 --- a/drivers/dax/device.c +++ b/drivers/dax/device.c @@ -222,7 +222,7 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff, unsigned long size) { struct resource *res; - phys_addr_t phys; + phys_addr_t phys = 0; int i; for (i = 0; i < dev_dax->num_resources; i++) { -- 2.9.5