isdn: use constants instead of magicnumbers
Subsystems (2)
PATCH 1/1 isdn: use constants instead of magicnumbers
This patch changes instances of magic numbers like 4 and 8 to equivalent constants.
The Coccinelle semantic patch used for making the change is as follows:
// <smpl>
@r@
type T;
T E;
identifier fld;
identifier c;
@@
E->fld & c
@s@
constant C;
identifier r.c;
@@
#define c C
@@
r.T E;
identifier r.fld;
identifier r.c;
constant s.C;
@@
E->fld &
- C
+ c
// </smpl>
Signed-off-by Himangi Saraogi <[email protected]>
Acked-by Julia Lawall <[email protected]>
---
To send to: Karsten Keil <[email protected]>,[email protected],[email protected]
drivers/isdn/i4l/isdn_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/isdn/i4l/isdn_net.c +2 -2
@@ -2918,8 +2918,8 @@ isdn_net_getcfg(isdn_net_ioctl_cfg *cfg) cfg->callback =2 ; cfg->cbhup = (lp->flags &ISDN_NET_CBHUP ) ?1 :0 ; cfg->dialmode = lp->flags &ISDN_NET_DIALMODE_MASK ; - cfg->chargehup = (lp->hupflags &4 ) ?1 :0 ; - cfg->ihup = (lp->hupflags &8 ) ?1 :0 ; + cfg->chargehup = (lp->hupflags &ISDN_CHARGEHUP ) ?1 :0 ; + cfg->ihup = (lp->hupflags &ISDN_INHUP ) ?1 :0 ; cfg->cbdelay = lp->cbdelay; cfg->dialmax = lp->dialmax; cfg->triggercps = lp->triggercps;
Signature · 1 line
1.9.1
From: Himangi Saraogi <[email protected]>
Date: Thu, 24 Jul 2014 02:46:38 +0530
Quoted 4 lines
This patch changes instances of magic numbers like 4 and 8 to equivalent constants.
The Coccinelle semantic patch used for making the change is as follows:
...
Quoted 2 lines
Signed-off-by Himangi Saraogi <[email protected]>Acked-by Julia Lawall <[email protected]>
Applied, thank you.