Skip to contentSkip to conversation

s390/con3215: Use macros for hardcoded values

PATCH Superseded Xose Vazquez Perez 1 participant 2 messages Jul 9, 2025 s390

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390/con3215: Use macros for hardcoded values

Similar as in sclp_vt220

Cc Heiko Carstens <[email protected]> (maintainer:S390 ARCHITECTURE,commit_signer:1/2=50%)
Cc Vasily Gorbik <[email protected]> (maintainer:S390 ARCHITECTURE)
Cc Alexander Gordeev <[email protected]> (maintainer:S390 ARCHITECTURE)
Cc Christian Borntraeger <[email protected]> (reviewer:S390 ARCHITECTURE)
Cc Sven Schnelle <[email protected]> (reviewer:S390 ARCHITECTURE,commit_signer:1/2=50%)
Cc S390 ML <[email protected]> (open list:S390 ARCHITECTURE

---
Trivial, but uncompiled!!

---
 drivers/s390/char/con3215.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/s390/char/con3215.c +12 -6
index 56e43d43c713..1519694c48f0 100644
@@ -35,6 +35,12 @@
 
 #include "ctrlchar.h"
 
+#define RAW3215_MAJOR		TTY_MAJOR
+#define RAW3215_MINOR		64
+#define RAW3215_DRIVER_NAME	"tty3215"
+#define RAW3215_DEVICE_NAME	"ttyS"
+#define RAW3215_CONSOLE_NAME	"3215"
+
 #define NR_3215		    1
 #define NR_3215_REQ	    (4*NR_3215)
 #define RAW3215_BUFFER_SIZE 65536     /* output buffer size */
@@ -813,7 +819,7 @@ static const struct attribute_group *con3215_drv_attr_groups[] = {
 
 static struct ccw_driver raw3215_ccw_driver = {
 	.driver = {
-		.name	= "3215",
+		.name	= RAW3215_CONSOLE_NAME,
 		.groups = con3215_drv_attr_groups,
 		.owner	= THIS_MODULE,
 	},
@@ -887,7 +893,7 @@ static struct notifier_block on_reboot_nb = {
  *  The console structure for the 3215 console
  */
 static struct console con3215 = {
-	.name	 = "ttyS",
+	.name	 = RAW3215_DEVICE_NAME,
 	.write	 = con3215_write,
 	.device	 = con3215_device,
 	.flags	 = CON_PRINTBUFFER,
@@ -1168,10 +1174,10 @@ static int __init tty3215_init(void)
 	 * proc_entry, set_termios, flush_buffer, set_ldisc, write_proc
 	 */
 
-	driver->driver_name = "tty3215";
-	driver->name = "ttyS";
-	driver->major = TTY_MAJOR;
-	driver->minor_start = 64;
+	driver->driver_name = RAW3215_DRIVER_NAME;
+	driver->name = RAW3215_DEVICE_NAME;
+	driver->major = RAW3215_MAJOR;
+	driver->minor_start = RAW3215_MINOR;
 	driver->type = TTY_DRIVER_TYPE_SYSTEM;
 	driver->subtype = SYSTEM_TYPE_TTY;
 	driver->init_termios = tty_std_termios;
Signature · 1 line
2.50.0
#1 lore raw

On 7/9/25 8:00 PM, Xose Vazquez Perez wrote:

Please, drop this one. v2 is out.

Quoted 65 lines

Similar as in sclp_vt220

Cc Heiko Carstens <[email protected]> (maintainer:S390 ARCHITECTURE,commit_signer:1/2=50%)
Cc Vasily Gorbik <[email protected]> (maintainer:S390 ARCHITECTURE)
Cc Alexander Gordeev <[email protected]> (maintainer:S390 ARCHITECTURE)
Cc Christian Borntraeger <[email protected]> (reviewer:S390 ARCHITECTURE)
Cc Sven Schnelle <[email protected]> (reviewer:S390 ARCHITECTURE,commit_signer:1/2=50%)
Cc S390 ML <[email protected]> (open list:S390 ARCHITECTURE

---
Trivial, but uncompiled!!

---
  drivers/s390/char/con3215.c | 18 ++++++++++++------
  1 file changed, 12 insertions(+), 6 deletions(-)
drivers/s390/char/con3215.c +12 -6
index 56e43d43c713..1519694c48f0 100644
@@ -35,6 +35,12 @@
 
  #include "ctrlchar.h"
 
+#define RAW3215_MAJOR		TTY_MAJOR
+#define RAW3215_MINOR		64
+#define RAW3215_DRIVER_NAME	"tty3215"
+#define RAW3215_DEVICE_NAME	"ttyS"
+#define RAW3215_CONSOLE_NAME	"3215"
+
  #define NR_3215		    1
  #define NR_3215_REQ	    (4*NR_3215)
  #define RAW3215_BUFFER_SIZE 65536     /* output buffer size */
@@ -813,7 +819,7 @@ static const struct attribute_group *con3215_drv_attr_groups[] = {
 
  static struct ccw_driver raw3215_ccw_driver = {
  	.driver = {
-		.name	= "3215",
+		.name	= RAW3215_CONSOLE_NAME,
  		.groups = con3215_drv_attr_groups,
  		.owner	= THIS_MODULE,
  	},
@@ -887,7 +893,7 @@ static struct notifier_block on_reboot_nb = {
   *  The console structure for the 3215 console
   */
  static struct console con3215 = {
-	.name	 = "ttyS",
+	.name	 = RAW3215_DEVICE_NAME,
  	.write	 = con3215_write,
  	.device	 = con3215_device,
  	.flags	 = CON_PRINTBUFFER,
@@ -1168,10 +1174,10 @@ static int __init tty3215_init(void)
  	 * proc_entry, set_termios, flush_buffer, set_ldisc, write_proc
  	 */
 
-	driver->driver_name = "tty3215";
-	driver->name = "ttyS";
-	driver->major = TTY_MAJOR;
-	driver->minor_start = 64;
+	driver->driver_name = RAW3215_DRIVER_NAME;
+	driver->name = RAW3215_DEVICE_NAME;
+	driver->major = RAW3215_MAJOR;
+	driver->minor_start = RAW3215_MINOR;
  	driver->type = TTY_DRIVER_TYPE_SYSTEM;
  	driver->subtype = SYSTEM_TYPE_TTY;
  	driver->init_termios = tty_std_termios;