mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: constify sr_pm_ops structure
@ 2016-08-28 20:17 Julia Lawall
  2016-09-02 11:02 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2016-08-28 20:17 UTC (permalink / raw)
  To: Jens Axboe
  Cc: kernel-janitors, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel

sr_pm_ops, of type struct dev_pm_ops, is never modified, so declare it as
const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/scsi/sr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index ed17934..bed2bbd 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -83,7 +83,7 @@ static int sr_init_command(struct scsi_cmnd *SCpnt);
 static int sr_done(struct scsi_cmnd *);
 static int sr_runtime_suspend(struct device *dev);
 
-static struct dev_pm_ops sr_pm_ops = {
+static const struct dev_pm_ops sr_pm_ops = {
 	.runtime_suspend	= sr_runtime_suspend,
 };
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: constify sr_pm_ops structure
  2016-08-28 20:17 [PATCH] scsi: constify sr_pm_ops structure Julia Lawall
@ 2016-09-02 11:02 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2016-09-02 11:02 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jens Axboe, kernel-janitors, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel

>>>>> "Julia" == Julia Lawall <Julia.Lawall@lip6.fr> writes:

Julia> sr_pm_ops, of type struct dev_pm_ops, is never modified, so
Julia> declare it as const.

Applied to 4.9/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-02 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-28 20:17 [PATCH] scsi: constify sr_pm_ops structure Julia Lawall
2016-09-02 11:02 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®