From: <jsi...@us...> - 2007-04-11 14:10:23
|
Revision: 2365 http://linuxconsole.svn.sourceforge.net/linuxconsole/?rev=2365&view=rev Author: jsimmons Date: 2007-04-11 07:10:15 -0700 (Wed, 11 Apr 2007) Log Message: ----------- updated to 2.6.21 Modified Paths: -------------- branches/ruby-2.6.21/ruby-2.6/drivers/char/consolemap.c Modified: branches/ruby-2.6.21/ruby-2.6/drivers/char/consolemap.c =================================================================== --- branches/ruby-2.6.21/ruby-2.6/drivers/char/consolemap.c 2007-04-11 13:47:21 UTC (rev 2364) +++ branches/ruby-2.6.21/ruby-2.6/drivers/char/consolemap.c 2007-04-11 14:10:15 UTC (rev 2365) @@ -190,10 +190,9 @@ if (!q) { q = p->inverse_translations[i] = (unsigned char *) - kmalloc(MAX_GLYPH, GFP_KERNEL); + kzalloc(MAX_GLYPH, GFP_KERNEL); if (!q) return; } - memset(q, 0, MAX_GLYPH); for (j = 0; j < E_TABSZ; j++) { glyph = conv_uni_to_pc(vc, t[j]); @@ -343,27 +342,27 @@ for (i = 0; i < 32; i++) { if ((p1 = p->uni_pgdir[i]) != NULL) { for (j = 0; j < 32; j++) - if (p1[j]) - kfree(p1[j]); + kfree(p1[j]); kfree(p1); } p->uni_pgdir[i] = NULL; } - for (i = 0; i < 4; i++) - if (p->inverse_translations[i]) { - kfree(p->inverse_translations[i]); - p->inverse_translations[i] = NULL; - } + for (i = 0; i < 4; i++) { + kfree(p->inverse_translations[i]); + p->inverse_translations[i] = NULL; + } } void con_free_unimap(struct vc_data *vc) { struct uni_pagedir *p; - + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; - if (!p) return; + if (!p) + return; *vc->vc_uni_pagedir_loc = 0; - if (--p->refcount) return; + if (--p->refcount) + return; con_release_unimap(p); kfree(p); } @@ -417,16 +416,14 @@ u16 **p1, *p2; if (!(p1 = p->uni_pgdir[n = unicode >> 11])) { - p1 = p->uni_pgdir[n] = kmalloc(32*sizeof(u16 *), GFP_KERNEL); + p1 = p->uni_pgdir[n] = kzalloc(32*sizeof(u16 *), GFP_KERNEL); if (!p1) return -ENOMEM; - for (i = 0; i < 32; i++) - p1[i] = NULL; } if (!(p2 = p1[n = (unicode >> 6) & 0x1f])) { - p2 = p1[n] = kmalloc(64*sizeof(u16), GFP_KERNEL); + /* No glyphs for the characters (yet) */ + p2 = p1[n] = kzalloc(64*sizeof(u16), GFP_KERNEL); if (!p2) return -ENOMEM; - memset(p2, 0xff, 64*sizeof(u16)); /* No glyphs for the characters (yet) */ } p2[unicode & 0x3f] = fontpos; @@ -444,12 +441,11 @@ p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p && p->readonly) return -EIO; if (!p || --p->refcount) { - q = (struct uni_pagedir *)kmalloc(sizeof(*p), GFP_KERNEL); + q = kzalloc(sizeof(*p), GFP_KERNEL); if (!q) { if (p) p->refcount++; return -ENOMEM; } - memset(q, 0, sizeof(*q)); q->refcount=1; *vc->vc_uni_pagedir_loc = (unsigned long)q; } else { @@ -512,6 +508,7 @@ for (i = 0; i <= 3; i++) set_inverse_transl(vc, p, i); /* Update all inverse translations */ + return err; } @@ -525,7 +522,7 @@ int i, j, err = 0, err1; u16 *q; struct uni_pagedir *p; - + if (dflt) { p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p == dflt) @@ -568,7 +565,7 @@ int con_copy_unimap(struct vc_data *dst, struct vc_data *src) { struct uni_pagedir *q; - + if (!src || !*src->vc_uni_pagedir_loc) return -EINVAL; if (*dst->vc_uni_pagedir_loc == *src->vc_uni_pagedir_loc) @@ -610,9 +607,10 @@ void con_protect_unimap(struct vc_data *vc, int rdonly) { - struct uni_pagedir *p = (struct uni_pagedir *) *vc->vc_uni_pagedir_loc; + struct uni_pagedir *p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; - if (p) p->readonly = rdonly; + if (p) + p->readonly = rdonly; } int @@ -651,7 +649,7 @@ /* * This is called at sys_setup time, after memory and the console are - * initialized. It must be possible to call kmalloc(..., GFP_KERNEL) + * initialized. It must be possible to call kzalloc(..., GFP_KERNEL) * from this function, hence the call from sys_setup. */ void __init @@ -671,4 +669,3 @@ } EXPORT_SYMBOL(con_copy_unimap); - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |