Re: [PATCH 00/25] treewide: Use bool function return values of true/false not 1/0
On Mon, 2015-03-30 at 17:07 -0700, Casey Schaufler wrote: > On 3/30/2015 4:45 PM, Joe Perches wrote: > > Joe Perches (25): > > arm: Use bool function return values of true/false not 1/0 [etc...] > Why, and why these in particular? bool functions are probably better returning bool values instead of 1 and 0. Especially when the functions intermix returning returning 1/0 and true/false. (there are only a couple of those though) These are all the remaining instances in the kernel tree. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0
On Tue, 2015-03-31 at 12:49 +1100, Benjamin Herrenschmidt wrote: > On Mon, 2015-03-30 at 16:46 -0700, Joe Perches wrote: > > Use the normal return values for bool functions > > Acked-by: Benjamin Herrenschmidt > > Should we merge it or will you ? Hey Ben. I don't merge stuff. I just send patches. So, it'll be better if you do it. I'll resend whatever doesn't get picked up in the next couple months on to Andrew Morton. cheers. Joe ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 08/10] perf/hv24x7: Whitespace cleanup
On Mon, 2015-03-30 at 18:53 -0700, Sukadev Bhattiprolu wrote: > Fix minor whitespace damages. If you are going to do whitespace cleaning, please verify the patches with scripts/checkpatch.pl --strict. > diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c [] > @@ -1077,7 +1079,6 @@ static unsigned long single_24x7_request(struct > perf_event *event, u64 *count) > } > > resb = &result_buffer->results[0]; > - > *count = be64_to_cpu(resb->elements[0].element_data[0]); > out: > return ret; Does this deletion make the code easier to read? It might be better just to use: be64 val; ... val = result_buffer->results[0].elements[0].element_data[0]; *count = be64_to_cpu(val); ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RFC 01/10] devres: add devm_alloc_percpu()
On Wed, 2015-04-01 at 19:19 +0300, Madalin Bucur wrote: > Introduce managed counterparts for alloc_percpu() and free_percpu(). > Add devm_alloc_percpu() and devm_free_percpu() into the managed > interfaces list. It'd be nice to add include to these files rather than get included indirectly via module.h > drivers/base/devres.c | 63 > +++ > include/linux/device.h| 19 +++ ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RFC 02/10] dpaa_eth: add support for DPAA Ethernet
On Wed, 2015-04-01 at 19:19 +0300, Madalin Bucur wrote: > This introduces the Freescale Data Path Acceleration Architecture > (DPAA) Ethernet driver (dpaa_eth) that builds upon the DPAA QMan, > BMan, PAMU and FMan drivers to deliver Ethernet connectivity on > the Freescale DPAA QorIQ platforms. trivial notes: > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c [] > @@ -0,0 +1,835 @@ > +/* Copyright 2008 - 2015 Freescale Semiconductor Inc. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > met: > + * * Redistributions of source code must retain the above copyright > + *notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distribution. > + * * Neither the name of Freescale Semiconductor nor the > + *names of its contributors may be used to endorse or promote products > + *derived from this software without specific prior written permission. > + * > + * ALTERNATIVELY, this software may be distributed under the terms of the > + * GNU General Public License ("GPL") as published by the Free Software > + * Foundation, either version 2 of that License or (at your option) any > + * later version. Given this is GPLed here, does the first block need to exist? > +#define pr_fmt(fmt) \ > + KBUILD_MODNAME ": " fmt single line please > +#include /* arp_hdr_len() */ > +#include/* VLAN_HLEN */ > +#include /* struct icmphdr */ > +#include /* struct iphdr */ > +#include /* struct ipv6hdr */ > +#include/* struct udphdr */ > +#include/* struct tcphdr */ > +#include/* net_ratelimit() */ > +#include /* ETH_P_IP and ETH_P_IPV6 */ These comments are pretty unusual and likely incomplete so they're probably not useful. > +static u8 debug = -1; > +module_param(debug, byte, S_IRUGO); > +MODULE_PARM_DESC(debug, "Module/Driver verbosity level"); default on? Likely default off would be better. > +static void _dpa_rx_error(struct net_device *net_dev, > + const struct dpa_priv_s *priv, > + struct dpa_percpu_priv_s *percpu_priv, > + const struct qm_fd *fd, > + u32 fqid) > +{ > + /* limit common, possibly innocuous Rx FIFO Overflow errors' > + * interference with zero-loss convergence benchmark results. > + */ > + if (likely(fd->status & FM_FD_STAT_ERR_PHYSICAL)) > + pr_warn_once("non-zero error counters in fman statistics > (sysfs)\n"); > + else > + if (netif_msg_hw(priv) && net_ratelimit()) > + netdev_err(net_dev, "Err FD status = 0x%08x\n", > +fd->status & FM_FD_STAT_RX_ERRORS); if (netif_msg_(priv)) netdev_(netdev, ...) uses can be written like: netif_(priv, , netdev, ...); So this is perhaps better as if (likely(fd->status & FM_FD_STAT_ERR_PHYSICAL)) pr_warn_once("non-zero error counters in fman statistics (sysfs)\n"); else if (net_ratelimit()) netif_err(priv, hw, net_dev, "Err FD status = 0x%08x\n", fd->status & FM_FD_STAT_RX_ERRORS); > + > + percpu_priv->stats.rx_errors++; > + > + dpa_fd_release(net_dev, fd);, > +} > + > +static void _dpa_tx_error(struct net_device *net_dev, > + const struct dpa_priv_s *priv, > + struct dpa_percpu_priv_s *percpu_priv, > + const struct qm_fd*fd, > + u32fqid) > +{ > + struct sk_buff *skb; > + > + if (netif_msg_hw(priv) && net_ratelimit()) > + netdev_warn(net_dev, "FD status = 0x%08x\n", > + fd->status & FM_FD_STAT_TX_ERRORS); netif_warn(priv, hw, net_dev, etc...); > +static int __cold dpa_eth_priv_stop(struct net_device *net_dev) Use of __cold is pretty unusual in drivers > +static struct dpa_bp * __cold > +dpa_priv_bp_probe(struct device *dev) > +{ > + struct dpa_bp *dpa_bp; > + > + dpa_bp = devm_kzalloc(dev, sizeof(*dpa_bp), GFP_KERNEL); > + if (unlikely(!dpa_bp)) { > + dev_err(dev, "devm_kzalloc() failed\n"); No need for this alloc failure message > +static int dpa_priv_bp_create(struct net_device *net_dev, struct dpa_bp > *dpa_bp, > + size_t count) > +{ > + struct dpa_priv_s *priv = netdev_priv(net_dev); > + int i; > + > + if (netif_msg_probe(priv)) > + dev_dbg(net_dev->dev.parent, > +
Re: [PATCH RFC 06/10] dpaa_eth: add ethtool functionality
On Wed, 2015-04-01 at 19:19 +0300, Madalin Bucur wrote: > Add support for basic ethtool operations. > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c > b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c [] > +static int __cold dpa_get_settings(struct net_device *net_dev, > +struct ethtool_cmd *et_cmd) > +{ > + int _errno; Using a variable name of _errno is misleading at best, (btw: the only return value for phy_ethtool_gset is 0) > +static void __cold dpa_get_drvinfo(struct net_device *net_dev, > +struct ethtool_drvinfo *drvinfo) > +{ > + int _errno; > + > + strncpy(drvinfo->driver, KBUILD_MODNAME, > + sizeof(drvinfo->driver) - 1)[sizeof(drvinfo->driver) - 1] = 0; That's a really odd and unusual construct more commonly written as strlcpy > + _errno = snprintf(drvinfo->version, sizeof(drvinfo->version), Using errno here is especially misleading as that's not the return value of an snprintf ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RFC 10/10] dpaa_eth: add trace points
On Wed, 2015-04-01 at 19:19 +0300, Madalin Bucur wrote: > Add trace points on the hot processing path. more trivia: > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h [] > +#define fd_format_name(format) { qm_fd_##format, #format } > +#define fd_format_list \ > + fd_format_name(contig), \ > + fd_format_name(sg) Are these used anywhere? > +#define TR_FMT "[%s] fqid=%d, fd: addr=0x%llx, format=%s, off=%u, len=%u," \ > + " status=0x%08x" It's nicer to coalesce string fragments. Unless this is intended to be used more than once, perhaps it's better to remove it and use the string directly instead. > + /* This is what gets printed when the trace event is triggered */ > + TP_printk(TR_FMT, > + __get_str(name), __entry->fqid, __entry->fd_addr, > + __print_symbolic(__entry->fd_format, fd_format_list), > + __entry->fd_offset, __entry->fd_length, __entry->fd_status) ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RFC 10/10] dpaa_eth: add trace points
On Fri, 2015-04-03 at 17:29 +, Madalin-Cristian Bucur wrote: > > -Original Message- > > From: Joe Perches [mailto:j...@perches.com] > > > > On Wed, 2015-04-01 at 19:19 +0300, Madalin Bucur wrote: > > > Add trace points on the hot processing path. > > > > more trivia: > > > > > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h > > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h > > [] > > > +#define fd_format_name(format) { qm_fd_##format, #format } > > > +#define fd_format_list \ > > > + fd_format_name(contig), \ > > > + fd_format_name(sg) > > > > Are these used anywhere? > Yes, by the Frame Descriptor print: > > /* This is what gets printed when the trace event is triggered */ > TP_printk(TR_FMT, > __get_str(name), __entry->fqid, __entry->fd_addr, > __print_symbolic(__entry->fd_format, fd_format_list), > // <-- here > __entry->fd_offset, __entry->fd_length, __entry->fd_status) Thanks. I think it's nicer when format and argument match and aren't indirected by macros. Perhaps this would be better as: TP_printk("[%s] fqid=%d, fd: addr=0x%llx, format=%s, off=%u, len=%u, status=0x%08x" __get_str(name), __entry->fqid, __entry->fd_addr, __print_symbolic(__entry->fd_format, fd_format_list), __entry->fd_offset, __entry->fd_length, __entry->fd_status) > Checkpatch seems to be less forgiving if the long string is not in a printk: checkpatch is brainless, people aren't. > WARNING: line over 80 characters > #22: FILE: drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h:47: > +#define TR_FMT "[%s] fqid=%d, fd: addr=0x%llx, format=%s, off=%u, len=%u, > status=0x%08x" That's a checkpatch defect. Thanks. I'll see about fixing it. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] tty: serial: Add const to struct uart_ops declarations
These structs can be const, so make them const. Signed-off-by: Joe Perches --- Done with: sed -r -i -e 's/\bstruct\s+uart_ops\s+(\w+)\s*=\s*/const struct uart_ops \1 = /g' drivers/tty/serial/*.c Compiled x86 only, not cross-compiled. Untested. drivers/tty/serial/21285.c | 2 +- drivers/tty/serial/altera_jtaguart.c| 2 +- drivers/tty/serial/altera_uart.c| 2 +- drivers/tty/serial/amba-pl010.c | 2 +- drivers/tty/serial/amba-pl011.c | 2 +- drivers/tty/serial/apbuart.c| 2 +- drivers/tty/serial/ar933x_uart.c| 2 +- drivers/tty/serial/arc_uart.c | 2 +- drivers/tty/serial/atmel_serial.c | 2 +- drivers/tty/serial/bcm63xx_uart.c | 2 +- drivers/tty/serial/bfin_sport_uart.c| 2 +- drivers/tty/serial/bfin_uart.c | 2 +- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 2 +- drivers/tty/serial/dz.c | 2 +- drivers/tty/serial/efm32-uart.c | 2 +- drivers/tty/serial/fsl_lpuart.c | 4 ++-- drivers/tty/serial/icom.c | 2 +- drivers/tty/serial/imx.c| 2 +- drivers/tty/serial/ioc3_serial.c| 2 +- drivers/tty/serial/ioc4_serial.c| 2 +- drivers/tty/serial/ip22zilog.c | 2 +- drivers/tty/serial/jsm/jsm_tty.c| 2 +- drivers/tty/serial/lantiq.c | 2 +- drivers/tty/serial/lpc32xx_hs.c | 2 +- drivers/tty/serial/m32r_sio.c | 2 +- drivers/tty/serial/max3100.c| 2 +- drivers/tty/serial/men_z135_uart.c | 2 +- drivers/tty/serial/meson_uart.c | 2 +- drivers/tty/serial/mpc52xx_uart.c | 2 +- drivers/tty/serial/mpsc.c | 2 +- drivers/tty/serial/msm_serial.c | 2 +- drivers/tty/serial/mux.c| 2 +- drivers/tty/serial/mxs-auart.c | 2 +- drivers/tty/serial/netx-serial.c| 2 +- drivers/tty/serial/nwpserial.c | 2 +- drivers/tty/serial/omap-serial.c| 2 +- drivers/tty/serial/pch_uart.c | 2 +- drivers/tty/serial/pmac_zilog.c | 2 +- drivers/tty/serial/pnx8xxx_uart.c | 2 +- drivers/tty/serial/pxa.c| 2 +- drivers/tty/serial/sa1100.c | 2 +- drivers/tty/serial/samsung.c| 2 +- drivers/tty/serial/serial-tegra.c | 2 +- drivers/tty/serial/serial_ks8695.c | 2 +- drivers/tty/serial/serial_txx9.c| 2 +- drivers/tty/serial/sh-sci.c | 2 +- drivers/tty/serial/sirfsoc_uart.c | 2 +- drivers/tty/serial/sn_console.c | 2 +- drivers/tty/serial/sprd_serial.c| 2 +- drivers/tty/serial/st-asc.c | 2 +- drivers/tty/serial/sunhv.c | 2 +- drivers/tty/serial/sunsab.c | 2 +- drivers/tty/serial/sunsu.c | 2 +- drivers/tty/serial/sunzilog.c | 2 +- drivers/tty/serial/timbuart.c | 2 +- drivers/tty/serial/uartlite.c | 2 +- drivers/tty/serial/ucc_uart.c | 2 +- drivers/tty/serial/vr41xx_siu.c | 2 +- drivers/tty/serial/vt8500_serial.c | 2 +- drivers/tty/serial/xilinx_uartps.c | 2 +- drivers/tty/serial/zs.c | 2 +- 61 files changed, 62 insertions(+), 62 deletions(-) diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c index 9b208bd..804632b 100644 --- a/drivers/tty/serial/21285.c +++ b/drivers/tty/serial/21285.c @@ -334,7 +334,7 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct return ret; } -static struct uart_ops serial21285_ops = { +static const struct uart_ops serial21285_ops = { .tx_empty = serial21285_tx_empty, .get_mctrl = serial21285_get_mctrl, .set_mctrl = serial21285_set_mctrl, diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index 0fefdd8..668158a1 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -280,7 +280,7 @@ static int altera_jtaguart_verify_port(struct uart_port *port, /* * Define the basic serial functions we support. */ -static struct uart_ops altera_jtaguart_ops = { +static const struct uart_ops altera_jtaguart_ops = { .tx_empty = altera_jtaguart_tx_empty, .get_mctrl = altera_jtaguart_get_mctrl, .set_mctrl = altera_jtaguart_set_mctrl, diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index b2859fe..555b090 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c @@ -404,7 +404,7 @@ static void altera_uart_poll_put_char(struct uart_port *port, unsigned char c) /* * Define the basic serial functions we support. */ -sta
[PATCH V2] tty: serial: Add const to struct uart_ops declarations
These structs can be const, so make them const. Miscellanea: o Add static to struct uart_ops declaration in bfin_sport_uart Signed-off-by: Joe Perches --- On Sun, 2015-04-05 at 00:04 +0200, Stefan Agner wrote: > On 2015-04-04 19:47, Joe Perches wrote: > > Done with: > > sed -r -i -e 's/\bstruct\s+uart_ops\s+(\w+)\s*=\s*/const struct > > uart_ops \1 = /g' drivers/tty/serial/*.c [] > +++ b/drivers/tty/serial/fsl_lpuart.c > Something went wrong in this driver, const is twice... Apologies, thanks for noticing. The sed was mistakenly done twice on that file. V2: o Fix duplicate const in fsl_lpuart.c o Add static to drivers/tty/serial/bfin_sport_uart.c Still compiled only x86 and not cross-compiled or tested. drivers/tty/serial/21285.c | 2 +- drivers/tty/serial/altera_jtaguart.c| 2 +- drivers/tty/serial/altera_uart.c| 2 +- drivers/tty/serial/amba-pl010.c | 2 +- drivers/tty/serial/amba-pl011.c | 2 +- drivers/tty/serial/apbuart.c| 2 +- drivers/tty/serial/ar933x_uart.c| 2 +- drivers/tty/serial/arc_uart.c | 2 +- drivers/tty/serial/atmel_serial.c | 2 +- drivers/tty/serial/bcm63xx_uart.c | 2 +- drivers/tty/serial/bfin_sport_uart.c| 2 +- drivers/tty/serial/bfin_uart.c | 2 +- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 2 +- drivers/tty/serial/dz.c | 2 +- drivers/tty/serial/efm32-uart.c | 2 +- drivers/tty/serial/fsl_lpuart.c | 4 ++-- drivers/tty/serial/icom.c | 2 +- drivers/tty/serial/imx.c| 2 +- drivers/tty/serial/ioc3_serial.c| 2 +- drivers/tty/serial/ioc4_serial.c| 2 +- drivers/tty/serial/ip22zilog.c | 2 +- drivers/tty/serial/jsm/jsm_tty.c| 2 +- drivers/tty/serial/lantiq.c | 2 +- drivers/tty/serial/lpc32xx_hs.c | 2 +- drivers/tty/serial/m32r_sio.c | 2 +- drivers/tty/serial/max3100.c| 2 +- drivers/tty/serial/men_z135_uart.c | 2 +- drivers/tty/serial/meson_uart.c | 2 +- drivers/tty/serial/mpc52xx_uart.c | 2 +- drivers/tty/serial/mpsc.c | 2 +- drivers/tty/serial/msm_serial.c | 2 +- drivers/tty/serial/mux.c| 2 +- drivers/tty/serial/mxs-auart.c | 2 +- drivers/tty/serial/netx-serial.c| 2 +- drivers/tty/serial/nwpserial.c | 2 +- drivers/tty/serial/omap-serial.c| 2 +- drivers/tty/serial/pch_uart.c | 2 +- drivers/tty/serial/pmac_zilog.c | 2 +- drivers/tty/serial/pnx8xxx_uart.c | 2 +- drivers/tty/serial/pxa.c| 2 +- drivers/tty/serial/sa1100.c | 2 +- drivers/tty/serial/samsung.c| 2 +- drivers/tty/serial/serial-tegra.c | 2 +- drivers/tty/serial/serial_ks8695.c | 2 +- drivers/tty/serial/serial_txx9.c| 2 +- drivers/tty/serial/sh-sci.c | 2 +- drivers/tty/serial/sirfsoc_uart.c | 2 +- drivers/tty/serial/sn_console.c | 2 +- drivers/tty/serial/sprd_serial.c| 2 +- drivers/tty/serial/st-asc.c | 2 +- drivers/tty/serial/sunhv.c | 2 +- drivers/tty/serial/sunsab.c | 2 +- drivers/tty/serial/sunsu.c | 2 +- drivers/tty/serial/sunzilog.c | 2 +- drivers/tty/serial/timbuart.c | 2 +- drivers/tty/serial/uartlite.c | 2 +- drivers/tty/serial/ucc_uart.c | 2 +- drivers/tty/serial/vr41xx_siu.c | 2 +- drivers/tty/serial/vt8500_serial.c | 2 +- drivers/tty/serial/xilinx_uartps.c | 2 +- drivers/tty/serial/zs.c | 2 +- 61 files changed, 62 insertions(+), 62 deletions(-) diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c index 9b208bd..804632b 100644 --- a/drivers/tty/serial/21285.c +++ b/drivers/tty/serial/21285.c @@ -334,7 +334,7 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct return ret; } -static struct uart_ops serial21285_ops = { +static const struct uart_ops serial21285_ops = { .tx_empty = serial21285_tx_empty, .get_mctrl = serial21285_get_mctrl, .set_mctrl = serial21285_set_mctrl, diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index 0fefdd8..668158a1 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -280,7 +280,7 @@ static int altera_jtaguart_verify_port(struct uart_port *port, /* * Define the basic serial functions we support. */ -static struct uart_ops altera_jtaguart_ops = { +static const struct uart_ops altera_jtaguart_ops = { .tx_e
Re: [PATCH V2] tty: serial: Add const to struct uart_ops declarations
On Mon, 2015-04-06 at 01:09 +0200, Stefan Agner wrote: > On 2015-04-05 20:24, Joe Perches wrote: > > Still compiled only x86 and not cross-compiled or tested. > > Cross-compiled with multi_v7_defconfig [] > > drivers/tty/serial/fsl_lpuart.c | 4 ++-- > > Tested that driver on actual hardware, looks fine. > This driver seems to alter the startup function on initialization: > > CC drivers/video/of_display_timing.o > ../drivers/tty/serial/samsung.c: In function 's3c24xx_serial_init_port': > ../drivers/tty/serial/samsung.c:1702:3: error: assignment of member > 'startup' in read-only object >s3c24xx_serial_ops.startup = s3c64xx_serial_startup; >^ Thanks Stefan. Then that one can't be const. > That is the only thing which popped up with multi_v7_defconfig. I appreciate the testing. Greg, Jiri, I'll resend with this fixed in a week or so after waiting for any other comment or sign of brokenness. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/2] powerpc: pci-ioda: Remove unnecessary return value from printk
The return value is unnecessary and unused, so make the functions void instead of int. Signed-off-by: Joe Perches --- arch/powerpc/platforms/powernv/pci-ioda.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index df241b1..16bb93f 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -42,12 +42,11 @@ #include "pci.h" #define define_pe_printk_level(func, kern_level) \ -static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...)\ +static void func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ { \ struct va_format vaf; \ va_list args; \ char pfix[32]; \ - int r; \ \ va_start(args, fmt);\ \ @@ -61,12 +60,10 @@ static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ sprintf(pfix, "%04x:%02x ", \ pci_domain_nr(pe->pbus),\ pe->pbus->number); \ - r = printk(kern_level "pci %s: [PE# %.3d] %pV", \ - pfix, pe->pe_number, &vaf); \ + printk(kern_level "pci %s: [PE# %.3d] %pV", \ + pfix, pe->pe_number, &vaf); \ \ va_end(args); \ - \ - return r; \ } \ define_pe_printk_level(pe_err, KERN_ERR); -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 0/2] powerpc: pci-ioda: Neatening
printk calls should return void Joe Perches (2): powerpc: pci-ioda: Remove unnecessary return value from printk powerpc: pci-ioda: Use a single function to emit logging messages (compiled/untested) arch/powerpc/platforms/powernv/pci-ioda.c | 61 +++ 1 file changed, 30 insertions(+), 31 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 2/2] powerpc: pci-ioda: Use a single function to emit logging messages
No need for 3 functions when a single one will do. Modify the function declaring macros to call the single function. Reduces object code size a little: $ size arch/powerpc/platforms/powernv/pci-ioda.o* textdata bss dec hex filename 2230310736680 300567568 arch/powerpc/platforms/powernv/pci-ioda.o.new 2284011216776 307377811 arch/powerpc/platforms/powernv/pci-ioda.o.old Signed-off-by: Joe Perches --- arch/powerpc/platforms/powernv/pci-ioda.c | 58 --- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 16bb93f..b0d31083 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -41,34 +41,36 @@ #include "powernv.h" #include "pci.h" -#define define_pe_printk_level(func, kern_level) \ -static void func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ -{ \ - struct va_format vaf; \ - va_list args; \ - char pfix[32]; \ - \ - va_start(args, fmt);\ - \ - vaf.fmt = fmt; \ - vaf.va = &args; \ - \ - if (pe->pdev) \ - strlcpy(pfix, dev_name(&pe->pdev->dev), \ - sizeof(pfix)); \ - else\ - sprintf(pfix, "%04x:%02x ", \ - pci_domain_nr(pe->pbus),\ - pe->pbus->number); \ - printk(kern_level "pci %s: [PE# %.3d] %pV", \ - pfix, pe->pe_number, &vaf); \ - \ - va_end(args); \ -} \ - -define_pe_printk_level(pe_err, KERN_ERR); -define_pe_printk_level(pe_warn, KERN_WARNING); -define_pe_printk_level(pe_info, KERN_INFO); +static void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level, + const char *fmt, ...) +{ + struct va_format vaf; + va_list args; + char pfix[32]; + + va_start(args, fmt); + + vaf.fmt = fmt; + vaf.va = &args; + + if (pe->pdev) + strlcpy(pfix, dev_name(&pe->pdev->dev), sizeof(pfix)); + else + sprintf(pfix, "%04x:%02x ", + pci_domain_nr(pe->pbus), pe->pbus->number); + + printk("%spci %s: [PE# %.3d] %pV", + level, pfix, pe->pe_number, &vaf); + + va_end(args); +} + +#define pe_err(pe, fmt, ...) \ + pe_level_printk(pe, KERN_ERR, fmt, ##__VA_ARGS__) +#define pe_warn(pe, fmt, ...) \ + pe_level_printk(pe, KERN_WARNING, fmt, ##__VA_ARGS__) +#define pe_info(pe, fmt, ...) \ + pe_level_printk(pe, KERN_INFO, fmt, ##__VA_ARGS__) /* * stdcix is only supposed to be used in hypervisor real mode as per -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] tty: pr_warning->pr_warn and logging neatening
Convert the pr_warning to the more common pr_warn. Other miscellanea: o Convert unusual PR_FMT define and uses to pr_fmt o Remove unnecessary OOM message o Fix grammar in an error message o Convert a pr_warning with a KERN_ERR to pr_err Signed-off-by: Joe Perches --- drivers/tty/ehv_bytechan.c | 4 ++-- drivers/tty/hvc/hvcs.c | 2 +- drivers/tty/isicom.c | 14 +++--- drivers/tty/serial/bfin_sport_uart.c | 5 +++-- drivers/tty/serial/mfd.c | 2 +- drivers/tty/serial/mrst_max3110.c| 27 --- drivers/tty/vt/keyboard.c| 6 +++--- drivers/tty/vt/vt.c | 4 ++-- 8 files changed, 31 insertions(+), 33 deletions(-) diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c index 4f485e8..9d29d7e 100644 --- a/drivers/tty/ehv_bytechan.c +++ b/drivers/tty/ehv_bytechan.c @@ -309,8 +309,8 @@ static int __init ehv_bc_console_init(void) * handle for udbg. */ if (stdout_bc != CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE) - pr_warning("ehv-bc: udbg handle %u is not the stdout handle\n", - CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE); + pr_warn("ehv-bc: udbg handle %u is not the stdout handle\n", + CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE); #endif /* add_preferred_console() must be called before register_console(), diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index 81e939e..00bec633 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -1575,7 +1575,7 @@ static int __init hvcs_module_init(void) */ rc = driver_create_file(&(hvcs_vio_driver.driver), &driver_attr_rescan); if (rc) - pr_warning(KERN_ERR "HVCS: Failed to create rescan file (err %d)\n", rc); + pr_err("HVCS: Failed to create rescan file (err %d)\n", rc); return 0; } diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c index 858291c..59ed783 100644 --- a/drivers/tty/isicom.c +++ b/drivers/tty/isicom.c @@ -249,7 +249,7 @@ static int lock_card(struct isi_board *card) spin_unlock_irqrestore(&card->card_lock, card->flags); msleep(10); } - pr_warning("Failed to lock Card (0x%lx)\n", card->base); + pr_warn("Failed to lock Card (0x%lx)\n", card->base); return 0; /* Failed to acquire the card! */ } @@ -378,13 +378,13 @@ static inline int __isicom_paranoia_check(struct isi_port const *port, char *name, const char *routine) { if (!port) { - pr_warning("Warning: bad isicom magic for dev %s in %s.\n", - name, routine); + pr_warn("Warning: bad isicom magic for dev %s in %s\n", + name, routine); return 1; } if (port->magic != ISICOM_MAGIC) { - pr_warning("Warning: NULL isicom port for dev %s in %s.\n", - name, routine); + pr_warn("Warning: NULL isicom port for dev %s in %s\n", + name, routine); return 1; } @@ -546,8 +546,8 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id) byte_count = header & 0xff; if (channel + 1 > card->port_count) { - pr_warning("%s(0x%lx): %d(channel) > port_count.\n", - __func__, base, channel+1); + pr_warn("%s(0x%lx): %d(channel) > port_count\n", + __func__, base, channel + 1); outw(0x, base+0x04); /* enable interrupts */ spin_unlock(&card->card_lock); return IRQ_HANDLED; diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c index d62d8da..67d4083 100644 --- a/drivers/tty/serial/bfin_sport_uart.c +++ b/drivers/tty/serial/bfin_sport_uart.c @@ -517,14 +517,15 @@ static void sport_set_termios(struct uart_port *port, up->csize = 5; break; default: - pr_warning("requested word length not supported\n"); + pr_warn("requested word length not supported\n"); + break; } if (termios->c_cflag & CSTOPB) { up->stopb = 1; } if (termios->c_cflag & PARENB) { - pr_warning("PAREN bits is not supported yet\n"); + pr_warn("PAREN bit is not supported yet\n"); /* up->parib = 1; */ } diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c index 445799d..e1f4fda 100644 --- a/drivers/tty/serial/mfd.c +++ b/drivers/tty/serial/mfd.c @@ -1371,7 +1371,7 @@ static vo
Re: [PATCH] powerpc/pseries: use 'true' instead of '1' for orderly_poweroff
On Thu, 2013-05-30 at 15:07 +0800, liguang wrote: > orderly_poweroff is expecting a bool parameter, so > use 'ture' instead '1' [] > diff --git a/arch/powerpc/platforms/pseries/ras.c > b/arch/powerpc/platforms/pseries/ras.c [] > @@ -162,7 +162,7 @@ void rtas_parse_epow_errlog(struct rtas_error_log *log) > > case EPOW_SYSTEM_HALT: > pr_emerg("Firmware initiated power off"); > - orderly_poweroff(1); > + orderly_poweroff(ture); > break; Compile your patches _before_ submitting them please. "true" not "ture" here and in the commit message. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[Trivial PATCH 00/33] Remove uses of typedef ctl_table
It's clearer to use struct ctl_table instead Joe Perches (33): arm: kernel: isa: Convert use of typedef ctl_table to struct ctl_table frv: Convert use of typedef ctl_table to struct ctl_table ia64: crash: Convert use of typedef ctl_table to struct ctl_table mips: lasat: sysctl: Convert use of typedef ctl_table to struct ctl_table powerpc: idle: Convert use of typedef ctl_table to struct ctl_table s390: Convert use of typedef ctl_table to struct ctl_table tile: proc: Convert use of typedef ctl_table to struct ctl_table x86: vdso: Convert use of typedef ctl_table to struct ctl_table cdrom: Convert use of typedef ctl_table to struct ctl_table char: Convert use of typedef ctl_table to struct ctl_table infiniband: Convert use of typedef ctl_table to struct ctl_table macintosh: Convert use of typedef ctl_table to struct ctl_table md: Convert use of typedef ctl_table to struct ctl_table sgi: xpc: Convert use of typedef ctl_table to struct ctl_table parport: Convert use of typedef ctl_table to struct ctl_table scsi_sysctl: Convert use of typedef ctl_table to struct ctl_table coda: Convert use of typedef ctl_table to struct ctl_table fscache: Convert use of typedef ctl_table to struct ctl_table lockd: Convert use of typedef ctl_table to struct ctl_table nfs: Convert use of typedef ctl_table to struct ctl_table inotify: Convert use of typedef ctl_table to struct ctl_table ntfs: Convert use of typedef ctl_table to struct ctl_table ocfs2: Convert use of typedef ctl_table to struct ctl_table quota: Convert use of typedef ctl_table to struct ctl_table xfs: Convert use of typedef ctl_table to struct ctl_table fs: Convert use of typedef ctl_table to struct ctl_table key: Convert use of typedef ctl_table to struct ctl_table ipv6: Convert use of typedef ctl_table to struct ctl_table ndisc: Convert use of typedef ctl_table to struct ctl_table ipc: Convert use of typedef ctl_table to struct ctl_table sysctl: Convert use of typedef ctl_table to struct ctl_table mm: Convert use of typedef ctl_table to struct ctl_table security: keys: Convert use of typedef ctl_table to struct ctl_table arch/arm/kernel/isa.c | 6 ++-- arch/frv/kernel/pm.c | 8 +++--- arch/frv/kernel/sysctl.c | 4 +-- arch/ia64/kernel/crash.c | 4 +-- arch/ia64/kernel/perfmon.c | 6 ++-- arch/mips/lasat/sysctl.c | 14 - arch/powerpc/kernel/idle.c | 4 +-- arch/s390/appldata/appldata_base.c | 16 +-- arch/s390/kernel/debug.c | 4 +-- arch/s390/mm/cmm.c | 6 ++-- arch/tile/kernel/proc.c| 4 +-- arch/x86/vdso/vdso32-setup.c | 4 +-- drivers/cdrom/cdrom.c | 10 +++ drivers/char/hpet.c| 6 ++-- drivers/char/ipmi/ipmi_poweroff.c | 6 ++-- drivers/char/random.c | 8 +++--- drivers/char/rtc.c | 6 ++-- drivers/infiniband/core/ucma.c | 2 +- drivers/macintosh/mac_hid.c| 8 +++--- drivers/md/md.c| 6 ++-- drivers/misc/sgi-xp/xpc_main.c | 6 ++-- drivers/parport/procfs.c | 58 +++--- drivers/scsi/scsi_sysctl.c | 6 ++-- fs/coda/sysctl.c | 4 +-- fs/dcache.c| 2 +- fs/drop_caches.c | 2 +- fs/eventpoll.c | 2 +- fs/file_table.c| 4 +-- fs/fscache/main.c | 4 +-- fs/inode.c | 2 +- fs/lockd/svc.c | 6 ++-- fs/nfs/nfs4sysctl.c| 6 ++-- fs/nfs/sysctl.c| 6 ++-- fs/notify/inotify/inotify_user.c | 2 +- fs/ntfs/sysctl.c | 4 +-- fs/ocfs2/stackglue.c | 8 +++--- fs/quota/dquot.c | 6 ++-- fs/xfs/xfs_sysctl.c| 26 - include/linux/key.h| 2 +- include/net/ipv6.h | 4 +-- include/net/ndisc.h| 2 +- ipc/ipc_sysctl.c | 14 - ipc/mq_sysctl.c| 10 +++ kernel/sysctl.c| 2 +- kernel/utsname_sysctl.c| 6 ++-- mm/page-writeback.c| 2 +- mm/page_alloc.c| 15 +- security/keys/sysctl.c | 2 +- 48 files changed, 174 insertions(+), 171 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[Trivial PATCH 05/33] powerpc: idle: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- arch/powerpc/kernel/idle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c index 939ea7e..d7216c9 100644 --- a/arch/powerpc/kernel/idle.c +++ b/arch/powerpc/kernel/idle.c @@ -85,7 +85,7 @@ int powersave_nap; /* * Register the sysctl to set/clear powersave_nap. */ -static ctl_table powersave_nap_ctl_table[]={ +static struct ctl_table powersave_nap_ctl_table[] = { { .procname = "powersave-nap", .data = &powersave_nap, @@ -95,7 +95,7 @@ static ctl_table powersave_nap_ctl_table[]={ }, {} }; -static ctl_table powersave_nap_sysctl_root[] = { +static struct ctl_table powersave_nap_sysctl_root[] = { { .procname = "kernel", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[Trivial PATCH 12/33] macintosh: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- drivers/macintosh/mac_hid.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index 6a82388..80d30e8 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c @@ -181,7 +181,7 @@ static void mac_hid_stop_emulation(void) mac_hid_destroy_emumouse(); } -static int mac_hid_toggle_emumouse(ctl_table *table, int write, +static int mac_hid_toggle_emumouse(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { @@ -214,7 +214,7 @@ static int mac_hid_toggle_emumouse(ctl_table *table, int write, } /* file(s) in /proc/sys/dev/mac_hid */ -static ctl_table mac_hid_files[] = { +static struct ctl_table mac_hid_files[] = { { .procname = "mouse_button_emulation", .data = &mouse_emulate_buttons, @@ -240,7 +240,7 @@ static ctl_table mac_hid_files[] = { }; /* dir in /proc/sys/dev */ -static ctl_table mac_hid_dir[] = { +static struct ctl_table mac_hid_dir[] = { { .procname = "mac_hid", .maxlen = 0, @@ -251,7 +251,7 @@ static ctl_table mac_hid_dir[] = { }; /* /proc/sys/dev itself, in case that is not there yet */ -static ctl_table mac_hid_root_dir[] = { +static struct ctl_table mac_hid_root_dir[] = { { .procname = "dev", .maxlen = 0, -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 25/45] staging/octeon: Use get/put_online_cpus_atomic() to prevent CPU offline
On Mon, 2013-06-24 at 00:25 +0530, Srivatsa S. Bhat wrote: > On 06/23/2013 11:47 PM, Greg Kroah-Hartman wrote: > > On Sun, Jun 23, 2013 at 07:13:33PM +0530, Srivatsa S. Bhat wrote: [] > >> diff --git a/drivers/staging/octeon/ethernet-rx.c > >> b/drivers/staging/octeon/ethernet-rx.c [] > Honestly, I don't know. Let's CC the author of that code (David Daney). > I wonder why get_maintainer.pl didn't generate his name for this file, > even though the entire file is almost made up of his commits alone! Because by default, get_maintainer looks for a matching file entry in MAINTAINERS. Failing that, it looks at one year of git history. In this case, no work has been done on the file for quite awhile. --git-blame can be added to the get_maintainer.pl command line to look for % of authorship by line and commit count. Adding --git-blame can take a long time to run, that's why it's not on by default. Also, very old history can give invalid email addresses as people move around and email addresses decay. If you always want to find original authors, you could use a .get_maintainer.conf file with --git-blame in it. $ time ./scripts/get_maintainer.pl --git-blame -f drivers/staging/octeon/ethernet-tx.c Greg Kroah-Hartman (supporter:STAGING SUBSYSTEM,commits:4/16=25%) David Daney (authored lines:711/725=98%,commits:13/16=81%) Ralf Baechle (commits:11/16=69%) Eric Dumazet (commits:2/16=12%) Andrew Morton (commits:1/16=6%) de...@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) linux-ker...@vger.kernel.org (open list) real0m16.853s user0m16.088s sys 0m0.444s ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] hashtable: add hash_for_each_possible_rcu_notrace()
On Tue, 2013-07-23 at 12:28 +1000, Alexey Kardashevskiy wrote: > Anyone, ping. Is it good, bad, ugly (ack/nack)? Thanks! > > Is there any "trivial patches" list? Could not find it on vger. Jiri Kosina has triv...@kernel.org Also, there's kernel-janitors http://vger.kernel.org/vger-lists.html#kernel-janitors http://kernelnewbies.org/KernelJanitors MAINTAINERS has an entry: TRIVIAL PATCHES M: Jiri Kosina T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git S: Maintained K: ^Subject:.*(?i)trivial ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] hashtable: add hash_for_each_possible_rcu_notrace()
On Tue, 2013-07-23 at 12:43 +1000, Alexey Kardashevskiy wrote: > On 07/23/2013 12:41 PM, Joe Perches wrote: > > On Tue, 2013-07-23 at 12:28 +1000, Alexey Kardashevskiy wrote: > >> Anyone, ping. Is it good, bad, ugly (ack/nack)? Thanks! > >> Is there any "trivial patches" list? Could not find it on vger. [] > > MAINTAINERS has an entry: > > TRIVIAL PATCHES > > M: Jiri Kosina > > T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git [] > Cool, thanks! But is that patch really trivial? :) :) Was that the question? Anyway, you cc'd all the right people already. If no one responds after a couple weeks, either send it to Jiri or directly to Linus. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 0/3] networking: Use ETH_ALEN where appropriate
Convert the uses mac addresses to ETH_ALEN so it's easier to find and verify where mac addresses need to be __aligned(2) Joe Perches (3): uapi: Convert some uses of 6 to ETH_ALEN include: Convert ethernet mac address declarations to use ETH_ALEN ethernet: Convert mac address uses of 6 to ETH_ALEN drivers/net/ethernet/8390/ax88796.c| 4 +- drivers/net/ethernet/amd/pcnet32.c | 6 +-- drivers/net/ethernet/broadcom/cnic_if.h| 6 +-- drivers/net/ethernet/dec/tulip/tulip_core.c| 8 +-- drivers/net/ethernet/i825xx/sun3_82586.h | 4 +- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +- drivers/net/ethernet/nuvoton/w90p910_ether.c | 4 +- drivers/net/ethernet/pasemi/pasemi_mac.c | 13 ++--- drivers/net/ethernet/pasemi/pasemi_mac.h | 4 +- drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 4 +- drivers/net/ethernet/qlogic/qlge/qlge.h| 2 +- include/acpi/actbl2.h | 4 +- include/linux/dm9000.h | 4 +- include/linux/fs_enet_pd.h | 3 +- include/linux/ieee80211.h | 59 +++--- include/linux/mlx4/device.h| 11 ++-- include/linux/mlx4/qp.h| 5 +- include/linux/mv643xx_eth.h| 3 +- include/linux/sh_eth.h | 3 +- include/linux/smsc911x.h | 3 +- include/linux/uwb/spec.h | 5 +- include/media/tveeprom.h | 4 +- include/net/irda/irlan_common.h| 3 +- include/uapi/linux/dn.h| 3 +- include/uapi/linux/if_bridge.h | 3 +- include/uapi/linux/netfilter_bridge/ebt_802_3.h| 5 +- include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h | 3 +- include/uapi/linux/virtio_net.h| 2 +- include/uapi/linux/wimax/i2400m.h | 4 +- 29 files changed, 103 insertions(+), 81 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 2/3] include: Convert ethernet mac address declarations to use ETH_ALEN
It's convenient to have ethernet mac addresses use ETH_ALEN to be able to grep for them a bit easier and also to ensure that the addresses are __aligned(2). Add #include as necessary. Signed-off-by: Joe Perches --- include/acpi/actbl2.h | 4 ++- include/linux/dm9000.h | 4 ++- include/linux/fs_enet_pd.h | 3 ++- include/linux/ieee80211.h | 59 + include/linux/mlx4/device.h | 11 include/linux/mlx4/qp.h | 5 ++-- include/linux/mv643xx_eth.h | 3 ++- include/linux/sh_eth.h | 3 ++- include/linux/smsc911x.h| 3 ++- include/linux/uwb/spec.h| 5 ++-- include/media/tveeprom.h| 4 ++- include/net/irda/irlan_common.h | 3 ++- 12 files changed, 61 insertions(+), 46 deletions(-) diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index ffaac0e..3f0f11c 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -44,6 +44,8 @@ #ifndef __ACTBL2_H__ #define __ACTBL2_H__ +#include + /*** * * Additional ACPI Tables (2) @@ -605,7 +607,7 @@ struct acpi_ibft_nic { u8 secondary_dns[16]; u8 dhcp[16]; u16 vlan; - u8 mac_address[6]; + u8 mac_address[ETH_ALEN]; u16 pci_address; u16 name_length; u16 name_offset; diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h index 96e8769..841925f 100644 --- a/include/linux/dm9000.h +++ b/include/linux/dm9000.h @@ -14,6 +14,8 @@ #ifndef __DM9000_PLATFORM_DATA #define __DM9000_PLATFORM_DATA __FILE__ +#include + /* IO control flags */ #define DM9000_PLATF_8BITONLY (0x0001) @@ -27,7 +29,7 @@ struct dm9000_plat_data { unsigned intflags; - unsigned char dev_addr[6]; + unsigned char dev_addr[ETH_ALEN]; /* allow replacement IO routines */ diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index 51b7934..343d82a 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h @@ -18,6 +18,7 @@ #include #include +#include #include #define FS_ENET_NAME "fs_enet" @@ -135,7 +136,7 @@ struct fs_platform_info { const struct fs_mii_bus_info *bus_info; int rx_ring, tx_ring; /* number of buffers on rx */ - __u8 macaddr[6];/* mac address */ + __u8 macaddr[ETH_ALEN]; /* mac address */ int rx_copybreak; /* limit we copy small frames */ int use_napi; /* use NAPI*/ int napi_weight;/* NAPI weight */ diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index b0dc87a..4e101af 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -16,6 +16,7 @@ #define LINUX_IEEE80211_H #include +#include #include /* @@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2) struct ieee80211_hdr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; - u8 addr4[6]; + u8 addr4[ETH_ALEN]; } __packed __aligned(2); struct ieee80211_hdr_3addr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; } __packed __aligned(2); struct ieee80211_qos_hdr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; __le16 qos_ctrl; } __packed __aligned(2); @@ -608,8 +609,8 @@ struct ieee80211s_hdr { u8 flags; u8 ttl; __le32 seqnum; - u8 eaddr1[6]; - u8 eaddr2[6]; + u8 eaddr1[ETH_ALEN]; + u8 eaddr2[ETH_ALEN]; } __packed __aligned(2); /* Mesh flags */ @@ -758,7 +759,7 @@ struct ieee80211_rann_ie { u8 rann_flags; u8 rann_hopcount; u8 rann_ttl; - u8 rann_addr[6]; + u8 rann_addr[ETH_ALEN]; __le32 rann_seq; __le32 rann_interval; __le32 rann_metric; @@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits { struct ieee80211_mgmt { __le16 frame_control; __le16 duration; - u8 da[6]; - u8 sa[6]; - u8 bssid[6]; + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + u8 bssid[ETH_ALEN]; __le16 seq_ctrl; union { struct { @@ -833,7 +834,7 @@ struct ieee80211_mgmt { struct { __le16 capab_info; __le16 listen_interval; -
Re: [PATCH 2/3] include: Convert ethernet mac address declarations to use ETH_ALEN
On Mon, 2013-07-29 at 13:59 +0200, Rafael J. Wysocki wrote: > On Sunday, July 28, 2013 10:29:04 PM Joe Perches wrote: > > It's convenient to have ethernet mac addresses use > > ETH_ALEN to be able to grep for them a bit easier and > > also to ensure that the addresses are __aligned(2). [] > > diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h [] > > @@ -44,6 +44,8 @@ [] > > +#include > > + [] > > @@ -605,7 +607,7 @@ struct acpi_ibft_nic { [] > > - u8 mac_address[6]; > > + u8 mac_address[ETH_ALEN]; > Please don't touch this file. > > It comes from a code base outside of the kernel and should be kept in sync > with > the upstream. Which files in include/acpi have this characteristic? Perhaps an include/acpi/README is appropriate. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH V2 0/3] networking: Use ETH_ALEN where appropriate
Convert the uses mac addresses to ETH_ALEN so it's easier to find and verify where mac addresses need to be __aligned(2) Change from initial submission: - Remove include/acpi/actbl2.h conversion It's a file copied from outside ACPI sources Joe Perches (3): uapi: Convert some uses of 6 to ETH_ALEN include: Convert ethernet mac address declarations to use ETH_ALEN ethernet: Convert mac address uses of 6 to ETH_ALEN drivers/net/ethernet/8390/ax88796.c| 4 +- drivers/net/ethernet/amd/pcnet32.c | 6 +-- drivers/net/ethernet/broadcom/cnic_if.h| 6 +-- drivers/net/ethernet/dec/tulip/tulip_core.c| 8 +-- drivers/net/ethernet/i825xx/sun3_82586.h | 4 +- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +- drivers/net/ethernet/nuvoton/w90p910_ether.c | 4 +- drivers/net/ethernet/pasemi/pasemi_mac.c | 13 ++--- drivers/net/ethernet/pasemi/pasemi_mac.h | 4 +- drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 4 +- drivers/net/ethernet/qlogic/qlge/qlge.h| 2 +- include/linux/dm9000.h | 4 +- include/linux/fs_enet_pd.h | 3 +- include/linux/ieee80211.h | 59 +++--- include/linux/mlx4/device.h| 11 ++-- include/linux/mlx4/qp.h| 5 +- include/linux/mv643xx_eth.h| 3 +- include/linux/sh_eth.h | 3 +- include/linux/smsc911x.h | 3 +- include/linux/uwb/spec.h | 5 +- include/media/tveeprom.h | 4 +- include/net/irda/irlan_common.h| 3 +- include/uapi/linux/dn.h| 3 +- include/uapi/linux/if_bridge.h | 3 +- include/uapi/linux/netfilter_bridge/ebt_802_3.h| 5 +- include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h | 3 +- include/uapi/linux/virtio_net.h| 2 +- include/uapi/linux/wimax/i2400m.h | 4 +- 28 files changed, 100 insertions(+), 80 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH V2 2/3] include: Convert ethernet mac address declarations to use ETH_ALEN
It's convenient to have ethernet mac addresses use ETH_ALEN to be able to grep for them a bit easier and also to ensure that the addresses are __aligned(2). Add #include as necessary. Signed-off-by: Joe Perches Acked-by: Mauro Carvalho Chehab --- include/linux/dm9000.h | 4 ++- include/linux/fs_enet_pd.h | 3 ++- include/linux/ieee80211.h | 59 + include/linux/mlx4/device.h | 11 include/linux/mlx4/qp.h | 5 ++-- include/linux/mv643xx_eth.h | 3 ++- include/linux/sh_eth.h | 3 ++- include/linux/smsc911x.h| 3 ++- include/linux/uwb/spec.h| 5 ++-- include/media/tveeprom.h| 4 ++- include/net/irda/irlan_common.h | 3 ++- 11 files changed, 58 insertions(+), 45 deletions(-) diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h index 96e8769..841925f 100644 --- a/include/linux/dm9000.h +++ b/include/linux/dm9000.h @@ -14,6 +14,8 @@ #ifndef __DM9000_PLATFORM_DATA #define __DM9000_PLATFORM_DATA __FILE__ +#include + /* IO control flags */ #define DM9000_PLATF_8BITONLY (0x0001) @@ -27,7 +29,7 @@ struct dm9000_plat_data { unsigned intflags; - unsigned char dev_addr[6]; + unsigned char dev_addr[ETH_ALEN]; /* allow replacement IO routines */ diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index 51b7934..343d82a 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h @@ -18,6 +18,7 @@ #include #include +#include #include #define FS_ENET_NAME "fs_enet" @@ -135,7 +136,7 @@ struct fs_platform_info { const struct fs_mii_bus_info *bus_info; int rx_ring, tx_ring; /* number of buffers on rx */ - __u8 macaddr[6];/* mac address */ + __u8 macaddr[ETH_ALEN]; /* mac address */ int rx_copybreak; /* limit we copy small frames */ int use_napi; /* use NAPI*/ int napi_weight;/* NAPI weight */ diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index b0dc87a..4e101af 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -16,6 +16,7 @@ #define LINUX_IEEE80211_H #include +#include #include /* @@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2) struct ieee80211_hdr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; - u8 addr4[6]; + u8 addr4[ETH_ALEN]; } __packed __aligned(2); struct ieee80211_hdr_3addr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; } __packed __aligned(2); struct ieee80211_qos_hdr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; __le16 qos_ctrl; } __packed __aligned(2); @@ -608,8 +609,8 @@ struct ieee80211s_hdr { u8 flags; u8 ttl; __le32 seqnum; - u8 eaddr1[6]; - u8 eaddr2[6]; + u8 eaddr1[ETH_ALEN]; + u8 eaddr2[ETH_ALEN]; } __packed __aligned(2); /* Mesh flags */ @@ -758,7 +759,7 @@ struct ieee80211_rann_ie { u8 rann_flags; u8 rann_hopcount; u8 rann_ttl; - u8 rann_addr[6]; + u8 rann_addr[ETH_ALEN]; __le32 rann_seq; __le32 rann_interval; __le32 rann_metric; @@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits { struct ieee80211_mgmt { __le16 frame_control; __le16 duration; - u8 da[6]; - u8 sa[6]; - u8 bssid[6]; + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + u8 bssid[ETH_ALEN]; __le16 seq_ctrl; union { struct { @@ -833,7 +834,7 @@ struct ieee80211_mgmt { struct { __le16 capab_info; __le16 listen_interval; - u8 current_ap[6]; + u8 current_ap[ETH_ALEN]; /* followed by SSID and Supported rates */ u8 variable[0]; } __packed reassoc_req; @@ -966,21 +967,21 @@ struct ieee80211_vendor_ie { struct ieee80211_rts { __le16 frame_control; __le16 duration; - u8 ra[6]; - u8 ta[6]; + u8 ra[ETH_ALEN]; + u8 ta[ETH_ALEN]; } __packed __aligned(2); struct ieee80211_cts { __le16 frame_control; __le16 duration; - u8 ra[6]; + u8 ra[ETH_ALEN]; } __packed __aligne
[PATCH V3 0/3] networking: Use ETH_ALEN where appropriate
Convert the uses mac addresses to ETH_ALEN so it's easier to find and verify where mac addresses need to be __aligned(2) Change in V2: - Remove include/acpi/actbl2.h conversion It's a file copied from outside ACPI sources Changes in V3: - Don't move the pasemi_mac.h mac address to be aligned(2) Just note that it's unaligned. Joe Perches (3): uapi: Convert some uses of 6 to ETH_ALEN include: Convert ethernet mac address declarations to use ETH_ALEN ethernet: Convert mac address uses of 6 to ETH_ALEN drivers/net/ethernet/8390/ax88796.c| 4 +- drivers/net/ethernet/amd/pcnet32.c | 6 +-- drivers/net/ethernet/broadcom/cnic_if.h| 6 +-- drivers/net/ethernet/dec/tulip/tulip_core.c| 8 +-- drivers/net/ethernet/i825xx/sun3_82586.h | 4 +- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +- drivers/net/ethernet/nuvoton/w90p910_ether.c | 4 +- drivers/net/ethernet/pasemi/pasemi_mac.c | 13 ++--- drivers/net/ethernet/pasemi/pasemi_mac.h | 2 +- drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 4 +- drivers/net/ethernet/qlogic/qlge/qlge.h| 2 +- include/linux/dm9000.h | 4 +- include/linux/fs_enet_pd.h | 3 +- include/linux/ieee80211.h | 59 +++--- include/linux/mlx4/device.h| 11 ++-- include/linux/mlx4/qp.h| 5 +- include/linux/mv643xx_eth.h| 3 +- include/linux/sh_eth.h | 3 +- include/linux/smsc911x.h | 3 +- include/linux/uwb/spec.h | 5 +- include/media/tveeprom.h | 4 +- include/net/irda/irlan_common.h| 3 +- include/uapi/linux/dn.h| 3 +- include/uapi/linux/if_bridge.h | 3 +- include/uapi/linux/netfilter_bridge/ebt_802_3.h| 5 +- include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h | 3 +- include/uapi/linux/virtio_net.h| 2 +- include/uapi/linux/wimax/i2400m.h | 4 +- 28 files changed, 99 insertions(+), 79 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH V3 2/3] include: Convert ethernet mac address declarations to use ETH_ALEN
It's convenient to have ethernet mac addresses use ETH_ALEN to be able to grep for them a bit easier and also to ensure that the addresses are __aligned(2). Add #include as necessary. Signed-off-by: Joe Perches Acked-by: Mauro Carvalho Chehab --- include/linux/dm9000.h | 4 ++- include/linux/fs_enet_pd.h | 3 ++- include/linux/ieee80211.h | 59 + include/linux/mlx4/device.h | 11 include/linux/mlx4/qp.h | 5 ++-- include/linux/mv643xx_eth.h | 3 ++- include/linux/sh_eth.h | 3 ++- include/linux/smsc911x.h| 3 ++- include/linux/uwb/spec.h| 5 ++-- include/media/tveeprom.h| 4 ++- include/net/irda/irlan_common.h | 3 ++- 11 files changed, 58 insertions(+), 45 deletions(-) diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h index 96e8769..841925f 100644 --- a/include/linux/dm9000.h +++ b/include/linux/dm9000.h @@ -14,6 +14,8 @@ #ifndef __DM9000_PLATFORM_DATA #define __DM9000_PLATFORM_DATA __FILE__ +#include + /* IO control flags */ #define DM9000_PLATF_8BITONLY (0x0001) @@ -27,7 +29,7 @@ struct dm9000_plat_data { unsigned intflags; - unsigned char dev_addr[6]; + unsigned char dev_addr[ETH_ALEN]; /* allow replacement IO routines */ diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index 51b7934..343d82a 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h @@ -18,6 +18,7 @@ #include #include +#include #include #define FS_ENET_NAME "fs_enet" @@ -135,7 +136,7 @@ struct fs_platform_info { const struct fs_mii_bus_info *bus_info; int rx_ring, tx_ring; /* number of buffers on rx */ - __u8 macaddr[6];/* mac address */ + __u8 macaddr[ETH_ALEN]; /* mac address */ int rx_copybreak; /* limit we copy small frames */ int use_napi; /* use NAPI*/ int napi_weight;/* NAPI weight */ diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index b0dc87a..4e101af 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -16,6 +16,7 @@ #define LINUX_IEEE80211_H #include +#include #include /* @@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2) struct ieee80211_hdr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; - u8 addr4[6]; + u8 addr4[ETH_ALEN]; } __packed __aligned(2); struct ieee80211_hdr_3addr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; } __packed __aligned(2); struct ieee80211_qos_hdr { __le16 frame_control; __le16 duration_id; - u8 addr1[6]; - u8 addr2[6]; - u8 addr3[6]; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 addr3[ETH_ALEN]; __le16 seq_ctrl; __le16 qos_ctrl; } __packed __aligned(2); @@ -608,8 +609,8 @@ struct ieee80211s_hdr { u8 flags; u8 ttl; __le32 seqnum; - u8 eaddr1[6]; - u8 eaddr2[6]; + u8 eaddr1[ETH_ALEN]; + u8 eaddr2[ETH_ALEN]; } __packed __aligned(2); /* Mesh flags */ @@ -758,7 +759,7 @@ struct ieee80211_rann_ie { u8 rann_flags; u8 rann_hopcount; u8 rann_ttl; - u8 rann_addr[6]; + u8 rann_addr[ETH_ALEN]; __le32 rann_seq; __le32 rann_interval; __le32 rann_metric; @@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits { struct ieee80211_mgmt { __le16 frame_control; __le16 duration; - u8 da[6]; - u8 sa[6]; - u8 bssid[6]; + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + u8 bssid[ETH_ALEN]; __le16 seq_ctrl; union { struct { @@ -833,7 +834,7 @@ struct ieee80211_mgmt { struct { __le16 capab_info; __le16 listen_interval; - u8 current_ap[6]; + u8 current_ap[ETH_ALEN]; /* followed by SSID and Supported rates */ u8 variable[0]; } __packed reassoc_req; @@ -966,21 +967,21 @@ struct ieee80211_vendor_ie { struct ieee80211_rts { __le16 frame_control; __le16 duration; - u8 ra[6]; - u8 ta[6]; + u8 ra[ETH_ALEN]; + u8 ta[ETH_ALEN]; } __packed __aligned(2); struct ieee80211_cts { __le16 frame_control; __le16 duration; - u8 ra[6]; + u8 ra[ETH_ALEN]; } __packed __aligne
[PATCH] powerpc: Remove redundant breaks
break; break; isn't useful. Remove one. Signed-off-by: Joe Perches --- arch/powerpc/kernel/kvm.c | 1 - arch/powerpc/xmon/xmon.c | 1 - 2 files changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c index 33aa4dd..9ad37f8 100644 --- a/arch/powerpc/kernel/kvm.c +++ b/arch/powerpc/kernel/kvm.c @@ -649,7 +649,6 @@ static void kvm_check_ins(u32 *inst, u32 features) kvm_patch_ins_mtsrin(inst, inst_rt, inst_rb); } break; - break; #endif } diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index e599259..7a39f6c 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1987,7 +1987,6 @@ memex(void) case '^': adrs -= size; break; - break; case '/': if (nslash > 0) adrs -= 1 << nslash; ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 02/10] dpaa_eth: add support for DPAA Ethernet
On Wed, 2015-07-22 at 19:16 +0300, Madalin Bucur wrote: > This introduces the Freescale Data Path Acceleration Architecture > (DPAA) Ethernet driver (dpaa_eth) that builds upon the DPAA QMan, > BMan, PAMU and FMan drivers to deliver Ethernet connectivity on > the Freescale DPAA QorIQ platforms. trivia: > +static void __hot _dpa_tx_conf(struct net_device *net_dev, > +const struct dpa_priv_s *priv, > +struct dpa_percpu_priv_s *percpu_priv, > +const struct qm_fd *fd, > +u32 fqid) > +{ [] > +static struct dpa_bp * __cold > +dpa_priv_bp_probe(struct device *dev) Do the __hot and __cold markings really matter? Some of them may be questionable. > +static int __init dpa_load(void) > +{ [] > + err = platform_driver_register(&dpa_driver); > + if (unlikely(err < 0)) { > + pr_err(KBUILD_MODNAME > + ": %s:%hu:%s(): platform_driver_register() = %d\n", > + KBUILD_BASENAME ".c", __LINE__, __func__, err); > + } > + > + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", > + KBUILD_BASENAME ".c", __func__); Perhaps these should use pr_fmt > +static void __exit dpa_unload(void) > +{ > + pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", > + KBUILD_BASENAME ".c", __func__); dynamic debug has __func__ available and perhaps the function tracer might be used instead. > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h [] > +#define __hot curious. Maybe it'd be good to add a real __hot to compiler.h > +struct dpa_buffer_layout_s { > + u16 priv_data_size; > + boolparse_results; > + booltime_stamp; > + boolhash_results; > + u16 data_align; > +}; > +struct dpa_fq { > + struct qman_fq fq_base; > + struct list_head list; > + struct net_device *net_dev; some inconsistent indentation here and there > +struct dpa_bp { > + struct bman_pool*pool; > + u8 bpid; > + struct device *dev; > + union { > + /* The buffer pools used for the private ports are initialized > + * with target_count buffers for each CPU; at runtime the > + * number of buffers per CPU is constantly brought back to this > + * level > + */ > + int target_count; > + /* The configured value for the number of buffers in the pool, > + * used for shared port buffer pools > + */ > + int config_count; > + }; Anonymous unions are relatively rare > + struct { > + /** Maybe the /** style should be avoided > + * All egress queues to a given net device belong to one > + * (and the same) congestion group. > + */ > + struct qman_cgr cgr; > + } cgr_data; [] > +int dpa_stop(struct net_device *net_dev) > +{ [] > + err = mac_dev->stop(mac_dev); > + if (unlikely(err < 0)) > + netif_err(priv, ifdown, net_dev, "mac_dev->stop() = %d\n", > + err); Some of the likely/unlikely uses may not be useful/necessary. > + > + for_each_port_device(i, mac_dev->port_dev) { > + error = fm_port_disable( > + fm_port_drv_handle(mac_dev->port_dev[i])); > + err = error ? error : err; if (error) err = error; is more obvious to me. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 03/10] dpaa_eth: add configurable bpool thresholds
On Wed, 2015-07-22 at 19:16 +0300, Madalin Bucur wrote: > Allow the user to tweak the refill threshold and the total number > of buffers in the buffer pool. The provided values are for one CPU. Any value in making these module parameters instead? > +config FSL_DPAA_ETH_MAX_BUF_COUNT > + int "Maximum number of buffers in private bpool" > + range 64 2048 > + default "128" > + ---help--- > + The maximum number of buffers to be by default allocated in the > DPAA-Ethernet private port's > + buffer pool. One needn't normally modify this, as it has probably > been tuned for performance > + already. This cannot be lower than DPAA_ETH_REFILL_THRESHOLD. > + > +config FSL_DPAA_ETH_REFILL_THRESHOLD > + int "Private bpool refill threshold" > + range 32 FSL_DPAA_ETH_MAX_BUF_COUNT > + default "80" > + ---help--- > + The DPAA-Ethernet driver will start replenishing buffer pools whose > count > + falls below this threshold. This must be related to > DPAA_ETH_MAX_BUF_COUNT. One needn't normally > + modify this value unless one has very specific performance reasons. > + > config FSL_DPAA_CS_THRESHOLD_1G > hex "Egress congestion threshold on 1G ports" > range 0x1000 0x1000 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] hvc_xen: Remove unnecessary __GFP_ZERO from kzalloc
kzalloc already adds this __GFP_ZERO. Signed-off-by: Joe Perches --- drivers/tty/hvc/hvc_xen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 682210d..e61c36c 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -208,7 +208,7 @@ static int xen_hvm_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL | __GFP_ZERO); + info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL); if (!info) return -ENOMEM; } else if (info->intf != NULL) { @@ -257,7 +257,7 @@ static int xen_pv_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL | __GFP_ZERO); + info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL); if (!info) return -ENOMEM; } else if (info->intf != NULL) { @@ -284,7 +284,7 @@ static int xen_initial_domain_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL | __GFP_ZERO); + info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL); if (!info) return -ENOMEM; } -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH net-next] net:drivers/net: Miscellaneous conversions to ETH_ALEN
Convert the memset/memcpy uses of 6 to ETH_ALEN where appropriate. Also convert some struct definitions and u8 array declarations of [6] to ETH_ALEN. Signed-off-by: Joe Perches --- drivers/net/ethernet/8390/ax88796.c| 2 +- drivers/net/ethernet/amd/atarilance.c | 4 +- drivers/net/ethernet/amd/au1000_eth.c | 2 +- drivers/net/ethernet/amd/pcnet32.c | 2 +- drivers/net/ethernet/apple/bmac.c | 4 +- drivers/net/ethernet/broadcom/b44.c| 2 +- drivers/net/ethernet/broadcom/bnx2.c | 6 +- drivers/net/ethernet/broadcom/cnic.c | 4 +- drivers/net/ethernet/broadcom/tg3.c| 10 +-- drivers/net/ethernet/chelsio/cxgb/pm3393.c | 4 +- drivers/net/ethernet/davicom/dm9000.c | 2 +- .../net/ethernet/freescale/fs_enet/fs_enet-main.c | 2 +- drivers/net/ethernet/freescale/ucc_geth.c | 2 +- drivers/net/ethernet/i825xx/82596.c| 4 +- drivers/net/ethernet/i825xx/lib82596.c | 6 +- drivers/net/ethernet/ibm/emac/core.c | 2 +- drivers/net/ethernet/ibm/ibmveth.c | 4 +- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- drivers/net/ethernet/intel/igbvf/vf.c | 4 +- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 9 +-- drivers/net/ethernet/intel/ixgbevf/vf.c| 4 +- drivers/net/ethernet/jme.c | 4 +- drivers/net/ethernet/korina.c | 2 +- drivers/net/ethernet/marvell/mv643xx_eth.c | 4 +- drivers/net/ethernet/micrel/ks8851_mll.c | 4 +- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 4 +- drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 2 +- drivers/net/ethernet/renesas/sh_eth.c | 2 +- drivers/net/ethernet/sgi/meth.c| 2 +- drivers/net/ethernet/smsc/smsc911x.c | 2 +- drivers/net/ethernet/sun/cassini.c | 2 +- drivers/net/ethernet/sun/sungem.c | 2 +- drivers/net/ethernet/sun/sunhme.c | 10 +-- drivers/net/ethernet/sun/sunqe.c | 2 +- drivers/net/ethernet/ti/davinci_emac.c | 2 +- drivers/net/ethernet/tile/tilegx.c | 2 +- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +- drivers/net/fddi/skfp/fplustm.c| 2 +- drivers/net/fddi/skfp/skfddi.c | 6 +- drivers/net/plip/plip.c| 2 +- drivers/net/usb/catc.c | 8 +- drivers/net/wireless/ath/ath10k/wmi.c | 2 +- drivers/net/wireless/ath/wil6210/cfg80211.c| 4 +- drivers/net/wireless/atmel.c | 92 +++--- drivers/net/wireless/b43/xmit.c| 2 +- drivers/net/wireless/b43legacy/xmit.c | 2 +- drivers/net/wireless/brcm80211/brcmsmac/main.c | 6 +- drivers/net/wireless/hostap/hostap_info.c | 2 +- drivers/net/wireless/ipw2x00/ipw2200.c | 2 +- drivers/net/wireless/prism54/isl_ioctl.c | 10 +-- drivers/net/wireless/prism54/islpci_dev.c | 2 +- drivers/net/wireless/prism54/oid_mgt.c | 2 +- drivers/net/wireless/rtlwifi/core.c| 10 +-- net/bridge/br_multicast.c | 4 +- net/bridge/netfilter/ebt_among.c | 2 +- net/mac80211/trace.h | 4 +- 57 files changed, 146 insertions(+), 149 deletions(-) diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c index f92f001..36fa577 100644 --- a/drivers/net/ethernet/8390/ax88796.c +++ b/drivers/net/ethernet/8390/ax88796.c @@ -702,7 +702,7 @@ static int ax_init_dev(struct net_device *dev) for (i = 0; i < 16; i++) SA_prom[i] = SA_prom[i+i]; - memcpy(dev->dev_addr, SA_prom, 6); + memcpy(dev->dev_addr, SA_prom, ETH_ALEN); } #ifdef CONFIG_AX88796_93CX6 diff --git a/drivers/net/ethernet/amd/atarilance.c b/drivers/net/ethernet/amd/atarilance.c index 10ceca5..e07ce5f 100644 --- a/drivers/net/ethernet/amd/atarilance.c +++ b/drivers/net/ethernet/amd/atarilance.c @@ -586,10 +586,10 @@ static unsigned long __init lance_probe1( struct net_device *dev, switch( lp->cardtype ) { case OLD_RIEBL: /* No ethernet address! (Set some default address) */ - memcpy( dev->dev_addr, OldRieblDefHwaddr, 6 ); + memcpy(dev->dev_addr, OldRieblDefHwaddr, ETH_ALEN); break; case NEW_RIEBL: - lp->memcpy_f( dev->dev_addr, RIEBL_HWADDR_ADDR, 6 ); + lp->memcpy_f(dev->dev_addr, RIEBL_HWADDR_ADDR, ET
[PATCH 0/8] treewide: Remove OOM message after input_alloc_device
Joe Perches (8): Documentation: Remove OOM message after input_allocate_device cell: Remove OOM message after input_allocate_device hid: Remove OOM message after input_allocate_device input: Remove OOM message after input_allocate_device media: Remove OOM message after input_allocate_device platform:x86: Remove OOM message after input_allocate_device staging: Remove OOM message after input_allocate_device sound: Remove OOM message after input_allocate_device Documentation/input/input-programming.txt | 1 - arch/powerpc/platforms/cell/cbe_powerbutton.c | 1 - drivers/hid/hid-input.c | 1 - drivers/hid/hid-picolcd_core.c| 5 ++--- drivers/input/joystick/as5011.c | 2 -- drivers/input/joystick/db9.c | 1 - drivers/input/joystick/gamecon.c | 4 +--- drivers/input/joystick/turbografx.c | 1 - drivers/input/joystick/walkera0701.c | 1 - drivers/input/keyboard/amikbd.c | 4 +--- drivers/input/keyboard/davinci_keyscan.c | 1 - drivers/input/keyboard/gpio_keys.c| 1 - drivers/input/keyboard/lpc32xx-keys.c | 1 - drivers/input/keyboard/max7359_keypad.c | 1 - drivers/input/keyboard/mcs_touchkey.c | 1 - drivers/input/keyboard/mpr121_touchkey.c | 1 - drivers/input/keyboard/nomadik-ske-keypad.c | 1 - drivers/input/keyboard/opencores-kbd.c| 1 - drivers/input/keyboard/pmic8xxx-keypad.c | 1 - drivers/input/keyboard/pxa27x_keypad.c| 1 - drivers/input/keyboard/pxa930_rotary.c| 1 - drivers/input/keyboard/qt1070.c | 1 - drivers/input/keyboard/qt2160.c | 1 - drivers/input/keyboard/sh_keysc.c | 1 - drivers/input/keyboard/tc3589x-keypad.c | 1 - drivers/input/keyboard/tnetv107x-keypad.c | 1 - drivers/input/keyboard/w90p910_keypad.c | 1 - drivers/input/misc/88pm80x_onkey.c| 1 - drivers/input/misc/88pm860x_onkey.c | 1 - drivers/input/misc/arizona-haptics.c | 4 +--- drivers/input/misc/atlas_btns.c | 4 +--- drivers/input/misc/da9052_onkey.c | 1 - drivers/input/misc/da9055_onkey.c | 4 +--- drivers/input/misc/ideapad_slidebar.c | 1 - drivers/input/misc/ims-pcu.c | 7 +-- drivers/input/misc/kxtj9.c| 4 +--- drivers/input/misc/max8997_haptic.c | 1 - drivers/input/misc/mc13783-pwrbutton.c| 4 +--- drivers/input/misc/mpu3050.c | 1 - drivers/input/misc/pcf8574_keypad.c | 1 - drivers/input/misc/pm8xxx-vibrator.c | 1 - drivers/input/misc/pmic8xxx-pwrkey.c | 1 - drivers/input/misc/pwm-beeper.c | 1 - drivers/input/misc/twl4030-pwrbutton.c| 4 +--- drivers/input/misc/twl6040-vibra.c| 1 - drivers/input/mouse/appletouch.c | 4 +--- drivers/input/mouse/bcm5974.c | 4 +--- drivers/input/mouse/cyapa.c | 4 +--- drivers/input/mouse/inport.c | 1 - drivers/input/mouse/logibm.c | 1 - drivers/input/mouse/pc110pad.c| 1 - drivers/input/mouse/pxa930_trkball.c | 1 - drivers/input/tablet/aiptek.c | 5 + drivers/input/tablet/gtco.c | 1 - drivers/input/touchscreen/88pm860x-ts.c | 1 - drivers/input/touchscreen/atmel_mxt_ts.c | 1 - drivers/input/touchscreen/atmel_tsadcc.c | 1 - drivers/input/touchscreen/bu21013_ts.c| 1 - drivers/input/touchscreen/cyttsp4_core.c | 2 -- drivers/input/touchscreen/da9034-ts.c | 1 - drivers/input/touchscreen/edt-ft5x06.c| 1 - drivers/input/touchscreen/eeti_ts.c | 5 + drivers/input/touchscreen/htcpen.c| 1 - drivers/input/touchscreen/intel-mid-touch.c | 1 - drivers/input/touchscreen/lpc32xx_ts.c| 1 - drivers/input/touchscreen/mcs5000_ts.c| 1 - drivers/input/touchscreen/migor_ts.c | 1 - drivers/input/touchscreen/mk712.c | 1 - drivers/input/touchscreen/pixcir_i2c_ts.c | 1 - drivers/input/touchscreen/s3c2410_ts.c| 1 - drivers/input/touchscreen/ti_am335x_tsc.c | 1 - drivers/input/touchscreen/tnetv107x-ts.c | 1 - drivers/media/rc/imon.c | 8 ++-- drivers/media/usb/em28xx/em28xx-input.c | 4 +--- drivers/media/usb/pwc/pwc-if.c| 1 - drivers/platform/x86/asus-laptop.c| 5 ++--- drivers/platform/x86/eeepc-laptop.c | 4 +--- drivers/platform/x86/ideapad-laptop.c | 4 +--- drivers/platform/x86/intel_mid_powerbtn.c | 4 +--- drivers/platform/x86/panasonic-laptop.c | 5 + drivers/platform/x86/thinkpad_acpi.c | 1 - drivers/platform/x86/topstar-laptop.c | 4 +--- drivers/platform/x86/toshiba_acpi.c | 4 +--- drivers/staging/cptm1217
[PATCH 2/8] cell: Remove OOM message after input_allocate_device
Emitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done. Signed-off-by: Joe Perches --- arch/powerpc/platforms/cell/cbe_powerbutton.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/platforms/cell/cbe_powerbutton.c b/arch/powerpc/platforms/cell/cbe_powerbutton.c index 2bb8031..8804dbd 100644 --- a/arch/powerpc/platforms/cell/cbe_powerbutton.c +++ b/arch/powerpc/platforms/cell/cbe_powerbutton.c @@ -58,7 +58,6 @@ static int __init cbe_powerbutton_init(void) dev = input_allocate_device(); if (!dev) { ret = -ENOMEM; - printk(KERN_ERR "%s: Not enough memory.\n", __func__); goto out; } -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR
Remove the somewhat awkward uses of print_symbol and convert all the existing uses to a new vsprintf pointer type of %pSR. print_symbol can be interleaved when it is used in a sequence like: printk("something: ..."); print_symbol("%s", addr); printk("\n"); Instead use: printk("something: %pSR\n", (void *)addr); Add a new %p[SsFf]R vsprintf extension that can perform the same symbol function/address/offset formatting as print_symbol to reduce the number and styles of message logging functions. print_symbol used __builtin_extract_return_addr for those architectures like S/390 and SPARC that have offset or masked addressing. %p[FfSs]R uses the same gcc __builtin Joe Perches (26): vsprintf: Add extension %pSR - print_symbol replacement alpha: Convert print_symbol to %pSR arm: Convert print_symbol to %pSR arm64: Convert print_symbol to %pSR avr32: Convert print_symbol to %pSR c6x: Convert print_symbol to %pSR ia64: Convert print_symbol to %pSR m32r: Convert print_symbol to %pSR mn10300: Convert print_symbol to %pSR openrisc: Convert print_symbol to %pSR powerpc: Convert print_symbol to %pSR s390: Convert print_symbol to %pSR sh: Convert print_symbol to %pSR um: Convert print_symbol to %pSR unicore32: Convert print_symbol to %pSR x86: Convert print_symbol to %pSR xtensa: Convert print_symbol to %pSR drivers: base: Convert print_symbol to %pSR gfs2: Convert print_symbol to %pSR sysfs: Convert print_symbol to %pSR irq: Convert print_symbol to %pSR smp_processor_id: Convert print_symbol to %pSR mm: Convert print_symbol to %pSR xtensa: Convert print_symbol to %pSR x86: head_64.S: Use vsprintf extension %pSR not print_symbol kallsyms: Remove print_symbol Documentation/filesystems/sysfs.txt |4 +- Documentation/printk-formats.txt|2 + Documentation/zh_CN/filesystems/sysfs.txt |4 +- arch/alpha/kernel/traps.c |8 ++ arch/arm/kernel/process.c |4 +- arch/arm64/kernel/process.c |4 +- arch/avr32/kernel/process.c | 25 ++- arch/c6x/kernel/traps.c |3 +- arch/ia64/kernel/process.c | 13 --- arch/m32r/kernel/traps.c|6 +--- arch/mn10300/kernel/traps.c |8 +++--- arch/openrisc/kernel/traps.c|7 + arch/powerpc/platforms/cell/spu_callbacks.c | 12 -- arch/s390/kernel/traps.c| 28 +++--- arch/sh/kernel/process_32.c |4 +- arch/um/kernel/sysrq.c |6 +--- arch/unicore32/kernel/process.c |5 ++- arch/x86/kernel/cpu/mcheck/mce.c| 13 ++- arch/x86/kernel/dumpstack.c |5 +-- arch/x86/kernel/head_64.S |4 +- arch/x86/kernel/process_32.c|2 +- arch/x86/mm/mmio-mod.c |4 +- arch/x86/um/sysrq_32.c |9 ++- arch/xtensa/kernel/traps.c |6 +--- drivers/base/core.c |4 +- fs/gfs2/glock.c |4 +- fs/gfs2/trans.c |3 +- fs/sysfs/file.c |4 +- include/linux/kallsyms.h| 18 - kernel/irq/debug.h | 15 ++--- kernel/kallsyms.c | 11 -- lib/smp_processor_id.c |2 +- lib/vsprintf.c | 18 mm/memory.c |8 +++--- mm/slab.c |8 ++ 35 files changed, 117 insertions(+), 164 deletions(-) -- 1.7.8.112.g3fd21 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR
Use the new vsprintf extension to avoid any possible message interleaving. Convert the #ifdef DEBUG block to a single pr_debug. Signed-off-by: Joe Perches --- arch/powerpc/platforms/cell/spu_callbacks.c | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c index 75d6133..c5fe6d2 100644 --- a/arch/powerpc/platforms/cell/spu_callbacks.c +++ b/arch/powerpc/platforms/cell/spu_callbacks.c @@ -60,13 +60,11 @@ long spu_sys_callback(struct spu_syscall_block *s) syscall = spu_syscall_table[s->nr_ret]; -#ifdef DEBUG - print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); - printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", - s->nr_ret, - s->parm[0], s->parm[1], s->parm[2], - s->parm[3], s->parm[4], s->parm[5]); -#endif + pr_debug("SPU-syscall %pSR:syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", +syscall, +s->nr_ret, +s->parm[0], s->parm[1], s->parm[2], +s->parm[3], s->parm[4], s->parm[5]); return syscall(s->parm[0], s->parm[1], s->parm[2], s->parm[3], s->parm[4], s->parm[5]); -- 1.7.8.112.g3fd21 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR
On Thu, 2013-01-10 at 16:48 +1100, Benjamin Herrenschmidt wrote: > On Thu, 2012-12-13 at 11:58 +, Arnd Bergmann wrote: > > On Wednesday 12 December 2012, Joe Perches wrote: > > > Use the new vsprintf extension to avoid any possible > > > message interleaving. > > > > > > Convert the #ifdef DEBUG block to a single pr_debug. > > > > > > Signed-off-by: Joe Perches > > > > nice cleanup! > > ... which also breaks the build :-( > > > Acked-by: Arnd Bergmann > > I'll fix it up locally. OK, I didn't compile it. How does it break the build? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH net-next] drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb
Emitting netdev_alloc_skb and netdev_alloc_skb_ip_align OOM messages is unnecessary as there is already a dump_stack after allocation failures. Other trivial changes around these removals: Convert a few comparisons of pointer to 0 to !pointer. Change flow to remove unnecessary label. Remove now unused variable. Hoist assignment from if. Signed-off-by: Joe Perches --- drivers/net/caif/caif_shmcore.c| 5 + drivers/net/ethernet/adi/bfin_mac.c| 6 ++ drivers/net/ethernet/amd/7990.c| 2 -- drivers/net/ethernet/amd/a2065.c | 1 - drivers/net/ethernet/amd/am79c961a.c | 1 - drivers/net/ethernet/amd/ariadne.c | 1 - drivers/net/ethernet/amd/atarilance.c | 2 -- drivers/net/ethernet/amd/au1000_eth.c | 1 - drivers/net/ethernet/amd/declance.c| 2 -- drivers/net/ethernet/amd/pcnet32.c | 1 - drivers/net/ethernet/amd/sun3lance.c | 3 --- drivers/net/ethernet/amd/sunlance.c| 4 drivers/net/ethernet/atheros/atl1e/atl1e_main.c| 6 ++ drivers/net/ethernet/atheros/atlx/atl2.c | 3 --- drivers/net/ethernet/broadcom/bgmac.c | 4 +--- drivers/net/ethernet/broadcom/sb1250-mac.c | 5 + drivers/net/ethernet/cadence/at91_ether.c | 1 - drivers/net/ethernet/cirrus/cs89x0.c | 6 -- drivers/net/ethernet/dlink/dl2k.c | 7 ++- drivers/net/ethernet/freescale/fec.c | 2 -- .../net/ethernet/freescale/fs_enet/fs_enet-main.c | 17 +++-- drivers/net/ethernet/fujitsu/fmvj18x_cs.c | 2 -- drivers/net/ethernet/i825xx/82596.c| 8 +++- drivers/net/ethernet/i825xx/lib82596.c | 6 ++ drivers/net/ethernet/ibm/ehea/ehea_main.c | 9 ++--- drivers/net/ethernet/mellanox/mlx4/en_selftest.c | 5 ++--- drivers/net/ethernet/natsemi/sonic.c | 1 - drivers/net/ethernet/netx-eth.c| 2 -- drivers/net/ethernet/nuvoton/w90p910_ether.c | 1 - drivers/net/ethernet/nvidia/forcedeth.c| 1 - drivers/net/ethernet/qlogic/qla3xxx.c | 1 - drivers/net/ethernet/qlogic/qlge/qlge_main.c | 6 -- drivers/net/ethernet/rdc/r6040.c | 1 - drivers/net/ethernet/realtek/8139too.c | 2 -- drivers/net/ethernet/realtek/atp.c | 2 -- drivers/net/ethernet/seeq/ether3.c | 22 +- drivers/net/ethernet/seeq/sgiseeq.c| 2 -- drivers/net/ethernet/sis/sis900.c | 7 ++- drivers/net/ethernet/smsc/smc9194.c| 2 -- drivers/net/ethernet/smsc/smc91x.c | 2 -- drivers/net/ethernet/smsc/smsc9420.c | 4 +--- drivers/net/ethernet/sun/sunqe.c | 5 + drivers/net/ethernet/tehuti/tehuti.c | 5 ++--- drivers/net/ethernet/ti/tlan.c | 4 +--- drivers/net/ethernet/xilinx/ll_temac_main.c| 10 +++--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 9 +++-- drivers/net/ethernet/xircom/xirc2ps_cs.c | 1 - 47 files changed, 39 insertions(+), 161 deletions(-) diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c index bce8bac..cca2afc 100644 --- a/drivers/net/caif/caif_shmcore.c +++ b/drivers/net/caif/caif_shmcore.c @@ -338,11 +338,8 @@ static void shm_rx_work_func(struct work_struct *rx_work) /* Get a suitable CAIF packet and copy in data. */ skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev, frm_pck_len + 1); - - if (skb == NULL) { - pr_info("OOM: Try next frame in descriptor\n"); + if (skb == NULL) break; - } p = skb_put(skb, frm_pck_len); memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len); diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c index a175d0b..ee70577 100644 --- a/drivers/net/ethernet/adi/bfin_mac.c +++ b/drivers/net/ethernet/adi/bfin_mac.c @@ -188,10 +188,9 @@ static int desc_list_init(struct net_device *dev) /* allocate a new skb for next time receive */ new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN); - if (!new_skb) { - pr_notice("init: low on mem - packet dropped\n"); + if (!new_skb) goto init_error; - } + skb_reserve(new_skb, NET_IP_ALIGN); /* Invidate the data cache of skb->data range when it is write back
[PATCH 0/3] freescale: Update logging style
Convert various printk logging styles to current styles. Uncompiled, untested. Joe Perches (3): fec: Convert printks to netdev_ gianfar: Use netdev_ when possible ucc_geth: Convert ugeth_ to pr_ drivers/net/ethernet/freescale/fec_main.c | 26 +- drivers/net/ethernet/freescale/fec_mpc52xx.c | 16 +- drivers/net/ethernet/freescale/fec_ptp.c | 2 + drivers/net/ethernet/freescale/gianfar_ethtool.c | 24 +- drivers/net/ethernet/freescale/gianfar_ptp.c | 3 + drivers/net/ethernet/freescale/gianfar_sysfs.c| 2 +- drivers/net/ethernet/freescale/ucc_geth.c | 881 ++ drivers/net/ethernet/freescale/ucc_geth_ethtool.c | 24 +- 8 files changed, 441 insertions(+), 537 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/3] fec: Convert printks to netdev_
Use a more current logging message style. Convert the printks where a struct net_device is available to netdev_. Convert the other printks to pr_ and add pr_fmt where appropriate. Signed-off-by: Joe Perches --- drivers/net/ethernet/freescale/fec_main.c| 26 +++--- drivers/net/ethernet/freescale/fec_mpc52xx.c | 16 drivers/net/ethernet/freescale/fec_ptp.c | 2 ++ 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 153437b..d7657a4 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -266,7 +266,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) /* Ooops. All transmit buffers are full. Bail out. * This should not happen, since ndev->tbusy should be set. */ - printk("%s: tx queue full!.\n", ndev->name); + netdev_err(ndev, "tx queue full!\n"); return NETDEV_TX_BUSY; } @@ -578,7 +578,7 @@ fec_stop(struct net_device *ndev) writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */ udelay(10); if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA)) - printk("fec_stop : Graceful transmit stop did not complete !\n"); + netdev_err(ndev, "Graceful transmit stop did not complete!\n"); } /* Whack a reset. We should wait for this. */ @@ -676,7 +676,7 @@ fec_enet_tx(struct net_device *ndev) } if (status & BD_ENET_TX_READY) - printk("HEY! Enet xmit interrupt and TX_READY.\n"); + netdev_err(ndev, "HEY! Enet xmit interrupt and TX_READY\n"); /* Deferred means some collisions occurred during transmit, * but we eventually sent the packet OK. @@ -744,7 +744,7 @@ fec_enet_rx(struct net_device *ndev, int budget) * the last indicator should be set. */ if ((status & BD_ENET_RX_LAST) == 0) - printk("FEC ENET: rcv is not +last\n"); + netdev_err(ndev, "rcv is not +last\n"); if (!fep->opened) goto rx_processing_done; @@ -1031,7 +1031,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) usecs_to_jiffies(FEC_MII_TIMEOUT)); if (time_left == 0) { fep->mii_timeout = 1; - printk(KERN_ERR "FEC: MDIO read timeout\n"); + netdev_err(fep->netdev, "MDIO read timeout\n"); return -ETIMEDOUT; } @@ -1059,7 +1059,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum, usecs_to_jiffies(FEC_MII_TIMEOUT)); if (time_left == 0) { fep->mii_timeout = 1; - printk(KERN_ERR "FEC: MDIO write timeout\n"); + netdev_err(fep->netdev, "MDIO write timeout\n"); return -ETIMEDOUT; } @@ -1099,9 +1099,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) } if (phy_id >= PHY_MAX_ADDR) { - printk(KERN_INFO - "%s: no PHY, assuming direct connection to switch\n", - ndev->name); + netdev_info(ndev, "no PHY, assuming direct connection to switch\n"); strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); phy_id = 0; } @@ -1110,7 +1108,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, fep->phy_interface); if (IS_ERR(phy_dev)) { - printk(KERN_ERR "%s: could not attach to PHY\n", ndev->name); + netdev_err(ndev, "could not attach to PHY\n"); return PTR_ERR(phy_dev); } @@ -1128,11 +1126,9 @@ static int fec_enet_mii_probe(struct net_device *ndev) fep->link = 0; fep->full_duplex = 0; - printk(KERN_INFO - "%s: Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", - ndev->name, - fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev), - fep->phy_dev->irq); + netdev_info(ndev, "Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", + fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev), + fep->phy_dev->irq);
[PATCH 2/3] gianfar: Use netdev_ when possible
Use a more current logging style. Convert pr_ to netdev_ when a struct net_device is available. Add pr_fmt and neaten other formats too. Signed-off-by: Joe Perches --- drivers/net/ethernet/freescale/gianfar_ethtool.c | 24 +--- drivers/net/ethernet/freescale/gianfar_ptp.c | 3 +++ drivers/net/ethernet/freescale/gianfar_sysfs.c | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 4e7118f..083603f 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -389,14 +389,14 @@ static int gfar_scoalesce(struct net_device *dev, /* Check the bounds of the values */ if (cvals->rx_coalesce_usecs > GFAR_MAX_COAL_USECS) { - pr_info("Coalescing is limited to %d microseconds\n", - GFAR_MAX_COAL_USECS); + netdev_info(dev, "Coalescing is limited to %d microseconds\n", + GFAR_MAX_COAL_USECS); return -EINVAL; } if (cvals->rx_max_coalesced_frames > GFAR_MAX_COAL_FRAMES) { - pr_info("Coalescing is limited to %d frames\n", - GFAR_MAX_COAL_FRAMES); + netdev_info(dev, "Coalescing is limited to %d frames\n", + GFAR_MAX_COAL_FRAMES); return -EINVAL; } @@ -418,14 +418,14 @@ static int gfar_scoalesce(struct net_device *dev, /* Check the bounds of the values */ if (cvals->tx_coalesce_usecs > GFAR_MAX_COAL_USECS) { - pr_info("Coalescing is limited to %d microseconds\n", - GFAR_MAX_COAL_USECS); + netdev_info(dev, "Coalescing is limited to %d microseconds\n", + GFAR_MAX_COAL_USECS); return -EINVAL; } if (cvals->tx_max_coalesced_frames > GFAR_MAX_COAL_FRAMES) { - pr_info("Coalescing is limited to %d frames\n", - GFAR_MAX_COAL_FRAMES); + netdev_info(dev, "Coalescing is limited to %d frames\n", + GFAR_MAX_COAL_FRAMES); return -EINVAL; } @@ -735,7 +735,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, cmp_rqfpr = RQFPR_IPV6 |RQFPR_UDP; break; default: - pr_err("Right now this class is not supported\n"); + netdev_err(priv->ndev, + "Right now this class is not supported\n"); ret = 0; goto err; } @@ -751,7 +752,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, } if (i == MAX_FILER_IDX + 1) { - pr_err("No parse rule found, can't create hash rules\n"); + netdev_err(priv->ndev, + "No parse rule found, can't create hash rules\n"); ret = 0; goto err; } @@ -1568,7 +1570,7 @@ static int gfar_process_filer_changes(struct gfar_private *priv) gfar_cluster_filer(tab); gfar_optimize_filer_masks(tab); - pr_debug("\n\tSummary:\n" + pr_debug("\tSummary:\n" "\tData on hardware: %d\n" "\tCompression rate: %d%%\n", tab->index, 100 - (100 * tab->index) / i); diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c index 2e5daee..fe8e9e5 100644 --- a/drivers/net/ethernet/freescale/gianfar_ptp.c +++ b/drivers/net/ethernet/freescale/gianfar_ptp.c @@ -17,6 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include diff --git a/drivers/net/ethernet/freescale/gianfar_sysfs.c b/drivers/net/ethernet/freescale/gianfar_sysfs.c index cd14a4d..acb55af 100644 --- a/drivers/net/ethernet/freescale/gianfar_sysfs.c +++ b/drivers/net/ethernet/freescale/gianfar_sysfs.c @@ -337,5 +337,5 @@ void gfar_init_sysfs(struct net_device *dev) rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve); rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve_off); if (rc) - dev_err(&dev->dev, "Error creating gianfar sysfs files.\n"); + dev_err(&dev->dev, "Error creating gianfar sysfs files\n"); } -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be,le}_to_cpu() and cpu_to_{be,le}() macros
On Tue, 2014-05-27 at 17:22 -0700, Cody P Schafer wrote: > Rather manually specifying the size of the integer to be converted, key > off of the type size. Reduces duplicate size info and the occurance of > certain types of bugs (using the wrong sized conversion). [] > diff --git a/include/linux/byteorder.h b/include/linux/byteorder.h [] > @@ -0,0 +1,34 @@ > +#ifndef LINUX_BYTEORDER_H_ > +#define LINUX_BYTEORDER_H_ > + > +#include > + > +#define be_to_cpu(v) \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint8_t) , v, \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint16_t), be16_to_cpu(v), \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint32_t), be32_to_cpu(v), \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint64_t), be64_to_cpu(v), \ > + (void)0 probably better to use BUILD_BUG instead of these 0 returns > + > +#define le_to_cpu(v) \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint8_t) , v, \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint16_t), le16_to_cpu(v), \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint32_t), le32_to_cpu(v), \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint64_t), le64_to_cpu(v), \ > + (void)0 > + > +#define cpu_to_le(v) \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint8_t) , v, \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint16_t), cpu_to_le16(v), \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint32_t), cpu_to_le32(v), \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint64_t), cpu_to_le64(v), \ > + (void)0 > + > +#define cpu_to_be(v) \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint8_t) , v, \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint16_t), cpu_to_be16(v), \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint32_t), cpu_to_be32(v), \ > + __builtin_choose_expr(sizeof(v) == sizeof(uint64_t), cpu_to_be64(v), \ > + (void)0 > + > +#endif ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros
On Wed, 2014-05-28 at 17:11 -0500, Cody P Schafer wrote: > On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer wrote: > > On Wed, May 28, 2014 at 3:45 AM, David Laight > > wrote: > >> From: Cody P Schafer > >>> Rather manually specifying the size of the integer to be converted, key > >>> off of the type size. Reduces duplicate size info and the occurance of > >>> certain types of bugs (using the wrong sized conversion). > >> ... > >>> +#define be_to_cpu(v) \ > >>> + __builtin_choose_expr(sizeof(v) == sizeof(uint8_t) , v, \ > >>> + __builtin_choose_expr(sizeof(v) == sizeof(uint16_t), > >>> be16_to_cpu(v), \ > >>> + __builtin_choose_expr(sizeof(v) == sizeof(uint32_t), > >>> be32_to_cpu(v), \ > >>> + __builtin_choose_expr(sizeof(v) == sizeof(uint64_t), > >>> be64_to_cpu(v), \ > >>> + (void)0 > >> ... > >> > >> I'm not at all sure that using the 'size' of the constant will reduce > >> the number of bugs - it just introduces a whole new category of bugs. > > > > Certainly, if you mis-size the argument (and thus have missized one of > > the variables containing the be value, probably a bug anyhow), there > > will be problems. > > > > I put this interface together because of an actual bug I wrote into > > the initial code of the hv_24x7 driver (resized a struct member > > without adjusting the be*_to_cpu() sizing). > > Having this "auto sizing" macro means I can avoid encoding the size of > > a struct field in multiple places. > > To clarify, the point I'm making here is that this simply cuts out 1 > more place we can screw up endianness conversion sizing. It does screw up other types when you do things like: u8 foo = some_function(); cpu_to_be(foo + 1); the return value is sizeof(int) not u8 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH -next 01/26] powerpc: Use dma_zalloc_coherent
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches --- arch/powerpc/platforms/pasemi/dma_lib.c | 8 +++- arch/powerpc/sysdev/fsl_rmu.c | 9 - 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c index aafa01ba..52b391f 100644 --- a/arch/powerpc/platforms/pasemi/dma_lib.c +++ b/arch/powerpc/platforms/pasemi/dma_lib.c @@ -255,15 +255,13 @@ int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size) chan->ring_size = ring_size; - chan->ring_virt = dma_alloc_coherent(&dma_pdev->dev, -ring_size * sizeof(u64), -&chan->ring_dma, GFP_KERNEL); + chan->ring_virt = dma_zalloc_coherent(&dma_pdev->dev, + ring_size * sizeof(u64), + &chan->ring_dma, GFP_KERNEL); if (!chan->ring_virt) return -ENOMEM; - memset(chan->ring_virt, 0, ring_size * sizeof(u64)); - return 0; } EXPORT_SYMBOL(pasemi_dma_alloc_ring); diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c index b48197a..34b49fc 100644 --- a/arch/powerpc/sysdev/fsl_rmu.c +++ b/arch/powerpc/sysdev/fsl_rmu.c @@ -744,15 +744,14 @@ fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries) } /* Initialize outbound message descriptor ring */ - rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev, - rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE, - &rmu->msg_tx_ring.phys, GFP_KERNEL); + rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev, + rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE, + &rmu->msg_tx_ring.phys, + GFP_KERNEL); if (!rmu->msg_tx_ring.virt) { rc = -ENOMEM; goto out_dma; } - memset(rmu->msg_tx_ring.virt, 0, - rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE); rmu->msg_tx_ring.tx_slot = 0; /* Point dequeue/enqueue pointers at first entry in ring */ -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH -next 00/26] treewide: Use dma_zalloc_coherent
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Joe Perches (26): powerpc: Use dma_zalloc_coherent sh: Use dma_zalloc_coherent ata: Use dma_zalloc_coherent block: Use dma_zalloc_coherent crypto: Use dma_zalloc_coherent dma: Use dma_zalloc_coherent gpu: Use dma_zalloc_coherent infiniband: Use dma_zalloc_coherent mmc: Use dma_zalloc_coherent broadcom: Use dma_zalloc_coherent hisilicon: Use dma_zalloc_coherent intel: Use dma_zalloc_coherent ath: Use dma_zalloc_coherent rt2x00: Use dma_zalloc_coherent bfa: Use dma_zalloc_coherent bnx2fc: Use dma_zalloc_coherent bnx2i: Use dma_zalloc_coherent dpt_i2o: Use dma_zalloc_coherent lpfc: Use dma_zalloc_coherent megaraid: Use dma_zalloc_coherent mvsas: Use dma_zalloc_coherent qla2xxx: Use dma_zalloc_coherent qla4xxx: Use dma_zalloc_coherent usb: Use dma_zalloc_coherent fbdev: Use dma_zalloc_coherent sound: Use dma_zalloc_coherent arch/powerpc/platforms/pasemi/dma_lib.c | 8 ++-- arch/powerpc/sysdev/fsl_rmu.c | 9 ++-- arch/sh/mm/consistent.c | 4 +- drivers/ata/sata_fsl.c| 5 +-- drivers/block/nvme-core.c | 5 +-- drivers/crypto/amcc/crypto4xx_core.c | 8 ++-- drivers/crypto/ixp4xx_crypto.c| 8 ++-- drivers/dma/imx-sdma.c| 5 +-- drivers/dma/mxs-dma.c | 8 ++-- drivers/gpu/drm/drm_pci.c | 6 +-- drivers/infiniband/hw/cxgb3/cxio_hal.c| 7 ++-- drivers/infiniband/hw/mthca/mthca_memfree.c | 5 +-- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 20 - drivers/infiniband/hw/ocrdma/ocrdma_stats.c | 6 +-- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 8 ++-- drivers/mmc/host/msm_sdcc.c | 8 ++-- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 6 +-- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 5 +-- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 +-- drivers/net/wireless/ath/ath10k/pci.c | 8 +--- drivers/net/wireless/ath/ath10k/wmi.c | 8 +--- drivers/net/wireless/ath/wcn36xx/dxe.c| 6 +-- drivers/net/wireless/rt2x00/rt2x00mmio.c | 8 ++-- drivers/scsi/bfa/bfad_bsg.c | 6 +-- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 59 --- drivers/scsi/bnx2fc/bnx2fc_tgt.c | 51 ++- drivers/scsi/bnx2i/bnx2i_hwi.c| 14 +++ drivers/scsi/dpt_i2o.c| 19 - drivers/scsi/lpfc/lpfc_bsg.c | 5 +-- drivers/scsi/lpfc/lpfc_init.c | 22 -- drivers/scsi/lpfc/lpfc_mbox.c | 6 +-- drivers/scsi/lpfc/lpfc_sli.c | 14 +++ drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 ++-- drivers/scsi/mvsas/mv_init.c | 26 +--- drivers/scsi/qla2xxx/qla_init.c | 10 ++--- drivers/scsi/qla4xxx/ql4_init.c | 5 +-- drivers/scsi/qla4xxx/ql4_mbx.c| 21 -- drivers/scsi/qla4xxx/ql4_nx.c | 5 +-- drivers/scsi/qla4xxx/ql4_os.c | 12 +++--- drivers/usb/dwc2/hcd_ddma.c | 20 - drivers/usb/host/uhci-hcd.c | 7 ++-- drivers/video/fbdev/da8xx-fb.c| 9 ++-- sound/aoa/soundbus/i2sbus/core.c | 12 ++ sound/sparc/dbri.c| 6 +-- 44 files changed, 197 insertions(+), 308 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH -next 26/26] sound: Use dma_zalloc_coherent
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches --- sound/aoa/soundbus/i2sbus/core.c | 12 sound/sparc/dbri.c | 6 ++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index 4678360..a80d5ea 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -47,15 +47,11 @@ static int alloc_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev, /* We use the PCI APIs for now until the generic one gets fixed * enough or until we get some macio-specific versions */ - r->space = dma_alloc_coherent( - &macio_get_pci_dev(i2sdev->macio)->dev, - r->size, - &r->bus_addr, - GFP_KERNEL); + r->space = dma_zalloc_coherent(&macio_get_pci_dev(i2sdev->macio)->dev, + r->size, &r->bus_addr, GFP_KERNEL); + if (!r->space) + return -ENOMEM; - if (!r->space) return -ENOMEM; - - memset(r->space, 0, r->size); r->cmds = (void*)DBDMA_ALIGN(r->space); r->bus_cmd_start = r->bus_addr + (dma_addr_t)((char*)r->cmds - (char*)r->space); diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index be1b1aa..b2c3d0d 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c @@ -2534,12 +2534,10 @@ static int snd_dbri_create(struct snd_card *card, dbri->op = op; dbri->irq = irq; - dbri->dma = dma_alloc_coherent(&op->dev, - sizeof(struct dbri_dma), - &dbri->dma_dvma, GFP_ATOMIC); + dbri->dma = dma_zalloc_coherent(&op->dev, sizeof(struct dbri_dma), + &dbri->dma_dvma, GFP_ATOMIC); if (!dbri->dma) return -ENOMEM; - memset((void *)dbri->dma, 0, sizeof(struct dbri_dma)); dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n", dbri->dma, dbri->dma_dvma); -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 1/2] printk: Add function to return log buffer address and size
On Thu, 2014-07-31 at 15:22 -0700, Andrew Morton wrote: > Please include this in whatever tree carries "powerpc/powernv: > Interface to register/unregister opal dump region". At some point, I'd like to redo the patch series that breaks up printk.c into more manageable blocks. https://lkml.org/lkml/2012/10/17/41 Any suggestion for timing? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] ibmveth: Fix more little endian issues
On Mon, 2013-12-23 at 17:38 +1100, Anton Blanchard wrote: > The hypervisor expects MAC addresses passed in registers to be big > endian u64. So maybe use __be64 declarations? > +static unsigned long ibmveth_encode_mac_addr(char *mac) static __be64 ibmveth_encode_mac_addr(const char *mac) ? etc... ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/1] Fixed some coding style problems
On Mon, 2014-01-27 at 19:43 -0600, Brandon Stewart wrote: [] > diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c [] > @@ -624,8 +623,7 @@ do_adb_query(struct adb_request *req) > { > int ret = -EINVAL; > > - switch(req->data[1]) > - { > + switch(req->data[1]) { switch (req->data[1]) { > @@ -794,8 +792,8 @@ static ssize_t adb_write(struct file *file, const char > __user *buf, > } > /* Special case for ADB_BUSRESET request, all others are sent to > the controller */ > - else if ((req->data[0] == ADB_PACKET)&&(count > 1) > - &&(req->data[1] == ADB_BUSRESET)) { > + else if ((req->data[0] == ADB_PACKET) && (count > 1) > + && (req->data[1] == ADB_BUSRESET)) { else if (req->data[0] == ADB_PACKET && req->data[1] == ADB_BUSRESET && count > 1) { ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] powerpc: numa: Fix decimal permissions
This should have been octal. Signed-off-by: Joe Perches --- arch/powerpc/mm/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 86a63de..30a42e2 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1785,7 +1785,7 @@ static const struct file_operations topology_ops = { static int topology_update_init(void) { start_topology_update(); - proc_create("powerpc/topology_updates", 644, NULL, &topology_ops); + proc_create("powerpc/topology_updates", 0644, NULL, &topology_ops); return 0; } ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 6/6] cpu/idle.c: move to sched/idle.c
On Thu, 2014-01-30 at 17:27 +0100, Peter Zijlstra wrote: > On Thu, Jan 30, 2014 at 11:03:31AM -0500, Nicolas Pitre wrote: > > > This is not a valid patch for PATCH(1). Please try again. > > > > Don't you use git? ;-) > > Nah, git and me don't get along well. Perhaps you could use a newer version of patch http://savannah.gnu.org/forum/forum.php?forum_id=7361 GNU patch version 2.7 released Item posted by Andreas Gruenbacher on Wed 12 Sep 2012 02:18:14 PM UTC. I am pleased to announce that version 2.7 of GNU patch has been released. The following significant changes have happened since the last stable release in December 2009: * Support for most features of the "diff --git" format, including renames and copies, permission changes, and symlink diffs. Binary diffs are not supported yet; patch will complain and skip them. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[RFC PATCH] Remove CONFIG_DCACHE_WORD_ACCESS
It seems to duplicate CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS so use that instead. This changes the !CPU_LITTLE_ENDIAN powerpc arch to use unaligned accesses in fs/dcache.c and fs/namei.c as CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is enabled for that arch. Remove the now unused DCACHE_WORD_ACCESS defines & uses. Signed-off-by: Joe Perches --- arch/arm/Kconfig | 1 - arch/arm/include/asm/word-at-a-time.h | 4 ++-- arch/arm64/Kconfig| 1 - arch/x86/Kconfig | 1 - fs/Kconfig| 4 fs/dcache.c | 2 +- fs/namei.c| 2 +- 7 files changed, 4 insertions(+), 11 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 623a272..d5a2e60 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -12,7 +12,6 @@ config ARM select BUILDTIME_EXTABLE_SORT if MMU select CLONE_BACKWARDS select CPU_PM if (SUSPEND || CPU_IDLE) - select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI) select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GENERIC_IDLE_POLL_SETUP diff --git a/arch/arm/include/asm/word-at-a-time.h b/arch/arm/include/asm/word-at-a-time.h index a6d0a29..778b2ad 100644 --- a/arch/arm/include/asm/word-at-a-time.h +++ b/arch/arm/include/asm/word-at-a-time.h @@ -54,7 +54,7 @@ static inline unsigned long find_zero(unsigned long mask) #include #endif -#ifdef CONFIG_DCACHE_WORD_ACCESS +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS /* * Load an unaligned word from kernel space. @@ -94,5 +94,5 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) return ret; } -#endif /* DCACHE_WORD_ACCESS */ +#endif /* HAVE_EFFICIENT_UNALIGNED_ACCESS */ #endif /* __ASM_ARM_WORD_AT_A_TIME_H */ diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 764d682..2d6978c 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -13,7 +13,6 @@ config ARM64 select CLONE_BACKWARDS select COMMON_CLK select CPU_PM if (SUSPEND || CPU_IDLE) - select DCACHE_WORD_ACCESS select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GENERIC_IOMAP diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index abb261e..60cfa073 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -98,7 +98,6 @@ config X86 select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_IOMAP - select DCACHE_WORD_ACCESS select GENERIC_SMP_IDLE_THREAD select ARCH_WANT_IPC_PARSE_VERSION if X86_32 select HAVE_ARCH_SECCOMP_FILTER diff --git a/fs/Kconfig b/fs/Kconfig index 312393f..7511271 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -4,10 +4,6 @@ menu "File systems" -# Use unaligned word dcache accesses -config DCACHE_WORD_ACCESS - bool - if BLOCK source "fs/ext2/Kconfig" diff --git a/fs/dcache.c b/fs/dcache.c index 265e0ce..4e3c195 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -163,7 +163,7 @@ int proc_nr_dentry(ctl_table *table, int write, void __user *buffer, * Compare 2 name strings, return 0 if they match, otherwise non-zero. * The strings are both count bytes long, and count is non-zero. */ -#ifdef CONFIG_DCACHE_WORD_ACCESS +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS #include /* diff --git a/fs/namei.c b/fs/namei.c index 385f781..1ee33ca 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1618,7 +1618,7 @@ static inline int nested_symlink(struct path *path, struct nameidata *nd) * the final mask". Again, that could be replaced with a * efficient population count instruction or similar. */ -#ifdef CONFIG_DCACHE_WORD_ACCESS +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS #include ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver)
(added some cc's) On Fri, 2014-03-07 at 15:41 -0500, David Miller wrote: > From: Alistair Popple > Date: Thu, 6 Mar 2014 14:52:25 +1100 > > > + out_be32(dev->reg, in_be32(dev->reg) | WKUP_ETH_RGMIIEN > > +| WKUP_ETH_TX_OE | WKUP_ETH_RX_IE); > > When an expression spans multiple lines, the lines should end with > operators rather than begin with them. That's not in CodingStyle currently. Right now, checkpatch emits a --strict only warning on "&&" or "||" at the beginning of line but that could be changed to any "$Operators" our $Arithmetic = qr{\+|-|\*|\/|%}; our $Operators = qr{ <=|>=|==|!=| =>|->|<<|>>|<|>|!|~| &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic }x; The ones that likely have a too high false positive rates are the negation "!" and bitwise "~". Also, using perl, it's hard to distinguish between a logical "&" and the address-of "&" as well as the multiplication "*" and indirection "*" so maybe those should be excluded too. And I think it should only be added as a --strict test. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver)
On Fri, 2014-03-07 at 13:30 -0800, j...@joshtriplett.org wrote: > On Fri, Mar 07, 2014 at 01:02:44PM -0800, Joe Perches wrote: > > On Fri, 2014-03-07 at 15:41 -0500, David Miller wrote: > > > From: Alistair Popple > > > Date: Thu, 6 Mar 2014 14:52:25 +1100 > > > > > > > + out_be32(dev->reg, in_be32(dev->reg) | WKUP_ETH_RGMIIEN > > > > +| WKUP_ETH_TX_OE | WKUP_ETH_RX_IE); > > > > > > When an expression spans multiple lines, the lines should end with > > > operators rather than begin with them. > > > > That's not in CodingStyle currently. > > It's also not even remotely consistent across existing kernel code, and > it isn't obvious that there's a general developer consensus on the > "right" way to write it. I agree with that. Stuff that's not in CodingStyle generally doesn't have a developer consensus. > > Right now, checkpatch emits a --strict only warning on "&&" or "||" > > at the beginning of line but that could be changed to any "$Operators" > > > > our $Arithmetic = qr{\+|-|\*|\/|%}; > > our $Operators = qr{ > > <=|>=|==|!=| > > =>|->|<<|>>|<|>|!|~| > > &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic > > }x; > > > > The ones that likely have a too high false positive rates > > are the negation "!" and bitwise "~". > > I don't think warning about operators at start of line seems like a good > idea at all. There are plenty of cases where putting the operator at > the start of the line will produce a better result. (I'd actually > suggest that in *most* cases.) > > > Also, using perl, it's hard to distinguish between a > > logical "&" and the address-of "&" as well as the > > multiplication "*" and indirection "*" so maybe those > > should be excluded too. > > > > And I think it should only be added as a --strict test. > > Agreed, if even that. And probably made specific to net/ and drivers/net like a few other comment style tests until such time as a consensus exists. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver)
On Sat, 2014-03-08 at 02:04 +0300, Dan Carpenter wrote: > On Fri, Mar 07, 2014 at 01:30:17PM -0800, j...@joshtriplett.org wrote: > > On Fri, Mar 07, 2014 at 01:02:44PM -0800, Joe Perches wrote: > > > On Fri, 2014-03-07 at 15:41 -0500, David Miller wrote: > > > > From: Alistair Popple > > > > Date: Thu, 6 Mar 2014 14:52:25 +1100 > > > > > > > > > + out_be32(dev->reg, in_be32(dev->reg) | WKUP_ETH_RGMIIEN > > > > > + | WKUP_ETH_TX_OE | WKUP_ETH_RX_IE); > > > > > > > > When an expression spans multiple lines, the lines should end with > > > > operators rather than begin with them. > > > > > > That's not in CodingStyle currently. > > > > It's also not even remotely consistent across existing kernel code, and > > it isn't obvious that there's a general developer consensus on the > > "right" way to write it. > > > > We just had this discussion in staging and Greg modified the patch to > put the operator at the end. > > https://lkml.org/lkml/2014/2/25/125 I remember and it's the reason I bring it up in a more public way. > It's like logical && and || operators which go at the end these days. > I don't really want to have a lot of checkpatch churn to convert > everything... Nor I really. I simply would like a tool that lets more core maintainers like David M avoid sending out "do this, not that" type emails about patches. I don't mind adding style checking that emits something for patches and is quieter when scanning files. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] eeh_pseries: Missing break?
Looks like this is unintentional as the result = EEH_STATE_UNAVAILABLE is being overwritten by EEH_STATE_NOT_SUPPORT in the fallthrough to the default case. --- diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index 8a8f047..83da53f 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c @@ -460,14 +460,15 @@ static int pseries_eeh_get_state(struct eeh_pe *pe, int *state) case 5: if (rets[2]) { if (state) *state = rets[2]; result = EEH_STATE_UNAVAILABLE; } else { result = EEH_STATE_NOT_SUPPORT; } + break; default: result = EEH_STATE_NOT_SUPPORT; } } else { result = EEH_STATE_NOT_SUPPORT; } ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] eeh_pseries: Missing break?
On Sun, 2014-03-09 at 00:16 +0800, Gavin Shan wrote: > On Fri, Mar 07, 2014 at 04:31:32PM -0800, Joe Perches wrote: > >Looks like this is unintentional as the > >result = EEH_STATE_UNAVAILABLE is being > >overwritten by EEH_STATE_NOT_SUPPORT in the > >fallthrough to the default case. > > Thanks, Joe. It wasn't unintentional. Hi Gavin. English usages of "double negatives" are different than other languages. "it wasn't unintentional" means the same thing as "it was intentional". > Could you have better commit log > and subject, then repost it? > > The format looks like: > > --- > > powerpc/eeh: Fix overwritten PE state > > In pseries_eeh_get_state(), we always have EEH_STATE_UNAVAILABLE > overwritten by EEH_STATE_NOT_SUPPORT because of the missed "break" > the patch fixes the issue. > > Signed-off-by: Joe Perches From my perspective, you should write up a commit message of your own choice (I wouldn't use "we", but the rest seems OK) and add a Reported-by: All I did was notice it and bring it to your attention. > --- > > With the better commit log/subject, please have: > > Acked-by: Gavin Shan > > >--- > >diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c > >b/arch/powerpc/platforms/pseries/eeh_pseries.c > >index 8a8f047..83da53f 100644 > >--- a/arch/powerpc/platforms/pseries/eeh_pseries.c > >+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c > >@@ -460,14 +460,15 @@ static int pseries_eeh_get_state(struct eeh_pe *pe, > >int *state) > > case 5: > > if (rets[2]) { > > if (state) *state = rets[2]; > > result = EEH_STATE_UNAVAILABLE; > > } else { > > result = EEH_STATE_NOT_SUPPORT; > > } > >+break; > > default: > > result = EEH_STATE_NOT_SUPPORT; > > } > > } else { > > result = EEH_STATE_NOT_SUPPORT; > > } > > > > Thanks, > Gavin > ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 0/5] Convert last few uses of __FUNCTION__ to __func__
Outside of staging, there aren't any more uses of __FUNCTION__ now... Joe Perches (5): powerpc: Convert last uses of __FUNCTION__ to __func__ x86: Convert last uses of __FUNCTION__ to __func__ block: Convert last uses of __FUNCTION__ to __func__ i915: Convert last uses of __FUNCTION__ to __func__ slab: Convert last uses of __FUNCTION__ to __func__ arch/powerpc/platforms/pseries/nvram.c | 11 +-- arch/x86/kernel/hpet.c | 2 +- arch/x86/kernel/rtc.c| 4 ++-- arch/x86/platform/intel-mid/intel_mid_vrtc.c | 2 +- drivers/block/drbd/drbd_int.h| 8 drivers/block/xen-blkfront.c | 4 ++-- drivers/gpu/drm/i915/dvo_ns2501.c| 15 ++- mm/slab.h| 2 +- 8 files changed, 22 insertions(+), 26 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/5] powerpc: Convert last uses of __FUNCTION__ to __func__
Just about all of these have been converted to __func__, so convert the last uses. Signed-off-by: Joe Perches --- arch/powerpc/platforms/pseries/nvram.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c index d7096f2..0cc240b 100644 --- a/arch/powerpc/platforms/pseries/nvram.c +++ b/arch/powerpc/platforms/pseries/nvram.c @@ -298,13 +298,13 @@ int nvram_write_os_partition(struct nvram_os_partition *part, char * buff, rc = ppc_md.nvram_write((char *)&info, sizeof(struct err_log_info), &tmp_index); if (rc <= 0) { - pr_err("%s: Failed nvram_write (%d)\n", __FUNCTION__, rc); + pr_err("%s: Failed nvram_write (%d)\n", __func__, rc); return rc; } rc = ppc_md.nvram_write(buff, length, &tmp_index); if (rc <= 0) { - pr_err("%s: Failed nvram_write (%d)\n", __FUNCTION__, rc); + pr_err("%s: Failed nvram_write (%d)\n", __func__, rc); return rc; } @@ -351,15 +351,14 @@ int nvram_read_partition(struct nvram_os_partition *part, char *buff, sizeof(struct err_log_info), &tmp_index); if (rc <= 0) { - pr_err("%s: Failed nvram_read (%d)\n", __FUNCTION__, - rc); + pr_err("%s: Failed nvram_read (%d)\n", __func__, rc); return rc; } } rc = ppc_md.nvram_read(buff, length, &tmp_index); if (rc <= 0) { - pr_err("%s: Failed nvram_read (%d)\n", __FUNCTION__, rc); + pr_err("%s: Failed nvram_read (%d)\n", __func__, rc); return rc; } @@ -869,7 +868,7 @@ static void oops_to_nvram(struct kmsg_dumper *dumper, break; default: pr_err("%s: ignoring unrecognized KMSG_DUMP_* reason %d\n", - __FUNCTION__, (int) reason); + __func__, (int) reason); return; } -- 1.8.1.2.459.gbcd45b4.dirty ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFC PATCH] Remove CONFIG_DCACHE_WORD_ACCESS
On Wed, 2014-03-12 at 07:37 +1100, Benjamin Herrenschmidt wrote: > On Tue, 2014-03-04 at 12:23 -0800, Joe Perches wrote: > > It seems to duplicate CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS > > so use that instead. > > > > This changes the !CPU_LITTLE_ENDIAN powerpc arch to use unaligned > > accesses in fs/dcache.c and fs/namei.c as > > CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is enabled for that arch. > > > > Remove the now unused DCACHE_WORD_ACCESS defines & uses. > > Interesting.. we have word-at-a-time but we never enabled > DCACHE_WORD_ACCESS, I wonder why that is. In fact, we should > probably do it for LE as well for P8 if we can make a P8 > only config option... > > Anton, what do you reckon here ? Anton, do you have an opinion here? > Cheers, > Ben. > > > Signed-off-by: Joe Perches > > --- > > arch/arm/Kconfig | 1 - > > arch/arm/include/asm/word-at-a-time.h | 4 ++-- > > arch/arm64/Kconfig| 1 - > > arch/x86/Kconfig | 1 - > > fs/Kconfig| 4 > > fs/dcache.c | 2 +- > > fs/namei.c| 2 +- > > 7 files changed, 4 insertions(+), 11 deletions(-) > > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > > index 623a272..d5a2e60 100644 > > --- a/arch/arm/Kconfig > > +++ b/arch/arm/Kconfig > > @@ -12,7 +12,6 @@ config ARM > > select BUILDTIME_EXTABLE_SORT if MMU > > select CLONE_BACKWARDS > > select CPU_PM if (SUSPEND || CPU_IDLE) > > - select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS > > select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI) > > select GENERIC_CLOCKEVENTS_BROADCAST if SMP > > select GENERIC_IDLE_POLL_SETUP > > diff --git a/arch/arm/include/asm/word-at-a-time.h > > b/arch/arm/include/asm/word-at-a-time.h > > index a6d0a29..778b2ad 100644 > > --- a/arch/arm/include/asm/word-at-a-time.h > > +++ b/arch/arm/include/asm/word-at-a-time.h > > @@ -54,7 +54,7 @@ static inline unsigned long find_zero(unsigned long mask) > > #include > > #endif > > > > -#ifdef CONFIG_DCACHE_WORD_ACCESS > > +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS > > > > /* > > * Load an unaligned word from kernel space. > > @@ -94,5 +94,5 @@ static inline unsigned long load_unaligned_zeropad(const > > void *addr) > > return ret; > > } > > > > -#endif /* DCACHE_WORD_ACCESS */ > > +#endif /* HAVE_EFFICIENT_UNALIGNED_ACCESS */ > > #endif /* __ASM_ARM_WORD_AT_A_TIME_H */ > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index 764d682..2d6978c 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -13,7 +13,6 @@ config ARM64 > > select CLONE_BACKWARDS > > select COMMON_CLK > > select CPU_PM if (SUSPEND || CPU_IDLE) > > - select DCACHE_WORD_ACCESS > > select GENERIC_CLOCKEVENTS > > select GENERIC_CLOCKEVENTS_BROADCAST if SMP > > select GENERIC_IOMAP > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index abb261e..60cfa073 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -98,7 +98,6 @@ config X86 > > select CLKEVT_I8253 > > select ARCH_HAVE_NMI_SAFE_CMPXCHG > > select GENERIC_IOMAP > > - select DCACHE_WORD_ACCESS > > select GENERIC_SMP_IDLE_THREAD > > select ARCH_WANT_IPC_PARSE_VERSION if X86_32 > > select HAVE_ARCH_SECCOMP_FILTER > > diff --git a/fs/Kconfig b/fs/Kconfig > > index 312393f..7511271 100644 > > --- a/fs/Kconfig > > +++ b/fs/Kconfig > > @@ -4,10 +4,6 @@ > > > > menu "File systems" > > > > -# Use unaligned word dcache accesses > > -config DCACHE_WORD_ACCESS > > - bool > > - > > if BLOCK > > > > source "fs/ext2/Kconfig" > > diff --git a/fs/dcache.c b/fs/dcache.c > > index 265e0ce..4e3c195 100644 > > --- a/fs/dcache.c > > +++ b/fs/dcache.c > > @@ -163,7 +163,7 @@ int proc_nr_dentry(ctl_table *table, int write, void > > __user *buffer, > > * Compare 2 name strings, return 0 if they match, otherwise non-zero. > > * The strings are both count bytes long, and count is non-zero. > > */ > > -#ifdef CONFIG_DCACHE_WORD_ACCESS > > +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS > > > > #include > > /* > > diff --git a/fs/namei.c b/fs/namei.c > > index 385f781..1ee33ca 100644 > > --- a/fs/namei.c > > +++ b/fs/namei.c > > @@ -1618,7 +1618,7 @@ static inline int nested_symlink(struct path *path, > > struct nameidata *nd) > > * the final mask". Again, that could be replaced with a > > * efficient population count instruction or similar. > > */ > > -#ifdef CONFIG_DCACHE_WORD_ACCESS > > +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS > > > > #include ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH net-next 1/6] ppc: Kconfig: Enable BPF JIT on ppc32
On Sun, 2015-02-15 at 21:06 +0300, Denis Kirjanov wrote: [] > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig [] > @@ -126,7 +126,7 @@ config PPC > select IRQ_FORCED_THREADING > select HAVE_RCU_TABLE_FREE if SMP > select HAVE_SYSCALL_TRACEPOINTS > - select HAVE_BPF_JIT if PPC64 > + select HAVE_BPF_JIT trivia: Should this be the last patch of the series? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] cxl: Remove useless precision specifiers
On Mon, 2015-02-23 at 14:40 +1100, Ian Munsie wrote: > Excerpts from Rasmus Villemoes's message of 2015-02-21 00:26:22 +1100: > > C99 says that a precision given as simply '.' with no following digits > > or * should be interpreted as 0. The kernel's printf implementation, > > however, treats this case as if the precision was omitted. C99 also > > says that if both the precision and value are 0, no digits should be > > printed. Even if the kernel followed C99 to the letter, I don't think > > that would be particularly useful in these cases, so just remove the > > precision specifiers. > > Nice catch Rasmus, but I think a better patch would be one that adds the > missing precision (%.16llx). The kernel much more commonly uses %016llx $ git grep "%016llx" | grep -v staging | wc -l 792 $ git grep "%\.16llx" | grep -v staging | wc -l 36 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2] cxl: Add explicit precision specifiers
On Mon, 2015-02-23 at 11:55 +0100, Rasmus Villemoes wrote: > 24 of the %.16llx > matches are in drivers/misc/cxl/, so internal consistency wins. I think that's more an argument for changing all of the cx1 uses to "%016llx". ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 00/25] treewide: Use bool function return values of true/false not 1/0
Joe Perches (25): arm: Use bool function return values of true/false not 1/0 arm64: Use bool function return values of true/false not 1/0 hexagon: Use bool function return values of true/false not 1/0 ia64: Use bool function return values of true/false not 1/0 mips: Use bool function return values of true/false not 1/0 powerpc: Use bool function return values of true/false not 1/0 s390: Use bool function return values of true/false not 1/0 sparc: Use bool function return values of true/false not 1/0 tile: Use bool function return values of true/false not 1/0 unicore32: Use bool function return values of true/false not 1/0 x86: Use bool function return values of true/false not 1/0 virtio_console: Use bool function return values of true/false not 1/0 csiostor: Use bool function return values of true/false not 1/0 dcache: Use bool function return values of true/false not 1/0 nfsd: nfs4state: Use bool function return values of true/false not 1/0 include/linux: Use bool function return values of true/false not 1/0 sound: Use bool function return values of true/false not 1/0 rcu: tree_plugin: Use bool function return values of true/false not 1/0 sched: Use bool function return values of true/false not 1/0 ftrace: Use bool function return values of true/false not 1/0 slub: Use bool function return values of true/false not 1/0 bridge: Use bool function return values of true/false not 1/0 netfilter: Use bool function return values of true/false not 1/0 security: Use bool function return values of true/false not 1/0 sound: wm5100-tables: Use bool function return values of true/false not 1/0 arch/arm/include/asm/dma-mapping.h | 8 ++-- arch/arm/include/asm/kvm_emulate.h | 2 +- arch/arm/mach-omap2/powerdomain.c| 14 +++--- arch/arm64/include/asm/dma-mapping.h | 2 +- arch/hexagon/include/asm/dma-mapping.h | 2 +- arch/ia64/include/asm/dma-mapping.h | 2 +- arch/mips/include/asm/dma-mapping.h | 2 +- arch/powerpc/include/asm/dcr-native.h| 2 +- arch/powerpc/include/asm/dma-mapping.h | 4 +- arch/powerpc/include/asm/kvm_book3s_64.h | 4 +- arch/powerpc/sysdev/dcr.c| 2 +- arch/s390/include/asm/dma-mapping.h | 2 +- arch/sparc/mm/init_64.c | 8 ++-- arch/tile/include/asm/dma-mapping.h | 2 +- arch/unicore32/include/asm/dma-mapping.h | 2 +- arch/x86/include/asm/archrandom.h| 2 +- arch/x86/include/asm/dma-mapping.h | 2 +- arch/x86/include/asm/kvm_para.h | 2 +- arch/x86/kvm/cpuid.h | 2 +- arch/x86/kvm/vmx.c | 72 ++-- drivers/char/virtio_console.c| 2 +- drivers/scsi/csiostor/csio_scsi.c| 4 +- fs/dcache.c | 12 ++--- fs/nfsd/nfs4state.c | 2 +- include/linux/blkdev.h | 2 +- include/linux/ide.h | 2 +- include/linux/kgdb.h | 2 +- include/linux/mfd/db8500-prcmu.h | 2 +- include/linux/mm.h | 2 +- include/linux/power_supply.h | 8 ++-- include/linux/ssb/ssb_driver_extif.h | 2 +- include/linux/ssb/ssb_driver_gige.h | 16 +++ include/sound/soc.h | 4 +- kernel/rcu/tree_plugin.h | 4 +- kernel/sched/auto_group.h| 2 +- kernel/sched/completion.c| 16 --- kernel/trace/ftrace.c| 10 ++-- mm/slub.c| 12 ++--- net/bridge/br_private.h | 2 +- net/ipv4/netfilter/ipt_ah.c | 2 +- net/netfilter/ipset/ip_set_hash_ip.c | 8 ++-- net/netfilter/ipset/ip_set_hash_ipmark.c | 8 ++-- net/netfilter/ipset/ip_set_hash_ipport.c | 8 ++-- net/netfilter/ipset/ip_set_hash_ipportip.c | 8 ++-- net/netfilter/ipset/ip_set_hash_ipportnet.c | 8 ++-- net/netfilter/ipset/ip_set_hash_net.c| 8 ++-- net/netfilter/ipset/ip_set_hash_netiface.c | 8 ++-- net/netfilter/ipset/ip_set_hash_netport.c| 8 ++-- net/netfilter/ipset/ip_set_hash_netportnet.c | 8 ++-- net/netfilter/xt_connlimit.c | 2 +- net/netfilter/xt_hashlimit.c | 2 +- net/netfilter/xt_ipcomp.c| 2 +- security/apparmor/file.c | 8 ++-- security/apparmor/policy.c | 10 ++-- sound/soc/codecs/wm5100-tables.c | 12 ++--- 55 files changed, 178 insertions(+), 176 deletions(-) -- 2.1.2 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 06/25] powerpc: Use bool function return values of true/false not 1/0
Use the normal return values for bool functions Signed-off-by: Joe Perches --- arch/powerpc/include/asm/dcr-native.h| 2 +- arch/powerpc/include/asm/dma-mapping.h | 4 ++-- arch/powerpc/include/asm/kvm_book3s_64.h | 4 ++-- arch/powerpc/sysdev/dcr.c| 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/include/asm/dcr-native.h b/arch/powerpc/include/asm/dcr-native.h index 7d2e623..4efc11d 100644 --- a/arch/powerpc/include/asm/dcr-native.h +++ b/arch/powerpc/include/asm/dcr-native.h @@ -31,7 +31,7 @@ typedef struct { static inline bool dcr_map_ok_native(dcr_host_native_t host) { - return 1; + return true; } #define dcr_map_native(dev, dcr_n, dcr_c) \ diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 894d538..9103687 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h @@ -191,11 +191,11 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) struct dev_archdata *sd = &dev->archdata; if (sd->max_direct_dma_addr && addr + size > sd->max_direct_dma_addr) - return 0; + return false; #endif if (!dev->dma_mask) - return 0; + return false; return addr + size - 1 <= *dev->dma_mask; } diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h index 2d81e20..2a244bf 100644 --- a/arch/powerpc/include/asm/kvm_book3s_64.h +++ b/arch/powerpc/include/asm/kvm_book3s_64.h @@ -335,7 +335,7 @@ static inline bool hpte_read_permission(unsigned long pp, unsigned long key) { if (key) return PP_RWRX <= pp && pp <= PP_RXRX; - return 1; + return true; } static inline bool hpte_write_permission(unsigned long pp, unsigned long key) @@ -373,7 +373,7 @@ static inline bool slot_is_aligned(struct kvm_memory_slot *memslot, unsigned long mask = (pagesize >> PAGE_SHIFT) - 1; if (pagesize <= PAGE_SIZE) - return 1; + return true; return !(memslot->base_gfn & mask) && !(memslot->npages & mask); } diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c index 2d8a101..121e26f 100644 --- a/arch/powerpc/sysdev/dcr.c +++ b/arch/powerpc/sysdev/dcr.c @@ -54,7 +54,7 @@ bool dcr_map_ok_generic(dcr_host_t host) else if (host.type == DCR_HOST_MMIO) return dcr_map_ok_mmio(host.host.mmio); else - return 0; + return false; } EXPORT_SYMBOL_GPL(dcr_map_ok_generic); -- 2.1.2 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] MAINTAINERS: Add powerpc drivers to the powerpc section
On Wed, 2016-03-02 at 14:12 +1100, Michael Ellerman wrote: > On Wed, 2016-03-02 at 12:20 +1030, Joel Stanley wrote: > > > > > On Wed, Mar 2, 2016 at 12:06 PM, Michael Ellerman wrote: > > > > > > > > We'd like folks working on drivers for powerpc to also Cc linuxppc-dev, > > > so we can be aware of what's going on in drivers and/or review the > > > changes. > > > > > > So add patterns to the powerpc MAINTAINERS section to catch some of the > > > drivers we're interested in. > > There are a few more that would be good. '*opal*.c' catches these: > > > > ./drivers/i2c/busses/i2c-opal.c > > ./drivers/rtc/rtc-opal.c > > ./drivers/tty/hvc/hvc_opal.c > Ah yep thanks, will add "N: opal". N: and F: have different characteristics for get_maintainer.pl From MAINTAINERS: scripts/get_maintainer.pl has different behavior for files that match F: pattern and matches of N: patterns. By default, get_maintainer will not look at git log history when an F: pattern match occurs. When an N: match occurs, git log history is used to also notify the people that have git commit signatures. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v9 2/3] kernel.h: add to_user_ptr()
On Thu, 2016-03-17 at 18:19 -0300, Gustavo Padovan wrote: > 2016-03-17 Joe Perches : > > On Thu, 2016-03-17 at 16:50 -0400, Rob Clark wrote: > > > On Thu, Mar 17, 2016 at 4:40 PM, Joe Perches wrote: > > [] > > > > It's a name that seems like it should be a straightforward > > > > cast of a kernel pointer to a __user pointer like: > > > > > > > > static inline void __user *to_user_ptr(void *p) > > > > { > > > > return (void __user *)p; > > > > } > > > ahh, ok. I guess I was used to using it in the context of ioctl > > > structs.. in that context u64 -> (void __user *) made more sense. > > > > > > Maybe uapi_to_ptr()? (ok, not super-creative.. maybe someone has a > > > better idea) > > Maybe u64_to_user_ptr? > That is a good name. If everyone agrees I can resend this patch > changing it to u64_to_user_ptr. Then should we still keep it on > kernel.h? I've no particular opinion about location, but maybe compat.h might be appropriate. Maybe add all variants: void __user *u32_to_user_ptr(u32 val) void __user *u64_to_user_ptr(u64 val) u32 user_ptr_to_u32(void __user *p) u64 user_ptr_to_u64(void __user *p) Maybe there's something about 32 bit userspace on 64 OS that should be done too. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v9 2/3] kernel.h: add to_user_ptr()
On Thu, 2016-03-17 at 16:33 -0400, Rob Clark wrote: > On Thu, Mar 17, 2016 at 4:22 PM, Joe Perches wrote: > > On Thu, 2016-03-17 at 15:43 -0300, Gustavo Padovan wrote: > > > 2016-03-17 Gustavo Padovan : > > > > 2016-03-17 Joe Perches : > > > > > On Thu, 2016-03-17 at 14:30 -0300, Gustavo Padovan wrote: > > > > > > This function had copies in 3 different files. Unify them in > > > > > > kernel.h. > > > > > This is only used by gpu/drm. > > > > > > > > > > I think this is a poor name for a generic function > > > > > that would be in kernel.h. > > > > > > > > > > Isn't there an include file in linux/drm that's > > > > > appropriate for this. Maybe drmP.h > > > > > > > > > > Maybe prefix this function name with drm_ too. > > > > No, the next patch adds a user to drivers/staging (which will be moved > > > > to drivers/dma-buf) soon. Maybe move to a different header in > > > > include/linux/? not sure which one. > > > > > > > > > > > > > > > > > > > Also, there's this that might conflict: > > > > > > > > > > arch/powerpc/kernel/signal_32.c:#define to_user_ptr(p) > > > > > ptr_to_compat(p) > > > > > arch/powerpc/kernel/signal_32.c:#define to_user_ptr(p) > > > > > ((unsigned long)(p)) > > > > Right, I'll figure out how to replace these two too. > > > The powerpc to_user_ptr has a different meaning from the one I'm adding > > > in this patch. I propose we just rename powerpc's to_user_ptr to > > > __to_user_ptr and leave the rest as is. > > I think that's not a good idea, and you should really check > > this concept with the powerpc folk (added to to:s and cc:ed) > > > > If it were really added, then the function meaning is incorrect. > > > > This is taking a u64, casting that to (unsigned long/uint_ptr_t), > > then converting that to a user pointer. > > > > Does that naming and use make sense on x86-32 or arm32? > > > fwiw Gustavo's version of to_user_ptr() is in use on arm32 and arm64.. > Not entirely sure what doesn't make sense about it It's a name that seems like it should be a straightforward cast of a kernel pointer to a __user pointer like: static inline void __user *to_user_ptr(void *p) { return (void __user *)p; } As a static function in a single file, it's not great, but OK, fine, it's static. As a global function in kernel.h, it's misleading. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v9 2/3] kernel.h: add to_user_ptr()
On Thu, 2016-03-17 at 16:50 -0400, Rob Clark wrote: > On Thu, Mar 17, 2016 at 4:40 PM, Joe Perches wrote: [] > > It's a name that seems like it should be a straightforward > > cast of a kernel pointer to a __user pointer like: > > > > static inline void __user *to_user_ptr(void *p) > > { > > return (void __user *)p; > > } > ahh, ok. I guess I was used to using it in the context of ioctl > structs.. in that context u64 -> (void __user *) made more sense. > > Maybe uapi_to_ptr()? (ok, not super-creative.. maybe someone has a > better idea) Maybe u64_to_user_ptr? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v9 2/3] kernel.h: add to_user_ptr()
On Thu, 2016-03-17 at 15:43 -0300, Gustavo Padovan wrote: > 2016-03-17 Gustavo Padovan : > > 2016-03-17 Joe Perches : > > > On Thu, 2016-03-17 at 14:30 -0300, Gustavo Padovan wrote: > > > > > > > > This function had copies in 3 different files. Unify them in > > > > kernel.h. > > > This is only used by gpu/drm. > > > > > > I think this is a poor name for a generic function > > > that would be in kernel.h. > > > > > > Isn't there an include file in linux/drm that's > > > appropriate for this. Maybe drmP.h > > > > > > Maybe prefix this function name with drm_ too. > > No, the next patch adds a user to drivers/staging (which will be moved > > to drivers/dma-buf) soon. Maybe move to a different header in > > include/linux/? not sure which one. > > > > > > > > Also, there's this that might conflict: > > > > > > arch/powerpc/kernel/signal_32.c:#define to_user_ptr(p) > > > ptr_to_compat(p) > > > arch/powerpc/kernel/signal_32.c:#define to_user_ptr(p) > > > ((unsigned long)(p)) > > Right, I'll figure out how to replace these two too. > The powerpc to_user_ptr has a different meaning from the one I'm adding > in this patch. I propose we just rename powerpc's to_user_ptr to > __to_user_ptr and leave the rest as is. I think that's not a good idea, and you should really check this concept with the powerpc folk (added to to:s and cc:ed) If it were really added, then the function meaning is incorrect. This is taking a u64, casting that to (unsigned long/uint_ptr_t), then converting that to a user pointer. Does that naming and use make sense on x86-32 or arm32? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] mtd: nand: pasemi: switch to pr_* functions
On Fri, 2016-04-08 at 12:33 +0200, Rafał Miłecki wrote: > This patch also replaces %08llx with %08zx for printing resource start > address. Old format was triggering: > warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument > 2 has type ‘resource_size_t’ trivia: > diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c [] > @@ -112,8 +112,7 @@ static int pasemi_nand_probe(struct platform_device > *ofdev) > /* Allocate memory for MTD device structure and private data */ > chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL); > if (!chip) { > - printk(KERN_WARNING > - "Unable to allocate PASEMI NAND MTD device structure\n"); > + pr_warn("Unable to allocate PASEMI NAND MTD device > structure\n"); Maybe remove this unnecessary as there's an OOM stack dump. > err = -ENOMEM; > goto out; > } > @@ -163,13 +162,13 @@ static int pasemi_nand_probe(struct platform_device > *ofdev) > } > > if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) { > - printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n"); > + pr_err("pasemi_nand: Unable to register MTD device\n"); Maybe remove the embedded "pasemi_nand: " and add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt before the first #include? > err = -ENODEV; > goto out_lpc; > } > > - printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n", > - res.start, lpcctl); > + pr_info("PA Semi NAND flash at %08zx, control at I/O %x\n", res.start, > + lpcctl); Maybe use %pR, &res instead of res.start? pr_info("PA Semi NAND flash at %pR, control at I/O %x\n", &res, lpcctl); ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH V2] mtd: nand: pasemi: switch to pr_* functions
On Fri, 2016-04-08 at 13:13 +0200, Rafał Miłecki wrote: > 1) Use pr_fmt to keep messages consistent > 2) Don't warn if kzalloc fails as it dumps stack on its own > 3) Use %pR format for displaying whole resource to avoid: > warning: format ‘%08llx’ expects type ‘long long unsigned int’, but > argument 2 has type ‘resource_size_t’ thanks ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [net-next v4 1/8] devres: add devm_alloc_percpu()
On Mon, 2015-11-02 at 19:31 +0200, Madalin Bucur wrote: > Introduce managed counterparts for alloc_percpu() and free_percpu(). > Add devm_alloc_percpu() and devm_free_percpu() into the managed > interfaces list. trivia, could be fixed later > +/** > + * __devm_alloc_percpu - Resource-managed alloc_percpu > + * @dev: Device to allocate per-cpu memory for > + * @size: Size of per-cpu memory to allocate > + * @align: Alignement of per-cpu memory to allocate French spelling? alignment ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [net-next v4 2/8] dpaa_eth: add support for DPAA Ethernet
On Mon, 2015-11-02 at 19:31 +0200, Madalin Bucur wrote: > This introduces the Freescale Data Path Acceleration Architecture > (DPAA) Ethernet driver (dpaa_eth) that builds upon the DPAA QMan, > BMan, PAMU and FMan drivers to deliver Ethernet connectivity on > the Freescale DPAA QorIQ platforms. [] > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c [] > +static void _dpa_rx_error(struct net_device *net_dev, > + const struct dpa_priv_s *priv, > + struct dpa_percpu_priv_s *percpu_priv, > + const struct qm_fd *fd, > + u32 fqid) > +{ > + /* limit common, possibly innocuous Rx FIFO Overflow errors' > + * interference with zero-loss convergence benchmark results. > + */ > + if (likely(fd->status & FM_FD_ERR_PHYSICAL)) > + pr_warn_once("non-zero error counters in fman statistics > (sysfs)\n"); > + else > + if (net_ratelimit()) > + netif_err(priv, hw, net_dev, "Err FD status = 0x%08x\n", > + fd->status & FM_FD_STAT_RX_ERRORS); It's a bit of a pity the logging message code is a mix of pr_, dev_, netdev_ and netif_ Perhaps netif__ratelimited macros should be added. Something like: --- include/linux/netdevice.h | 54 +++ 1 file changed, 54 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 210d11a..555471d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4025,6 +4025,60 @@ do { \ }) #endif +#define netif_level_ratelimited(level, priv, type, dev, fmt, args...) \ +do { \ + if (netif_msg_##type(priv) && net_ratelimit()) \ + netdev_##level(dev, fmt, ##args); \ +} while (0) + +#define netif_emerg_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(emerg, priv, type, dev, fmt, ##args) +#define netif_alert_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(alert, priv, type, dev, fmt, ##args) +#define netif_crit_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(crit, priv, type, dev, fmt, ##args) +#define netif_err_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(err, priv, type, dev, fmt, ##args) +#define netif_warn_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(warn, priv, type, dev, fmt, ##args) +#define netif_notice_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(notice, priv, type, dev, fmt, ##args) +#define netif_info_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(info, priv, type, dev, fmt, ##args) + +#if defined(CONFIG_DYNAMIC_DEBUG) +/* descriptor check is first to prevent flooding with "callbacks suppressed" */ +#define netif_dbg_ratelimited(priv, type, dev, fmt, args...) \ +do { \ + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ + if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) &&\ + netif_msg_##type(priv) && net_ratelimit()) \ + __dynamic_netdev_dbg(&descriptor, dev, fmt, ##args);\ +} while (0) +#elif defined(DEBUG) +#define netif_dbg_ratelimited(priv, type, dev, fmt, args...) \ +do { \ + if (netif_msg_##type(priv) && net_ratelimit()) \ + netif_printk(priv, type, KERN_DEBUG, dev, fmt, ##args); \ +} while (0) +#else +#define netif_dbg_ratelimited(priv, type, dev, fmt, args...) \ +do { \ + if (0) \ + netif_printk(priv, type, KERN_DEBUG, dev, fmt, ##args); \ +} while (0) +#endif + +#if defined(VERBOSE_DEBUG) +#define netif_vdbg_ratelimited netif_dbg_ratelimited +#else +#define netif_vdbg(priv, type, dev, fmt, args...) \ +do { \ + if (0) \ + netif_printk(priv, type, KERN_DEBUG, dev, fmt, ##args); \ +} while (0) +#endif + /* * The list of packet types we will receive (as opposed to discard) * and the routines to invoke. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [net-next v4 3/8] dpaa_eth: add support for S/G frames
On Mon, 2015-11-02 at 19:31 +0200, Madalin Bucur wrote: > Add support for Scater/Gather (S/G) frames. The FMan can place > the frame content into multiple buffers and provide a S/G Table > (SGT) into one first buffer with references to the others. trivia: scatter > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c [] > @@ -1177,10 +1177,42 @@ void dpaa_eth_init_ports(struct mac_device *mac_dev, > port_fqs->rx_defq, &buf_layout[RX]); > } > > +void dpa_release_sgt(struct qm_sg_entry *sgt) > +{ > + struct dpa_bp *dpa_bp; > + struct bm_buffer bmb[DPA_BUFF_RELEASE_MAX]; Where is "struct bm_buffer" defined? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [net-next v4 6/8] dpaa_eth: add ethtool statistics
On Mon, 2015-11-02 at 19:31 +0200, Madalin Bucur wrote: > Add a series of counters to be exported through ethtool: > - add detailed counters for reception errors; > - add detailed counters for QMan enqueue reject events; > - count the number of fragmented skbs received from the stack; > - count all frames received on the Tx confirmation path; > - add congestion group statistics; > - count the number of interrupts for each CPU. [] > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c > b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c [] > +static void dpa_get_strings(struct net_device *net_dev, u32 stringset, u8 > *data) > +{ > + unsigned int i, j, num_cpus, size; > + char string_cpu[ETH_GSTRING_LEN]; > + u8 *strings; > + > + strings = data; > + num_cpus = num_online_cpus(); > + size = DPA_STATS_GLOBAL_LEN * ETH_GSTRING_LEN; > + > + for (i = 0; i < DPA_STATS_PERCPU_LEN; i++) { > + for (j = 0; j < num_cpus; j++) { > + snprintf(string_cpu, ETH_GSTRING_LEN, "%s [CPU %d]", > + dpa_stats_percpu[i], j); > + memcpy(strings, string_cpu, ETH_GSTRING_LEN); > + strings += ETH_GSTRING_LEN; > + } > + snprintf(string_cpu, ETH_GSTRING_LEN, "%s [TOTAL]", > + dpa_stats_percpu[i]); > + memcpy(strings, string_cpu, ETH_GSTRING_LEN); > + strings += ETH_GSTRING_LEN; > + } > + memcpy(strings, dpa_stats_global, size); > +} This leaks uninitialized stack via a memcpy of uninitialized string_cpu bytes into user-space. Using char string_cpu[ETH_GSTRING_LEN] = {}; or a memset before each snprintf would fix it. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [net-next v4 3/8] dpaa_eth: add support for S/G frames
On Mon, 2015-11-02 at 19:31 +0200, Madalin Bucur wrote: > Add support for Scater/Gather (S/G) frames. The FMan can place > the frame content into multiple buffers and provide a S/G Table > (SGT) into one first buffer with references to the others. trivia: > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h [] > @@ -347,7 +347,7 @@ static inline void clear_fd(struct qm_fd *fd) > } > > static inline int _dpa_tx_fq_to_id(const struct dpa_priv_s *priv, > -struct qman_fq *tx_fq) > + struct qman_fq *tx_fq) superfluous change? > +void dpa_release_sgt(struct qm_sg_entry *sgt) > +{ > + struct dpa_bp *dpa_bp; > + struct bm_buffer bmb[DPA_BUFF_RELEASE_MAX]; > + u8 i = 0, j; Using int may be better than u8 for indexing ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [net-next v5 2/8] dpaa_eth: add support for DPAA Ethernet
On Fri, 2015-12-04 at 14:55 -0500, David Miller wrote: > From: Madalin Bucur > Date: Thu, 3 Dec 2015 15:49:43 +0200 > > > @@ -0,0 +1,22 @@ > > +menuconfig FSL_DPAA_ETH > > + tristate "DPAA Ethernet" > > + depends on FSL_SOC && FSL_BMAN && FSL_QMAN && FSL_FMAN > > + select PHYLIB > > + select FSL_FMAN_MAC > > I do not see the FSL_FMAN_MAC Kconfig symbol defined anywhere in the > tree. I believe this patch series is dependent on two other patch series mentioned in the cover letter. --- The latest FMan driver patches were submitted by Igal Liberman: https://patchwork.ozlabs.org/project/netdev/list/?submitter=64715&state=* The latest Q/BMan drivers were submitted by Roy Pledge: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?submitter=66331&state=* ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/3] checkpatch.pl: add missing memory barriers
On Mon, 2016-01-04 at 13:36 +0200, Michael S. Tsirkin wrote: > SMP-only barriers were missing in checkpatch.pl > > Refactor code slightly to make adding more variants easier. > > Signed-off-by: Michael S. Tsirkin > --- > scripts/checkpatch.pl | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 2b3c228..0245bbe 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -5116,7 +5116,14 @@ sub process { > } > } > # check for memory barriers without a comment. > - if ($line =~ > /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) > { > + > + my @barriers = ('mb', 'rmb', 'wmb', 'read_barrier_depends'); > + my @smp_barriers = ('smp_store_release', 'smp_load_acquire', > 'smp_store_mb'); > + > + @smp_barriers = (@smp_barriers, map {"smp_" . $_} @barriers); I think using map, which so far checkpatch doesn't use, makes smp_barriers harder to understand and it'd be better to enumerate them. > + my $all_barriers = join('|', (@barriers, @smp_barriers)); > + > + if ($line =~ /\b($all_barriers)\(/) { It would be better to use /\b$all_barriers\s*\(/ as there's no reason for the capture and there could be a space between the function and the open parenthesis. > if (!ctx_has_comment($first_line, $linenr)) { > WARN("MEMORY_BARRIER", > "memory barrier without comment\n" . > $herecurr); ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/3] checkpatch.pl: add missing memory barriers
On Mon, 2016-01-04 at 16:11 +, Russell King - ARM Linux wrote: > On Mon, Jan 04, 2016 at 08:07:40AM -0800, Joe Perches wrote: > > On Mon, 2016-01-04 at 13:36 +0200, Michael S. Tsirkin wrote: > > > + my $all_barriers = join('|', (@barriers, @smp_barriers)); > > > + > > > + if ($line =~ /\b($all_barriers)\(/) { > > > > It would be better to use /\b$all_barriers\s*\(/ > > as there's no reason for the capture and there > > could be a space between the function and the > > open parenthesis. > > I think you mean > > /\b(?:$all_barriers)\s*\(/ > > as 'all_barriers' will be: > > mb|wmb|rmb|smp_mb|smp_wmb|smp_rmb > > and putting that into your suggestion results in: > > /\bmb|wmb|rmb|smp_mb|smp_wmb|smp_rmb\s*\(/ > > which is clearly wrong - the \b only applies to 'mb' and the \s*\( only > applies to smp_rmb. right, thanks. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/3] checkpatch: add virt barriers
On Mon, 2016-01-04 at 13:37 +0200, Michael S. Tsirkin wrote: > Add virt_ barriers to list of barriers to check for > presence of a comment. Are these virt_ barriers used anywhere? I see some virtio_ barrier like uses. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/3] checkpatch: add virt barriers
On Mon, 2016-01-04 at 23:07 +0200, Michael S. Tsirkin wrote: > On Mon, Jan 04, 2016 at 08:47:53AM -0800, Joe Perches wrote: > > On Mon, 2016-01-04 at 13:37 +0200, Michael S. Tsirkin wrote: > > > Add virt_ barriers to list of barriers to check for > > > presence of a comment. > > > > Are these virt_ barriers used anywhere? > > > > I see some virtio_ barrier like uses. > > They will be :) They are added and used by patchset > arch: barrier cleanup + barriers for virt > > See > http://article.gmane.org/gmane.linux.kernel.virtualization/26555 Ah, OK, thanks. Are the virtio_ barriers going away? If not, maybe those should be added too. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/3] checkpatch.pl: add missing memory barriers
On Mon, 2016-01-04 at 22:45 +0200, Michael S. Tsirkin wrote: > On Mon, Jan 04, 2016 at 08:07:40AM -0800, Joe Perches wrote: > > On Mon, 2016-01-04 at 13:36 +0200, Michael S. Tsirkin wrote: > > > SMP-only barriers were missing in checkpatch.pl > > > > > > Refactor code slightly to make adding more variants easier. > > > > > > Signed-off-by: Michael S. Tsirkin > > > --- > > > scripts/checkpatch.pl | 9 - > > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > > index 2b3c228..0245bbe 100755 > > > --- a/scripts/checkpatch.pl > > > +++ b/scripts/checkpatch.pl > > > @@ -5116,7 +5116,14 @@ sub process { > > > } > > > } > > > # check for memory barriers without a comment. > > > - if ($line =~ > > > /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) > > > { > > > + > > > + my @barriers = ('mb', 'rmb', 'wmb', 'read_barrier_depends'); > > > + my @smp_barriers = ('smp_store_release', 'smp_load_acquire', > > > 'smp_store_mb'); > > > + > > > + @smp_barriers = (@smp_barriers, map {"smp_" . $_} @barriers); > > > > I think using map, which so far checkpatch doesn't use, > > makes smp_barriers harder to understand and it'd be > > better to enumerate them. > > Okay - I'll rewrite using foreach. > I think using the qr form (like 'our $Attribute' and a bunch of others) is the general style that should be used for checkpatch. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Build failure: -Wno-unused-const-variable DNE on old GCC
On Thu, 2016-01-07 at 20:44 +0100, Michal Marek wrote: > Dne 7.1.2016 v 20:37 Joe Perches napsal(a): > > On Thu, 2016-01-07 at 10:54 -0800, Brian Norris wrote: > > > I'm using a GCC 4.6.3 compiler for some compile tests, and I noticed > > > that commit 2cd55c68c0a4 ("cxl: Fix build failure due to -Wunused-variable > > > behaviour change") breaks my builds, because the > > > -Wno-unused-const-variable doesn't exist on GCC 4.6.3. > > > drivers/misc/cxl/base.c: At top level: > > > cc1: error: unrecognized command line option > > > "-Wno-unused-const-variable" [-Werror] > > > Any thoughts on how to best fix this? I'd like not to have to scrounge > > > up a new cross compiler just for build tests. > > drivers/misc/cxl/Makefile:ccflags-y := -Werror -Wno-unused-const-variable > > You could take that -Wno-unused-const-variable out of the > > Makefile or maybe add something like: > > > > $(call cc-ifversion, -ge, 0530, -Wno-unused-const-variable) > > > > or whatever gcc version actually added that unused-const-variable check > > We have cc-disable-warning for this. Thanks Michal. Perhaps most uses of -Werror without some CONFIG_ guard should be removed or replaced by some other mechanism. $ git grep -E "=\s*\-Werror" | grep -v CONFIG [...] arch/alpha/lib/Makefile:ccflags-y := -Werror arch/alpha/mm/Makefile:ccflags-y := -Werror arch/alpha/oprofile/Makefile:ccflags-y := -Werror -Wno-sign-compare arch/metag/oprofile/Makefile:ccflags-y += -Werror arch/mips/Kbuild:subdir-ccflags-y := -Werror arch/sh/cchips/hd6446x/Makefile:ccflags-y := -Werror arch/sh/kernel/Makefile:ccflags-y := -Werror arch/sh/lib/Makefile:ccflags-y := -Werror arch/sh/mm/Makefile:ccflags-y := -Werror arch/sparc/kernel/Makefile:ccflags-y := -Werror arch/sparc/lib/Makefile:ccflags-y := -Werror arch/sparc/mm/Makefile:ccflags-y := -Werror arch/sparc/prom/Makefile:ccflags := -Werror drivers/gpu/drm/tilcdc/Makefile:ccflags-y += -Werror drivers/misc/cxl/Makefile:ccflags-y := -Werror -Wno-unused-const-variable drivers/scsi/aic7xxx/Makefile:ccflags-y += -Werror drivers/scsi/lpfc/Makefile:ccflags-y += -Werror ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 1/3] checkpatch.pl: add missing memory barriers
On Sun, 2016-01-10 at 13:56 +0200, Michael S. Tsirkin wrote: > SMP-only barriers were missing in checkpatch.pl > > Refactor code slightly to make adding more variants easier. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -5116,7 +5116,25 @@ sub process { > } > } > # check for memory barriers without a comment. > - if ($line =~ > /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) > { > + > + my $barriers = qr{ > + mb| > + rmb| > + wmb| > + read_barrier_depends > + }x; > + my $smp_barriers = qr{ > + store_release| > + load_acquire| > + store_mb| > + ($barriers) > + }x; If I use a variable called $smp_barriers, I'd expect it to actually be the smp_barriers, not to have to prefix it with smp_ before using it. my $smp_barriers = qr{ smp_store_release| smp_load_acquire| smp_store_mb| smp_read_barrier_depends }x; or my $smp_barriers = qr{ smp_(?:store_release|load_acquire|store_mb|read_barrier_depends) }x; > + my $all_barriers = qr{ > + $barriers| > + smp_($smp_barriers) > + }x; And this shouldn't have a capture group. my $all_barriers = qr{ $barriers| $smp_barriers }x; > + > + if ($line =~ /\b($all_barriers)\s*\(/) { This doesn't need the capture group either (?:all_barriers) > if (!ctx_has_comment($first_line, $linenr)) > { > WARN("MEMORY_BARRIER", > "memory barrier without > comment\n" . $herecurr); ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 2/3] checkpatch: check for __smp outside barrier.h
On Sun, 2016-01-10 at 13:57 +0200, Michael S. Tsirkin wrote: > Introduction of __smp barriers cleans up a bunch of duplicate code, but > it gives people an additional handle onto a "new" set of barriers - just > because they're prefixed with __* unfortunately doesn't stop anyone from > using it (as happened with other arch stuff before.) > > Add a checkpatch test so it will trigger a warning. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -5141,6 +5141,16 @@ sub process { > } > } > > + my $underscore_smp_barriers = qr{__smp_($smp_barriers)}x; another unnecessary capture group > + > + if ($realfile !~ m@^include/asm-generic/@ && > + $realfile !~ m@/barrier\.h$@ && > + $line =~ m/\b($underscore_smp_barriers)\s*\(/ && > + $line !~ > m/^.\s*\#\s*define\s+($underscore_smp_barriers)\s*\(/) { > + WARN("MEMORY_BARRIER", > + "__smp memory barriers shouldn't be used outside > barrier.h and asm-generic\n" . $herecurr); > + } > + > # check for waitqueue_active without a comment. > if ($line =~ /\bwaitqueue_active\s*\(/) { > if (!ctx_has_comment($first_line, $linenr)) { ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 1/3] checkpatch.pl: add missing memory barriers
On Sun, 2016-01-10 at 07:07 -0800, Joe Perches wrote: > On Sun, 2016-01-10 at 13:56 +0200, Michael S. Tsirkin wrote: > > SMP-only barriers were missing in checkpatch.pl > > > > Refactor code slightly to make adding more variants easier. > [] > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > If I use a variable called $smp_barriers, I'd expect > it to actually be the smp_barriers, not to have to > prefix it with smp_ before using it. > > my $smp_barriers = qr{ > smp_store_release| > smp_load_acquire| > smp_store_mb| > smp_read_barrier_depends That's missing (?:barriers) too. btw: shouldn't this also have smp_mb__(?:before|after)_atomic ? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v3 3/3] checkpatch: add virt barriers
On Mon, 2016-01-11 at 09:13 +1100, Julian Calaby wrote: > On Mon, Jan 11, 2016 at 6:31 AM, Michael S. Tsirkin wrote: > > Add virt_ barriers to list of barriers to check for > > presence of a comment. [] > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > > @@ -5133,7 +5133,8 @@ sub process { > > }x; > > my $all_barriers = qr{ > > $barriers| > > - smp_(?:$smp_barrier_stems) > > + smp_(?:$smp_barrier_stems)| > > + virt_(?:$smp_barrier_stems) > > Sorry I'm late to the party here, but would it make sense to write this as: > > (?:smp|virt)_(?:$smp_barrier_stems) Yes. Perhaps the name might be better as barrier_stems. Also, ideally this would be longest match first or use \b after the matches so that $all_barriers could work successfully without a following \s*\( my $all_barriers = qr{ (?:smp|virt)_(?:barrier_stems)| $barriers) }x; or maybe add separate $smp_barriers and $virt_barriers it doesn't matter much in any case ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v4 0/3] checkpatch: handling of memory barriers
On Mon, 2016-01-11 at 13:00 +0200, Michael S. Tsirkin wrote: > As part of memory barrier cleanup, this patchset > extends checkpatch to make it easier to stop > incorrect memory barrier usage. Thanks Michael. Acked-by: Joe Perches ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Build failure: -Wno-unused-const-variable DNE on old GCC
On Sat, 2016-01-30 at 14:20 +, Maciej W. Rozycki wrote: > On Thu, 7 Jan 2016, Brian Norris wrote: > > > > Perhaps most uses of -Werror without some CONFIG_ guard > > > should be removed or replaced by some other mechanism. > > > > +1000. I'd personally like to see all one-off uses of -Werror removed. > > > > > $ git grep -E "=\s*\-Werror" | grep -v CONFIG > > > [...] > > > arch/alpha/lib/Makefile:ccflags-y := -Werror > > > arch/alpha/mm/Makefile:ccflags-y := -Werror > > > arch/alpha/oprofile/Makefile:ccflags-y := -Werror -Wno-sign-compare > > > arch/metag/oprofile/Makefile:ccflags-y+= -Werror > > > arch/mips/Kbuild:subdir-ccflags-y := -Werror > > > > ^^ I always patch this one out when build-testing MIPS, since I like to > > turn up warning levels (e.g., W=1), but not kill the build entirely. > > The MIPS port switched on -Werror years ago, because people submitted > awful code and couldn't be bothered unless the build crashed. You're > welcome to patch your own tree, however I maintain it was a very good > decision, and TBH I think -Werror should be on globally. That'd be easy to do with some CONFIG_COMPILER_ERROR type rather than in specific directory Makefiles ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/4] powerpc/ps3: gelic_udbg: use struct ethhdr from
On Sun, 2016-02-07 at 17:38 +, Luis Henriques wrote: > Instead of defining a local version of struct ethhdr use the standard > definition from . trivia: > diff --git a/arch/powerpc/platforms/ps3/gelic_udbg.c > b/arch/powerpc/platforms/ps3/gelic_udbg.c [] > @@ -173,8 +169,8 @@ static void gelic_debug_init(void) > > h_eth = (struct ethhdr *)dbg.pkt; > > - memset(&h_eth->dest, 0xff, 6); > - memcpy(&h_eth->src, &mac, 6); > + memset(&h_eth->h_dest, 0xff, 6); > + memcpy(&h_eth->h_source, &mac, 6); Be nice to use ETH_ALEN and eth_broadcast_addr. Maybe ether_addr_copy too. > @@ -183,7 +179,7 @@ static void gelic_debug_init(void) > GELIC_LV1_VLAN_TX_ETHERNET_0, 0, 0, > &vlan_id, &v2); > if (!result) { > - h_eth->type = 0x8100; > + h_eth->h_proto= 0x8100; ETH_P_8021Q > header_size += sizeof(struct vlantag); > h_vlan = (struct vlantag *)(h_eth + 1); > @@ -191,7 +187,7 @@ static void gelic_debug_init(void) > h_vlan->subtype = 0x0800; > h_ip = (struct iphdr *)(h_vlan + 1); > } else { > - h_eth->type = 0x0800; > + h_eth->h_proto= 0x0800; ETH_P_IP ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 2/5] ocxl: Clean up printf formats
On Wed, 2019-02-27 at 15:57 +1100, Alastair D'Silva wrote: > From: Alastair D'Silva > > Use %# instead of using a literal '0x' I think it's better not to change this unless the compilation unit already uses a mix of styles. Overall, the kernel uses "0x%" over "%#" by ~8:1 $ git grep -P '0x%\d*[hl]*x' | wc -l 27654 $ git grep -P '%#\d*[hl]*x' | wc -l 3454 > diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/ocxl/config.c [] > @@ -178,9 +178,9 @@ static int read_dvsec_vendor(struct pci_dev *dev) > pci_read_config_dword(dev, pos + OCXL_DVSEC_VENDOR_DLX_VERS, &dlx); > > dev_dbg(&dev->dev, "Vendor specific DVSEC:\n"); > - dev_dbg(&dev->dev, " CFG version = 0x%x\n", cfg); > - dev_dbg(&dev->dev, " TLX version = 0x%x\n", tlx); > - dev_dbg(&dev->dev, " DLX version = 0x%x\n", dlx); > + dev_dbg(&dev->dev, " CFG version = %#x\n", cfg); > + dev_dbg(&dev->dev, " TLX version = %#x\n", tlx); > + dev_dbg(&dev->dev, " DLX version = %#x\n", dlx); [...]
Re: [PATCH v3 2/5] ocxl: Clean up printf formats
On Wed, 2019-03-20 at 16:34 +1100, Alastair D'Silva wrote: > From: Alastair D'Silva > > Use %# instead of using a literal '0x' I do not suggest this as reasonable. There are 10's of thousands of uses of 0x%x in the kernel and converting them to save a byte seems unnecessary. $ git grep -P '0x%[\*\d\.]*[xX]' | wc -l 26120 And the %#x style is by far the lesser used form $ git grep -P '%#[\*\d\.]*[xX]' | wc -l 2726 Also, the sized form of %#[size]x is frequently misused where the size does not account for the initial 0x output. > diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/ocxl/config.c [] > @@ -178,9 +178,9 @@ static int read_dvsec_vendor(struct pci_dev *dev) > pci_read_config_dword(dev, pos + OCXL_DVSEC_VENDOR_DLX_VERS, &dlx); > > dev_dbg(&dev->dev, "Vendor specific DVSEC:\n"); > - dev_dbg(&dev->dev, " CFG version = 0x%x\n", cfg); > - dev_dbg(&dev->dev, " TLX version = 0x%x\n", tlx); > - dev_dbg(&dev->dev, " DLX version = 0x%x\n", dlx); > + dev_dbg(&dev->dev, " CFG version = %#x\n", cfg); > + dev_dbg(&dev->dev, " TLX version = %#x\n", tlx); > + dev_dbg(&dev->dev, " DLX version = %#x\n", dlx); etc...
Bad file pattern in MAINTAINERS section 'IBM Power Virtual Accelerator Switchboard'
A file pattern line in this section of the MAINTAINERS file in linux-next does not have a match in the linux source files. This could occur because a matching filename was never added, was deleted or renamed in some other commit. The commits that added and if found renamed or removed the file pattern are shown below. Please fix this defect appropriately. 1: --- linux-next MAINTAINERS section: 7396IBM Power Virtual Accelerator Switchboard 7397M: Sukadev Bhattiprolu 7398L: linuxppc-dev@lists.ozlabs.org 7399S: Supported 7400F: arch/powerpc/platforms/powernv/vas* 7401F: arch/powerpc/platforms/powernv/copy-paste.h 7402F: arch/powerpc/include/asm/vas.h --> 7403F: arch/powerpc/include/uapi/asm/vas.h 2: --- The most recent commit that added or modified file pattern 'arch/powerpc/include/uapi/asm/vas.h': commit 4dea2d1a927c61114a168d4509b56329ea6effb7 Author: Sukadev Bhattiprolu Date: Mon Aug 28 23:23:33 2017 -0700 powerpc/powernv/vas: Define vas_init() and vas_exit() Implement vas_init() and vas_exit() functions for a new VAS module. This VAS module is essentially a library for other device drivers and kernel users of the NX coprocessors like NX-842 and NX-GZIP. In the future this will be extended to add support for user space to access the NX coprocessors. VAS is currently only supported with 64K page size. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Michael Ellerman .../devicetree/bindings/powerpc/ibm,vas.txt| 22 +++ MAINTAINERS| 8 ++ arch/powerpc/platforms/powernv/Kconfig | 14 ++ arch/powerpc/platforms/powernv/Makefile| 1 + arch/powerpc/platforms/powernv/vas-window.c| 19 +++ arch/powerpc/platforms/powernv/vas.c | 151 + arch/powerpc/platforms/powernv/vas.h | 2 + 7 files changed, 217 insertions(+) 3: --- No commit with file pattern 'arch/powerpc/include/uapi/asm/vas.h' was found
Re: Bad file pattern in MAINTAINERS section 'IBM Power Virtual Accelerator Switchboard'
On Mon, 2019-03-25 at 16:35 -0700, Joe Perches wrote: > A file pattern line in this section of the MAINTAINERS file in linux-next > does not have a match in the linux source files. > > This could occur because a matching filename was never added, was deleted > or renamed in some other commit. > > The commits that added and if found renamed or removed the file pattern > are shown below. > > Please fix this defect appropriately. > > 1: --- > > linux-next MAINTAINERS section: > > 7396IBM Power Virtual Accelerator Switchboard > 7397M: Sukadev Bhattiprolu btw: Your name needs an email address here too. This should be: M: Sukadev Bhattiprolu
Re: [PATCH] MAINTAINERS: Update remaining @linux.vnet.ibm.com addresses
On Thu, 2019-04-11 at 06:27 +0200, Lukas Bulwahn wrote: > Paul McKenney attempted to update all email addresses @linux.vnet.ibm.com > to @linux.ibm.com in commit 1dfddcdb95c4 > ("MAINTAINERS: Update from @linux.vnet.ibm.com to @linux.ibm.com"), but > some still remained. > > We update the remaining email addresses in MAINTAINERS, hopefully finally > catching all cases for good. Perhaps update all the similar addresses in other files too $ git grep --name-only 'linux\.vnet\.ibm\.com' | wc -l 315
Re: [PATCH] MAINTAINERS: Update remaining @linux.vnet.ibm.com addresses
On Thu, 2019-04-11 at 22:07 +1000, Michael Ellerman wrote: > Joe Perches writes: > > On Thu, 2019-04-11 at 06:27 +0200, Lukas Bulwahn wrote: > > > Paul McKenney attempted to update all email addresses @linux.vnet.ibm.com > > > to @linux.ibm.com in commit 1dfddcdb95c4 > > > ("MAINTAINERS: Update from @linux.vnet.ibm.com to @linux.ibm.com"), but > > > some still remained. > > > > > > We update the remaining email addresses in MAINTAINERS, hopefully finally > > > catching all cases for good. > > > > Perhaps update all the similar addresses in other files too > > > > $ git grep --name-only 'linux\.vnet\.ibm\.com' | wc -l > > 315 > > A good number of them are no longer valid. So I'm not sure it's worth > updating them en masse to addresses that won't ever work. > > We have git now, we don't need email addresses in files, they're just > prone to bitrot like this. > > Should we just change them all like so? > > -arch/powerpc/boot/dts/bamboo.dts: * Josh Boyer > +arch/powerpc/boot/dts/bamboo.dts: * Josh Boyer (IBM) > > To indicate the author was at IBM when they wrote it? If that's desired, perhaps: $ git grep -P --name-only '?' | \ grep -vP '\.mailmap|MAINTAINERS' | \ xargs perl -p -i -e 's/?/(IBM)/g' > Or should we try and update them with current addresses? Though then the > authors might start getting mails they don't want. That'd be my preference. If authors get emails they don't want, then those contact emails should be removed.
Re: [PATCH] MAINTAINERS: Update remaining @linux.vnet.ibm.com addresses
On Thu, 2019-04-11 at 06:12 -0700, Paul E. McKenney wrote: > If my email address were > to change again, I would instead go with the "(IBM)" approach and let > the git log and MAINTAINERS file keep the contact information. Not that > we get to update the git log, of course. ;-) Add entries to .mailmap works too.