qlogic: netxen: constify bin_attribute structures
commitff2924583b7211b062ee5433924256f99011b0d9
authorBhumika Goyal <bhumirks@gmail.com>
Tue, 21 Feb 2017 18:47:48 +0000 (22 00:17 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Feb 2017 20:39:09 +0000 (22 15:39 -0500)
tree4a10351e9a0a040ca02b37fa6fbe2d50b873959d
parent0ccea2210c7ed486c688cd05fd1b674d95ef9894
qlogic: netxen: constify bin_attribute structures

Declare bin_attribute structures as const as they are only passed as an
arguments to the functions device_remove_bin_file and
device_create_bin_file. These function arguments are of type const, so
bin_attribute structures having this property can be made const too.
Done using Coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct bin_attribute i@p = {...};

@ok1@
identifier r1.i;
position p,p1;
@@
(
device_remove_bin_file(...,&i@p)
|
device_create_bin_file(..., &i@p1)
)

@bad@
position p!={r1.p,ok1.p,ok1.p1};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct bin_attribute i;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c