Re: [PATCH] 4/7 cleanup/consolidate code in scsi_request_fn

Patrick Mansfield
2003-03-26T00:58:22Z

On Tue, Mar 25, 2003 at 04:32:50PM -0500, Luben Tuikov wrote:
> Patrick Mansfield wrote:

> > +static inline int scsi_check_sdev(struct request_queue *q,
> > + struct scsi_device *sdev)
>
> scsi_check_sdev: clearly every function is C does a check, or a computation,
> or a modificaiton, or some permutation of those. So this name is too trivial
> and doesn't mean what the function does.
>
> Further more since the function outcome is logical in nature, i.e. it does
> NOT return an error code, you can can return 1 on success, and 0 on fault.
>
> How about this:
> /**
> * scsi_dev_ok2queue: Return non-zero if we can queue to the
> * device, else 0.
> */

I don't care much one way or the other, but I don't like ok2queue.

I was using sdev to distinguish the name from struct dev and functions
related to struct dev. We already have the confusing names scsi_device_get
and scsi_get_device - one for a "get" of a scsi_device one to get a
struct dev given a scsi_host. And then the shost naming matches sdev.

Anyway, the following are fine with me:
scsi_dev_ready, scsi_host_ready
scsi_sdev_ready, scsi_shost_ready

> > +static inline int scsi_check_shost(struct request_queue *q,
> > + struct Scsi_Host *shost,
> > + struct scsi_device *sdev)
>
> Abosulutely the same story here, as above.
>
> scsi_host_ok2queue() -- please do not use ``shost'' in function names,
> ``host'' I think is descriptive enough.

-- Patrick Mansfield