All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruno Ducrot <ducrot@poupinou.org>
To: Alexander Clouter <alex@digriz.org.uk>
Cc: davej@redhat.com, cpufreq@ZenII.linux.org.uk,
	Dominik Brodowski <linux@dominikbrodowski.net>
Subject: Re: [PATCH] (1/3) cpufreq_ondemand - 01_ignore-nice.diff
Date: Mon, 21 Feb 2005 12:41:46 +0100	[thread overview]
Message-ID: <20050221114146.GA12182@poupinou.org> (raw)
In-Reply-To: <20050220181448.GA5277@inskipp>

On Sun, Feb 20, 2005 at 06:14:48PM +0000, Alexander Clouter wrote:
> Morning,
> 
> On Feb 20, Dominik Brodowski wrote:
> > On Sun, Feb 20, 2005 at 01:15:18PM +0000, Alexander Clouter wrote:
> > > +			( !dbs_tuners_ins.ignore_nice
> > > +			  ? kstat_cpu(j).cpustat.nice : NULL );
> > NULL is a pointer, 0 is a number. You most probably want "0" here.
> > 
> > > +				( !dbs_tuners_ins.ignore_nice
> > > +				  ? kstat_cpu(j).cpustat.nice : NULL );
> > dito.
> > 
> NULL comes out as a nothing, there is no problem in adding NULL to a
> variable; the c-compiler, I have been assured, drops this out (or rather it
> should) as a NOOP.  Of course this is what I have been told, by my flatmate
> whom works with a large number of different compilers for different
> architectures from different software houses, and lives/breathes C
> (concerningly :)

Please don't assume anything about NULL in kernelspace.  It's
defined in a header (stddef.h for C99) and standard headers can't be
included in kernel space.  NULL is defined elsewhere for kernel, but that's
another story.

Anyway, you are mixing pointers and integers types.  These lead *always*
to bugs, especially if you must change to another HW architecture
(and sometimes another software environment like DOS).

> Along similar lines, I was told that initialising statics to zero *must* be
> done and not assumed; friends have told me its a 'gcc specific extension'.  
> Last time I was told this was not necessary...

I don't get it.  I assume statics variables being always initialized as said by
a previous answer even on pre-ansi C compilers.

Cheers,

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

  parent reply	other threads:[~2005-02-21 11:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-20 13:15 [PATCH] (1/3) cpufreq_ondemand - 01_ignore-nice.diff Alexander Clouter
2005-02-20 14:12 ` Arjan van de Ven
2005-02-20 14:51   ` Dominik Brodowski
2005-02-20 14:53 ` Dominik Brodowski
2005-02-20 18:14   ` Alexander Clouter
2005-02-20 20:59     ` PCS
2005-02-21 11:41     ` Bruno Ducrot [this message]
2005-02-20 16:14 ` Eric Piel
2005-02-21 10:20   ` Eric Piel
2005-02-21 10:27     ` Alexander Clouter
2005-02-21 12:58       ` Eric Piel
2005-02-21 15:54     ` Dominik Brodowski
2005-02-21 13:11   ` Stefan Seyfried
2005-02-21 13:31     ` Eric Piel
  -- strict thread matches above, loose matches on Subject: below --
2005-02-21 18:05 Pallipadi, Venkatesh
2005-05-10 22:30 Alexander Clouter
2005-05-11  1:30 ` Dave Jones
2005-05-11  2:38   ` Dave Jones

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=20050221114146.GA12182@poupinou.org \
    --to=ducrot@poupinou.org \
    --cc=alex@digriz.org.uk \
    --cc=cpufreq@ZenII.linux.org.uk \
    --cc=davej@redhat.com \
    --cc=linux@dominikbrodowski.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.