From patchwork Sun Jul 2 20:26:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 13299491 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18AF4EB64D9 for ; Sun, 2 Jul 2023 20:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=5QyP5Wy975sygCQVqHoOtpmcy011V0w2iYvE/sN1iBs=; b=XKcyu3QiNh6plM yEVplotNvad+FiQQHeJguzGyremOF6n6+nWY8xi8bp9fUuP4rYmJ2GRzb53pg0fx2xSiwqVW1dZfv Rzu5CT1hVdsu1zKdRquV/mTrmmEA0pHOe6NpqCyL6TgUpis4TKPRq2rD8gM9hamPBZA5T2Wp4jNG3 Vs4n60DbQwQvxx+ZQTbZbsR2+gZDlewdqAqqUrSpnMwUFfXVN/0XBHK6ECVVE/XpLAO+o//1y3enY tptXyNCaH3659kVc0Ju+/CVr/Mj1k9SfRKRlQTi5ETyZ+Xgbm+rnIzliz6yTWBSC1T1m7wNKb5+5B biJZ28BinLDKQ1YJtccw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qG3eA-008aQN-39; Sun, 02 Jul 2023 20:26:14 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qG3e7-008aPL-1U for linux-arm-kernel@lists.infradead.org; Sun, 02 Jul 2023 20:26:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688329568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RAuoFBXJGbrEK7r6lFPsWq6Du417iZcQuP9Eu+SLXPs=; b=i5fSoVu+JxqByZczP9BaA4ZzoS0GqFf+8xE8AawGSmRBduJMlCjrmAp5oE6/cUuhlsAojk m0GV/9c20cisBi0W9YZdBt+HQi1Kg4mIFXvi3BQahLrczryA9EAg5eiM83pdqvbOdHk9tR yoMAmaxJY5rZoZEq11IODMgfKsFmeGU= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-543-Gu1sew1NPM6IkKLSlv0-rQ-1; Sun, 02 Jul 2023 16:26:07 -0400 X-MC-Unique: Gu1sew1NPM6IkKLSlv0-rQ-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-635e822b49eso25866516d6.2 for ; Sun, 02 Jul 2023 13:26:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688329566; x=1690921566; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RAuoFBXJGbrEK7r6lFPsWq6Du417iZcQuP9Eu+SLXPs=; b=lZNSZjBJ9yiU2vGjYyTqkeWsRX5b11ZfCSujNz4HfBqCe9ueCPNsxqLR20RVgBVEqs WT9Ewxg5q4AcuCxEN/oDydDCTTkte5u3+qXGfVHnhl1q02F8Fh2St4i47beQME+CCQPI yZsVUabnOF5OUrqIJ334R3i6JV+9D2c7NBcLD+kHNu6JAHeHSo5C6ynVeKsIiZTllQQ8 LS8UW6leObbzX7w4SKpkzvCndQ7KUhDOC7jrtnleW+iuaBz8DV22H7oo8VRfoZ2jUzvz hWviTfCmASUcULBxKYkkeIbsXnobt8/xI4U99wSKHkrVdw4HehE5x9Nf+IR3/Olvu1hL uflQ== X-Gm-Message-State: ABy/qLax9nL6F8jzg89htn7unAGZxE3hm8yivCLV1uxbHmYmTg8oQMBD MOUjhqsBlhiAJcO4cb/t5WU9Wb1ZCA0qetp1d6TJdftmOf49hYwaCOgHDO+bkHJAgG/WINT0JyB bpoY7VUxHHOs/bUdUbXpOHMI0rItprBJaGkg= X-Received: by 2002:ad4:5fcd:0:b0:635:a1f5:5458 with SMTP id jq13-20020ad45fcd000000b00635a1f55458mr10055516qvb.12.1688329566551; Sun, 02 Jul 2023 13:26:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlHAdOVmOK/0+cxD45eADjdrnL8vXwAqDR93DNfpbltexe47gg5n3KhEGJTHpGhBn8F7/mMyLw== X-Received: by 2002:ad4:5fcd:0:b0:635:a1f5:5458 with SMTP id jq13-20020ad45fcd000000b00635a1f55458mr10055495qvb.12.1688329566186; Sun, 02 Jul 2023 13:26:06 -0700 (PDT) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id g10-20020ad4510a000000b0063623c266easm4430335qvp.3.2023.07.02.13.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 13:26:05 -0700 (PDT) From: Tom Rix To: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, jing.cai@mediatek.com, sean.wang@mediatek.com, chris.lu@mediatek.com Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Tom Rix Subject: [PATCH] Bluetooth: btmtk: fix handling of CONFIG_DEV_COREDUMP not being defined Date: Sun, 2 Jul 2023 16:26:03 -0400 Message-Id: <20230702202603.3442724-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230702_132611_593097_929C097D X-CRM114-Status: GOOD ( 12.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When CONFIG_DEV_COREDUMP is not defined, there is this error drivers/bluetooth/btmtk.c: In function ‘btmtk_process_coredump’: drivers/bluetooth/btmtk.c:386:44: error: ‘struct hci_dev’ has no member named ‘dump’ 386 | schedule_delayed_work(&hdev->dump.dump_timeout, | ^~ The runtime IS_ENABLED(CONFIG_DEV_COREDUMP) is not enough to prevent the compiletime error of accessing the dump element of hci_dev. So switch to #ifdef. Fixes: 872f8c253cb9 ("Bluetooth: btusb: mediatek: add MediaTek devcoredump support") Signed-off-by: Tom Rix --- drivers/bluetooth/btmtk.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 786f775196ae..12769e95bf55 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -369,11 +369,9 @@ EXPORT_SYMBOL_GPL(btmtk_register_coredump); int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb) { + int err = 0; +#ifdef CONFIG_DEV_COREDUMP struct btmediatek_data *data = hci_get_priv(hdev); - int err; - - if (!IS_ENABLED(CONFIG_DEV_COREDUMP)) - return 0; switch (data->cd_info.state) { case HCI_DEVCOREDUMP_IDLE: @@ -407,7 +405,7 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb) if (err < 0) kfree_skb(skb); - +#endif return err; } EXPORT_SYMBOL_GPL(btmtk_process_coredump);