public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Weinehall <tao@acc.umu.se>
To: Christopher Kanaan <kanaan@stanford.edu>
Cc: kraxel@goldbach.in-berlin.de, torvalds@transmeta.com,
	linux-kernel@vger.kernel.org
Subject: Re: [Patch] sis_main.c
Date: Sat, 5 May 2001 00:07:34 +0200	[thread overview]
Message-ID: <20010505000734.A17320@khan.acc.umu.se> (raw)
In-Reply-To: <3AF2C3B3.8C668467@stanford.edu>
In-Reply-To: <3AF2C3B3.8C668467@stanford.edu>; from kanaan@stanford.edu on Fri, May 04, 2001 at 07:58:59AM -0700

On Fri, May 04, 2001 at 07:58:59AM -0700, Christopher Kanaan wrote:
> Hello, 
> I am a working with Dawson Englers meta compilation group at Stanford. 
> Here is a patch for sis_main.c  Basically the patch checks to see 
> if kmalloc returns null.  This patch applies to kernel version 2.4.4

Great, but why not follow Documentation/CodingStyle, and the example set
by the rest of the file?!

Instead of:

> --- /usr/src/linux/drivers/video/sis/sis_main.c Fri Feb  9 11:30:23 2001
> +++ ./sis_main.c        Fri May  4 07:34:47 2001
> @@ -1030,6 +1030,11 @@
>         if (heap.pohFreeList == NULL) {
>                 poha = kmalloc(OH_ALLOC_SIZE, GFP_KERNEL);
>  
> +               if(!poha)
> +                 {
> +                   return(NULL);
> +                 }
> +
>                 poha->pohaNext = heap.pohaChain;
>                 heap.pohaChain = poha;

Something like this:

        if (heap.pohFreeList == NULL) {
                poha = kmalloc(OH_ALLOC_SIZE, GFP_KERNEL);
 
+               if (!poha) {
+               	return(NULL);
+               }
+
                poha->pohaNext = heap.pohaChain;
                heap.pohaChain = poha;



/David Weinehall
  _                                                                 _
 // David Weinehall <tao@acc.umu.se> /> Northern lights wander      \\
//  Project MCA Linux hacker        //  Dance across the winter sky //
\>  http://www.acc.umu.se/~tao/    </   Full colour fire           </

  reply	other threads:[~2001-05-04 22:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-04 14:58 [Patch] sis_main.c Christopher Kanaan
2001-05-04 22:07 ` David Weinehall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-05-04 15:21 Christopher Kanaan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010505000734.A17320@khan.acc.umu.se \
    --to=tao@acc.umu.se \
    --cc=kanaan@stanford.edu \
    --cc=kraxel@goldbach.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox