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 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 0A49ECA0EE1 for ; Fri, 30 Aug 2024 05:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:To:Date:From:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GExFSIDcR+m296qL0+T8lfbyMBHXGvoOKDeyXebihgs=; b=GjzNFNK6eHRRttOva7+FhKw6le ImcjoC3DC2lzv+3RkCzeHUoKVq2CFYGPDj/PyHZAFnSPgScXycQfGn3d2f/hD/pbuQnLRl0LY3N6G ifi8Mjo/cOoL1DySIuVBzJ4WewEHA/J/euIU9UCabjp2/O+vMEBeuzLRUPWBaUlwVju/oPigFyCAi IR+yoGXZg+pYQyNjiJqjZx5Pcec6NcU7AkqsdpddBqkHrW+jz3/tQLVBZBWgZPh0VAcuNg/hqsOjg Lel6M9t2LH+fCTPGKgZktiGRqWRD3dJMfOI/nXZ2wzQytN7z5WLozb3C4dFrJCBr6dtlitauRM5y3 pO7y40Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sju5D-00000004mEy-2y13; Fri, 30 Aug 2024 05:22:03 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sju4L-00000004m4E-1qVu for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 05:21:11 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a868d7f92feso167003466b.2 for ; Thu, 29 Aug 2024 22:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1724995267; x=1725600067; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=GExFSIDcR+m296qL0+T8lfbyMBHXGvoOKDeyXebihgs=; b=KPT6QGRcQ2nIH96xcsDSNpqrTKuy6XWlUo52IpJQcHw4Hp36CIZsoL5NEki6w6dow8 Bf59TZzPDFGwhfij5iTKGj7hZUkaM1N5oVO4dzROGwJ0cE470eH3wJCefSxh70L3B+/W 37Zma4KXZugMpijpt8wGbokdFjEUj9PjO27q1gjdJoLuhzPx1RiwKppN1ycNqFUFgvuE YDSD/O3EqAgvw7p+otXAS2AVyutwPlo1UWCrVFVxQIb+agamnRJKLnv0FB0SsL6fUa1q WBeNoNQ/taJ1nVLk+PwsqdpJHdWGSwRiYs/S3wxUfp5EUt5MvHcsQzYxGeO73U+r5kIg bItA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724995267; x=1725600067; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GExFSIDcR+m296qL0+T8lfbyMBHXGvoOKDeyXebihgs=; b=s5reRGqgSBsq9dTw/VKx+J+GXN5ovGbWGajatJxH8qfVkpujcOMjJtdY/yyNSoIfye IMX3TgRtGgDszf/oItCVDel7yo9OreJyBtjjqI4NQ6iSC2EJ5DKb/BIkM99jQ+VixCNB efQAcxUamx8sA8WLfg1vNEi/Ie6VXiNwGcDw8TzSRlCY+YdEpg3ON5rNYnQ2FNm6GhZX OSVObgbmOFZQNVGGQdSvNkHYX9VD5ZRbKNshsNKSgYeph8IGjF2quo3uE5csBdNaYD/6 KavyCC2eDrNRIs/Ibz35QodYvslk+/sWDqgpfR/PLgy5yhs3DZQUgP7xOb6rpOqneszz QPlA== X-Forwarded-Encrypted: i=1; AJvYcCWDMxwBIx3aEt3AJ5CwwPIPZzfO1i7hRLpgqFlEXmTgfudwLSYemdmREZx50tz4FxXDzJbboxx8WSPp+QhfvuoI@lists.infradead.org X-Gm-Message-State: AOJu0YxNNkFh5jFppmlowgoBuCMGrkyErLyXqTTlaPe/yTA+Mn2fn0jN z+6bRzoIqwnYi2KRvQTw1uZMxOe0Xs9aaNy8aD4gzd+E69ovz8LjSznkTrUdrkQ= X-Google-Smtp-Source: AGHT+IF7+hVzizb5h2RAOKpmPeEAucZHJJ8SE3J6cbyAO0CAecmSuqQGdIsglF6MfVFAtKQonNztKg== X-Received: by 2002:a17:907:7da8:b0:a86:8b7b:7880 with SMTP id a640c23a62f3a-a897fad50fdmr358086866b.63.1724995265995; Thu, 29 Aug 2024 22:21:05 -0700 (PDT) Received: from localhost (host-80-182-198-72.retail.telecomitalia.it. [80.182.198.72]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8988ff4233sm166746966b.25.2024.08.29.22.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 22:21:05 -0700 (PDT) From: Andrea della Porta X-Google-Original-From: Andrea della Porta Date: Fri, 30 Aug 2024 07:21:12 +0200 To: Andrew Lunn Subject: Re: [PATCH 00/11] Add support for RaspberryPi RP1 PCI device using a DT overlay Message-ID: References: <14990d25-40a2-46c0-bf94-25800f379a30@kernel.org> <45a41ed9-2e42-4fd5-a1d5-35de93ce0512@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_222109_508119_BAE35D4F X-CRM114-Status: GOOD ( 26.89 ) 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: , Cc: Catalin Marinas , Michael Turquette , Claudiu Beznea , Eric Dumazet , Dragan Cvetic , Will Deacon , linux-clk@vger.kernel.org, linux-arch@vger.kernel.org, Rob Herring , Florian Fainelli , Lee Jones , Krzysztof Kozlowski , Saravana Kannan , Broadcom internal kernel review list , linux-pci@vger.kernel.org, Jakub Kicinski , Paolo Abeni , Linus Walleij , devicetree@vger.kernel.org, Conor Dooley , Arnd Bergmann , linux-gpio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Bjorn Helgaas , Andrea della Porta , linux-arm-kernel@lists.infradead.org, Derek Kiernan , Stephen Boyd , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Stefan Wahren , netdev@vger.kernel.org, Krzysztof Kozlowski , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Andrew, On 15:04 Thu 29 Aug , Andrew Lunn wrote: > > > > WARNING: externs should be avoided in .c files > > > > #331: FILE: drivers/misc/rp1/rp1-pci.c:58: > > > > +extern char __dtbo_rp1_pci_begin[]; > > > > > > > > True, but in this case we don't have a symbol that should be exported to other > > > > translation units, it just needs to be referenced inside the driver and > > > > consumed locally. Hence it would be better to place the extern in .c file. > > > > > > Did you try making it static. > > > > The dtso is compiled into an obj and linked with the driver which is in > > a different transaltion unit. I'm not aware on other ways to include that > > symbol without declaring it extern (the exception being some hackery > > trick that compile the dtso into a .c file to be included into the driver > > main source file). > > Or probably I'm not seeing what you are proposing, could you please elaborate > > on that? > > Sorry, i jumped to the wrong conclusion. Often it is missing static > keyword which causes warnings. However, you say it needs to be global > scope. > > Reading the warning again: > > > > > WARNING: externs should be avoided in .c files > > It is wanting you to put it in a .h file, which then gets > included by the two users. On a second thought, are you really sure we want to proceed with the header file? After all the only line in it would be the extern declaration and the only one to include it would be rp1-dev.c. Moreover, an header file would convey the false premise that you can include it and use that symbol while in fact it should be only used inside the driver. OTOH, not creating that header file will continue to trigger the warning... Many thanks, Andrea > > Andrew