Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp368273rwb; Wed, 10 Aug 2022 09:28:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hL8nTd0KIGQlzgyh19J8+JiUytcCm1nmu7m/pcXG9EwKFwYjyGD9O02tuVA8phSqtOFY2 X-Received: by 2002:a17:90a:8c88:b0:1f2:12b0:ae9e with SMTP id b8-20020a17090a8c8800b001f212b0ae9emr4655086pjo.42.1660148931270; Wed, 10 Aug 2022 09:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660148931; cv=none; d=google.com; s=arc-20160816; b=JxLNdWkpF7Ay6r6bmOkdMkycuG+4SYZ84Y6g1HqTop94h/HIGFdkvoJhKC6BZAbi5y BZrwWxVeGubLyDLLC4q00Dorzuj6jkPEqzzA2rAO+bB2JwdSE+/QgzalbODXwiuKWs08 2cqeLdPKEA/eDcwi/3onGpdqpYsn6OkTM5NVkX79VO2swX76Yo1VLT4c96qXQe0K/zfm XmnbUnFav58njyQoFCMa6C21xyt9MwP0D4JGUvkwbzb6L12RJVa96Wir3wIjbNqCKYbD a4A0GQUrvJcYcevZLTNpHwvVUPSDGVhTK+5xTx3RHpz/ckrDz7pRwm9mkfVv9VyZOsqV WleA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Vzy9vRX/aq4Xb3OxwwPyuzcJXHdmqY65+bPIWp/xHlM=; b=elj8kSv/fwLxos3b3vOsQAa7neapoK2igQnEK2DZoNa4z92S83TAdLTaI6Y0IAI/c1 hATE0jgU+Wqx50ZGinGPVmaUhHHBBr5J/QEmA/drl1lV/tXeOHj63v+BctZmP+cFPwmy I4nPmALGREFgPNMncbJJ4p7JrZiputT1Q2mZ7wmWhd7aeLS54C3DmCBvR7C1wJmVuA2j dQWr279eCpKpOhONmBsEoJreq/SmXEiNawHQJLfQCOxYYZKfu3/UJJWn+hfLqIqyimuZ fHHvbQMxgBuhwQTsVZ9KYnIPBlMB6Rk9MS7Gwhv1AfzrsdDFadLjlhdan6GAYl6ITezw jnWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZY1o7ndk; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id on7-20020a17090b1d0700b001f5028973ddsi2977862pjb.7.2022.08.10.09.27.38; Wed, 10 Aug 2022 09:28:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZY1o7ndk; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230359AbiHJQTq (ORCPT + 99 others); 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> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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