Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit feb254a7 authored by Gargi Sharma's avatar Gargi Sharma Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192u: Constify ieee80211_qos_parameters structure



Declare ieee80211_qos_parameters structure constant it is only passed
as src parameter to the function memcpy. The fields of
def_qos_parameters structure are never modified and hence it can be
declared as const.

Coccinelle Script:

@r1 disable optional_qualifier@
identifier i;
position p;
@@

static struct ieee80211_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 ieee80211_qos_parameters i={...};

Signed-off-by: default avatarGargi Sharma <gs051095@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 08680307
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment