]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
MIPS: TXx9: 7segled: use permission-specific DEVICE_ATTR variants
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 29 Oct 2016 19:36:59 +0000 (21:36 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 3 Jan 2017 15:34:32 +0000 (16:34 +0100)
commit3c2b02397893c40ce46e2297ba980fbc40d908b0
tree05c911bd408abf1290e9011c087e75f47d3e6603
parentccebb88aea1329221e1063906f4846b532a57fb5
MIPS: TXx9: 7segled: use permission-specific DEVICE_ATTR variants

Use DEVICE_ATTR_WO for write only attributes.  This simplifies the
source code, improves readbility, and reduces the chance of
inconsistencies.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@wo@
declarer name DEVICE_ATTR;
identifier x,x_store;
@@

DEVICE_ATTR(x, \(0200\|S_IWUSR\), NULL, x_store);

@script:ocaml@
x << wo.x;
x_store << wo.x_store;
@@

if not (x^"_store" = x_store) then Coccilib.include_match false

@@
declarer name DEVICE_ATTR_WO;
identifier wo.x,wo.x_store;
@@

- DEVICE_ATTR(x, \(0200\|S_IWUSR\), NULL, x_store);
+ DEVICE_ATTR_WO(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14463/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/txx9/generic/7segled.c