[parisc-linux-cvs] linux tsbogend

Thomas Bogendoerfer tsbogend@alpha.franken.de
Sat, 30 Mar 2002 22:22:19 +0100


On Sat, Mar 30, 2002 at 01:34:41PM -0700, Thomas Bogendoerfer wrote:
> CVSROOT:	/var/cvs
> Module name:	linux
> Changes by:	tsbogend	02/03/30 13:34:41
> 
> Modified files:
> 	.              : Makefile 
> 
> Log message:
> 2.4.18-pa12:
> - hp100 receive skb align fix
> - stifb framebuffer length fix


Index: hp100.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/net/hp100.c,v
retrieving revision 1.10
diff -u -p -r1.10 hp100.c
--- hp100.c	9 Nov 2001 23:36:03 -0000	1.10
+++ hp100.c	30 Mar 2002 20:24:52 -0000
@@ -1851,7 +1851,7 @@ static void hp100_rx(struct net_device *
 #endif
 
 		/* Now we allocate the skb and transfer the data into it. */
-		skb = dev_alloc_skb(pkt_len);
+		skb = dev_alloc_skb(pkt_len+2);
 		if (skb == NULL) {	/* Not enough memory->drop packet */
 #ifdef HP100_DEBUG
 			printk("hp100: %s: rx: couldn't allocate a sk_buff of size %d\n",
@@ -1862,10 +1862,12 @@ static void hp100_rx(struct net_device *
 
 			u_char *ptr;
 
+			skb_reserve(skb,2);
 			skb->dev = dev;
 
 			/* ptr to start of the sk_buff data area */
-			ptr = (u_char *) skb_put(skb, pkt_len);
+			skb_put(skb, pkt_len);
+			ptr = skb->data;
 
 			/* Now transfer the data from the card into that area */
 			if (lp->mode == 2) {
Index: stifb.c
===================================================================
RCS file: /var/cvs/linux/drivers/video/sti/stifb.c,v
retrieving revision 1.29
diff -u -p -r1.29 stifb.c
--- stifb.c	2002/03/03 23:05:06	1.29
+++ stifb.c	2002/03/30 20:32:12
@@ -1330,14 +1330,11 @@ stifb_init_fb(struct sti_struct *sti, in
 #else
 	fix->smem_start = fb->sti->regions_phys[1];
 #endif
+	fix->smem_len = fb->sti->regions[1].region_desc.length * 4096;
+
 	fix->line_length = (fb->sti->glob_cfg->total_x * bpp) / 8;
 	if (!fix->line_length)
 		fix->line_length = 2048; /* default */
-	if (fb->sti->pd)
-		fix->smem_len = pci_resource_len(fb->sti->pd, 0);
-	else
-		fix->smem_len = fb->sti->glob_cfg->total_y *
-				fix->line_length;
 	fix->accel = FB_ACCEL_NONE;
 
 	switch (bpp) {
-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                 [ Alexander Viro on linux-kernel ]