From patchwork Wed Jul 13 21:03:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102021 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1198251qga; Wed, 13 Jul 2016 14:05:09 -0700 (PDT) X-Received: by 10.98.54.198 with SMTP id d189mr6834595pfa.39.1468443909036; Wed, 13 Jul 2016 14:05:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v76si101805pfa.20.2016.07.13.14.05.08; Wed, 13 Jul 2016 14:05:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751518AbcGMVEv (ORCPT + 4 others); Wed, 13 Jul 2016 17:04:51 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51079 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbcGMVEt (ORCPT ); Wed, 13 Jul 2016 17:04:49 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0MB1l6-1bV6Iq2KzU-009zAi; Wed, 13 Jul 2016 23:04:04 +0200 From: Arnd Bergmann To: Jiri Pirko Cc: netdev@vger.kernel.org, Steven Rostedt , Ingo Molnar , "David S . Miller" , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH net-next 1/2] devlink: fix build error for CONFIG_MODULES=n Date: Wed, 13 Jul 2016 23:03:37 +0200 Message-Id: <20160713210338.1647521-1-arnd@arndb.de> X-Mailer: git-send-email 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-Mailing-List: netdev@vger.kernel.org A driver calling trace_devlink_hwmsg cannot be built when modules are disabled: include/trace/events/devlink.h: In function 'trace_event_get_offsets_devlink_hwmsg': include/trace/events/devlink.h:25:51: error: dereferencing pointer to incomplete type 'struct module' __string(owner_name, devlink->dev->driver->owner->name) This changes the code to only print the module name when modules are actually enabled, otherwise we hardcode the string "built-in". Signed-off-by: Arnd Bergmann Fixes: e5224f0fe2ac ("devlink: add hardware messages tracing facility") --- include/trace/events/devlink.h | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.9.0 diff --git a/include/trace/events/devlink.h b/include/trace/events/devlink.h index 333c32ac9bfa..26f92d3c7e9c 100644 --- a/include/trace/events/devlink.h +++ b/include/trace/events/devlink.h @@ -22,7 +22,11 @@ TRACE_EVENT(devlink_hwmsg, TP_STRUCT__entry( __string(bus_name, devlink->dev->bus->name) __string(dev_name, dev_name(devlink->dev)) +#ifdef CONFIG_MODULES __string(owner_name, devlink->dev->driver->owner->name) +#else + __string(owner_name, "built-in") +#endif __field(bool, incoming) __field(unsigned long, type) __dynamic_array(u8, buf, len) @@ -32,7 +36,11 @@ TRACE_EVENT(devlink_hwmsg, TP_fast_assign( __assign_str(bus_name, devlink->dev->bus->name); __assign_str(dev_name, dev_name(devlink->dev)); +#ifdef CONFIG_MODULES __assign_str(owner_name, devlink->dev->driver->owner->name); +#else + __assign_str(owner_name, "built-in"); +#endif __entry->incoming = incoming; __entry->type = type; memcpy(__get_dynamic_array(buf), buf, len);