lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 10 Dec 2012 20:21:05 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:	Vinod Koul <vinod.koul@...el.com>,
	spear-devel <spear-devel@...t.st.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2 1/2] dw_dmac: backlink to dw_dma in dw_dma_chan is superfluous

On 10 December 2012 20:10, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
> The same information could be exctracted from the struct dma_chan.
> The patch introduces helper function dwc_get_data_width() as well.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/dma/dw_dmac.c      |   19 ++++++++++++-------
>  drivers/dma/dw_dmac_regs.h |    3 ---
>  2 files changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index fdae96f..427d35b 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -73,6 +73,14 @@ static inline unsigned int dwc_get_sms(struct dw_dma_slave *slave)
>   */
>  #define NR_DESCS_PER_CHANNEL   64
>
> +static inline unsigned int dwc_get_data_width(struct dma_chan *chan, bool d)
> +{
> +       struct dw_dma *dw = to_dw_dma(chan->device);
> +       struct dw_dma_slave *dws = chan->private;
> +
> +       return dw->data_width[d ? dwc_get_dms(dws) : dwc_get_sms(dws)];
> +}

I am so sorry to ask for V3 for this patch, but i didn't like the bool d at all.
Logically the variable name is not good enough in describing its purpose.

What i would have done here is:
#define SRC_MASTER 0
#define DST_MASTER 1

And used them here. :)

Rest is fine.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists