[PATCH] Use sg_set_buf/sg_init_one where applicable

This patch uses sg_set_buf/sg_init_one in some places where it was
duplicated.

Signed-off-by: David Hardeman <david@2gen.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Greg KH <greg@kroah.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
David Hardeman
2005-09-17 17:55:31 +10:00
committed by Herbert Xu
parent d32311fed7
commit 378f058cc4
10 changed files with 44 additions and 105 deletions

View File

@ -75,7 +75,7 @@
#ifdef CONFIG_IPV6_PRIVACY
#include <linux/random.h>
#include <linux/crypto.h>
#include <asm/scatterlist.h>
#include <linux/scatterlist.h>
#endif
#include <asm/uaccess.h>
@ -1217,12 +1217,8 @@ static int __ipv6_regen_rndid(struct inet6_dev *idev)
struct net_device *dev;
struct scatterlist sg[2];
sg[0].page = virt_to_page(idev->entropy);
sg[0].offset = offset_in_page(idev->entropy);
sg[0].length = 8;
sg[1].page = virt_to_page(idev->work_eui64);
sg[1].offset = offset_in_page(idev->work_eui64);
sg[1].length = 8;
sg_set_buf(&sg[0], idev->entropy, 8);
sg_set_buf(&sg[1], idev->work_eui64, 8);
dev = idev->dev;