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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEFC4C4727C for ; Thu, 1 Oct 2020 15:53:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6AF092145D for ; Thu, 1 Oct 2020 15:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601567593; bh=3y8JWfLL5dODqPi5bHq6fgfvuFy9ctHX4jdjrNwdoSM=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=i7+AmEaerR4zR5FmokjPkA0UHgefGuhzjMLqTu9vE3OCPml/Sk+EO8FM2Bc/06Ill WRUj6U/OYlZ17mo74QTxl4lH9HOCjVhT+eoDY/l2bBN29+OH4JRHZ7Zi83NBew3q2g xwgVVScjsOHAOgwybXObFATk6rpRMJU11DHx4u58= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732517AbgJAPxM (ORCPT ); Thu, 1 Oct 2020 11:53:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:58148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732331AbgJAPxM (ORCPT ); Thu, 1 Oct 2020 11:53:12 -0400 Received: from localhost (170.sub-72-107-125.myvzw.com [72.107.125.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CEF120872; Thu, 1 Oct 2020 15:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601567592; bh=3y8JWfLL5dODqPi5bHq6fgfvuFy9ctHX4jdjrNwdoSM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=u9lKXwnUgdRk7flb8sSGV4h8hpJkTGqBDR8Ke54ap9Co71JHTTM8WEC3uxX14dZsh PgzH8rOE4RYARidBG81FkydMhDeZwtl0QHOlj6zYqgTwPQG+MCL6rw2TaYxymrdoKY Go7G1yCJsiSs1eTOk4CxIoKvtowwg6vrP3mJNBgA= Date: Thu, 1 Oct 2020 10:53:10 -0500 From: Bjorn Helgaas To: Rob Herring Cc: Pratyush Anand , Thomas Petazzoni , Lorenzo Pieralisi , PCI Subject: Re: of_match[] warnings Message-ID: <20201001155310.GA2691450@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Oct 01, 2020 at 07:48:23AM -0500, Rob Herring wrote: > On Wed, Sep 30, 2020 at 5:37 PM Bjorn Helgaas wrote: > > > > These warnings are sort of annoying. I guess most of the other > > drivers avoid this by depending on OF as well as COMPILE_TEST. > > Using the of_match_ptr() macro should prevent this. Both drivers *do* use of_match_ptr(), but the of_device_id table is unused when of_match_ptr() throws away the pointer. I guess we could add __maybe_unused to squelch the warning. Ugly, but I do think COMPILE_TEST has some value. > > $ grep -E "CONFIG_(OF|PCIE_(SPEAR13XX|ARMADA_8K))" .config > > CONFIG_PCIE_SPEAR13XX=y > > CONFIG_PCIE_ARMADA_8K=y > > # CONFIG_OF is not set > > > > $ make W=1 drivers/pci/ > > ... > > CC drivers/pci/controller/dwc/pcie-spear13xx.o > > drivers/pci/controller/dwc/pcie-spear13xx.c:270:34: warning: ‘spear13xx_pcie_of_match’ defined but not used [-Wunused-const-variable=] > > 270 | static const struct of_device_id spear13xx_pcie_of_match[] = { > > | ^~~~~~~~~~~~~~~~~~~~~~~ > > ... > > CC drivers/pci/controller/dwc/pcie-armada8k.o > > drivers/pci/controller/dwc/pcie-armada8k.c:344:34: warning: ‘armada8k_pcie_of_match’ defined but not used [-Wunused-const-variable=] > > 344 | static const struct of_device_id armada8k_pcie_of_match[] = { > > | ^~~~~~~~~~~~~~~~~~~~~~ > >