Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751930AbcDRE3I (ORCPT ); Mon, 18 Apr 2016 00:29:08 -0400 Received: from mga04.intel.com ([192.55.52.120]:40549 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbcDRE3F convert rfc822-to-8bit (ORCPT ); Mon, 18 Apr 2016 00:29:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,500,1455004800"; d="scan'208";a="86940816" From: "Chakravarty, Souvik K" To: Dan Carpenter CC: Darren Hart , "platform-driver-x86@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-janitors@vger.kernel.org" Subject: RE: [patch] intel_telemetry_pltdrv: silence an unintialized variable warning Thread-Topic: [patch] intel_telemetry_pltdrv: silence an unintialized variable warning Thread-Index: AQHRlyWd0WFXa2CGNE+i9bGzkO5OB5+PJlEA Date: Mon, 18 Apr 2016 04:28:11 +0000 Message-ID: <5F7315E704FA0841B5DFCE90329B2BB42CAC85CD@BGSMSX102.gar.corp.intel.com> References: <20160415144558.GD8953@mwanda> In-Reply-To: <20160415144558.GD8953@mwanda> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2UwOGVjMzItY2U3ZC00ZDljLWE2YmEtOGJiM2M0OTVjOTFhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjZoY2llUmRhZU0xdWt6am9SXC9yd3VLRTh5OVE0RVB0d2RhWjJ3elgyZU5FPSJ9 x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1280 Lines: 33 Looks good...thanks Dan. > -----Original Message----- > From: Dan Carpenter [mailto:dan.carpenter@oracle.com] > Sent: Friday, April 15, 2016 8:16 PM > To: Chakravarty, Souvik K > Cc: Darren Hart ; platform-driver- > x86@vger.kernel.org; linux-kernel@vger.kernel.org; kernel- > janitors@vger.kernel.org > Subject: [patch] intel_telemetry_pltdrv: silence an unintialized variable > warning > > Presumably "pss_period" and "ioss_period" can't both be zero, but this > function is never called so we can't infer that using static analysis alone. > > Let's silence the warning by setting "ret" to zero. > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/platform/x86/intel_telemetry_pltdrv.c > b/drivers/platform/x86/intel_telemetry_pltdrv.c > index 397119f..781bd10 100644 > --- a/drivers/platform/x86/intel_telemetry_pltdrv.c > +++ b/drivers/platform/x86/intel_telemetry_pltdrv.c > @@ -659,7 +659,7 @@ static int telemetry_plt_update_events(struct > telemetry_evtconfig pss_evtconfig, static int > telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period) { > u32 telem_ctrl = 0; > - int ret; > + int ret = 0; > > mutex_lock(&(telm_conf->telem_lock)); > if (ioss_period) {