All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jian Dong <dj0227@163.com>
To: sre@kernel.org
Cc: linux-pm@vger.kernel.org, dongjian@yulong.com, huyue2@yulong.com,
	zhangwen@yulong.com
Subject: [PATCH] power-supply: Constify static psy_tzd_ops struct
Date: Wed, 20 Jan 2021 17:54:26 +0800	[thread overview]
Message-ID: <20210120095427.10592-1-dj0227@163.com> (raw)

From: dongjian <dongjian@yulong.com>

The usage of this struct is to assign operation function's address
to the field in thermal_zone_device_ops, it is a const pointer.
make it const to allow the compiler to put it in read-only memory.

Signed-off-by: dongjian <dongjian@yulong.com>
---
 drivers/power/supply/power_supply_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 38e3aa64..ae34856 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -952,7 +952,7 @@ static int power_supply_read_temp(struct thermal_zone_device *tzd,
 	return ret;
 }
 
-static struct thermal_zone_device_ops psy_tzd_ops = {
+static const struct thermal_zone_device_ops psy_tzd_ops = {
 	.get_temp = power_supply_read_temp,
 };
 
-- 
1.9.1



             reply	other threads:[~2021-01-20 17:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  9:54 Jian Dong [this message]
2021-01-20 19:16 ` [PATCH] power-supply: Constify static psy_tzd_ops struct kernel test robot
2021-01-20 21:50 ` kernel test robot
2021-01-20 21:50   ` kernel test robot
2021-01-28  0:30 ` Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210120095427.10592-1-dj0227@163.com \
    --to=dj0227@163.com \
    --cc=dongjian@yulong.com \
    --cc=huyue2@yulong.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=zhangwen@yulong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.