Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753978AbcLLDpL (ORCPT ); Sun, 11 Dec 2016 22:45:11 -0500 Received: from mga04.intel.com ([192.55.52.120]:20847 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751680AbcLLDpK (ORCPT ); Sun, 11 Dec 2016 22:45:10 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,334,1477983600"; d="scan'208";a="201495185" Message-ID: <1481514306.2325.1.camel@intel.com> Subject: Re: [PATCH] Fix multiple definition error under lto From: Zhang Rui To: Peter Foley , linux-kernel@vger.kernel.org, edubezval@gmail.com, linux-pm@vger.kernel.org Date: Mon, 12 Dec 2016 11:45:06 +0800 In-Reply-To: <20161126222528.15261-1-pefoley2@pefoley.com> References: <20161126222528.15261-1-pefoley2@pefoley.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1498 Lines: 42 On Sat, 2016-11-26 at 17:25 -0500, Peter Foley wrote: > drivers/thermal/built-in.o: In function `type_show.lto_priv.33': > (.text+0x3d80): multiple definition of `type_show.lto_priv.33' > drivers/base/built-in.o:(.text+0x2a40): first defined here > can you illustrate how to reproduce this problem? thanks, rui > Signed-off-by: Peter Foley > --- >  drivers/thermal/thermal_core.c | 4 ++-- >  1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/thermal/thermal_core.c > b/drivers/thermal/thermal_core.c > index 226b0b4aced6..23ec1dd2ff3b 100644 > --- a/drivers/thermal/thermal_core.c > +++ b/drivers/thermal/thermal_core.c > @@ -643,7 +643,7 @@ static void thermal_zone_device_check(struct > work_struct *work) >   container_of(_dev, struct thermal_zone_device, device) >   >  static ssize_t > -type_show(struct device *dev, struct device_attribute *attr, char > *buf) > +thermal_type_show(struct device *dev, struct device_attribute *attr, > char *buf) >  { >   struct thermal_zone_device *tz = to_thermal_zone(dev); >   > @@ -1159,7 +1159,7 @@ int power_actor_set_power(struct > thermal_cooling_device *cdev, >   return 0; >  } >   > -static DEVICE_ATTR(type, 0444, type_show, NULL); > +static DEVICE_ATTR(type, 0444, thermal_type_show, NULL); >  static DEVICE_ATTR(temp, 0444, temp_show, NULL); >  static DEVICE_ATTR(mode, 0644, mode_show, mode_store); >  static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, > passive_store);