From patchwork Tue Jun 23 19:52:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 191616 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp1374476ecs; Tue, 23 Jun 2020 14:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4gJTQ4qy5Mt+A/lEB4cXTRoAj/Y2ySLIkzeWrawHdSyUPdQhwkrVIvC9a1m69DGFxGLtK X-Received: by 2002:a05:6402:3ca:: with SMTP id t10mr24555730edw.128.1592948282808; Tue, 23 Jun 2020 14:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592948282; cv=none; d=google.com; s=arc-20160816; b=oRWqegyq2ANE4gHRwg3bmgzTemOdC/oDAAc8IPyzWEQkT1KMvlGSevMfFjN+MPyXd2 9pbx49Tndk9yFTHS+JBUm7zb9pFTKn+erUHft4KiCIsTldzPtwT59k/lfSpt5QTvZUUJ l/hq2OdqtfYnI67874fagIaTKGujC6ZC3reSJoFdVEvBg5RNWI481eyoqGr9Qu5Co0fo aHN+Lro+Ec7HwF7cuMwKp89ccikpNCAwhk74RmIGEgVbzyegkantL6fVcQWA8cwehYY7 YJ5jq+Ba/6S1S0tuNWvX6nr3fDrywXbGXRX58Y4fOELLemZbFvdUFrhRbLGpiotynbDZ ncXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RhUWPJOCxssrikN+Q97JsfIcuwlAaMKlUiv80f4iYTA=; b=PDoB/z31yXUvfvxYDrwWSiFncrT3GogcdKfN5dQeM8Qw9Gjda3O+IHG3clxfW4A1Ib UbM8m4M9Yr3Tl0ECYfw37dvhn+iogVQB0VcMeRB50Z2yRQUiOqMFcpC01TF1oMylluFk +P8QujidDoJOJiOIxntA+aNVNg4q1r1MpqLqY8X9sUtO+zinfzRqz0sXLi3vPZfGn8xq ObhZheFngBZXc4iLH7mN1KU/7Ayju6fLAyoRpmnqh2WHUSk6xe4dhN3gaglHt/9aLzSq 8BAGNRg1+XN+6LJ2FUiuXQjM8PfzRxMd6iTuF7hVbd2uC9h9noiwh78CjBy6UHb0SN2t WEiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEmUFeQo; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si1572211edb.90.2020.06.23.14.38.02; Tue, 23 Jun 2020 14:38:02 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEmUFeQo; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388207AbgFWVhw (ORCPT + 15 others); Tue, 23 Jun 2020 17:37:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:49614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388033AbgFWUIi (ORCPT ); Tue, 23 Jun 2020 16:08:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 049C42080C; Tue, 23 Jun 2020 20:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592942917; bh=00LaLXwHMBQRfAvmBDri+hTtcKQVEn7pCEdWW67VnxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AEmUFeQoqpTb5XZdtQLpgm6QWvxHydj/mch5UOHCyHY89vZ9gRW2rQMvEAOdTzgsy yq0YBYmsVmiFPKUxI+ztc3XbcNKAU97jM3ib1721ZouIyZASKsLSlB/pu9YeyOhmQv VrXGrtcXLqM5SvMHOkzdQ2hCgl5nU2F11qL3caEo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jerome Pouiller , Sasha Levin Subject: [PATCH 5.7 169/477] staging: wfx: avoid compiler warning on empty array Date: Tue, 23 Jun 2020 21:52:46 +0200 Message-Id: <20200623195415.573848247@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 2eeefd3787fdc6319124945d453774be95b97897 ] 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' assumed 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 Cc: Jerome Pouiller Link: https://lore.kernel.org/r/20200429142119.1735196-1-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/wfx/bus_sdio.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c index dedc3ff58d3eb..c2e4bd1e3b0a0 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 = { .align_size = wfx_sdio_align_size, }; -static const struct of_device_id wfx_sdio_of_match[]; +static const struct of_device_id wfx_sdio_of_match[] = { + { .compatible = "silabs,wfx-sdio" }, + { .compatible = "silabs,wf200" }, + { }, +}; +MODULE_DEVICE_TABLE(of, wfx_sdio_of_match); + 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[] = { }; MODULE_DEVICE_TABLE(sdio, wfx_sdio_ids); -#ifdef CONFIG_OF -static const struct of_device_id wfx_sdio_of_match[] = { - { .compatible = "silabs,wfx-sdio" }, - { .compatible = "silabs,wf200" }, - { }, -}; -MODULE_DEVICE_TABLE(of, wfx_sdio_of_match); -#endif - struct sdio_driver wfx_sdio_driver = { .name = "wfx-sdio", .id_table = wfx_sdio_ids, @@ -264,6 +261,6 @@ struct sdio_driver wfx_sdio_driver = { .remove = wfx_sdio_remove, .drv = { .owner = THIS_MODULE, - .of_match_table = of_match_ptr(wfx_sdio_of_match), + .of_match_table = wfx_sdio_of_match, } };