public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Gerd Knorr <kraxel@bytesex.org>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org
Subject: Re: [patch] add scsi changer driver
Date: Tue, 15 Feb 2005 17:54:31 +0000	[thread overview]
Message-ID: <20050215175431.GA2896@infradead.org> (raw)
In-Reply-To: <20050215164245.GA13352@bytesex>

[this should go to linux-scsi]

> +#include <linux/version.h>

not needed.

> +#include <asm/system.h>

I doubt you'll need this one.

> +#include <asm/uaccess.h>
> +
> +#include <linux/chio.h>			/* here are all the ioctls */

<linux/*.h> should always go before <asm/*.h>

> +#define MAJOR_NR	SCSI_CHANGER_MAJOR

please kill this one

> +#include "scsi.h"

never use this header but always the <scsi/*.h>

> +MODULE_SUPPORTED_DEVICE("sch");

no needed thsese days

> +static int dt_id[CH_DT_MAX] = { [ 0 ... (CH_DT_MAX-1) ] = -1 };
> +static int dt_lun[CH_DT_MAX];
> +module_param_array(dt_id,  int, NULL, 0444);
> +module_param_array(dt_lun, int, NULL, 0444);
> +
> +/* tell the driver about vendor-specific slots */
> +static int vendor_firsts[CH_TYPES-4];
> +static int vendor_counts[CH_TYPES-4];
> +module_param_array(vendor_firsts, int, NULL, 0444);
> +module_param_array(vendor_counts, int, NULL, 0444);
> +
> +static char *vendor_labels[CH_TYPES-4] = {
> +	"v0", "v1", "v2", "v3"
> +};
> +// module_param_string_array(vendor_labels, NULL, 0444);
> +
> +#define dprintk(fmt, arg...)    if (debug) \
> +        printk(KERN_DEBUG "%s: " fmt, ch->name, ##arg)
> +#define vprintk(fmt, arg...)    if (verbose) \
> +        printk(KERN_INFO "%s: " fmt, ch->name, ##arg)
> +
> +/* ------------------------------------------------------------------- */

> +static int ioctl32_register(void)
> +{
> +	unsigned int i;
> +	int err;
> +
> +	for (i = 0; i < ARRAY_SIZE(ioctl32_cmds); i++) {
> +		err = register_ioctl32_conversion(ioctl32_cmds[i].cmd,NULL);
> +		if (err >= 0)
> +			ioctl32_cmds[i].reg++;
> +	}
> +	return 0;
> +}

please implement ->compat_ioctl instead.

> +	int errno, retries = 0, timeout;
> +	DECLARE_COMPLETION(wait);
> +	Scsi_Request *sr;
> +	
> +	sr = scsi_allocate_request(ch->device, GFP_ATOMIC);

wouldn't a GFP_KERNEL do just fine?

> +	if (NULL == sr)
> +		return -ENOMEM;

normal kernel style would be

	if (!s)
		return -ENOMEM;

> +	list_for_each(item,&ch_devlist) {
> +		tmp = list_entry(item, scsi_changer, list);

list_for_each_entry

> +	list_for_each(item,&ch_devlist) {
> +		tmp = list_entry(item, scsi_changer, list);

dito


  reply	other threads:[~2005-02-15 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-15 16:42 [patch] add scsi changer driver Gerd Knorr
2005-02-15 17:54 ` Christoph Hellwig [this message]
2005-02-16 14:39   ` Gerd Knorr
2005-03-06 17:55     ` James Bottomley
2005-03-07  8:21       ` Gerd Knorr
2005-03-07  8:42         ` James Bottomley

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=20050215175431.GA2896@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@osdl.org \
    --cc=kraxel@bytesex.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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