From patchwork Sat Mar 22 06:40:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 26893 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF35D203AB for ; Sat, 22 Mar 2014 06:40:43 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id gq1sf12690069obb.3 for ; Fri, 21 Mar 2014 23:40:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=9TIcvQgOKP9w9VcLw/piN0+/8bTWmGzlA1HrI9gLAZE=; b=aZjQ/3tD3b/dxMlAVFZDkFgFZ3xVlyDeU/jlGxGF7+sO/WA7nrFwXNiKsvhMC2xZKE u3nHRe0usAER4GjcrRI4MZebdJp0LdfwJqBrJPvcW0wmQcVIZ+yGP9zpFAa7sYrpqq86 IiV2t0bCyvFGeQ2pLOcGBD9Ijepd4vO35sMtUM0+PafYZxOiPkan4RrA98y+Jof8VPDz HAB/CVZz5EIU4tUfh84hSLs47G+qRGj6/J4Tmp91yBizRtd1HC5bIc1XobTnw6ptlSMJ EunlrD/YxT6D/GZuKH5WNQzJXrSVLD+25GmqdWlwoRc6DZji7wnos/9+yu39TDIuqboB /0uQ== X-Gm-Message-State: ALoCoQk6a0BWBBWNRBo+Mol3s1LRRBQbG7cfgKundZwIDM4w8aHf3iE/XQFLn8/sd1S2Cv3pQYgm X-Received: by 10.182.230.168 with SMTP id sz8mr7991888obc.9.1395470443280; Fri, 21 Mar 2014 23:40:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.101 with SMTP id a92ls863894qga.66.gmail; Fri, 21 Mar 2014 23:40:43 -0700 (PDT) X-Received: by 10.221.37.1 with SMTP id tc1mr233396vcb.32.1395470443198; Fri, 21 Mar 2014 23:40:43 -0700 (PDT) Received: from mail-vc0-x22b.google.com (mail-vc0-x22b.google.com [2607:f8b0:400c:c03::22b]) by mx.google.com with ESMTPS id fv9si1644717vcb.128.2014.03.21.23.40.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 23:40:43 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::22b is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::22b; Received: by mail-vc0-f171.google.com with SMTP id lg15so3626963vcb.2 for ; Fri, 21 Mar 2014 23:40:43 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr12125275vco.25.1395470443071; Fri, 21 Mar 2014 23:40:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp81398vck; Fri, 21 Mar 2014 23:40:42 -0700 (PDT) X-Received: by 10.68.245.162 with SMTP id xp2mr58209210pbc.69.1395470441981; Fri, 21 Mar 2014 23:40:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vo7si5075929pab.385.2014.03.21.23.40.41; Fri, 21 Mar 2014 23:40:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751427AbaCVGke (ORCPT + 26 others); Sat, 22 Mar 2014 02:40:34 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:49242 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbaCVGkb (ORCPT ); Sat, 22 Mar 2014 02:40:31 -0400 Received: by mail-pd0-f172.google.com with SMTP id p10so3211957pdj.31 for ; Fri, 21 Mar 2014 23:40:31 -0700 (PDT) X-Received: by 10.68.66.1 with SMTP id b1mr58505142pbt.43.1395470431230; Fri, 21 Mar 2014 23:40:31 -0700 (PDT) Received: from localhost.localdomain ([75.148.49.89]) by mx.google.com with ESMTPSA id hw8sm13686890pbc.62.2014.03.21.23.40.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 23:40:29 -0700 (PDT) From: behanw@converseincode.com To: dh.herrmann@gmail.com, sameo@linux.intel.com, jani.nikula@intel.com, alexandre.bounine@idt.com Cc: akpm@linux-foundation.org, dmitry.torokhov@gmail.com, tomas.winkler@intel.com, gregkh@linuxfoundation.org, arnd@arndb.de, linux-kernel@vger.kernel.org, dwmw2@infradead.org, pageexec@freemail.hu, Behan Webster , =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= Subject: [PATCH] x86: LLVMLinux: Fix "incomplete type const struct x86cpu_device_id" Date: Fri, 21 Mar 2014 23:40:18 -0700 Message-Id: <1395470418-16015-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::22b is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (no key for signature) header.i=@converseincode.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Behan Webster Similar to the fix in 40413dcb7b273bda681dca38e6ff0bbb3728ef11 MODULE_DEVICE_TABLE(x86cpu, ...) expects the struct to be called struct x86cpu_device_id, and not struct x86_cpu_id which is what is used in the rest of the kernel code. Although gcc seems to ignore this error, clang fails without this define to fix the name. Code from drivers/thermal/x86_pkg_temp_thermal.c static const struct x86_cpu_id __initconst pkg_temp_thermal_ids[] = { ... }; MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids); Error from clang: drivers/thermal/x86_pkg_temp_thermal.c:577:1: error: variable has incomplete type 'const struct x86cpu_device_id' MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids); ^ include/linux/module.h:145:3: note: expanded from macro 'MODULE_DEVICE_TABLE' MODULE_GENERIC_TABLE(type##_device, name) ^ include/linux/module.h:87:32: note: expanded from macro 'MODULE_GENERIC_TABLE' extern const struct gtype##_id __mod_##gtype##_table \ ^ :143:1: note: expanded from here __mod_x86cpu_device_table ^ drivers/thermal/x86_pkg_temp_thermal.c:577:1: note: forward declaration of 'struct x86cpu_device_id' include/linux/module.h:145:3: note: expanded from macro 'MODULE_DEVICE_TABLE' MODULE_GENERIC_TABLE(type##_device, name) ^ include/linux/module.h:87:21: note: expanded from macro 'MODULE_GENERIC_TABLE' extern const struct gtype##_id __mod_##gtype##_table \ ^ :141:1: note: expanded from here x86cpu_device_id ^ 1 error generated. Signed-off-by: Behan Webster Signed-off-by: Jan-Simon Möller Acked-by: Greg Kroah-Hartman --- include/linux/mod_devicetable.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 45e9214..dbb5cf0 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -548,6 +548,11 @@ struct amba_id { * See documentation of "x86_match_cpu" for details. */ +/* + * MODULE_DEVICE_TABLE expects this struct to be called x86cpu_device_id. + * Although gcc seems to ignore this error, clang fails without this define. + */ +#define x86cpu_device_id x86_cpu_id struct x86_cpu_id { __u16 vendor; __u16 family;