mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Mark Gross <mgross@linux.intel.com>
Cc: "Bouchard, Sebastien" <Sebastien.Bouchard@ca.kontron.com>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"Lorenzini, Mario" <mario.lorenzini@ca.kontron.com>
Subject: Re: Patch of a new driver for kernel 2.4.x that need review
Date: Wed, 6 Jul 2005 15:57:10 -0700	[thread overview]
Message-ID: <20050706225709.GA26801@kroah.com> (raw)
In-Reply-To: <200507061414.48764.mgross@linux.intel.com>

On Wed, Jul 06, 2005 at 02:14:44PM -0700, Mark Gross wrote:
> +#ifndef __KERNEL__
> +#  define __KERNEL__
> +#endif

Not needed.

> +
> +#include <linux/config.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/sched.h>
> +#include <linux/kernel.h>	/* printk() */
> +#include <linux/fs.h>		/* everything... */
> +#include <linux/errno.h>	/* error codes */
> +#include <linux/delay.h>	/* udelay */
> +#include <asm/uaccess.h>
> +#include <linux/slab.h>
> +#include <linux/ioport.h>
> +#include <linux/devfs_fs_kernel.h>	/* Devfs support */
> +#include <linux/interrupt.h>
> +#include <linux/spinlock.h>
> +#include <linux/timer.h>
> +#include <asm/io.h>		/* inb/outb */

Put asm/ at the end.

> +
> +#include "tlclk.h"	/* TELECOM IOCTL DEFINE */

No new ioctls please.  Use sysfs or something else.

> +
> +MODULE_AUTHOR("Sebastien Bouchard <sebastien.bouchard@ca.kontron.com>");
> +MODULE_LICENSE("GPL");
> +
> +/* Telecom clock I/O register definition */
> +#define TLCLK_BASE 0xa08            
> +#define TLCLK_REG0 TLCLK_BASE
> +#define TLCLK_REG1 (TLCLK_BASE+1)
> +#define TLCLK_REG2 (TLCLK_BASE+2)
> +#define TLCLK_REG3 (TLCLK_BASE+3)
> +#define TLCLK_REG4 (TLCLK_BASE+4)
> +#define TLCLK_REG5 (TLCLK_BASE+5)
> +#define TLCLK_REG6 (TLCLK_BASE+6)
> +#define TLCLK_REG7 (TLCLK_BASE+7)
> +
> +#define SET_PORT_BITS(port, mask, val) outb(((inb(port) & mask) | val), port)
> +
> +/* 0 = Dynamic allocation of the major device number */
> +#define TLCLK_MAJOR 252

Is this a reserved major?

> +/* DEVFS support or not */
> +#ifdef CONFIG_DEVFS_FS

DEVFS is obsolete and will be removed very soon now.  You don't need to
add support for it in your driver.

> +/*
> +*  Function : Module Opening
> +*  Description : Called when a program open the 
> +*  /dev/telclock file related to the module.
> +*/

Function comments like this are not needed at all.

> +struct tlclk_alarms {
> +	unsigned int lost_clocks;
> +	unsigned int lost_primary_clock;
> +	unsigned int lost_secondary_clock;
> +	unsigned int primary_clock_back;
> +	unsigned int secondary_clock_back;
> +	unsigned int switchover_primary;
> +	unsigned int switchover_secondary;
> +	unsigned int pll_holdover;
> +	unsigned int pll_end_holdover;
> +	unsigned int pll_lost_sync;
> +	unsigned int pll_sync;
> +};

If you are going to pass a structure accross the kernel/userspace
boundry, you need to explicitly mark the variable sizes.  Use __u8,
__u16, or __u32 here (unless they are signed, then use __s8, etc.)

All of those values look like they should just be exported as individual
sysfs files, right?

thanks,

greg k-h

  parent reply	other threads:[~2005-07-06 22:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-22 15:12 Bouchard, Sebastien
2005-06-22 19:43 ` Pekka Enberg
2005-06-22 20:32   ` Willy Tarreau
2005-06-22 20:59     ` Bill Gatliff
2005-06-22 21:58       ` Willy Tarreau
2005-06-23  4:58       ` Pekka Enberg
2005-06-23  4:16     ` Pekka J Enberg
2005-06-23  4:49       ` Willy Tarreau
2005-07-06 21:11         ` Mark Gross
2005-07-07  6:00           ` Pekka J Enberg
2005-07-07  6:50             ` Dmitry Torokhov
2005-07-07  6:55               ` Pekka J Enberg
2005-07-07  7:13                 ` Dmitry Torokhov
2005-07-07  7:43                   ` Pekka J Enberg
2005-07-07  6:10           ` Pekka J Enberg
2005-06-22 20:04 ` Pekka Enberg
2005-06-23 21:42   ` Alan Cox
2005-06-22 21:18 ` Jesper Juhl
2005-07-06 21:14 ` Mark Gross
2005-07-06 22:49   ` randy_dunlap
2005-07-06 22:57   ` Greg KH [this message]
2005-08-08 15:35   ` Mark Gross
2005-08-09  7:17     ` Pekka Enberg
2005-08-09 16:56     ` Mark Gross
2005-08-09 17:51       ` Nishanth Aravamudan
2005-07-07  8:15 moreau francis

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=20050706225709.GA26801@kroah.com \
    --to=greg@kroah.com \
    --cc=Sebastien.Bouchard@ca.kontron.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.lorenzini@ca.kontron.com \
    --cc=mgross@linux.intel.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

all inboxes | Powered by JetHome®