Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4869462rwb; Tue, 8 Aug 2023 15:35:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHzLp5aKd9VJyhX6gvbf0tWHmfWjbZtP0NYb7OHnCj08+9TdBC5cpxgNkdd0q0dGEY0AvN X-Received: by 2002:a05:6a21:35c2:b0:134:b28f:b58a with SMTP id ba2-20020a056a2135c200b00134b28fb58amr853904pzc.7.1691534123354; Tue, 08 Aug 2023 15:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691534123; cv=none; d=google.com; s=arc-20160816; b=LTVUGCImYmqT8cC/gR5FKnPr4MCjV1FpX5SyJHJN/xFsmq5EbGhwVF2G8bpxdtJ5qu oG/rvIyvoUSsQA4ap3fu3xn1Fk1Dzf/y1ESRiiiqe04ktReWF7KgY+CbFd1j4yD8BDvH /aojH6ei2dXwMiSRGGMleZroSAyDNFToY49iAHAjUFGyUUQn7LXPdlECvSEudME2boZv Ag/Iepwo2+m3kg0rdhzMZ8zeuBX0r5pT/rBk+tR5DYU2wLVtWcQV6xAt52qNPCdSSe9v 2WoDKF8C+K+KBuvy/8WbsXRda5XUeIlsxna0TxyWkTmzsxu6fAS+cVuIvJG5W5GlIxvy Z5mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=zRGROs0prSq9MFh0VojzEm9/faHihdz2gNY33winOk0=; fh=THIKxGr0uRaXb5ZGewsFvPDLZtF1HqJG5B1gdElDcrk=; b=eOdR7JcbNH+AZlh5b/+tQZUNnSeqh0LZK14ddyPMDPfh7kK2wN0h1cIchiCfuIBPnG DDymyaBlTi6dMKlZ7nGBwypGJhn9yI7OtzTDo7N1jaFPZruDpBo3NxFP2LMPKRHkeSH/ pSHlzgDN2YPKjAUPdqNxXMG01gjIWQmejnqLfAvZZ4Ak9XmaDBjEXtiaPwqxnLB53Dn3 J/LnQbJ8cPdmKhFpWGjilWVwGBME8RZIcIsdHW+p5VmTgtJSAxV2nVJGy20B5IOfjOKt dPmqahTWp9kDPVzqfmXeP3KuZ40lLpjiS/YqZTezDAOFc1rrPNIoc7DFXX/loY6nx1au Ag+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ZwuzzdZO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t189-20020a6381c6000000b0056532771dd0si305344pgd.740.2023.08.08.15.35.12; Tue, 08 Aug 2023 15:35:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@google.com header.s=20221208 header.b=ZwuzzdZO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234094AbjHHTua (ORCPT + 99 others); Tue, 8 Aug 2023 15:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233314AbjHHTuM (ORCPT ); Tue, 8 Aug 2023 15:50:12 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98D1B53524 for ; Tue, 8 Aug 2023 09:56:19 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d1c693a29a0so6762949276.1 for ; Tue, 08 Aug 2023 09:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691513778; x=1692118578; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=zRGROs0prSq9MFh0VojzEm9/faHihdz2gNY33winOk0=; b=ZwuzzdZO9kYs2Oc/mNbJfARuvGlMIC3UUvNeZoKIvfQ2VX/159UeLD1ZOmH/QRku2q UdxijLS1nyzh4vJapMPxBdB8Mw0I7WhzdZN5HIP1q4KkrgtgqCuWf6ebvKHNXq6l9tGA r/JobYflpqEJayDjQmiSyLfBHt9cttoaedbWNQRVokc8GdBH1nN1OhMM71m5X6bnIFOX jGZafbBDftxnGbVwxScApAzdztO3THQLw8zbAAexjzipo9xfZrido1s5h4shka1W8pRA mt9oD6/q/ha3W6CQK/O/WueGTnREmrbLW/46ftFn+1ehcZRoL4uLnQTtAg2+1kfrNN1r 1RaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691513778; x=1692118578; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zRGROs0prSq9MFh0VojzEm9/faHihdz2gNY33winOk0=; b=i5YrUiXvughzVKliKIRwYOFjYaQSbkPAHOTPgTRyX3omDB9nUZl+Ex9k3fnLUTlve9 3rQOnk6xX1bzT8T7kbWQyPRNnsNB0Bszy6VKYrQ+3qaD5zpGkQg0JeulueeN4oSPCWVo 5eEbtDeUDcpANCM/xNk+LflwYVglI2bpzuV9sZxCWTcgsH9nQdurjQWEG+zT8rBB6JrV ZsjiJd/YEeIyIgpJYEGFlTI00Z7nkPcw0YG2AzeZ0d9TFtRCfkFm9NKNfWYQZRICQ0od /TlnRbFg8TC+8imb3bQWRR++MyvwZnYa5ycXrMWnei5wJgABZ5ynynJ0yNgsBnj0tEBA 221A== X-Gm-Message-State: AOJu0Yy0UR5Ih0eJPCncPxELX/NQYYor+LNVl1EOx3hj0wPwCkWAJd0q 9o2ckAjmVjGP0HO+mIlcy84UQ4zKfNq+hSWG8RA= X-Received: from ndesaulniers-desktop.svl.corp.google.com ([2620:15c:2d1:203:cc03:38d0:9718:e90b]) (user=ndesaulniers job=sendgmr) by 2002:a25:860e:0:b0:d5d:511b:16da with SMTP id y14-20020a25860e000000b00d5d511b16damr1793ybk.2.1691513778422; Tue, 08 Aug 2023 09:56:18 -0700 (PDT) Date: Tue, 08 Aug 2023 09:56:16 -0700 Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAK9z0mQC/x3MQQqAIBBA0avIrBPUiqSrRISMU80iC40IxLsnL d/i/wyJIlOCUWSI9HDiM1ToRgDuLmwk2VeDUaZVVlnJBqU7/JJudzNKq6lHMzjbIUGNrkgrv/9 wmkv5AFb2g4hgAAAA X-Developer-Key: i=ndesaulniers@google.com; a=ed25519; pk=UIrHvErwpgNbhCkRZAYSX0CFd/XFEwqX3D0xqtqjNug= X-Developer-Signature: v=1; a=ed25519-sha256; t=1691513776; l=2427; i=ndesaulniers@google.com; s=20220923; h=from:subject:message-id; bh=si09L+ne/76nNtqRPQQNA8vh+v/vSOpRLqSBS/7yXBU=; b=rVdUpEz91pDMvj2lTvd62ib7crXJtBOPX1kW9foKJV39T/d9Twit/ju7Ur4Jw4tv+AsMmMlNb X1Dlt6TmZSeDalyhdGjGC+BA2Yko/jKs/08sEV2wsETgddvbzoMAjbW X-Mailer: b4 0.12.3 Message-ID: <20230808-i2c-amd_static-v1-1-1902f608bba1@google.com> Subject: [PATCH] i2c/busses: fix -Wmissing-variable-declarations From: Nick Desaulniers To: Jean Delvare , Andi Shyti Cc: Nathan Chancellor , Tom Rix , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, llvm@lists.linux.dev, kernel test robot , Nick Desaulniers Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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-kernel@vger.kernel.org I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day bot spotted the following instance: drivers/i2c/busses/i2c-amd756.c:286:20: warning: no previous extern declaration for non-static variable 'amd756_smbus' [-Wmissing-variable-declarations] 286 | struct i2c_adapter amd756_smbus = { | ^ drivers/i2c/busses/i2c-amd756.c:286:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit 286 | struct i2c_adapter amd756_smbus = { | ^ This symbol is referenced by more than one translation unit, so create then include the correct header for their declarations. Reported-by: kernel test robot Closes: https://lore.kernel.org/llvm/202308081000.tTL1ElTr-lkp@intel.com/ Signed-off-by: Nick Desaulniers --- drivers/i2c/busses/i2c-amd756-s4882.c | 3 +-- drivers/i2c/busses/i2c-amd756.c | 1 + drivers/i2c/busses/i2c-amd756.h | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c index 063274388a75..8156cfc43df3 100644 --- a/drivers/i2c/busses/i2c-amd756-s4882.c +++ b/drivers/i2c/busses/i2c-amd756-s4882.c @@ -26,8 +26,7 @@ #include #include #include - -extern struct i2c_adapter amd756_smbus; +#include "i2c-amd756.h" static struct i2c_adapter *s4882_adapter; static struct i2c_algorithm *s4882_algo; diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index ef1307a258e9..af77374d2ab3 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c @@ -31,6 +31,7 @@ #include #include #include +#include "i2c-amd756.h" /* AMD756 SMBus address offsets */ #define SMB_ADDR_OFFSET 0xE0 diff --git a/drivers/i2c/busses/i2c-amd756.h b/drivers/i2c/busses/i2c-amd756.h new file mode 100644 index 000000000000..88698266d6d8 --- /dev/null +++ b/drivers/i2c/busses/i2c-amd756.h @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include +extern struct i2c_adapter amd756_smbus; --- base-commit: 14f9643dc90adea074a0ffb7a17d337eafc6a5cc change-id: 20230808-i2c-amd_static-81e5c27a84ce Best regards, -- Nick Desaulniers