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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100408135958F.fujita.tomonori@lab.ntt.co.jp>
Date:	Thu, 8 Apr 2010 14:00:22 +0900
From:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To:	vapier.adi@...il.com
Cc:	fujita.tomonori@....ntt.co.jp, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -mm 09/12] blackfin: use use asm-generic/scatterlist.h

On Wed, 7 Apr 2010 23:51:04 -0400
Mike Frysinger <vapier.adi@...il.com> wrote:

> > #define ISA_DMA_THRESHOLD (0xffffffff)
> 
> this is the same value as the common asm-generic one, so this define
> should be punted, especially since this would probably introduce
> redefined warnings.

I removed ISA_DMA_THRESHOLD in the common asm-generic one since it
doesn't work for powerpc.

I've attached the common asm-generic in -mm below.

> once that is done, this header is simply a redirect, so it'd be better
> if it was just one line:
> #include <asm-generic/scatterlist.h>
> 
> one of the reasons i hadnt converted sooner was that it seems like the
> common header introduces bloat.  the Blackfin header has just "length"

I took care of it. Blackfin doesn't define
CONFIG_NEED_SG_DMA_LENGTH so doesn't get "dma_length".


> while the asm-generic has both "length" and "dma_length".  unless i
> missed something, this hasnt been a problem for us.  perhaps the
> common header should have something like:
> #if __BITS_PER_LONG == 64
>     unsigned int    dma_length;
> #endif

'#if __BITS_PER_LONG == 64' doesn't work since some 32-bit
architectures need it. So I invented CONFIG_NEED_SG_DMA_LENGTH.

=
#ifndef __ASM_GENERIC_SCATTERLIST_H
#define __ASM_GENERIC_SCATTERLIST_H

#include <linux/types.h>

struct scatterlist {
#ifdef CONFIG_DEBUG_SG
	unsigned long	sg_magic;
#endif
	unsigned long	page_link;
	unsigned int	offset;
	unsigned int	length;
	dma_addr_t	dma_address;
#ifdef CONFIG_NEED_SG_DMA_LENGTH
	unsigned int	dma_length;
#endif
};

/*
 * These macros should be used after a dma_map_sg call has been done
 * to get bus addresses of each of the SG entries and their lengths.
 * You should only work with the number of sg entries pci_map_sg
 * returns, or alternatively stop on the first sg_dma_len(sg) which
 * is 0.
 */
#define sg_dma_address(sg)	((sg)->dma_address)

#ifdef CONFIG_NEED_SG_DMA_LENGTH
#define sg_dma_len(sg)		((sg)->dma_length)
#else
#define sg_dma_len(sg)		((sg)->length)
#endif

#endif /* __ASM_GENERIC_SCATTERLIST_H */
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ