mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sander Vanheule <sander@svanheule.net>
To: Mark Brown <broonie@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Adrew Lunn <andrew@lunn.ch>,
	Sander Vanheule <sander@svanheule.net>
Subject: [PATCH v2 1/2] regmap: mdio: Fix regmap_bus pointer constness
Date: Wed,  9 Jun 2021 15:10:03 +0200	[thread overview]
Message-ID: <f304ca638ffdc66d4803a6df1f75436894bd1d5f.1623244066.git.sander@svanheule.net> (raw)
In-Reply-To: <cover.1623244066.git.sander@svanheule.net>

A const qualifier was omitted in the declaration of the regmap_bus
pointer, resulting in the following errors:

drivers/base/regmap/regmap-mdio.c: In function ‘__regmap_init_mdio’:
drivers/base/regmap/regmap-mdio.c:87:7: warning: assignment discards
‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   87 |   bus = &regmap_mdio_c22_bus;
      |       ^
drivers/base/regmap/regmap-mdio.c:89:7: warning: assignment discards
‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   89 |   bus = &regmap_mdio_c45_bus;
      |       ^

Fix this by ensuring the pointer has the same qualifiers as the assigned
values.

Fixes: f083be9db060 ("regmap: mdio: Add clause-45 support")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
---
 drivers/base/regmap/regmap-mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regmap-mdio.c b/drivers/base/regmap/regmap-mdio.c
index cfb23afb19eb..b772b42809e2 100644
--- a/drivers/base/regmap/regmap-mdio.c
+++ b/drivers/base/regmap/regmap-mdio.c
@@ -69,7 +69,7 @@ struct regmap *__regmap_init_mdio(struct mdio_device *mdio_dev,
 	const struct regmap_config *config, struct lock_class_key *lock_key,
 	const char *lock_name)
 {
-	struct regmap_bus *bus;
+	const struct regmap_bus *bus;
 
 	if (config->reg_bits == 5 && config->val_bits == 16)
 		bus = &regmap_mdio_c22_bus;
-- 
2.31.1


  reply	other threads:[~2021-06-09 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 13:10 [PATCH v2 0/2] Clause-22/Clause-45 MDIO regmap support fixups Sander Vanheule
2021-06-09 13:10 ` Sander Vanheule [this message]
2021-06-09 13:10 ` [PATCH v2 2/2] regmap: mdio: Reject invalid addresses Sander Vanheule
2021-06-14 19:53 ` [PATCH v2 0/2] Clause-22/Clause-45 MDIO regmap support fixups Mark Brown

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=f304ca638ffdc66d4803a6df1f75436894bd1d5f.1623244066.git.sander@svanheule.net \
    --to=sander@svanheule.net \
    --cc=andrew@lunn.ch \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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 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®