aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192e/rtl8192e
diff options
context:
space:
mode:
authorBhumika Goyal <bhumirks@gmail.com>2016-10-04 23:22:36 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-16 10:24:51 +0200
commit67f9dcb155875864ccaf74625a7c702e6d07ab31 (patch)
treea1f3878e93912eedd261b5359be36bfafa2a3270 /drivers/staging/rtl8192e/rtl8192e
parentstaging: sm750fb: Replace printk() with pr_info(). (diff)
downloadlinux-dev-67f9dcb155875864ccaf74625a7c702e6d07ab31.tar.xz
linux-dev-67f9dcb155875864ccaf74625a7c702e6d07ab31.zip
Staging: rtl8192e: rtl_core: Constify rtllib_qos_parameters structures
Declare the structure rtllib_qos_parameters as constant as it is only passed as the second argument to the function memcpy. This argument is constant so the fields of rtllib_qos_parameters structure are never modified and hence it can be declared as const. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct rtllib_qos_parameters i@p = {...}; @ok1@ identifier r1.i; position p; expression e1,e2; @@ memcpy(e1,&i@p,e2) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct rtllib_qos_parameters i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct rtllib_qos_parameters i; File size before: text data bss dec hex filename 30910 496 201 31607 7b77 drivers/staging/rtl8192e/rtl8192e/rtl_core.o File size after: text data bss dec hex filename 30942 464 201 31607 7b77 drivers/staging/rtl8192e/rtl8192e/rtl_core.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtl8192e/rtl_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 4c30eea45f89..f985d88f8726 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -367,7 +367,7 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap)
}
}
-static struct rtllib_qos_parameters def_qos_parameters = {
+static const struct rtllib_qos_parameters def_qos_parameters = {
{cpu_to_le16(3), cpu_to_le16(3), cpu_to_le16(3), cpu_to_le16(3)},
{cpu_to_le16(7), cpu_to_le16(7), cpu_to_le16(7), cpu_to_le16(7)},
{2, 2, 2, 2},