From patchwork Fri Mar 29 21:54:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13611118 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0107113D62A for ; Fri, 29 Mar 2024 21:54:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711749296; cv=none; b=PfUv1xE69LKzgp5q3YwKr6p0MAuiZ6eubc7e/8yqqHlzalCfTzvYcCKg0VInGLyela9Hr2SsLOl1Sx+Y9rAieiJOd1wv68SW6UEYhzhUsjJSzZQ65NZlFXcKTh3N0Fo41x1PkvKXXJ1Yibzdz+W3gPFepXIak6sj+ONZFClPJfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711749296; c=relaxed/simple; bh=55ielaMdCo8NuhRMyayKJKpy7EfE8De+nbULEuRF+Wk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=U1YfMR8O7QFqrGD0gRnEQdCk3hql+8I3mOIcRiRojhM3WTz3AGvqwG+28frFNQ6Zqehfen56BjgEBoMfYlIYvprxEzqTm/rFEDjK6Rg+zRJs1cpv45AHsvlZsm5KNPtza26A6N8zm/ejXdsWf0A2XsNLI9uCPUY8PuBN1PlAX94= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rqKBY-0004gh-8s; Fri, 29 Mar 2024 22:54:52 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqKBX-009GMK-L7; Fri, 29 Mar 2024 22:54:51 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rqKBX-00DTk6-1r; Fri, 29 Mar 2024 22:54:51 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jaroslav Kysela , Takashi Iwai Cc: linux-sound@vger.kernel.org, linux-kbuild@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH] OSS: dmasound/paula: Mark driver struct with __refdata to prevent section mismatch Date: Fri, 29 Mar 2024 22:54:42 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: <2e3783106bf6bd9a7bdeb12b706378fb16316471.1711748999.git.u.kleine-koenig@pengutronix.de> References: <2e3783106bf6bd9a7bdeb12b706378fb16316471.1711748999.git.u.kleine-koenig@pengutronix.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1494; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=55ielaMdCo8NuhRMyayKJKpy7EfE8De+nbULEuRF+Wk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmBzimrhUDxeR5t7sUYuBLCronWqDYUniezvvXV EiVKgRkH6CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZgc4pgAKCRCPgPtYfRL+ Tss1CACNzk+Hwa8QKejErFP909TZkyw7uzqy8KyLXO9jdRmi6XSF2cDpyYcTiQtyf0mqNVR98eB VVxwL8Wj5pm4httcQG07xEYCOXvohOvoSUfKCLIauqr+RNpmYn8q5nC5xhmglkFZAJsAJuRz3d+ /2IS4t5h1WS0fknIG26uGXpE1RetxL1bU/mAUgoFVzl/ysQFyAz8KChilZrtS98+guNftjWSeA1 CZCKs78BI8gflwo168exmdMVwmrZm61LxZ730SBOQXLzmpd1InHKEhn2gakrZmg9tqJsAsyNdWj xHoVBK1HstTKl9KG0HZX44oH3TeZX5lBimyFNBbLmKqlELpq X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-sound@vger.kernel.org As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent the following section mismatch warning WARNING: modpost: sound/oss/dmasound/dmasound_paula: section mismatch in reference: amiga_audio_driver+0x8 (section: .data) -> amiga_audio_remove (section: .exit.text) that triggers on an allmodconfig W=1 build. Signed-off-by: Uwe Kleine-König --- sound/oss/dmasound/dmasound_paula.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2 diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c index 0ba8f0c4cd99..3a593da09280 100644 --- a/sound/oss/dmasound/dmasound_paula.c +++ b/sound/oss/dmasound/dmasound_paula.c @@ -725,7 +725,13 @@ static void __exit amiga_audio_remove(struct platform_device *pdev) dmasound_deinit(); } -static struct platform_driver amiga_audio_driver = { +/* + * amiga_audio_remove() lives in .exit.text. For drivers registered via + * module_platform_driver_probe() this is ok because they cannot get unbound at + * runtime. So mark the driver struct with __refdata to prevent modpost + * triggering a section mismatch warning. + */ +static struct platform_driver amiga_audio_driver __refdata = { .remove_new = __exit_p(amiga_audio_remove), .driver = { .name = "amiga-audio",