net: mark read-only arrays as const
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / netfilter / ipvs / ip_vs_proto_tcp.c
index dd4566ea2bff7bce68baabf916eb4b9ae25c9a6f..91d28e073742db770bb5df2ee8ee123fb7afbc0a 100644 (file)
@@ -13,6 +13,9 @@
  *
  */
 
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/ip.h>
 #include <linux/tcp.h>                  /* for tcphdr */
@@ -192,8 +195,8 @@ tcp_snat_handler(struct sk_buff *skb,
        /* Adjust TCP checksums */
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
                tcp_partial_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
-                                       htonl(oldlen),
-                                       htonl(skb->len - tcphoff));
+                                       htons(oldlen),
+                                       htons(skb->len - tcphoff));
        } else if (!cp->app) {
                /* Only port and addr are changed, do fast csum update */
                tcp_fast_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
@@ -267,8 +270,8 @@ tcp_dnat_handler(struct sk_buff *skb,
         */
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
                tcp_partial_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
-                                       htonl(oldlen),
-                                       htonl(skb->len - tcphoff));
+                                       htons(oldlen),
+                                       htons(skb->len - tcphoff));
        } else if (!cp->app) {
                /* Only port and addr are changed, do fast csum update */
                tcp_fast_csum_update(cp->af, tcph, &cp->vaddr, &cp->daddr,
@@ -374,7 +377,7 @@ static int tcp_timeouts[IP_VS_TCP_S_LAST+1] = {
        [IP_VS_TCP_S_LAST]              =       2*HZ,
 };
 
-static char * tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
+static const char *const tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
        [IP_VS_TCP_S_NONE]              =       "NONE",
        [IP_VS_TCP_S_ESTABLISHED]       =       "ESTABLISHED",
        [IP_VS_TCP_S_SYN_SENT]          =       "SYN_SENT",
@@ -661,7 +664,7 @@ tcp_app_conn_bind(struct ip_vs_conn *cp)
                                break;
                        spin_unlock(&tcp_app_lock);
 
-                       IP_VS_DBG_BUF(9, "%s: Binding conn %s:%u->"
+                       IP_VS_DBG_BUF(9, "%s(): Binding conn %s:%u->"
                                      "%s:%u to app %s on port %u\n",
                                      __func__,
                                      IP_VS_DBG_ADDR(cp->af, &cp->caddr),