Skip to contentSkip to conversation

llc: fix non-const printk warning

PATCH Applied Stephen Hemminger 3 participants 6 messages Feb 20, 2009 – Feb 22, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 llc: fix non-const printk warning

Mark some strings as const.

net/llc/af_llc.c +3 -3
@@ -1118,11 +1118,11 @@ static const struct proto_ops llc_ui_ops
 	.sendpage    = sock_no_sendpage,
 };
 
-static char llc_proc_err_msg[] __initdata =
+static const char llc_proc_err_msg[] __initconst =
 	KERN_CRIT "LLC: Unable to register the proc_fs entries\n";
-static char llc_sysctl_err_msg[] __initdata =
+static const char llc_sysctl_err_msg[] __initconst =
 	KERN_CRIT "LLC: Unable to register the sysctl entries\n";
-static char llc_sock_err_msg[] __initdata =
+static const char llc_sock_err_msg[] __initconst =
 	KERN_CRIT "LLC: Unable to register the network family\n";
 
 static int __init llc2_init(void)
#1 lore raw

PATCH 2/2 snap: handle registration error and compile warning

If this module can't load, it is almost certainly because something else is already bound to that SAP. So in that case, return the same error code as other SAP usage, and fail the module load.

Also fixes a compiler warning about printk of non const.

net/802/psnap.c +4 -3
@@ -95,15 +95,16 @@ static int snap_request(struct datalink_
 EXPORT_SYMBOL(register_snap_client);
 EXPORT_SYMBOL(unregister_snap_client);
 
-static char snap_err_msg[] __initdata =
+static const char snap_err_msg[] __initconst =
 	KERN_CRIT "SNAP - unable to register with 802.2\n";
 
 static int __init snap_init(void)
 {
 	snap_sap = llc_sap_open(0xAA, snap_rcv);
-
-	if (!snap_sap)
+	if (!snap_sap) {
 		printk(snap_err_msg);
+		return -EBUSY;
+	}
 
 	return 0;
 }
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] snap: handle registration error and compile warning

Em Fri, Feb 20, 2009 at 10:03:02AM -0800, Stephen Hemminger escreveu:

Quoted 7 lines

If this module can't load, it is almost certainly because something else is already bound to that SAP. So in that case, return the same error code as other SAP usage, and fail the module load.

Also fixes a compiler warning about printk of non const.

Thanks,

Quoted 24 lines
net/802/psnap.c +4 -4
@@ -95,15 +95,16 @@ static int snap_request(struct datalink_
 EXPORT_SYMBOL(register_snap_client);
 EXPORT_SYMBOL(unregister_snap_client);
 
-static char snap_err_msg[] __initdata =
+static const char snap_err_msg[] __initconst =
 	KERN_CRIT "SNAP - unable to register with 802.2\n";
 
 static int __init snap_init(void)
 {
 	snap_sap = llc_sap_open(0xAA, snap_rcv);
-
-	if (!snap_sap)
+	if (!snap_sap) {
 		printk(snap_err_msg);
+		return -EBUSY;
+	}
 
 	return 0;
 }
--
Acked-by on v1 1/2
#4 lore raw
In reply to Stephen Hemminger

Em Fri, Feb 20, 2009 at 10:02:06AM -0800, Stephen Hemminger escreveu:

Quoted 3 lines

Mark some strings as const.

Thanks,

Quoted 19 lines
net/llc/af_llc.c +3 -4
@@ -1118,11 +1118,11 @@ static const struct proto_ops llc_ui_ops
 	.sendpage    = sock_no_sendpage,
 };
 
-static char llc_proc_err_msg[] __initdata =
+static const char llc_proc_err_msg[] __initconst =
 	KERN_CRIT "LLC: Unable to register the proc_fs entries\n";
-static char llc_sysctl_err_msg[] __initdata =
+static const char llc_sysctl_err_msg[] __initconst =
 	KERN_CRIT "LLC: Unable to register the sysctl entries\n";
-static char llc_sock_err_msg[] __initdata =
+static const char llc_sock_err_msg[] __initconst =
 	KERN_CRIT "LLC: Unable to register the network family\n";
 
 static int __init llc2_init(void)
--
maintainer
#3 lore raw

Re: [PATCH 2/2] snap: handle registration error and compile warning

In reply to Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <[email protected]>
Date: Fri, 20 Feb 2009 18:37:35 -0300

Quoted 5 lines

Em Fri, Feb 20, 2009 at 10:03:02AM -0800, Stephen Hemminger escreveu:

Quoted 4 lines

If this module can't load, it is almost certainly because something else is already bound to that SAP. So in that case, return the same error code as other SAP usage, and fail the module load.

Quoted 7 lines
Quoted 3 lines

Also fixes a compiler warning about printk of non const.

Thanks,

Also applied, thanks.