From patchwork Fri Mar 29 21:11:41 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: 13611105 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 D9C6E13BC04 for ; Fri, 29 Mar 2024 21:12:04 +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=1711746728; cv=none; b=g/0SNDQ8FbeYHdpp20mp+O/dyq+3U9Hn6OIYrxovDI7nOS+7U74NozIaCR3njyCAJki7v2v9JRtN+LDT2HJeNg1r0LG8qMyIDryBcwXMX3ucmMRlTZ7Ozo5TuMSamB6Wnm9XpYuEkN67I3wuMEX1aWNWDU1YU2k0Kh+xNGt+ShM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711746728; c=relaxed/simple; bh=bKdMOx1D1ms9abbmdlq3OhzYAiylGh+vfVq74VLFAqI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=b8DFYQJk3wLPDMO+8YOGop50Ap+ECtR/sVeqU/45EuJe7U7ENAGn278zDryxxX9QXfZN5yLoY4jvrNubqZnPlv9BjKoTNZgBhwZYYwoN37rFa1MwWtEN+bHZpA8EuDRay5pORR1vZPubP1hF54+FRUs+g9UB3n0dMaFvgYVPFXA= 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 1rqJVy-0001yG-0Q; Fri, 29 Mar 2024 22:11:54 +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 1rqJVx-009GFR-BC; Fri, 29 Mar 2024 22:11:53 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rqJVx-00DTbu-0s; Fri, 29 Mar 2024 22:11:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] scsi: a3000: Mark driver struct with __refdata to prevent section mismatch Date: Fri, 29 Mar 2024 22:11:41 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1424; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=bKdMOx1D1ms9abbmdlq3OhzYAiylGh+vfVq74VLFAqI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmBy6P+LLBanKBe+nswRcMQfjDig8IwRQDd0edP 2le/lg8Ub2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZgcujwAKCRCPgPtYfRL+ TnO8CAClW1s6i+N5UZj8nckRXB2iZWFepVWwMVK5aeqULpdOk/7G295An1wcD0C1418mVSFEK8a +WbDZrMfKRqqFmhhMjMxCN7PTqBftKCsrJS2jWG0jDtoXI8xw/EuvWK31TxYrrXd6fLpukonF5i EDWGIAfoqiyVvrrI/TJdR182Gl0bIm5DxgR53j7kM7+mxMWH/iAK71jD3/x8Rf9HD5PMVTMxUnp ndfm3Ee3eWHYTnXFDH8EcnSOOxqVePxuA+ZkIc2Axa3Spt3TJ4r13+LXP/VYwm4viH90mu+ZS0U BgeBAcHFEwHXZR0YWoPetpGIRqBMOZXnHkyES6i+gHjQM1Si 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-scsi@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: drivers/scsi/a3000: section mismatch in reference: amiga_a3000_scsi_driver+0x8 (section: .data) -> amiga_a3000_scsi_remove (section: .exit.text) that triggers on an allmodconfig W=1 build. Signed-off-by: Uwe Kleine-König --- drivers/scsi/a3000.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c index 378906f77909..ad39797890e5 100644 --- a/drivers/scsi/a3000.c +++ b/drivers/scsi/a3000.c @@ -295,7 +295,13 @@ static void __exit amiga_a3000_scsi_remove(struct platform_device *pdev) release_mem_region(res->start, resource_size(res)); } -static struct platform_driver amiga_a3000_scsi_driver = { +/* + * amiga_a3000_scsi_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_a3000_scsi_driver __refdata = { .remove_new = __exit_p(amiga_a3000_scsi_remove), .driver = { .name = "amiga-a3000-scsi", From patchwork Fri Mar 29 21:11: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: 13611101 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 D9C4E13BC02 for ; Fri, 29 Mar 2024 21:12:04 +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=1711746728; cv=none; b=TBuMwzIxV8bLi+qcQI7s2PGRwAUci2EATN5jrtTlBN6GNLx/tn6JU01C3toWyijsJKBWaiPUiPoi8PW2wi/L2Jlcl0ei3WZk05LrXlaEn18ZixKbJOaJKZw1x0hoNBFeoUU1eJGGX/Qg5SEkTvVZ6AWjgDrzekCPXa3HCe6h+ag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711746728; c=relaxed/simple; bh=Abug/1AlTVrkf5hoU+XeSHjL1x+TGk/87EavF9x/BFc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JU/LZd64nStTKxcyZOuCu5mhCz8BYDmcPf+2tbejXFNSd5aasduNSS1kKNrZgayu/RiAAygvuYQsdH43R8Ti1TFysmKwCH9aKmrE94ZDo4KkbGUd5OogBXdf2GRA5cqwe0UlLU3h6sULSRk6n+y4tapuU9VzzSHqCi7TmgKfCmk= 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 1rqJVy-0001yH-0S; Fri, 29 Mar 2024 22:11:54 +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 1rqJVx-009GFU-Hx; Fri, 29 Mar 2024 22:11:53 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rqJVx-00DTby-1Y; Fri, 29 Mar 2024 22:11:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] scsi: a4000t: Mark driver struct with __refdata to prevent section mismatch Date: Fri, 29 Mar 2024 22:11:42 +0100 Message-ID: <743c3cfaf12b9f61f66afa5529ac126c856e4d11.1711746359.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1438; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=Abug/1AlTVrkf5hoU+XeSHjL1x+TGk/87EavF9x/BFc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmBy6QQWBCfh1ljFFUWoreRFgJSKNprv25A13+x KtQHBetN3GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZgcukAAKCRCPgPtYfRL+ TntLB/9EPkvxDhLxC/dP/J1d5lku5oO57nuWP1JUJ24B4Eig/oUqmOIB3+LMhMMLbTuwM24AjHs JrEp/xS0LMeX7ujvmBXYC1O2WpaG+D4VDnlD5AgRqrKFVuyq/flC9Y3kSS1O9a8iX34B5lJDVqz 2xvFVaZF0y8T0pLVMdA7/aT1JoRoqxNSSTJEkrhri98BmQNwP30eLtlkMLvTh7AxhdbuSp6Lb+w GqDbXhdClNSn4M0aep+zJXIn2ccvKyIRzgBcl/OAY6melzUihIWxGwb0pZK/hvPvOeMdQ2MTkGu x/CN54+6ndPif0jaxYsQa8vYbcnOeop6strleN2sBVaWFgsk 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-scsi@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: drivers/scsi/a4000t: section mismatch in reference: amiga_a4000t_scsi_driver+0x8 (section: .data) -> amiga_a4000t_scsi_remove (section: .exit.text) that triggers on an allmodconfig W=1 build. Signed-off-by: Uwe Kleine-König --- drivers/scsi/a4000t.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/a4000t.c b/drivers/scsi/a4000t.c index e435fc06a624..d9103adc87fe 100644 --- a/drivers/scsi/a4000t.c +++ b/drivers/scsi/a4000t.c @@ -108,7 +108,13 @@ static void __exit amiga_a4000t_scsi_remove(struct platform_device *pdev) release_mem_region(res->start, resource_size(res)); } -static struct platform_driver amiga_a4000t_scsi_driver = { +/* + * amiga_a4000t_scsi_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_a4000t_scsi_driver __refdata = { .remove_new = __exit_p(amiga_a4000t_scsi_remove), .driver = { .name = "amiga-a4000t-scsi", From patchwork Fri Mar 29 21:11:43 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: 13611104 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 5DACE13BC2C for ; Fri, 29 Mar 2024 21:12:05 +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=1711746728; cv=none; b=J7jY3j4NGR+S03gvYm+H03xGcc4QUnvebg+md9/MIBMuiyzgcEe9hAVKKeQw6+aIa/U9mDoyQgnm0Tx1si3JWluEjZNmJPn8T8VpDTvP7da4bolKiavvtf4Plw7yz+KgmE+9lAxbxhXgdu5g1CUjCnXSEqoiVo8nkq1d0K+PjD0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711746728; c=relaxed/simple; bh=+B0EcHTWfRe9T5vqvoCIeZk3emeJgiZZkzvz79SceLI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tTh0tBcLHgcHyXCe7TBrf2ONHtClEwjodgGRdpOzipM3qkmvDiH1UUXwQINek5L2SlX/85ysW8EXh5NQTKz8+RjSYLu06al3HPACXqa+EhNiu7LTVcEIy355zjwQlppFFYm2f3U8mJayMietkx1dHLz65b2NPy8S+EUQDR8azow= 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 1rqJVy-0001yI-D8; Fri, 29 Mar 2024 22:11:54 +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 1rqJVx-009GFX-Ou; Fri, 29 Mar 2024 22:11:53 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rqJVx-00DTc2-2E; Fri, 29 Mar 2024 22:11:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Finn Thain , Michael Schmitz , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] scsi: atari_scsi: Mark driver struct with __refdata to prevent section mismatch Date: Fri, 29 Mar 2024 22:11:43 +0100 Message-ID: <0170bda7ac0be3d8b694dca1b2f079fb17d9539b.1711746359.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1392; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=+B0EcHTWfRe9T5vqvoCIeZk3emeJgiZZkzvz79SceLI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmBy6R2Hxu5ahCRTuWgYqbZUR7wXxX+KB9o2mrn drAu51Y5XSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZgcukQAKCRCPgPtYfRL+ TswvB/9yNSCzyf8x+1PBmtap9Aynu7xZo1qmeWeOk7qFEMxcBKrNT6TUlEW/uX1jylX+/E7S+rz 6B//Pw1yYD3Iv6f9br9/hdRL2MkjyMSRJ+yzt2t2A167Hbhajt1y4sDhYtuRqCgxfcolpfr6bG3 5sFDUTPhgyA84S7eC3bTjQtIyIurIW0IX+f1Lrvx4Gc0CWLdhqXG1SpvKkyKc9wuaxVVg20FIEU 0VZT2jbGtDb/27q3WdOf16OMzsI+ojIFTENOm8HA6idSLTmfqnYSOQyqHzm56TwMdxlsEs3ccXU rHOwVb/Dm6LDcPqmmSjvj6D60TllXTCdZ3Twl8UdG+yQzzDc 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-scsi@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: drivers/scsi/atari_scsi: section mismatch in reference: atari_scsi_driver+0x8 (section: .data) -> atari_scsi_remove (section: .exit.text) that triggers on an allmodconfig W=1 build. Signed-off-by: Uwe Kleine-König --- drivers/scsi/atari_scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index d99e70914817..742625ac7d99 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c @@ -878,7 +878,13 @@ static void __exit atari_scsi_remove(struct platform_device *pdev) atari_stram_free(atari_dma_buffer); } -static struct platform_driver atari_scsi_driver = { +/* + * atari_scsi_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 atari_scsi_driver __refdata = { .remove_new = __exit_p(atari_scsi_remove), .driver = { .name = DRV_MODULE_NAME, From patchwork Fri Mar 29 21:11:44 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: 13611102 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 5DB4313BC36 for ; Fri, 29 Mar 2024 21:12:05 +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=1711746728; cv=none; b=U/7pNRxkssgwqbKSUqtPkCegrRGJz22QTSyVs/v7vs0vSPUlnI0rJ+JhsLeu8gQ95I49I9cpJc2wnqWmh7uacq+xTPyqsUM5l5K7F5bbBvrmcdnVkkipwoWO7cKVkJ/xXkQxxDQG3CoKE1t2Fi6Rk02J90dVZt2/oIfzpZWMOVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711746728; c=relaxed/simple; bh=hv4dYqlWt4P94v21pCLxlYrQxDhe3mmII1wfhthO9mE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=u5RlueeUH502pWHA7yp6Lekrlw853tBUctK4iWd1BNV2fHH7xCPnTxpXtE72hN27DWG/KUByM/HMTuukQwXhy/D0WC9lNweTrMB5jkTx7b76jcIAv8hx2Qd1RnDfbHdwKKxqwuv0T+nx/FdUVwRl8Z49uMN8W4gPBu05nfYXMc4= 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 1rqJVy-0001zX-Dx; Fri, 29 Mar 2024 22:11:54 +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 1rqJVy-009GFa-0f; Fri, 29 Mar 2024 22:11:54 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rqJVx-00DTc6-32; Fri, 29 Mar 2024 22:11:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Finn Thain , Michael Schmitz , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] scsi: mac_scsi: Mark driver struct with __refdata to prevent section mismatch Date: Fri, 29 Mar 2024 22:11:44 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1354; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=hv4dYqlWt4P94v21pCLxlYrQxDhe3mmII1wfhthO9mE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmBy6SQtf+uF6JNIYVg7RWhEJ8ApxpMhe4bCFFK ON6mZMWQ4OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZgcukgAKCRCPgPtYfRL+ TtDOB/4z467zTs9ge4dbmmquGbKz1kkfgjwfnj6G5UJcLnA91KyHgLDvNDotqQ6S22j46HQ5LK8 RiWYLZ5/2r91Ho5AR4Qk6PBGUWjpPerRTsv8OrNBwDWWkom+9RgLedRyqfB+de6mF9yIR90lgGm 63WmPhJdBtMSU+ziML3WR+zhkYtu5i7JW4W6rcH1OCD2aA4nkr5jEmGAnwELWvXi8FbVei/u2Io P7a0siHVtNBg+aTum1RU1eR+ngLe1tygANO3lCDRXQLq4oM5HWHyrAVwb95qP2uF3SNrBJ28DcN ElXuKf/p49F8DqmcuWkBwyLI1Qj5qVtJcMKf6KMZmf8FGe/g 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-scsi@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: drivers/scsi/mac_scsi: section mismatch in reference: mac_scsi_driver+0x8 (section: .data) -> mac_scsi_remove (section: .exit.text) that triggers on an allmodconfig W=1 build. Signed-off-by: Uwe Kleine-König --- drivers/scsi/mac_scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c index 181f16899fdc..a402c4dc4645 100644 --- a/drivers/scsi/mac_scsi.c +++ b/drivers/scsi/mac_scsi.c @@ -534,7 +534,13 @@ static void __exit mac_scsi_remove(struct platform_device *pdev) scsi_host_put(instance); } -static struct platform_driver mac_scsi_driver = { +/* + * mac_scsi_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 mac_scsi_driver __refdata = { .remove_new = __exit_p(mac_scsi_remove), .driver = { .name = DRV_MODULE_NAME,