[PATCH 1/1 linux-next] powerpc/fsl-lbc: use DEFINE_SPINLOCK()
Signed-off-by: Fabian Frederick <f...@skynet.be> --- arch/powerpc/sysdev/fsl_lbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c index 424b67f..5340a48 100644 --- a/arch/powerpc/sysdev/fsl_lbc.c +++ b/arch/powerpc/sysdev/fsl_lbc.c @@ -31,7 +31,7 @@ #include #include -static spinlock_t fsl_lbc_lock = __SPIN_LOCK_UNLOCKED(fsl_lbc_lock); +static DEFINE_SPINLOCK(fsl_lbc_lock); struct fsl_lbc_ctrl *fsl_lbc_ctrl_dev; EXPORT_SYMBOL(fsl_lbc_ctrl_dev); -- 2.7.4
[PATCH 1/1 linux-next] soc/qman: test: use DEFINE_SPINLOCK()
Signed-off-by: Fabian Frederick <f...@skynet.be> --- drivers/soc/fsl/qbman/qman_test_stash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/qman_test_stash.c b/drivers/soc/fsl/qbman/qman_test_stash.c index b9795f3..e87b654 100644 --- a/drivers/soc/fsl/qbman/qman_test_stash.c +++ b/drivers/soc/fsl/qbman/qman_test_stash.c @@ -175,7 +175,7 @@ static DEFINE_PER_CPU(struct hp_cpu, hp_cpus); /* links together the hp_cpu structs, in first-come first-serve order. */ static LIST_HEAD(hp_cpu_list); -static spinlock_t hp_lock = __SPIN_LOCK_UNLOCKED(hp_lock); +static DEFINE_SPINLOCK(hp_lock); static unsigned int hp_cpu_list_length; -- 2.7.4
[PATCH 1/1 linux-next] net: fs_enet: use swap() in fs_enet_rx_napi()
Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index 9b3639e..c5f299d 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -86,7 +86,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget) struct net_device *dev = fep-ndev; const struct fs_platform_info *fpi = fep-fpi; cbd_t __iomem *bdp; - struct sk_buff *skb, *skbn, *skbt; + struct sk_buff *skb, *skbn; int received = 0; u16 pkt_len, sc; int curidx; @@ -161,10 +161,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget) skb_reserve(skbn, 2); /* align IP header */ skb_copy_from_linear_data(skb, skbn-data, pkt_len); - /* swap */ - skbt = skb; - skb = skbn; - skbn = skbt; + swap(skb, skbn); } } else { skbn = netdev_alloc_skb(dev, ENET_RX_FRSIZE); -- 2.4.2 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/7 linux-next] ALSA: aoa: constify of_device_id array
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick f...@skynet.be --- sound/aoa/soundbus/i2sbus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index b9737fa..1cbf210 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -31,7 +31,7 @@ module_param(force, int, 0444); MODULE_PARM_DESC(force, Force loading i2sbus even when no layout-id property is present); -static struct of_device_id i2sbus_match[] = { +static const struct of_device_id i2sbus_match[] = { { .name = i2s }, { } }; -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 03/16 linux-next] net/fsl: constify of_device_id array
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/net/ethernet/freescale/fec_mpc52xx.c | 2 +- drivers/net/ethernet/freescale/fec_mpc52xx_phy.c | 2 +- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 4 ++-- drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c | 2 +- drivers/net/ethernet/freescale/fs_enet/mii-fec.c | 4 ++-- drivers/net/ethernet/freescale/fsl_pq_mdio.c | 2 +- drivers/net/ethernet/freescale/gianfar.c | 2 +- drivers/net/ethernet/freescale/gianfar_ptp.c | 2 +- drivers/net/ethernet/freescale/ucc_geth.c | 2 +- drivers/net/ethernet/freescale/xgmac_mdio.c | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c index f495796..afe7f39 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx.c @@ -1057,7 +1057,7 @@ static int mpc52xx_fec_of_resume(struct platform_device *op) } #endif -static struct of_device_id mpc52xx_fec_match[] = { +static const struct of_device_id mpc52xx_fec_match[] = { { .compatible = fsl,mpc5200b-fec, }, { .compatible = fsl,mpc5200-fec, }, { .compatible = mpc5200-fec, }, diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c index e052890..1e647be 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c @@ -134,7 +134,7 @@ static int mpc52xx_fec_mdio_remove(struct platform_device *of) return 0; } -static struct of_device_id mpc52xx_fec_mdio_match[] = { +static const struct of_device_id mpc52xx_fec_mdio_match[] = { { .compatible = fsl,mpc5200b-mdio, }, { .compatible = fsl,mpc5200-mdio, }, { .compatible = mpc5200b-fec-phy, }, diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index a176287..9b3639e 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -916,7 +916,7 @@ static const struct net_device_ops fs_enet_netdev_ops = { #endif }; -static struct of_device_id fs_enet_match[]; +static const struct of_device_id fs_enet_match[]; static int fs_enet_probe(struct platform_device *ofdev) { const struct of_device_id *match; @@ -1082,7 +1082,7 @@ static int fs_enet_remove(struct platform_device *ofdev) return 0; } -static struct of_device_id fs_enet_match[] = { +static const struct of_device_id fs_enet_match[] = { #ifdef CONFIG_FS_ENET_HAS_SCC { .compatible = fsl,cpm1-scc-enet, diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c index 1d5617d..68a428d 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c +++ b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c @@ -213,7 +213,7 @@ static int fs_enet_mdio_remove(struct platform_device *ofdev) return 0; } -static struct of_device_id fs_enet_mdio_bb_match[] = { +static const struct of_device_id fs_enet_mdio_bb_match[] = { { .compatible = fsl,cpm2-mdio-bitbang, }, diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c index 1648e35..2be383e 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c +++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c @@ -95,7 +95,7 @@ static int fs_enet_fec_mii_write(struct mii_bus *bus, int phy_id, int location, } -static struct of_device_id fs_enet_mdio_fec_match[]; +static const struct of_device_id fs_enet_mdio_fec_match[]; static int fs_enet_mdio_probe(struct platform_device *ofdev) { const struct of_device_id *match; @@ -208,7 +208,7 @@ static int fs_enet_mdio_remove(struct platform_device *ofdev) return 0; } -static struct of_device_id fs_enet_mdio_fec_match[] = { +static const struct of_device_id fs_enet_mdio_fec_match[] = { { .compatible = fsl,pq1-fec-mdio, }, diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c index d1a91e3..3c40f6b 100644 --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c @@ -294,7 +294,7 @@ static void ucc_configure(phys_addr_t start, phys_addr_t end) #endif -static struct of_device_id fsl_pq_mdio_match[] = { +static const struct of_device_id fsl_pq_mdio_match[] = { #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE) { .compatible = fsl,gianfar-tbi, diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 70fa688
[PATCH 00/16 linux-next] drivers/net: constify of_device_id array
This small patchset adds const to of_device_id arrays in drivers/net branch. Fabian Frederick (16): net: netcp: constify of_device_id array Altera TSE: constify of_device_id array net/fsl: constify of_device_id array net: ethoc: constify of_device_id array drivers: net: xgene: constify of_device_id array net: ethernet: apple: constify of_device_id array netdev: octeon_mgmt: constify of_device_id array net: greth: constify of_device_id array net: xilinx: constify of_device_id array orinoco: constify of_device_id array net: phy: constify of_device_id array can: constify of_device_id array IBM-EMAC: constify of_device_id array ehea: constify of_device_id array net: via-rhine: constify of_device_id array via-velocity: constify of_device_id array drivers/net/can/cc770/cc770_platform.c| 2 +- drivers/net/can/grcan.c | 2 +- drivers/net/can/mscan/mpc5xxx_can.c | 2 +- drivers/net/can/sja1000/sja1000_platform.c| 2 +- drivers/net/can/xilinx_can.c | 2 +- drivers/net/ethernet/aeroflex/greth.c | 2 +- drivers/net/ethernet/altera/altera_tse_main.c | 4 ++-- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 +- drivers/net/ethernet/apple/bmac.c | 2 +- drivers/net/ethernet/apple/mace.c | 2 +- drivers/net/ethernet/ethoc.c | 2 +- drivers/net/ethernet/freescale/fec_mpc52xx.c | 2 +- drivers/net/ethernet/freescale/fec_mpc52xx_phy.c | 2 +- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 4 ++-- drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c | 2 +- drivers/net/ethernet/freescale/fs_enet/mii-fec.c | 4 ++-- drivers/net/ethernet/freescale/fsl_pq_mdio.c | 2 +- drivers/net/ethernet/freescale/gianfar.c | 2 +- drivers/net/ethernet/freescale/gianfar_ptp.c | 2 +- drivers/net/ethernet/freescale/ucc_geth.c | 2 +- drivers/net/ethernet/freescale/xgmac_mdio.c | 2 +- drivers/net/ethernet/ibm/ehea/ehea_main.c | 4 ++-- drivers/net/ethernet/ibm/emac/core.c | 2 +- drivers/net/ethernet/ibm/emac/mal.c | 2 +- drivers/net/ethernet/ibm/emac/rgmii.c | 2 +- drivers/net/ethernet/ibm/emac/tah.c | 2 +- drivers/net/ethernet/ibm/emac/zmii.c | 2 +- drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +- drivers/net/ethernet/ti/netcp_core.c | 2 +- drivers/net/ethernet/via/via-rhine.c | 2 +- drivers/net/ethernet/via/via-velocity.c | 2 +- drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +- drivers/net/phy/mdio-bcm-unimac.c | 2 +- drivers/net/phy/mdio-gpio.c | 2 +- drivers/net/phy/mdio-mux-gpio.c | 2 +- drivers/net/phy/mdio-mux-mmioreg.c| 2 +- drivers/net/phy/mdio-octeon.c | 2 +- drivers/net/wireless/orinoco/airport.c| 2 +- 40 files changed, 44 insertions(+), 44 deletions(-) -- 2.1.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 00/35 linux-next] constify of_device_id array
This small patchset adds const to of_device_id arrays in drivers branch. Fabian Frederick (35): ata: constify of_device_id array regulator: constify of_device_id array thermal: constify of_device_id array tty/hvc_opal: constify of_device_id array tty: constify of_device_id array power: constify of_device_id array char: constify of_device_id array dma: constify of_device_id array iio: constify of_device_id array misc: constify of_device_id array usb: gadget: constify of_device_id array mtd: constify of_device_id array w1: constify of_device_id array ide: pmac: constify of_device_id array spi: constify of_device_id array video: constify of_device_id array coresight-replicator: constify of_device_id array macintosh: constify of_device_id array virtio_mmio: constify of_device_id array swim3: constify of_device_id array mfd: constify of_device_id array soc: ti: constify of_device_id array [media]: constify of_device_id array Input: constify of_device_id array PCI: constify of_device_id array hwmon: constify of_device_id array reset: sti: constify of_device_id array uio: constify of_device_id array gpu: constify of_device_id array devfreq: constify of_device_id array EDAC: constify of_device_id array clk: constify of_device_id array mmc: constify of_device_id array Staging: octeon: constify of_device_id array pinctrl: constify of_device_id array drivers/ata/pata_macio.c | 2 +- drivers/ata/pata_mpc52xx.c | 2 +- drivers/ata/pata_octeon_cf.c | 2 +- drivers/ata/pata_of_platform.c | 2 +- drivers/ata/sata_fsl.c | 2 +- drivers/ata/sata_mv.c| 2 +- drivers/ata/sata_rcar.c | 2 +- drivers/block/swim3.c| 2 +- drivers/char/hw_random/pasemi-rng.c | 2 +- drivers/char/hw_random/powernv-rng.c | 2 +- drivers/char/hw_random/ppc4xx-rng.c | 2 +- drivers/char/ipmi/ipmi_si_intf.c | 4 ++-- drivers/char/xillybus/xillybus_of.c | 2 +- drivers/clk/clk-palmas.c | 2 +- drivers/clk/st/clkgen-fsyn.c | 2 +- drivers/clk/st/clkgen-mux.c | 8 drivers/clk/st/clkgen-pll.c | 4 ++-- drivers/clk/ti/clk-dra7-atl.c| 2 +- drivers/clk/ti/clockdomain.c | 2 +- drivers/clk/versatile/clk-vexpress-osc.c | 2 +- drivers/coresight/coresight-replicator.c | 2 +- drivers/devfreq/event/exynos-ppmu.c | 2 +- drivers/devfreq/tegra-devfreq.c | 2 +- drivers/dma/bestcomm/bestcomm.c | 4 ++-- drivers/dma/k3dma.c | 2 +- drivers/dma/mmp_pdma.c | 2 +- drivers/dma/mmp_tdma.c | 2 +- drivers/dma/mpc512x_dma.c| 2 +- drivers/dma/mv_xor.c | 2 +- drivers/dma/sirf-dma.c | 2 +- drivers/dma/sun6i-dma.c | 2 +- drivers/edac/highbank_mc_edac.c | 2 +- drivers/edac/mpc85xx_edac.c | 4 ++-- drivers/edac/ppc4xx_edac.c | 2 +- drivers/edac/synopsys_edac.c | 2 +- drivers/gpio/gpio-mpc8xxx.c | 2 +- drivers/gpio/gpio-octeon.c | 2 +- drivers/gpio/gpio-tz1090-pdc.c | 2 +- drivers/gpio/gpio-tz1090.c | 2 +- drivers/gpio/gpio-zynq.c | 2 +- drivers/gpu/drm/armada/armada_crtc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/exynos/exynos_mixer.c| 2 +- drivers/gpu/drm/panel/panel-ld9040.c | 2 +- drivers/gpu/drm/panel/panel-s6e8aa0.c| 2 +- drivers/gpu/drm/sti/sti_dvo.c| 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 ++-- drivers/gpu/drm/tilcdc/tilcdc_panel.c| 2 +- drivers/gpu/drm/tilcdc/tilcdc_slave.c| 4 ++-- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 4 ++-- drivers/gpu/host1x/dev.c | 2 +- drivers/gpu/host1x/mipi.c| 2 +- drivers/hwmon/pwm-fan.c | 2 +- drivers/hwmon/vexpress.c | 2 +- drivers/ide/pmac.c | 2 +- drivers/iio/common/ssp_sensors/ssp_dev.c | 2 +- drivers/input/misc/palmas-pwrbutton.c| 2 +- drivers/input/misc/regulator-haptic.c| 2 +- drivers/input/misc/tps65218-pwrbutton.c | 2 +- drivers/input/touchscreen/ar1021_i2c.c | 2 +- drivers/macintosh/mediabay.c | 2 +- drivers/macintosh/rack-meter.c | 2 +- drivers/media/i2c/adv7604.c | 2 +- drivers/media/platform/fsl-viu.c | 2 +- drivers/media/platform/soc_camera/rcar_vin.c
[PATCH 04/35 linux-next] tty/hvc_opal: constify of_device_id array
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/tty/hvc/hvc_opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index 071551b..543b234 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/drivers/tty/hvc/hvc_opal.c @@ -41,7 +41,7 @@ static const char hvc_opal_name[] = hvc_opal; -static struct of_device_id hvc_opal_match[] = { +static const struct of_device_id hvc_opal_match[] = { { .name = serial, .compatible = ibm,opal-console-raw }, { .name = serial, .compatible = ibm,opal-console-hvsi }, { }, -- 2.1.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 05/35 linux-next] tty: constify of_device_id array
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/tty/serial/apbuart.c| 2 +- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 2 +- drivers/tty/serial/fsl_lpuart.c | 2 +- drivers/tty/serial/mpc52xx_uart.c | 2 +- drivers/tty/serial/mxs-auart.c | 2 +- drivers/tty/serial/of_serial.c | 4 ++-- drivers/tty/serial/pmac_zilog.c | 2 +- drivers/tty/serial/pxa.c| 2 +- drivers/tty/serial/serial-tegra.c | 2 +- drivers/tty/serial/sirfsoc_uart.c | 2 +- drivers/tty/serial/st-asc.c | 2 +- drivers/tty/serial/uartlite.c | 2 +- drivers/tty/serial/ucc_uart.c | 2 +- drivers/tty/serial/xilinx_uartps.c | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c index 4f0f95e..f3af317 100644 --- a/drivers/tty/serial/apbuart.c +++ b/drivers/tty/serial/apbuart.c @@ -572,7 +572,7 @@ static int apbuart_probe(struct platform_device *op) return 0; } -static struct of_device_id apbuart_match[] = { +static const struct of_device_id apbuart_match[] = { { .name = GAISLER_APBUART, }, diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index fddb1fd..08431ad 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c @@ -1435,7 +1435,7 @@ static int cpm_uart_remove(struct platform_device *ofdev) return uart_remove_one_port(cpm_reg, pinfo-port); } -static struct of_device_id cpm_uart_match[] = { +static const struct of_device_id cpm_uart_match[] = { { .compatible = fsl,cpm1-smc-uart, }, diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index b1893f3..946273a 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -257,7 +257,7 @@ struct lpuart_port { struct timer_list lpuart_timer; }; -static struct of_device_id lpuart_dt_ids[] = { +static const struct of_device_id lpuart_dt_ids[] = { { .compatible = fsl,vf610-lpuart, }, diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index 3308ef2..1589f17 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c @@ -1717,7 +1717,7 @@ static struct uart_driver mpc52xx_uart_driver = { /* OF Platform Driver */ /* */ -static struct of_device_id mpc52xx_uart_of_match[] = { +static const struct of_device_id mpc52xx_uart_of_match[] = { #ifdef CONFIG_PPC_MPC52xx { .compatible = fsl,mpc5200b-psc-uart, .data = mpc5200b_psc_ops, }, { .compatible = fsl,mpc5200-psc-uart, .data = mpc52xx_psc_ops, }, diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 20a863b..f7e5825 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -176,7 +176,7 @@ static struct platform_device_id mxs_auart_devtype[] = { }; MODULE_DEVICE_TABLE(platform, mxs_auart_devtype); -static struct of_device_id mxs_auart_dt_ids[] = { +static const struct of_device_id mxs_auart_dt_ids[] = { { .compatible = fsl,imx28-auart, .data = mxs_auart_devtype[IMX28_AUART] diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index 33fb94f..d8c4eea 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c @@ -155,7 +155,7 @@ out: /* * Try to register a serial port */ -static struct of_device_id of_platform_serial_table[]; +static const struct of_device_id of_platform_serial_table[]; static int of_platform_serial_probe(struct platform_device *ofdev) { const struct of_device_id *match; @@ -320,7 +320,7 @@ static SIMPLE_DEV_PM_OPS(of_serial_pm_ops, of_serial_suspend, of_serial_resume); /* * A few common types, add more as needed. */ -static struct of_device_id of_platform_serial_table[] = { +static const struct of_device_id of_platform_serial_table[] = { { .compatible = ns8250, .data = (void *)PORT_8250, }, { .compatible = ns16450, .data = (void *)PORT_16450, }, { .compatible = ns16550a, .data = (void *)PORT_16550A, }, diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 8f51579..e156e39 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -1846,7 +1846,7 @@ static int __init pmz_register(void) #ifdef CONFIG_PPC_PMAC -static struct of_device_id pmz_match[] = +static const struct of_device_id pmz_match[] = { { .name = ch-a, diff --git a/drivers
[PATCH 07/35 linux-next] char: constify of_device_id array
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/char/hw_random/pasemi-rng.c | 2 +- drivers/char/hw_random/powernv-rng.c | 2 +- drivers/char/hw_random/ppc4xx-rng.c | 2 +- drivers/char/ipmi/ipmi_si_intf.c | 4 ++-- drivers/char/xillybus/xillybus_of.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/char/hw_random/pasemi-rng.c b/drivers/char/hw_random/pasemi-rng.c index 3eb7bdd..51cb1d5 100644 --- a/drivers/char/hw_random/pasemi-rng.c +++ b/drivers/char/hw_random/pasemi-rng.c @@ -133,7 +133,7 @@ static int rng_remove(struct platform_device *dev) return 0; } -static struct of_device_id rng_match[] = { +static const struct of_device_id rng_match[] = { { .compatible = 1682m-rng, }, { .compatible = pasemi,pwrficient-rng, }, { }, diff --git a/drivers/char/hw_random/powernv-rng.c b/drivers/char/hw_random/powernv-rng.c index 3f4f632..263a5bb 100644 --- a/drivers/char/hw_random/powernv-rng.c +++ b/drivers/char/hw_random/powernv-rng.c @@ -61,7 +61,7 @@ static int powernv_rng_probe(struct platform_device *pdev) return 0; } -static struct of_device_id powernv_rng_match[] = { +static const struct of_device_id powernv_rng_match[] = { { .compatible = ibm,power-rng,}, {}, }; diff --git a/drivers/char/hw_random/ppc4xx-rng.c b/drivers/char/hw_random/ppc4xx-rng.c index c85d31a..b2cfda0 100644 --- a/drivers/char/hw_random/ppc4xx-rng.c +++ b/drivers/char/hw_random/ppc4xx-rng.c @@ -123,7 +123,7 @@ static int ppc4xx_rng_remove(struct platform_device *dev) return 0; } -static struct of_device_id ppc4xx_rng_match[] = { +static const struct of_device_id ppc4xx_rng_match[] = { { .compatible = ppc4xx-rng, }, { .compatible = amcc,ppc460ex-rng, }, { .compatible = amcc,ppc440epx-rng, }, diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 003b4c1..97cf9c2 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -2664,7 +2664,7 @@ static struct pci_driver ipmi_pci_driver = { }; #endif /* CONFIG_PCI */ -static struct of_device_id ipmi_match[]; +static const struct of_device_id ipmi_match[]; static int ipmi_probe(struct platform_device *dev) { #ifdef CONFIG_OF @@ -2761,7 +2761,7 @@ static int ipmi_remove(struct platform_device *dev) return 0; } -static struct of_device_id ipmi_match[] = +static const struct of_device_id ipmi_match[] = { { .type = ipmi, .compatible = ipmi-kcs, .data = (void *)(unsigned long) SI_KCS }, diff --git a/drivers/char/xillybus/xillybus_of.c b/drivers/char/xillybus/xillybus_of.c index 2002a3a..7818650 100644 --- a/drivers/char/xillybus/xillybus_of.c +++ b/drivers/char/xillybus/xillybus_of.c @@ -31,7 +31,7 @@ MODULE_LICENSE(GPL v2); static const char xillyname[] = xillybus_of; /* Match table for of_platform binding */ -static struct of_device_id xillybus_of_match[] = { +static const struct of_device_id xillybus_of_match[] = { { .compatible = xillybus,xillybus-1.00.a, }, { .compatible = xlnx,xillybus-1.00.a, }, /* Deprecated */ {} -- 2.1.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 18/35 linux-next] macintosh: constify of_device_id array
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/macintosh/mediabay.c | 2 +- drivers/macintosh/rack-meter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index d98e566..2ddbe87 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c @@ -707,7 +707,7 @@ static const struct mb_ops keylargo_mb_ops = { * Therefore we do it all by polling the media bay once each tick. */ -static struct of_device_id media_bay_match[] = +static const struct of_device_id media_bay_match[] = { { .name = media-bay, diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 4192901..4585f70 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c @@ -578,7 +578,7 @@ static int rackmeter_shutdown(struct macio_dev* mdev) return 0; } -static struct of_device_id rackmeter_match[] = { +static const struct of_device_id rackmeter_match[] = { { .name = i2s }, { } }; -- 2.1.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/1 linux-next] powerpc: use kbuild generic-y where possible
Replace one line asm-generic include files declared in arch/powerpc/include/asm/ by generic-y declaration which creates arch/powerpc/include/generated/asm equivalent. Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/include/asm/Kbuild | 4 +++- arch/powerpc/include/asm/div64.h| 1 - arch/powerpc/include/asm/irq_regs.h | 2 -- arch/powerpc/include/asm/local64.h | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 arch/powerpc/include/asm/div64.h delete mode 100644 arch/powerpc/include/asm/irq_regs.h delete mode 100644 arch/powerpc/include/asm/local64.h diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild index 382b28e..4b87205 100644 --- a/arch/powerpc/include/asm/Kbuild +++ b/arch/powerpc/include/asm/Kbuild @@ -1,6 +1,8 @@ - generic-y += clkdev.h +generic-y += div64.h +generic-y += irq_regs.h generic-y += irq_work.h +generic-y += local64.h generic-y += mcs_spinlock.h generic-y += preempt.h generic-y += rwsem.h diff --git a/arch/powerpc/include/asm/div64.h b/arch/powerpc/include/asm/div64.h deleted file mode 100644 index 6cd978c..000 --- a/arch/powerpc/include/asm/div64.h +++ /dev/null @@ -1 +0,0 @@ -#include asm-generic/div64.h diff --git a/arch/powerpc/include/asm/irq_regs.h b/arch/powerpc/include/asm/irq_regs.h deleted file mode 100644 index ba94b51..000 --- a/arch/powerpc/include/asm/irq_regs.h +++ /dev/null @@ -1,2 +0,0 @@ -#include asm-generic/irq_regs.h - diff --git a/arch/powerpc/include/asm/local64.h b/arch/powerpc/include/asm/local64.h deleted file mode 100644 index 36c93b5..000 --- a/arch/powerpc/include/asm/local64.h +++ /dev/null @@ -1 +0,0 @@ -#include asm-generic/local64.h -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 3/7 linux-next] powerpc/pmac: replace current-state by set_current_state()
Use helper functions to access current-state. Direct assignments are prone to races and therefore buggy. current-state = TASK_RUNNING can be replaced by __set_current_state() Thanks to Peter Zijlstra for the exact definition of the problem. Suggested-By: Peter Zijlstra pet...@infradead.org Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/macintosh/via-pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index dee88e5..3c608d4 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -2109,7 +2109,7 @@ pmu_read(struct file *file, char __user *buf, spin_lock_irqsave(pp-lock, flags); add_wait_queue(pp-wait, wait); - current-state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); for (;;) { ret = -EAGAIN; @@ -2138,7 +2138,7 @@ pmu_read(struct file *file, char __user *buf, schedule(); spin_lock_irqsave(pp-lock, flags); } - current-state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); remove_wait_queue(pp-wait, wait); spin_unlock_irqrestore(pp-lock, flags); -- 2.1.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/1 linux-next] powerpc: fix section mismatch warning
Adding __init to MMU_setup() which uses __initdata boot_command_line. Warning appeared since commit 3e47d1474c2b (powerpc: Remove powerpc specific cmd_line) Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/mm/init_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c index cad68ff..415a51b 100644 --- a/arch/powerpc/mm/init_32.c +++ b/arch/powerpc/mm/init_32.c @@ -103,7 +103,7 @@ unsigned long __max_low_memory = MAX_LOW_MEM; /* * Check for command-line options that affect what MMU_init will do. */ -void MMU_setup(void) +void __init MMU_setup(void) { /* Check for nobats option (used in mapin_ram). */ if (strstr(boot_command_line, nobats)) { -- 1.9.3 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 00/30] drivers/net: remove unnecessary break after return
On 21 July 2014 at 06:31 David Miller da...@davemloft.net wrote: From: Fabian Frederick f...@skynet.be Date: Sun, 20 Jul 2014 16:16:08 +0200 Second patchset after remove unnecessary break after goto addressing break redundancy on drivers/net branch (suggested by Joe Perches) All applied except the i40e patch, which did not apply to net-next at all. Thanks a lot David. Fabian ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 00/30] drivers/net: remove unnecessary break after return
Second patchset after remove unnecessary break after goto addressing break redundancy on drivers/net branch (suggested by Joe Perches) Fabian Frederick (30): dlci: remove unnecessary break after return eth_v10: remove unnecessary break after return brcm80211: remove unnecessary break after return mwl8k: remove unnecessary break after return rtlwifi: remove unnecessary break after return rtlwifi: rtl8192ce: remove unnecessary break after return rtlwifi: rtl8192se: remove unnecessary break after return rtlwifi: rtl8723ae: remove unnecessary break after return rtlwifi: rtl8723be: remove unnecessary break after return rtlwifi: rtl8188ee: remove unnecessary break after return prism54: remove unnecessary break after return cw1200: remove unnecessary break after return airo: remove unnecessary break after return ath6kl: remove unnecessary break after return carl9170: remove unnecessary break after return i40e: remove unnecessary break after return e1000: remove unnecessary break after return ixgbe: remove unnecessary break after return e1000e: remove unnecessary break after return igb: remove unnecessary break after return 8390: remove unnecessary break after return net: tulip: remove unnecessary break after return bna: remove unnecessary break after return sis900: remove unnecessary break after return niu: remove unnecessary break after return ucc_geth: remove unnecessary break after return atl1e: remove unnecessary break after return atlx: remove unnecessary break after return atl1c: remove unnecessary break after return ps3_gelic: remove unnecessary break after return drivers/net/cris/eth_v10.c | 1 - drivers/net/ethernet/8390/mac8390.c | 8 drivers/net/ethernet/atheros/atl1c/atl1c_hw.c | 2 -- drivers/net/ethernet/atheros/atl1e/atl1e_hw.c | 1 - drivers/net/ethernet/atheros/atlx/atl1.c| 1 - drivers/net/ethernet/atheros/atlx/atl2.c| 3 --- drivers/net/ethernet/brocade/bna/cna_fwimg.c| 4 drivers/net/ethernet/dec/tulip/de4x5.c | 1 - drivers/net/ethernet/freescale/ucc_geth.c | 2 -- drivers/net/ethernet/intel/e1000/e1000_ethtool.c| 3 --- drivers/net/ethernet/intel/e1000/e1000_hw.c | 2 -- drivers/net/ethernet/intel/e1000e/82571.c | 4 drivers/net/ethernet/intel/e1000e/ethtool.c | 2 -- drivers/net/ethernet/intel/e1000e/ich8lan.c | 1 - drivers/net/ethernet/intel/e1000e/mac.c | 1 - drivers/net/ethernet/intel/i40e/i40e_common.c | 1 - drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 1 - drivers/net/ethernet/intel/igb/e1000_82575.c| 1 - drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 1 - drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c| 2 -- drivers/net/ethernet/sis/sis900.c | 1 - drivers/net/ethernet/sun/niu.c | 1 - drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 7 --- drivers/net/wan/dlci.c | 1 - drivers/net/wireless/airo.c | 1 - drivers/net/wireless/ath/ath6kl/init.c | 1 - drivers/net/wireless/ath/carl9170/phy.c | 1 - drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 1 - drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | 1 - drivers/net/wireless/cw1200/fwio.c | 1 - drivers/net/wireless/mwl8k.c| 5 - drivers/net/wireless/prism54/oid_mgt.c | 1 - drivers/net/wireless/rtlwifi/core.c | 1 - drivers/net/wireless/rtlwifi/rtl8188ee/pwrseqcmd.c | 1 - drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 1 - drivers/net/wireless/rtlwifi/rtl8192se/fw.c | 3 --- drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 1 - drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | 1 - drivers/net/wireless/rtlwifi/rtl8723be/pwrseqcmd.c | 1 - 39 files changed, 73 deletions(-) -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 26/30] ucc_geth: remove unnecessary break after return
Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/net/ethernet/freescale/ucc_geth.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 36fc429..8ceaf7a 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -2396,7 +2396,6 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) if (netif_msg_ifup(ugeth)) pr_err(Bad number of Rx threads value\n); return -EINVAL; - break; } switch (ug_info-numThreadsTx) { @@ -2419,7 +2418,6 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) if (netif_msg_ifup(ugeth)) pr_err(Bad number of Tx threads value\n); return -EINVAL; - break; } /* Calculate rx_extended_features */ -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 0/7] arch/powerpc: convert single variable sscanf to kstrtotype
Here is a small untested patchset to use the current string manipulation kstrtotype functions instead of sscanf like specified in checkpatch: Prefer kstrtotype to single variable sscanf autodetect base 0 has been used for both %d, %i, %ld, %lu, %u and base 16 for %lx Fabian Frederick (7): powerpc: fadump: replace sscanf by kstrtoint powerpc/mv64x60_pci: replace sscanf by kstrtou32 powerpc/powernv: replace sscanf %lx by kstrtoul 16 powerpc/sysfs: replace sscanf by kstrtol hugetlb: replace sscanf by kstrtoul powerpc/cell: replace sscanf by kstrtouint powerpc/pseries: replace sscanf by kstrtoul arch/powerpc/kernel/fadump.c | 5 +++-- arch/powerpc/kernel/sysfs.c | 7 +++ arch/powerpc/mm/hugetlbpage.c | 2 +- arch/powerpc/platforms/cell/cbe_thermal.c | 4 ++-- arch/powerpc/platforms/powernv/subcore.c | 6 +++--- arch/powerpc/platforms/pseries/power.c| 5 ++--- arch/powerpc/sysdev/mv64x60_pci.c | 7 +-- 7 files changed, 19 insertions(+), 17 deletions(-) -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/7] powerpc: fadump: replace sscanf by kstrtoint
See checkpatch warning Prefer kstrtotype to single variable sscanf Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/kernel/fadump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 742694c..3c40b5f 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -426,6 +426,7 @@ static inline int fadump_gpr_index(u64 id) { int i = -1; char str[3]; + int rc; if ((id GPR_MASK) == REG_ID(GPR)) { /* get the digits at the end */ @@ -434,8 +435,8 @@ static inline int fadump_gpr_index(u64 id) str[2] = '\0'; str[1] = id 0xff; str[0] = (id 8) 0xff; - sscanf(str, %d, i); - if (i 31) + rc = kstrtoint(str, 0, i); + if (rc || i 31) i = -1; } return i; -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 2/7] powerpc/mv64x60_pci: replace sscanf by kstrtou32
See checkpatch warning Prefer kstrtotype to single variable sscanf Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/sysdev/mv64x60_pci.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c index 330d566..ca0b29c 100644 --- a/arch/powerpc/sysdev/mv64x60_pci.c +++ b/arch/powerpc/sysdev/mv64x60_pci.c @@ -52,14 +52,17 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj, { struct pci_dev *phb; u32 v; + int rc; if (off 0) return 0; if (count = 0) return -EINVAL; - if (sscanf(buf, %i, v) != 1) - return -EINVAL; + rc = kstrtou32(buf, 0, v); + + if (rc) + return rc; phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); if (!phb) -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 5/7] hugetlb: replace sscanf by kstrtoul
See checkpatch warning Prefer kstrtotype to single variable sscanf Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 7e70ae9..9118313 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c @@ -350,7 +350,7 @@ static int __init do_gpage_early_setup(char *param, char *val, size = memparse(val, NULL); } else if (strcmp(param, hugepages) == 0) { if (size != 0) { - if (sscanf(val, %lu, npages) = 0) + if (kstrtoul(val, 0, npages)) npages = 0; gpage_npages[shift_to_mmu_psize(__ffs(size))] = npages; size = 0; -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 3/7] powerpc/powernv: replace sscanf %lx by kstrtoul 16
See checkpatch warning Prefer kstrtotype to single variable sscanf Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/platforms/powernv/subcore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c index 894ecb3..79721b2 100644 --- a/arch/powerpc/platforms/powernv/subcore.c +++ b/arch/powerpc/platforms/powernv/subcore.c @@ -337,9 +337,9 @@ static ssize_t __used store_subcores_per_core(struct device *dev, /* We are serialised by the attribute lock */ - rc = sscanf(buf, %lx, val); - if (rc != 1) - return -EINVAL; + rc = kstrtoul(buf, 16, val); + if (rc) + return rc; switch (val) { case 1: -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 4/7] powerpc/sysfs: replace sscanf by kstrtol
See checkpatch warning Prefer kstrtotype to single variable sscanf Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/kernel/sysfs.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 67fd2fd..4293e4f 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c @@ -43,12 +43,11 @@ static ssize_t store_smt_snooze_delay(struct device *dev, size_t count) { struct cpu *cpu = container_of(dev, struct cpu, dev); - ssize_t ret; long snooze; + int rc = kstrtol(buf, 0, snooze); - ret = sscanf(buf, %ld, snooze); - if (ret != 1) - return -EINVAL; + if (rc) + return rc; per_cpu(smt_snooze_delay, cpu-dev.id) = snooze; return count; -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 6/7] powerpc/cell: replace sscanf by kstrtouint
See checkpatch warning Prefer kstrtotype to single variable sscanf Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/platforms/cell/cbe_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c index 2c15ff0..d71c3c4 100644 --- a/arch/powerpc/platforms/cell/cbe_thermal.c +++ b/arch/powerpc/platforms/cell/cbe_thermal.c @@ -129,9 +129,9 @@ static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char u64 new_value; int ret; - ret = sscanf(buf, %u, temp); + ret = kstrtouint(buf, 0, temp); - if (ret != 1 || temp TEMP_MIN || temp TEMP_MAX) + if (ret || temp TEMP_MIN || temp TEMP_MAX) return -EINVAL; new_value = temp_to_reg(temp); -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 7/7] powerpc/pseries: replace sscanf by kstrtoul
See checkpatch warning Prefer kstrtotype to single variable sscanf Signed-off-by: Fabian Frederick f...@skynet.be --- arch/powerpc/platforms/pseries/power.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/pseries/power.c b/arch/powerpc/platforms/pseries/power.c index 6d62662..27a3e9c 100644 --- a/arch/powerpc/platforms/pseries/power.c +++ b/arch/powerpc/platforms/pseries/power.c @@ -38,11 +38,10 @@ static ssize_t auto_poweron_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) { - int ret; unsigned long ups_restart; - ret = sscanf(buf, %lu, ups_restart); + int ret = kstrtoul(buf, 0, ups_restart); - if ((ret == 1) ((ups_restart == 1) || (ups_restart == 0))){ + if ((!ret) ((ups_restart == 1) || (ups_restart == 0))) { rtas_poweron_auto = ups_restart; return n; } -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev