Skip to content

Commit

Permalink
cam: clean up empty lines in .c and .h files
Browse files Browse the repository at this point in the history
  • Loading branch information
mjguzik committed Sep 1, 2020
1 parent 985b8ee commit 27dcd3d
Show file tree
Hide file tree
Showing 58 changed files with 56 additions and 289 deletions.
6 changes: 2 additions & 4 deletions sys/cam/ata/ata_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,6 @@ ata_string2mode(char *str)
return (-1);
}


u_int
ata_mode2speed(int mode)
{
Expand Down Expand Up @@ -995,7 +994,7 @@ ata_identify_match(caddr_t identbuffer, caddr_t table_entry)
{
struct scsi_inquiry_pattern *entry;
struct ata_params *ident;

entry = (struct scsi_inquiry_pattern *)table_entry;
ident = (struct ata_params *)identbuffer;

Expand All @@ -1013,7 +1012,7 @@ ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry)
{
struct scsi_static_inquiry_pattern *entry;
struct ata_params *ident;

entry = (struct scsi_static_inquiry_pattern *)table_entry;
ident = (struct ata_params *)identbuffer;

Expand Down Expand Up @@ -1108,7 +1107,6 @@ semb_write_buffer(struct ccb_ataio *ataio,
length > 0 ? data_ptr[0] : 0, 0x80, length / 4);
}


void
ata_zac_mgmt_out(struct ccb_ataio *ataio, uint32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
Expand Down
8 changes: 0 additions & 8 deletions sys/cam/ata/ata_da.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ static struct ada_zone_desc {
{ADA_ZONE_FLAG_RWP_SUP, "Reset Write Pointer" },
};


/* Offsets into our private area for storing information */
#define ccb_state ppriv_field0
#define ccb_bp ppriv_ptr1
Expand Down Expand Up @@ -1009,7 +1008,6 @@ adaclose(struct disk *dp)
(softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 &&
(periph->flags & CAM_PERIPH_INVALID) == 0 &&
cam_periph_hold(periph, PRIBIO) == 0) {

ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
cam_fill_ataio(&ccb->ataio,
1,
Expand Down Expand Up @@ -1198,7 +1196,6 @@ adainit(void)
printf("ada: Failed to attach master async callback "
"due to status 0x%x!\n", status);
} else if (ada_send_ordered) {

/* Register our event handlers */
if ((EVENTHANDLER_REGISTER(power_suspend, adasuspend,
NULL, EVENTHANDLER_PRI_LAST)) == NULL)
Expand Down Expand Up @@ -1462,7 +1459,6 @@ adazonesupsysctl(SYSCTL_HANDLER_ARGS)
return (error);
}


static void
adasysctlinit(void *context, int pending)
{
Expand Down Expand Up @@ -2573,7 +2569,6 @@ adastart(struct cam_periph *periph, union ccb *start_ccb)
break;
}


ata_read_log(ataio,
/*retries*/1,
/*cbfcnp*/adadone,
Expand Down Expand Up @@ -2838,7 +2833,6 @@ adazonedone(struct cam_periph *periph, union ccb *ccb)
free(ccb->ataio.data_ptr, M_ATADA);
}


static void
adadone(struct cam_periph *periph, union ccb *done_ccb)
{
Expand Down Expand Up @@ -3082,8 +3076,6 @@ adadone(struct cam_periph *periph, union ccb *done_ccb)
/*getcount_only*/0);
}
}


}

free(ataio->data_ptr, M_ATADA);
Expand Down
2 changes: 1 addition & 1 deletion sys/cam/ata/ata_pmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ pmpasync(void *callback_arg, u_int32_t code,
{
struct ccb_getdev *cgd;
cam_status status;

cgd = (struct ccb_getdev *)arg;
if (cgd == NULL)
break;
Expand Down
3 changes: 0 additions & 3 deletions sys/cam/cam.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ cam_strvis_sbuf(struct sbuf *sb, const u_int8_t *src, int srclen,
}
}


/*
* Compare string with pattern, returning 0 on match.
* Short pattern matches trailing blanks in name,
Expand Down Expand Up @@ -330,7 +329,6 @@ camstatusentrycomp(const void *key, const void *member)
return (status - table_entry->status_code);
}


#ifdef _KERNEL
char *
cam_error_string(union ccb *ccb, char *str, int str_len,
Expand Down Expand Up @@ -493,7 +491,6 @@ cam_error_string(struct cam_device *device, union ccb *ccb, char *str,
if ((proto_flags & CAM_ESF_PRINT_SENSE)
&& (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND)
&& (ccb->ccb_h.status & CAM_AUTOSNS_VALID)) {

#ifdef _KERNEL
scsi_sense_sbuf(&ccb->csio, &sb,
SSS_FLAG_NONE);
Expand Down
3 changes: 1 addition & 2 deletions sys/cam/cam.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ typedef enum {
/* SCSI Bus Busy */
CAM_SCSI_BUSY = 0x3f,


/*
* Flags
*/
Expand All @@ -304,7 +303,7 @@ typedef enum {
/*
* Target Specific Adjunct Status
*/

/* sent sense with status */
CAM_SENT_SENSE = 0x40000000
} cam_status;
Expand Down
2 changes: 0 additions & 2 deletions sys/cam/cam_ccb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,6 @@ struct ccb_trans_settings {
} xport_specific;
};


/*
* Calculate the geometry parameters for a device
* give the block size and volume size in blocks.
Expand All @@ -1132,7 +1131,6 @@ struct ccb_calc_geometry {
#define KNOB_VALID_ADDRESS 0x1
#define KNOB_VALID_ROLE 0x2


#define KNOB_ROLE_NONE 0x0
#define KNOB_ROLE_INITIATOR 0x1
#define KNOB_ROLE_TARGET 0x2
Expand Down
3 changes: 1 addition & 2 deletions sys/cam/cam_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ cam_compat_translate_dev_match_0x18(union ccb *ccb)
dm = ccb->cdm.matches;
/* Translate in-place: old fields are smaller */
dm18 = (struct dev_match_result_0x18 *)(dm);

for (i = 0; i < ccb->cdm.num_matches; i++) {
dm18[i].type = dm[i].type;
switch (dm[i].type) {
Expand Down Expand Up @@ -420,4 +420,3 @@ cam_compat_translate_dev_match_0x18(union ccb *ccb)

return (0);
}

1 change: 0 additions & 1 deletion sys/cam/cam_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ int cam_compat_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
struct thread *td, int(*cbfnp)(struct cdev *, u_long, caddr_t, int,
struct thread *));


/* Version 0x16 compatibility */
#define CAM_VERSION_0x16 0x16

Expand Down
5 changes: 0 additions & 5 deletions sys/cam/cam_iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ struct iop_stats {
struct cam_iosched_softc *softc;
};


typedef enum {
set_max = 0, /* current = max */
read_latency, /* Steer read latency by throttling writes */
Expand Down Expand Up @@ -456,7 +455,6 @@ cam_iosched_iops_tick(struct iop_stats *ios)
ios->l_value1 += new_ios;
}


return 0;
}

Expand Down Expand Up @@ -542,7 +540,6 @@ cam_iosched_bw_caniop(struct iop_stats *ios, struct bio *bp)
if (ios->current > 0 && ios->l_value1 <= 0)
return EAGAIN;


return 0;
}

Expand Down Expand Up @@ -615,7 +612,6 @@ cam_iosched_ticker(void *arg)
isc->total_ticks++;
}


static void
cam_iosched_cl_init(struct control_loop *clp, struct cam_iosched_softc *isc)
{
Expand Down Expand Up @@ -791,7 +787,6 @@ cam_iosched_has_more_trim(struct cam_iosched_softc *isc)
#define cam_iosched_sort_queue(isc) ((isc)->sort_io_queue >= 0 ? \
(isc)->sort_io_queue : cam_sort_io_queues)


static inline bool
cam_iosched_has_work(struct cam_iosched_softc *isc)
{
Expand Down
15 changes: 3 additions & 12 deletions sys/cam/cam_periph.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ cam_periph_alloc(periph_ctor_t *periph_ctor,
* handler. If it looks like a mistaken re-allocation, complain.
*/
if ((periph = cam_periph_find(path, name)) != NULL) {

if ((periph->flags & CAM_PERIPH_INVALID) != 0
&& (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) == 0) {
periph->flags |= CAM_PERIPH_NEW_DEV_FOUND;
Expand All @@ -233,15 +232,14 @@ cam_periph_alloc(periph_ctor_t *periph_ctor,
}
return (CAM_REQ_INVALID);
}

periph = (struct cam_periph *)malloc(sizeof(*periph), M_CAMPERIPH,
M_NOWAIT|M_ZERO);

if (periph == NULL)
return (CAM_RESRC_UNAVAIL);

init_level++;

init_level++;

sim = xpt_path_sim(path);
path_id = xpt_path_path_id(path);
Expand Down Expand Up @@ -342,7 +340,6 @@ cam_periph_find(struct cam_path *path, char *name)

xpt_lock_buses();
for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) {

if (name != NULL && (strcmp((*p_drv)->driver_name, name) != 0))
continue;

Expand Down Expand Up @@ -380,7 +377,6 @@ cam_periph_list(struct cam_path *path, struct sbuf *sb)
count = 0;
xpt_lock_buses();
for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) {

TAILQ_FOREACH(periph, &(*p_drv)->units, unit_links) {
if (xpt_path_comp(periph->path, path) != 0)
continue;
Expand Down Expand Up @@ -468,7 +464,7 @@ cam_periph_release(struct cam_periph *periph)

if (periph == NULL)
return;

cam_periph_assert(periph, MA_NOTOWNED);
mtx = cam_periph_mtx(periph);
mtx_lock(mtx);
Expand Down Expand Up @@ -549,7 +545,6 @@ camperiphnextunit(struct periph_driver *p_drv, u_int newunit, int wired,

periph_name = p_drv->driver_name;
for (;;newunit++) {

for (periph = TAILQ_FIRST(&p_drv->units);
periph != NULL && periph->unit_number != newunit;
periph = TAILQ_NEXT(periph, unit_links))
Expand Down Expand Up @@ -930,7 +925,6 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo,
PHOLD(curproc);

for (i = 0; i < numbufs; i++) {

/* Save the user's data address. */
mapinfo->orig[i] = *data_ptrs[i];

Expand Down Expand Up @@ -1146,7 +1140,6 @@ cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr,
ccb->cgdl.index = 0;
ccb->cgdl.status = CAM_GDEVLIST_MORE_DEVS;
while (ccb->cgdl.status == CAM_GDEVLIST_MORE_DEVS) {

/* we want the next device in the list */
xpt_action(ccb);
if (strncmp(ccb->cgdl.periph_name,
Expand Down Expand Up @@ -2032,7 +2025,6 @@ cam_periph_error(union ccb *ccb, cam_flags camflags,
xpt_path_path_id(ccb->ccb_h.path),
xpt_path_target_id(ccb->ccb_h.path),
lun_id) == CAM_REQ_CMP) {

/*
* Let peripheral drivers know that this
* device has gone away.
Expand All @@ -2052,7 +2044,6 @@ cam_periph_error(union ccb *ccb, cam_flags camflags,
xpt_path_path_id(ccb->ccb_h.path),
xpt_path_target_id(ccb->ccb_h.path),
CAM_LUN_WILDCARD) == CAM_REQ_CMP) {

scan_ccb = xpt_alloc_ccb_nowait();
if (scan_ccb != NULL) {
scan_ccb->ccb_h.path = newpath;
Expand Down
6 changes: 2 additions & 4 deletions sys/cam/cam_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ cam_ccbq_alloc(int openings)
free(ccbq, M_CAMCCBQ);
return (NULL);
}

return (ccbq);
}

Expand Down Expand Up @@ -348,7 +348,6 @@ heap_up(cam_pinfo **queue_array, int new_index)
child = new_index;

while (child != 1) {

parent = child >> 1;
if (queue_cmp(queue_array, parent, child) <= 0)
break;
Expand All @@ -367,11 +366,10 @@ heap_down(cam_pinfo **queue_array, int index, int num_entries)
{
int child;
int parent;

parent = index;
child = parent << 1;
for (; child <= num_entries; child = parent << 1) {

if (child < num_entries) {
/* child+1 is the right child of parent */
if (queue_cmp(queue_array, child + 1, child) < 0)
Expand Down
4 changes: 1 addition & 3 deletions sys/cam/cam_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ struct cam_devq {
int send_active;
};


struct cam_devq *cam_devq_alloc(int devices, int openings);

int cam_devq_init(struct cam_devq *devq, int devices,
Expand All @@ -87,7 +86,7 @@ int cam_devq_init(struct cam_devq *devq, int devices,
void cam_devq_free(struct cam_devq *devq);

u_int32_t cam_devq_resize(struct cam_devq *camq, int openings);

/*
* Allocate a cam_ccb_queue structure and initialize it.
*/
Expand Down Expand Up @@ -167,7 +166,6 @@ cam_ccbq_ccb_done(struct cam_ccbq *ccbq, union ccb *done_ccb);
static __inline void
cam_ccbq_release_opening(struct cam_ccbq *ccbq);


static __inline int
cam_ccbq_pending_ccb_count(struct cam_ccbq *ccbq)
{
Expand Down
1 change: 0 additions & 1 deletion sys/cam/cam_sim.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ void cam_sim_release(struct cam_sim *sim);
/* Optional sim attributes may be set with these. */
void cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id);


/* Generically useful offsets into the sim private area */
#define spriv_ptr0 sim_priv.entries[0].ptr
#define spriv_ptr1 sim_priv.entries[1].ptr
Expand Down
Loading

0 comments on commit 27dcd3d

Please sign in to comment.