From: winterver <295107659@qq.com>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
winterver <295107659@qq.com>
Subject: [PATCH] dio: Improve readability: rename dio_scodetophysaddr
Date: Mon, 30 Sep 2024 11:18:37 +0800 [thread overview]
Message-ID: <tencent_A926284D28E1F878F1888699245B2E06CF0A@qq.com> (raw)
Rename dio_scodetophysaddr to dio_scode_to_physaddr.
Also dio_scodetoipl -> dio_scode_to_ipl and dio_scode_to_name
-> dio_scode_to_name, though they're not implemented yet.
I've searched these names in the repo. There are only a few of references.
I think it's OK and worth renaming them for readability.
Signed-off-by: winterver <295107659@qq.com>
---
drivers/dio/dio.c | 12 ++++++------
drivers/tty/serial/8250/8250_hp300.c | 2 +-
include/linux/dio.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c
index 0a051d656..143e58c9f 100644
--- a/drivers/dio/dio.c
+++ b/drivers/dio/dio.c
@@ -11,12 +11,12 @@
* This means that framebuffers should pass it as
* DIO_ENCODE_ID(DIO_ID_FBUFFER,DIO_ID2_TOPCAT)
* (or whatever); everybody else just uses DIO_ID_FOOBAR.
- * unsigned long dio_scodetophysaddr(int scode)
+ * unsigned long dio_scode_to_physaddr(int scode)
* Return the physical address corresponding to the given select code.
- * int dio_scodetoipl(int scode)
+ * int dio_scode_to_ipl(int scode)
* Every DIO card has a fixed interrupt priority level. This function
* returns it, whatever it is.
- * const char *dio_scodetoname(int scode)
+ * const char *dio_scode_to_name(int scode)
* Return a character string describing this board [might be "" if
* not CONFIG_DIO_CONSTANTS]
* void dio_config_board(int scode) mark board as configured in the list
@@ -130,7 +130,7 @@ int __init dio_find(int deviceid)
if (DIO_SCINHOLE(scode))
continue;
- pa = dio_scodetophysaddr(scode);
+ pa = dio_scode_to_physaddr(scode);
if (!pa)
continue;
@@ -203,7 +203,7 @@ static int __init dio_init(void)
if (DIO_SCINHOLE(scode))
continue;
- pa = dio_scodetophysaddr(scode);
+ pa = dio_scode_to_physaddr(scode);
if (!pa)
continue;
@@ -274,7 +274,7 @@ subsys_initcall(dio_init);
/* Bear in mind that this is called in the very early stages of initialisation
* in order to get the address of the serial port for the console...
*/
-unsigned long dio_scodetophysaddr(int scode)
+unsigned long dio_scode_to_physaddr(int scode)
{
if (scode >= DIOII_SCBASE)
return (DIOII_BASE + (scode - 132) * DIOII_DEVSIZE);
diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
index 3012ea03d..1bef48842 100644
--- a/drivers/tty/serial/8250/8250_hp300.c
+++ b/drivers/tty/serial/8250/8250_hp300.c
@@ -124,7 +124,7 @@ int __init hp300_setup_serial_console(void)
#endif
} else {
#ifdef CONFIG_HPDCA
- unsigned long pa = dio_scodetophysaddr(scode);
+ unsigned long pa = dio_scode_to_physaddr(scode);
if (!pa)
return 0;
diff --git a/include/linux/dio.h b/include/linux/dio.h
index 464331c4c..1677cdf6d 100644
--- a/include/linux/dio.h
+++ b/include/linux/dio.h
@@ -241,7 +241,7 @@ struct dio_driver {
*/
extern int dio_find(int deviceid);
-extern unsigned long dio_scodetophysaddr(int scode);
+extern unsigned long dio_scode_to_physaddr(int scode);
extern int dio_create_sysfs_dev_files(struct dio_dev *);
/* New-style probing */
--
2.25.1
next reply other threads:[~2024-09-30 3:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 3:18 winterver [this message]
2024-09-30 13:20 ` Greg KH
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=tencent_A926284D28E1F878F1888699245B2E06CF0A@qq.com \
--to=295107659@qq.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.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®