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=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 367F5C83000 for ; Wed, 29 Apr 2020 16:04:25 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A3022072A for ; Wed, 29 Apr 2020 16:04:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="eEKrRJry" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A3022072A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CBFA71FD90; Wed, 29 Apr 2020 16:04:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6CdzcvIbQc1j; Wed, 29 Apr 2020 16:04:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id E6E86203D4; Wed, 29 Apr 2020 16:04:21 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3CB451BF36C for ; Wed, 29 Apr 2020 16:04:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 372FC85621 for ; Wed, 29 Apr 2020 16:04:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PmBtDor2Y_Tt for ; Wed, 29 Apr 2020 16:04:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2055.outbound.protection.outlook.com [40.107.93.55]) by fraxinus.osuosl.org (Postfix) with ESMTPS id D83CC8452E for ; Wed, 29 Apr 2020 16:04:19 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b7zSrXN5cgVrw1zmLKE4R/R0ks4qXjXV6r3CntICsIDVBZhBsu2LAkVleg3hFpZM1t0XLeFqb4icUZD3lvIF3ftuQVfprS2tylED2pTWgWLuYVK+jzu+YC8h8iYQulngqj6LFiMINIgT0J+F/QRAps0SxXtpdO1BmuzGWrPC/0d7QRcErXBdycJpZmyIqYtOsvSU4sImtrV1IxFp6eBwN0xGsWypSJA/Jkxom23nrNiFx31Q3CIbzQaGe5+FVq6QfWAXLVfN7jgVG1ri3AwIu65+5qFRKpeBosQSM4ThKhRCCe+hzSCA1FZEN6TYdDwVueUraKwjHxYFBe1HHPFkLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=awVt15CK6307gmzu2M1d49T5JfWnzkVqPpxTjk0lgDc=; b=jjUpv0y27txVPnUg50Q94JI4BN2K+4cMBdYkhSG7nQshyE45OQPe6ptrPENSKtnS7ArCTnAc2/hdSWOBnsVJxf4ay8u1C/mGnDafOJ1DDqazeQjSbADjB/8um4yCzn9lCa+Sm85jNvXjmbTJ3WiRfHRF1cWY0HDEJMEwP53pr/ELo9tqB+CuYRUSjGhLSlNgQhSYwdBjv2ot+lItO9KYhEUJlbyKAyTG/1jk3PXoEbDFTUQEgmNoNP+oingqcg2Z+TR9riJ9DSB/1PrAVb/qmZGfCRrg78TExtBSvOQMO8AxgYBADZpsk4d6hLFohDinvoF/qWHOOv4MukQwP+zabg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=awVt15CK6307gmzu2M1d49T5JfWnzkVqPpxTjk0lgDc=; b=eEKrRJryfRhsKozOhb5LgeqMeIi4V9RGx8CMy6QexcMrBBZ5AMF7wttLUHsTwaXs+oek/5USNuICSg/TifqrZbxPP9rMy01HgRIfjK37tVuE/hroyox/hF+DIJHu9bOrRH7PZiO9vbP3SXVJGFu6xM1ER7Q3Jy+NrP4LOKJQJnI= Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB0014.namprd11.prod.outlook.com (2603:10b6:301:64::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Wed, 29 Apr 2020 16:04:17 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::81d5:b62b:3770:ffbe]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::81d5:b62b:3770:ffbe%10]) with mapi id 15.20.2937.028; Wed, 29 Apr 2020 16:04:17 +0000 From: Jerome Pouiller To: Arnd Bergmann Subject: Re: [PATCH] staging: wfx: avoid compiler warning on empty array Thread-Topic: [PATCH] staging: wfx: avoid compiler warning on empty array Thread-Index: AQHWHjF5vlfoO7puXUWgUhn1WHjUDaiQQ0QA Date: Wed, 29 Apr 2020 16:04:16 +0000 Message-ID: <3943343.tW1xmJHsB6@pc-42> References: <20200429142119.1735196-1-arnd@arndb.de> In-Reply-To: <20200429142119.1735196-1-arnd@arndb.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=none action=none header.from=silabs.com; x-originating-ip: [82.67.86.106] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5e3ab641-8e68-44f3-c678-08d7ec56f822 x-ms-traffictypediagnostic: MWHPR11MB0014: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-forefront-prvs: 03883BD916 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(7916004)(376002)(366004)(39850400004)(136003)(346002)(396003)(316002)(186003)(54906003)(2906002)(66574012)(66556008)(66946007)(66446008)(64756008)(76116006)(91956017)(5660300002)(66476007)(71200400001)(26005)(33716001)(478600001)(6506007)(8676002)(4326008)(86362001)(6486002)(9686003)(6512007)(8936002)(6916009)(39026012); DIR:OUT; SFP:1101; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: I8ldv3mmdYEzDyyvyuog+jebCxNqBEnTu8WhJnzlldX6uqItMRcgM0GPCM5F15dd5PaK3XS97icO5QcnD+ePh8qHRYN6AaCiuLGIKtZhXlsyZHFo6grYBmEqlO5DPHRc5xyCD2YqivYVAzqGzldTdFzuX4quR8IBMI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W+OCD78PUf7zhMXQNDRgykMQdYX2mETnyd8KFJRwDo3paKaNKlRKBnmklZw8HJGvDgCEs9ddwmoS/Amyt9C2fDUe+8RnrsYxrMYS9WlmJ1zMJL+YGZRLTNdlA= x-ms-exchange-transport-forked: True Content-ID: <8DC2BB2508D84F49A627E80CC3308FE3@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e3ab641-8e68-44f3-c678-08d7ec56f822 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2020 16:04:16.9266 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tmrOUnZcz9gUkT5BfcotSOJvCF4P8IuSbdA8qO11BWemkK9y2uoL5ObdqqlQZiBai+/RTjmgdKauMxp+zzOoyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB0014 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devel@driverdev.osuosl.org" , Greg Kroah-Hartman , Jules Irenge , "linux-kernel@vger.kernel.org" , =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Wednesday 29 April 2020 16:21:09 CEST Arnd Bergmann wrote: > = > When CONFIG_OF is disabled, gcc-9 produces a warning about the > wfx_sdio_of_match[] array having a declaration without a dimension: > = > drivers/staging/wfx/bus_sdio.c:159:34: error: array 'wfx_sdio_of_match' a= ssumed to have one element [-Werror] > 159 | static const struct of_device_id wfx_sdio_of_match[]; > | ^~~~~~~~~~~~~~~~~ > = > Move the proper declaration up and out of the #ifdef instead. > = > Fixes: a7a91ca5a23d ("staging: wfx: add infrastructure for new driver") > Signed-off-by: Arnd Bergmann > --- > drivers/staging/wfx/bus_sdio.c | 19 ++++++++----------- > 1 file changed, 8 insertions(+), 11 deletions(-) > = > diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdi= o.c > index dedc3ff58d3e..c2e4bd1e3b0a 100644 > --- a/drivers/staging/wfx/bus_sdio.c > +++ b/drivers/staging/wfx/bus_sdio.c > @@ -156,7 +156,13 @@ static const struct hwbus_ops wfx_sdio_hwbus_ops =3D= { > .align_size =3D wfx_sdio_align_size, > }; > = > -static const struct of_device_id wfx_sdio_of_match[]; > +static const struct of_device_id wfx_sdio_of_match[] =3D { > + { .compatible =3D "silabs,wfx-sdio" }, > + { .compatible =3D "silabs,wf200" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, wfx_sdio_of_match); I suggest to keep the '#ifdef CONFIG_OF' around this definition. If CONFIG_OF is undefined, of_match_ptr() and of_match_node() will be NULL and it should compile. > + > static int wfx_sdio_probe(struct sdio_func *func, > const struct sdio_device_id *id) > { > @@ -248,15 +254,6 @@ static const struct sdio_device_id wfx_sdio_ids[] = =3D { > }; > MODULE_DEVICE_TABLE(sdio, wfx_sdio_ids); > = > -#ifdef CONFIG_OF > -static const struct of_device_id wfx_sdio_of_match[] =3D { > - { .compatible =3D "silabs,wfx-sdio" }, > - { .compatible =3D "silabs,wf200" }, > - { }, > -}; > -MODULE_DEVICE_TABLE(of, wfx_sdio_of_match); > -#endif > - > struct sdio_driver wfx_sdio_driver =3D { > .name =3D "wfx-sdio", > .id_table =3D wfx_sdio_ids, > @@ -264,6 +261,6 @@ struct sdio_driver wfx_sdio_driver =3D { > .remove =3D wfx_sdio_remove, > .drv =3D { > .owner =3D THIS_MODULE, > - .of_match_table =3D of_match_ptr(wfx_sdio_of_match), > + .of_match_table =3D wfx_sdio_of_match, ... and obviously keep of_match_ptr() here. > } > }; -- = J=E9r=F4me Pouiller _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel