All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] introduce setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 functions
@ 2018-09-07 19:41 ` Corentin Labbe
  0 siblings, 0 replies; 63+ messages in thread
From: Corentin Labbe @ 2018-09-07 19:41 UTC (permalink / raw)
  To: Gilles.Muller, Julia.Lawall, agust, alexandre.torgue, alistair,
	benh, carlo, davem, galak, joabreu, khilman, maxime.ripard,
	michal.lkml, mpe, mporter, nicolas.palix, oss, paulus,
	peppe.cavallaro, tj, vitb, wens
  Cc: cocci, linux-amlogic, linux-arm-kernel, linux-ide, linux-kernel,
	linuxppc-dev, netdev, linux-sunxi, Corentin Labbe

Hello

This patchset adds a new set of functions which are open-coded in lot of
place.
Basicly the pattern is always the same, "read, modify a bit, write"
some driver already have thoses pattern them as functions. (like ahci_sunxi.c or dwmac-meson8b)

The first patch rename some powerpc funtions which already use the same name (xxxbits32)
but with only bigendian values.

The second patch adds the header.
The third patch is an ugly try to implement a coccinelle semantic patch to
find all place where xxxbits function could be used.
Probably this spatch could be better written and I didnt found an easy way to add the "linux/setbits" header.

The two last patch are example of convertion of two drivers.
Thoses patchs give an example of the reduction of code won by using xxxbits32.

This patchset is tested with the ahci_sunxi and dwmac-sun8i drivers.

Regards

Corentin Labbe (5):
  powerpc: rename setbits32/clrbits32 to setbits32_be/clrbits32_be
  include: add
    setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 in
    linux/setbits.h
  coccinelle: add xxxsetbitsXX converting spatch
  net: ethernet: stmmac: use xxxsetbits32
  ata: ahci_sunxi: use xxxsetbits32 functions

 arch/powerpc/include/asm/fsl_lbc.h                 |   2 +-
 arch/powerpc/include/asm/io.h                      |   5 +-
 arch/powerpc/platforms/44x/canyonlands.c           |   4 +-
 arch/powerpc/platforms/4xx/gpio.c                  |  28 +-
 arch/powerpc/platforms/512x/pdm360ng.c             |   6 +-
 arch/powerpc/platforms/52xx/mpc52xx_common.c       |   6 +-
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c          |  10 +-
 arch/powerpc/platforms/82xx/ep8248e.c              |   2 +-
 arch/powerpc/platforms/82xx/km82xx.c               |   6 +-
 arch/powerpc/platforms/82xx/mpc8272_ads.c          |  10 +-
 arch/powerpc/platforms/82xx/pq2.c                  |   2 +-
 arch/powerpc/platforms/82xx/pq2ads-pci-pic.c       |   4 +-
 arch/powerpc/platforms/82xx/pq2fads.c              |  10 +-
 arch/powerpc/platforms/83xx/km83xx.c               |   6 +-
 arch/powerpc/platforms/83xx/mpc836x_mds.c          |   2 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c          |   2 +-
 arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c       |   4 +-
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |   2 +-
 arch/powerpc/platforms/85xx/p1022_ds.c             |   4 +-
 arch/powerpc/platforms/85xx/p1022_rdk.c            |   4 +-
 arch/powerpc/platforms/85xx/t1042rdb_diu.c         |   4 +-
 arch/powerpc/platforms/85xx/twr_p102x.c            |   2 +-
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c         |   4 +-
 arch/powerpc/platforms/8xx/adder875.c              |   2 +-
 arch/powerpc/platforms/8xx/m8xx_setup.c            |   4 +-
 arch/powerpc/platforms/8xx/mpc86xads_setup.c       |   4 +-
 arch/powerpc/platforms/8xx/mpc885ads_setup.c       |  28 +-
 arch/powerpc/platforms/embedded6xx/flipper-pic.c   |   6 +-
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c      |   8 +-
 arch/powerpc/platforms/embedded6xx/wii.c           |  10 +-
 arch/powerpc/sysdev/cpm1.c                         |  26 +-
 arch/powerpc/sysdev/cpm2.c                         |  16 +-
 arch/powerpc/sysdev/cpm_common.c                   |   4 +-
 arch/powerpc/sysdev/fsl_85xx_l2ctlr.c              |   8 +-
 arch/powerpc/sysdev/fsl_lbc.c                      |   2 +-
 arch/powerpc/sysdev/fsl_pci.c                      |   8 +-
 arch/powerpc/sysdev/fsl_pmc.c                      |   2 +-
 arch/powerpc/sysdev/fsl_rcpm.c                     |  74 ++--
 arch/powerpc/sysdev/fsl_rio.c                      |   4 +-
 arch/powerpc/sysdev/fsl_rmu.c                      |   8 +-
 arch/powerpc/sysdev/mpic_timer.c                   |  12 +-
 drivers/ata/ahci_sunxi.c                           |  51 +--
 .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c    |  54 +--
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |  55 +--
 .../net/ethernet/stmicro/stmmac/dwmac1000_core.c   |  21 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c  |  51 +--
 drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c   |  13 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c   |  42 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac5.c       |  11 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c    |  17 +-
 .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c    |  30 +-
 drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c |  69 +---
 .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c  |  11 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c  |   7 +-
 include/linux/setbits.h                            |  55 +++
 scripts/coccinelle/misc/setbits.cocci              | 423 +++++++++++++++++++++
 56 files changed, 776 insertions(+), 489 deletions(-)
 create mode 100644 include/linux/setbits.h
 create mode 100644 scripts/coccinelle/misc/setbits.cocci

-- 
2.16.4

^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2018-09-10 18:53 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 19:41 [PATCH 0/5] introduce setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 functions Corentin Labbe
2018-09-07 19:41 ` Corentin Labbe
2018-09-07 19:41 ` Corentin Labbe
2018-09-07 19:41 ` [Cocci] " Corentin Labbe
2018-09-07 19:41 ` [PATCH 1/5] powerpc: rename setbits32/clrbits32 to setbits32_be/clrbits32_be Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` [Cocci] " Corentin Labbe
2018-09-10  5:16   ` Christophe LEROY
2018-09-10  5:16     ` Christophe LEROY
2018-09-10  5:16     ` Christophe LEROY
2018-09-10  5:16     ` [Cocci] " Christophe LEROY
2018-09-10 18:50     ` LABBE Corentin
2018-09-10 18:50       ` LABBE Corentin
2018-09-10 18:50       ` LABBE Corentin
2018-09-10 18:50       ` [Cocci] " LABBE Corentin
2018-09-07 19:41 ` [PATCH 2/5] include: add setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 in linux/setbits.h Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` [Cocci] " Corentin Labbe
2018-09-07 20:00   ` Scott Wood
2018-09-07 20:00     ` Scott Wood
2018-09-07 20:00     ` Scott Wood
2018-09-07 20:00     ` [Cocci] " Scott Wood
2018-09-07 20:00     ` Scott Wood
2018-09-10 18:49     ` LABBE Corentin
2018-09-10 18:49       ` LABBE Corentin
2018-09-10 18:49       ` LABBE Corentin
2018-09-10 18:49       ` [Cocci] " LABBE Corentin
2018-09-10  5:22   ` Christophe LEROY
2018-09-10  5:22     ` Christophe LEROY
2018-09-10  5:22     ` Christophe LEROY
2018-09-10  5:22     ` [Cocci] " Christophe LEROY
2018-09-10 18:53     ` LABBE Corentin
2018-09-10 18:53       ` LABBE Corentin
2018-09-10 18:53       ` LABBE Corentin
2018-09-10 18:53       ` [Cocci] " LABBE Corentin
2018-09-07 19:41 ` [PATCH RFC 3/5] coccinelle: add xxxsetbitsXX converting spatch Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` [Cocci] " Corentin Labbe
2018-09-09 11:13   ` SF Markus Elfring
2018-09-09 11:13     ` SF Markus Elfring
2018-09-09 11:13     ` SF Markus Elfring
2018-09-09 11:13     ` SF Markus Elfring
2018-09-09 11:13     ` SF Markus Elfring
2018-09-09 11:13     ` SF Markus Elfring
2018-09-07 19:41 ` [PATCH 4/5] net: ethernet: stmmac: use xxxsetbits32 Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` [Cocci] " Corentin Labbe
2018-09-07 19:41 ` [PATCH 5/5] ata: ahci_sunxi: use xxxsetbits32 functions Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` Corentin Labbe
2018-09-07 19:41   ` [Cocci] " Corentin Labbe
2018-09-07 21:57 ` [PATCH 0/5] introduce setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 functions David Miller
2018-09-07 21:57   ` David Miller
2018-09-07 21:57   ` David Miller
2018-09-07 21:57   ` [Cocci] " David Miller
2018-09-10  5:24 ` Christophe LEROY
2018-09-10  5:24   ` Christophe LEROY
2018-09-10  5:24   ` Christophe LEROY
2018-09-10  5:24   ` [Cocci] " Christophe LEROY

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.