RE: [PATCH] mtd: nand: Rename nand.h into rawnand.h

2017-08-07 Thread Hartley Sweeten
On Friday, August 04, 2017 8:29 AM, Boris Brezillon wrote:
> We are planning to share more code between different NAND based
> devices (SPI NAND, OneNAND and raw NANDs), but before doing that
> we need to move the existing include/linux/mtd/nand.h file into
> include/linux/mtd/rawnand.h so we can later create a nand.h header
> containing all common structure and function prototypes.

For ep93xx,

Acked-by: H Hartley Sweeten 


RE: [PATCH 6/9] dmaengine: consolidate tx_status functions

2012-03-06 Thread H Hartley Sweeten
On Tuesday, March 06, 2012 3:35 PM, Russell King wrote:
>
> Now that we have the completed cookie in the dma_chan structure, we
> can consolidate the tx_status functions by providing a function to set
> the txstate structure and returning the DMA status.  We also provide
> a separate helper to set the residue for cookies which are still in
> progress.
>
> Signed-off-by: Russell King 
> ---



>  drivers/dma/dmaengine.h |   31 +++



>  drivers/dma/ep93xx_dma.c|7 +--



> diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
> index 47e0997..1ca5e0e 100644
> --- a/drivers/dma/dmaengine.h
> +++ b/drivers/dma/dmaengine.h
> @@ -45,4 +45,35 @@ static inline void dma_cookie_complete(struct 
> dma_async_tx_descriptor *tx)
>   tx->cookie = 0;
>  }
>  
> +/**
> + * dma_cookie_status - report cookie status
> + * @chan: dma channel
> + * @cookie: cookie we are interested in
> + * @state: dma_tx_state structure to return last/used cookies
> + *
> + * Report the status of the cookie, filling in the state structure if
> + * non-NULL.  No locking is required.
> + */
> +static inline enum dma_status dma_cookie_status(struct dma_chan *chan,
> + dma_cookie_t cookie, struct dma_tx_state *state)
> +{
> + dma_cookie_t used, complete;
> +
> + used = chan->cookie;
> + complete = chan->completed_cookie;
> + barrier();
> + if (state) {
> + state->last = complete;
> + state->used = used;
> + state->residue = 0;
> + }
> + return dma_async_is_complete(cookie, complete, used);
> +}
> +
> +static inline void dma_set_residue(struct dma_tx_state *state, u32 residue)
> +{
> + if (state)
> + state->residue = residue;
> +}
> +
>  #endif



> diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> index 1c56f75..142ebf0 100644
> --- a/drivers/dma/ep93xx_dma.c
> +++ b/drivers/dma/ep93xx_dma.c
> @@ -1241,18 +1241,13 @@ static enum dma_status ep93xx_dma_tx_status(struct 
> dma_chan *chan,
>   struct dma_tx_state *state)
>  {
>   struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan);
> - dma_cookie_t last_used, last_completed;
>   enum dma_status ret;
>   unsigned long flags;
>  
>   spin_lock_irqsave(&edmac->lock, flags);
> - last_used = chan->cookie;
> - last_completed = chan->completed_cookie;
> + ret = dma_cookie_status(chan, cookie, state);
>   spin_unlock_irqrestore(&edmac->lock, flags);
>  
> - ret = dma_async_is_complete(cookie, last_completed, last_used);
> - dma_set_tx_state(state, last_completed, last_used, 0);
> -
>   return ret;
>  }
>  

For ep93xx:

Tested-by: H Hartley Sweeten 
Acked-by: H Hartley Sweeten 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 5/9] dmaengine: provide a common function for completing a dma descriptor

2012-03-06 Thread H Hartley Sweeten
On Tuesday, March 06, 2012 3:35 PM, Russell King wrote:
>
> Provide a common function to do the cookie mechanics for completing
> a DMA descriptor.
>
> Signed-off-by: Russell King 
> ---



>  drivers/dma/dmaengine.h |   18 ++



>  drivers/dma/ep93xx_dma.c|2 +-



> diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
> index 7692c86..47e0997 100644
> --- a/drivers/dma/dmaengine.h
> +++ b/drivers/dma/dmaengine.h
> @@ -5,6 +5,7 @@
>  #ifndef DMAENGINE_H
>  #define DMAENGINE_H
>  
> +#include 
>  #include 
>  
>  /**
> @@ -27,4 +28,21 @@ static inline dma_cookie_t dma_cookie_assign(struct 
> dma_async_tx_descriptor *tx)
>   return cookie;
>  }
>  
> +/**
> + * dma_cookie_complete - complete a descriptor
> + * @tx: descriptor to complete
> + *
> + * Mark this descriptor complete by updating the channels completed
> + * cookie marker.  Zero the descriptors cookie to prevent accidental
> + * repeated completions.
> + *
> + * Note: caller is expected to hold a lock to prevent concurrency.
> + */
> +static inline void dma_cookie_complete(struct dma_async_tx_descriptor *tx)
> +{
> + BUG_ON(tx->cookie < DMA_MIN_COOKIE);
> + tx->chan->completed_cookie = tx->cookie;
> + tx->cookie = 0;
> +}
> +
>  #endif



> diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> index e5aaae8..1c56f75 100644
> --- a/drivers/dma/ep93xx_dma.c
> +++ b/drivers/dma/ep93xx_dma.c
> @@ -703,7 +703,7 @@ static void ep93xx_dma_tasklet(unsigned long data)
>   desc = ep93xx_dma_get_active(edmac);
>   if (desc) {
>   if (desc->complete) {
> - edmac->chan.completed_cookie = desc->txd.cookie;
> + dma_cookie_complete(&desc->txd);
>   list_splice_init(&edmac->active, &list);
>   }
>   callback = desc->txd.callback;

For ep93xx:

Tested-by: H Hartley Sweeten 
Acked-by: H Hartley Sweeten 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 4/9] dmaengine: consolidate assignment of DMA cookies

2012-03-06 Thread H Hartley Sweeten
On Tuesday, March 06, 2012 3:35 PM, Russell King wrote:
>
> Everyone deals with assigning DMA cookies in the same way (it's part of
> the API so they should be), so lets consolidate the common code into a
> helper function to avoid this duplication.
>
> Signed-off-by: Russell King 
> ---



>  drivers/dma/dmaengine.h |   20 



>  drivers/dma/ep93xx_dma.c|9 +



> diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
> index 968570d..7692c86 100644
> --- a/drivers/dma/dmaengine.h
> +++ b/drivers/dma/dmaengine.h
> @@ -7,4 +7,24 @@
>  
>  #include 
>  
> +/**
> + * dma_cookie_assign - assign a DMA engine cookie to the descriptor
> + * @tx: descriptor needing cookie
> + *
> + * Assign a unique non-zero per-channel cookie to the descriptor.
> + * Note: caller is expected to hold a lock to prevent concurrency.
> + */
> +static inline dma_cookie_t dma_cookie_assign(struct dma_async_tx_descriptor 
> *tx)
> +{
> + struct dma_chan *chan = tx->chan;
> + dma_cookie_t cookie;
> +
> + cookie = chan->cookie + 1;
> + if (cookie < DMA_MIN_COOKIE)
> + cookie = DMA_MIN_COOKIE;
> + tx->cookie = chan->cookie = cookie;
> +
> + return cookie;
> +}
> +
>  #endif



> diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> index 3260198..e5aaae8 100644
> --- a/drivers/dma/ep93xx_dma.c
> +++ b/drivers/dma/ep93xx_dma.c
> @@ -783,17 +783,10 @@ static dma_cookie_t ep93xx_dma_tx_submit(struct 
> dma_async_tx_descriptor *tx)
>   unsigned long flags;
>  
>   spin_lock_irqsave(&edmac->lock, flags);
> -
> - cookie = edmac->chan.cookie;
> -
> - if (++cookie < 0)
> - cookie = 1;
> + cookie = dma_cookie_assign(tx);
>  
>   desc = container_of(tx, struct ep93xx_dma_desc, txd);
>  
> - edmac->chan.cookie = cookie;
> - desc->txd.cookie = cookie;
> -
>   /*
>* If nothing is currently prosessed, we push this descriptor
>* directly to the hardware. Otherwise we put the descriptor

For ep93xx:

Tested-by: H Hartley Sweeten 
Acked-by: H Hartley Sweeten 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 3/9] dmaengine: add private header file

2012-03-06 Thread H Hartley Sweeten
On Tuesday, March 06, 2012 3:34 PM, Russell King wrote:
>
> Add a local private header file to contain definitions and declarations
> which should only be used by DMA engine drivers.
>
> We also fix linux/dmaengine.h to use LINUX_DMAENGINE_H to guard against
> multiple inclusion.
>
> Signed-off-by: Russell King 
> ---



>  drivers/dma/dmaengine.h |   10 ++



>  drivers/dma/ep93xx_dma.c|2 ++



>  include/linux/dmaengine.h   |4 ++--



> diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
> new file mode 100644
> index 000..968570d
> --- /dev/null
> +++ b/drivers/dma/dmaengine.h
> @@ -0,0 +1,10 @@
> +/*
> + * The contents of this file are private to DMA engine drivers, and is not
> + * part of the API to be used by DMA engine users.
> + */
> +#ifndef DMAENGINE_H
> +#define DMAENGINE_H
> +
> +#include 
> +
> +#endif



> diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> index bc45787..3260198 100644
> --- a/drivers/dma/ep93xx_dma.c
> +++ b/drivers/dma/ep93xx_dma.c
> @@ -28,6 +28,8 @@
>  
>  #include 
>  
> +#include "dmaengine.h"
> +
>  /* M2P registers */
>  #define M2P_CONTROL  0x
>  #define M2P_CONTROL_STALLINT BIT(0)



> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index 41d0f92..4b17ca8 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -18,8 +18,8 @@
>   * The full GNU General Public License is included in this distribution in 
> the
>   * file called COPYING.
>   */
> -#ifndef DMAENGINE_H
> -#define DMAENGINE_H
> +#ifndef LINUX_DMAENGINE_H
> +#define LINUX_DMAENGINE_H
>  
>  #include 
>  #include 

For ep93xx:

Tested-by: H Hartley Sweeten 
Acked-by: H Hartley Sweeten 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 2/9] dmaengine: move last completed cookie into generic dma_chan structure

2012-03-06 Thread H Hartley Sweeten
On Tuesday, March 06, 2012 3:34 PM, Russell King wrote:
>
> Every DMA engine implementation declares a last completed dma cookie
> in their private dma channel structures.  This is pointless, and
> forces driver specific code.  Move this out into the common dma_chan
> structure.
>
> Signed-off-by: Russell King 
> ---



 drivers/dma/ep93xx_dma.c |8 +++-



 include/linux/dmaengine.h|2 ++



> diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> index 59e7a96..bc45787 100644
> --- a/drivers/dma/ep93xx_dma.c
> +++ b/drivers/dma/ep93xx_dma.c
> @@ -122,7 +122,6 @@ struct ep93xx_dma_desc {
>   * @lock: lock protecting the fields following
>   * @flags: flags for the channel
>   * @buffer: which buffer to use next (0/1)
> - * @last_completed: last completed cookie value
>   * @active: flattened chain of descriptors currently being processed
>   * @queue: pending descriptors which are handled next
>   * @free_list: list of free descriptors which can be used
> @@ -157,7 +156,6 @@ struct ep93xx_dma_chan {
>  #define EP93XX_DMA_IS_CYCLIC 0
>  
>   int buffer;
> - dma_cookie_tlast_completed;
>   struct list_headactive;
>   struct list_headqueue;
>   struct list_headfree_list;
> @@ -703,7 +701,7 @@ static void ep93xx_dma_tasklet(unsigned long data)
>   desc = ep93xx_dma_get_active(edmac);
>   if (desc) {
>   if (desc->complete) {
> - edmac->last_completed = desc->txd.cookie;
> + edmac->chan.completed_cookie = desc->txd.cookie;
>   list_splice_init(&edmac->active, &list);
>   }
>   callback = desc->txd.callback;
> @@ -861,7 +859,7 @@ static int ep93xx_dma_alloc_chan_resources(struct 
> dma_chan *chan)
>   goto fail_clk_disable;
>  
>   spin_lock_irq(&edmac->lock);
> - edmac->last_completed = 1;
> + edmac->chan.completed_cookie = 1;
>   edmac->chan.cookie = 1;
>   ret = edmac->edma->hw_setup(edmac);
>   spin_unlock_irq(&edmac->lock);
> @@ -1254,7 +1252,7 @@ static enum dma_status ep93xx_dma_tx_status(struct 
> dma_chan *chan,
>  
>   spin_lock_irqsave(&edmac->lock, flags);
>   last_used = chan->cookie;
> - last_completed = edmac->last_completed;
> + last_completed = chan->completed_cookie;
>   spin_unlock_irqrestore(&edmac->lock, flags);
>  
>   ret = dma_async_is_complete(cookie, last_completed, last_used);



> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index 679b349..41d0f92 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -257,6 +257,7 @@ struct dma_chan_percpu {
>   * struct dma_chan - devices supply DMA channels, clients use them
>   * @device: ptr to the dma device who supplies this channel, always !%NULL
>   * @cookie: last cookie value returned to client
> + * @completed_cookie: last completed cookie for this channel
>   * @chan_id: channel ID for sysfs
>   * @dev: class device for sysfs
>   * @device_node: used to add this to the device chan list
> @@ -268,6 +269,7 @@ struct dma_chan_percpu {
>  struct dma_chan {
>   struct dma_device *device;
>   dma_cookie_t cookie;
> + dma_cookie_t completed_cookie;
>  
>   /* sysfs */
>   int chan_id;

For ep93xx:

Tested-by: H Hartley Sweeten 
Acked-by: H Hartley Sweeten 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 6/9] dmaengine: consolidate tx_status functions

2012-03-05 Thread H Hartley Sweeten
On Monday, March 05, 2012 1:17 PM, Russell King wrote:
> 
> Now that we have the completed cookie in the dma_chan structure, we
> can consolidate the tx_status functions by providing a function to set
> the txstate structure and returning the DMA status.  We also provide
> a separate helper to set the residue for cookies which are still in
> progress.
>
> Signed-off-by: Russell King 
> ---



> diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
> index 47e0997..244a2c5 100644
> --- a/drivers/dma/dmaengine.h
> +++ b/drivers/dma/dmaengine.h
> @@ -45,4 +45,35 @@ static inline void dma_cookie_complete(struct 
> dma_async_tx_descriptor *tx)
>   tx->cookie = 0;
>  }
>  
> +/**
> + * dma_cookie_status - report cookie status
> + * @chan: dma channel
> + * @cookie: cookie we are interested in
> + * @state: dma_tx_state structure to return last/used cookies
> + *
> + * Report the status of the cookie, filling in the state structure if
> + * non-NULL.  No locking is required.
> + */
> +static inline enum dma_status dma_cookie_status(struct dma_chan *chan,
> + dma_cookie_t cookie, struct dma_tx_state *state)
> +{
> + dma_cookie_t used, complete;
> +
> + used = chan->cookie;
> + complete = chan->complete;
> + barrier();
> + if (state) {
> + state->last = complete;
> + state->used = used;
> + state->residue = 0;
> + }

Isn't this dma_set_tx_state()?

> + return dma_async_is_complete(cookie, complete, used);
> +}

Regards,
Hartley

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 0/9] DMA engine cookie handling cleanups

2012-03-05 Thread H Hartley Sweeten
On Monday, March 05, 2012 1:51 PM, Linus Walleij wrote:
> On Mon, Mar 5, 2012 at 9:14 PM, Russell King - ARM Linux wrote:
>
>> This patch series cleans up the handling of cookies in DMA engine drivers.
>> This is done by providing a set of inline library functions for common
>> tasks:
>
> Overall this looks good, but I have a problem:
> patch [1/9] does not appear in any subscribed accounts (it may be on
> my @stericsson.com address, will check tomorrow)

Patch 8/9 also doesn't appear to be on the mailing list.

> One I get hold of an ungmangled copy I can test the series on
> ux500 and U300.
>
> Is it just stuck in moderation because of size or something like that?

I'm also trying to test the series on ep93xx but have some compile issues
with patches [3/9] and [6/9].

Regards,
Hartley
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 6/9] dmaengine: consolidate tx_status functions

2012-03-05 Thread H Hartley Sweeten
On Monday, March 05, 2012 1:17 PM, Russell King wrote:
>
> Now that we have the completed cookie in the dma_chan structure, we
> can consolidate the tx_status functions by providing a function to set
> the txstate structure and returning the DMA status.  We also provide
> a separate helper to set the residue for cookies which are still in
> progress.
>
> Signed-off-by: Russell King 



> diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
> index 47e0997..244a2c5 100644
> --- a/drivers/dma/dmaengine.h
> +++ b/drivers/dma/dmaengine.h
> @@ -45,4 +45,35 @@ static inline void dma_cookie_complete(struct 
> dma_async_tx_descriptor *tx)
>   tx->cookie = 0;
>  }
>  
> +/**
> + * dma_cookie_status - report cookie status
> + * @chan: dma channel
> + * @cookie: cookie we are interested in
> + * @state: dma_tx_state structure to return last/used cookies
> + *
> + * Report the status of the cookie, filling in the state structure if
> + * non-NULL.  No locking is required.
> + */
> +static inline enum dma_status dma_cookie_status(struct dma_chan *chan,
> + dma_cookie_t cookie, struct dma_tx_state *state)
> +{
> + dma_cookie_t used, complete;
> +
> + used = chan->cookie;
> + complete = chan->complete;

Is this supposed to be:

complete = chan->completed_cookie;

Regards,
Hartley

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 3/9] dmaengine: add private header file

2012-03-05 Thread H Hartley Sweeten
On Monday, March 05, 2012 1:16 PM, Russell King wrote:
>
> Add a local private header file to contain definitions and declarations
> which should only be used by DMA engine drivers.
>
> Signed-off-by: Russell King 
> ---
>  drivers/dma/amba-pl08x.c|2 ++
>  drivers/dma/at_hdmac.c  |1 +
>  drivers/dma/coh901318.c |1 +
>  drivers/dma/dmaengine.h |   10 ++
>  drivers/dma/dw_dmac.c   |1 +
>  drivers/dma/ep93xx_dma.c|2 ++
>  drivers/dma/fsldma.c|1 +
>  drivers/dma/imx-dma.c   |2 ++
>  drivers/dma/imx-sdma.c  |2 ++
>  drivers/dma/intel_mid_dma.c |2 ++
>  drivers/dma/ioat/dma.c  |2 ++
>  drivers/dma/ioat/dma_v2.c   |2 ++
>  drivers/dma/iop-adma.c  |2 ++
>  drivers/dma/ipu/ipu_idmac.c |1 +
>  drivers/dma/mpc512x_dma.c   |2 ++
>  drivers/dma/mv_xor.c|2 ++
>  drivers/dma/mxs-dma.c   |2 ++
>  drivers/dma/pch_dma.c   |2 ++
>  drivers/dma/pl330.c |2 ++
>  drivers/dma/ppc4xx/adma.c   |1 +
>  drivers/dma/shdma.c |2 ++
>  drivers/dma/ste_dma40.c |1 +
>  drivers/dma/timb_dma.c  |2 ++
>  drivers/dma/txx9dmac.c  |2 ++
>  24 files changed, 49 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/dma/dmaengine.h
>
> diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
> index 2b5121f..87475cb 100644
> --- a/drivers/dma/amba-pl08x.c
> +++ b/drivers/dma/amba-pl08x.c
> @@ -85,6 +85,8 @@
>  #include 
>  #include 
>  
> +#include "dmaengine.h"
> +
>  #define DRIVER_NAME  "pl08xdmac"
>  
>  static struct amba_driver pl08x_amba_driver;
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index 6baf5d7..ce26ba3 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -27,6 +27,7 @@
>  #include 
>  
>  #include "at_hdmac_regs.h"
> +#include "dmaengine.h"
>  
>  /*
>   * Glossary
> diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
> index 521434b..fb0d124 100644
> --- a/drivers/dma/coh901318.c
> +++ b/drivers/dma/coh901318.c
> @@ -24,6 +24,7 @@
>  #include 
>  
>  #include "coh901318_lli.h"
> +#include "dmaengine.h"
>  
>  #define COHC_2_DEV(cohc) (&cohc->chan.dev->device)
>  
> diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
> new file mode 100644
> index 000..968570d
> --- /dev/null
> +++ b/drivers/dma/dmaengine.h
> @@ -0,0 +1,10 @@
> +/*
> + * The contents of this file are private to DMA engine drivers, and is not
> + * part of the API to be used by DMA engine users.
> + */
> +#ifndef DMAENGINE_H
> +#define DMAENGINE_H
> +
> +#include 
> +
> +#endif

Russell,

You have an include issue here.

All the dmaengine drivers have:

#include 

Which is guarded with

#ifndef DMAENGINE_H
#define DMAENGINE_H

...

#endif

This is the same guard you are using in the private "dmaengine.h". And it
also includes  again...

This doesn't compile as-is because the "dmaengine.h" file is not used due
to the #ifndef...

Regards,
Hartley

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] nodmask.h: remove macro any_online_node

2010-01-06 Thread H Hartley Sweeten
nodmask.h: remove macro any_online_node

The macro any_online_node is prone to producing sparse warnings
due to the local symbol 'node'. Since all the in-tree users are really
requesting the first online node (the mask argument is either
NODE_MASK_ALL or node_online_map) just use the first_online_node
macro and remove the any_online_node macro since there are no users.

Signed-off-by: H Hartley Sweeten 
Cc: Andrew Morton 
Cc: David Rientjes 
Cc: KAMEZAWA Hiroyuki 
Cc: Mel Gorman 
Cc: Lee Schermerhorn 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Dave Hansen 
Cc: Milton Miller 
Cc: Nathan Fontenot 
Cc: Geoff Levand 
Cc: Grant Likely 
Cc: J. Bruce Fields 
Cc: Neil Brown 
Cc: Trond Myklebust 
Cc: David S. Miller 
Cc: Benny Halevy 
Cc: Chuck Lever 
Cc: Ricardo Labiaga 

---

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b037d95..64c0022 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -451,7 +451,7 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
nid = of_node_to_nid_single(cpu);
 
if (nid < 0 || !node_online(nid))
-   nid = any_online_node(NODE_MASK_ALL);
+   nid = first_online_node;
 out:
map_cpu_to_node(lcpu, nid);
 
@@ -1114,7 +1114,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
int nid, found = 0;
 
if (!numa_enabled || (min_common_depth < 0))
-   return any_online_node(NODE_MASK_ALL);
+   return first_online_node;
 
memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
if (memory) {
@@ -1125,7 +1125,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
}
 
if (nid < 0 || !node_online(nid))
-   nid = any_online_node(NODE_MASK_ALL);
+   nid = first_online_node;
 
if (NODE_DATA(nid)->node_spanned_pages)
return nid;
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 454997c..c4fa64b 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -69,8 +69,6 @@
  * int node_online(node)   Is some node online?
  * int node_possible(node) Is some node possible?
  *
- * int any_online_node(mask)   First online node in mask
- *
  * node_set_online(node)   set bit 'node' in node_online_map
  * node_set_offline(node)  clear bit 'node' in node_online_map
  *
@@ -467,15 +465,6 @@ static inline int num_node_state(enum node_states state)
 #define node_online_mapnode_states[N_ONLINE]
 #define node_possible_map  node_states[N_POSSIBLE]
 
-#define any_online_node(mask)  \
-({ \
-   int node;   \
-   for_each_node_mask(node, (mask))\
-   if (node_online(node))  \
-   break;  \
-   node;   \
-})
-
 #define num_online_nodes() num_node_state(N_ONLINE)
 #define num_possible_nodes()   num_node_state(N_POSSIBLE)
 #define node_online(node)  node_state((node), N_ONLINE)
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 538ca43..832c1fe 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -133,7 +133,7 @@ svc_pool_map_choose_mode(void)
return SVC_POOL_PERNODE;
}
 
-   node = any_online_node(node_online_map);
+   node = first_online_node;
if (nr_cpus_node(node) > 2) {
/*
 * Non-trivial SMP, or CONFIG_NUMA on
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH] arch/powerpc/boot/devtree.c: use %pM to show MAC address

2009-12-31 Thread H Hartley Sweeten
On Wednesday, December 30, 2009 9:49 PM, Paul Mackerras wrote:
> On Wed, Dec 30, 2009 at 02:30:39PM -0500, H Hartley Sweeten wrote:
>
>> Use the %pM kernel extension to display the MAC address.
>> 
>> Signed-off-by: H Hartley Sweeten 
>> 
>> ---
>
> Nak - this isn't the kernel, this is a separate program, namely the
> bootwrapper that decompresses the kernel image, and it has its own
> printf (not printk) implementation in arch/powerpc/boot/stdio.c, which
> doesn't understand the %pX extensions (and I don't see any good reason
> to make it do so).

OK.  Sorry for the noise.

Regards,
Hartley
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] arch/powerpc/boot/devtree.c: use %pM to show MAC address

2009-12-30 Thread H Hartley Sweeten
Use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten 

---

diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index a7e21a3..a2f07a5 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -93,10 +93,7 @@ void dt_fixup_mac_address_by_alias(const char *alias, const 
u8 *addr)
void *devp = find_node_by_alias(alias);
 
if (devp) {
-   printf("%s: local-mac-address <-"
-  " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
-  addr[0], addr[1], addr[2],
-  addr[3], addr[4], addr[5]);
+   printf("%s: local-mac-address <- %pM\n\r", alias, addr);
 
setprop(devp, "local-mac-address", addr, 6);
}
@@ -108,10 +105,7 @@ void dt_fixup_mac_address(u32 index, const u8 *addr)
 (void*)&index, sizeof(index));
 
if (devp) {
-   printf("ENET%d: local-mac-address <-"
-  " %02x:%02x:%02x:%02x:%02x:%02x\n\r", index,
-  addr[0], addr[1], addr[2],
-  addr[3], addr[4], addr[5]);
+   printf("ENET%d: local-mac-address <- %pM\n\r", index, addr);
 
setprop(devp, "local-mac-address", addr, 6);
} 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev