From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6414BC00140 for ; Wed, 10 Aug 2022 16:19:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbiHJQTq (ORCPT ); Wed, 10 Aug 2022 12:19:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbiHJQTp (ORCPT ); Wed, 10 Aug 2022 12:19:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D16597D1D7; Wed, 10 Aug 2022 09:19:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6BA4E61198; Wed, 10 Aug 2022 16:19:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B79AC433C1; Wed, 10 Aug 2022 16:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660148383; bh=mSFaj+NwiQylRGU1GkqPGJTjj0pD5iaBeP7XgeK+7/c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZY1o7ndkkJqLdKESA7qXprqqgsdOFbeZj6hdoew6R6Lk2SsUlDvvR/QtV3v8nIEz3 +JYzt+49ABFHpC5VRUCBvutA+5Od1jCAhBx8jLaerDAvtD655TWuZRUBrjTzcNN6Vy WTSammJgiPWO73gkBSxDS968IugW9xgfbgaWAhuU= Date: Wed, 10 Aug 2022 18:19:40 +0200 From: Greg Kroah-Hartman To: Manish Mandlik Cc: Arend van Spriel , marcel@holtmann.org, luiz.dentz@gmail.com, Johannes Berg , Dan Williams , Jason Gunthorpe , linux-bluetooth@vger.kernel.org, Thomas Gleixner , "Rafael J . Wysocki" , chromeos-bluetooth-upstreaming@chromium.org, Won Chung , Abhishek Pandit-Subedi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Johan Hedberg , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v5 3/5] Bluetooth: Add support for hci devcoredump Message-ID: References: <20220810085753.v5.1.I5622b2a92dca4d2703a0f747e24f3ef19303e6df@changeid> <20220810085753.v5.3.Iaf638bb9f885f5880ab1b4e7ae2f73dd53a54661@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220810085753.v5.3.Iaf638bb9f885f5880ab1b4e7ae2f73dd53a54661@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Wed, Aug 10, 2022 at 09:00:36AM -0700, Manish Mandlik wrote: > --- a/net/bluetooth/hci_core.c > +++ b/net/bluetooth/hci_core.c > @@ -2510,14 +2510,23 @@ struct hci_dev *hci_alloc_dev_priv(int sizeof_priv) > INIT_WORK(&hdev->tx_work, hci_tx_work); > INIT_WORK(&hdev->power_on, hci_power_on); > INIT_WORK(&hdev->error_reset, hci_error_reset); > +#ifdef CONFIG_DEV_COREDUMP > + INIT_WORK(&hdev->dump.dump_rx, hci_devcoredump_rx); > +#endif > > hci_cmd_sync_init(hdev); > > INIT_DELAYED_WORK(&hdev->power_off, hci_power_off); > +#ifdef CONFIG_DEV_COREDUMP > + INIT_DELAYED_WORK(&hdev->dump.dump_timeout, hci_devcoredump_timeout); > +#endif > > skb_queue_head_init(&hdev->rx_q); > skb_queue_head_init(&hdev->cmd_q); > skb_queue_head_init(&hdev->raw_q); > +#ifdef CONFIG_DEV_COREDUMP > + skb_queue_head_init(&hdev->dump.dump_q); > +#endif Putting #ifdef in .c files is messy, why not put all of this behind a function that you properly handle in a .h file instead? thanks, greg k-h