Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 027360c5 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Staging: line6: minor coding style cleanups



This fixes up all of the remaining coding style issues that
make any sense to make in the line6 driver.

Cc: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 79be7254
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -37,7 +37,9 @@ int line6_init_audio(struct usb_line6 *line6)
	strcpy(card->id, line6->properties->id);
	strcpy(card->driver, DRIVER_NAME);
	strcpy(card->shortname, line6->properties->name);
	sprintf(card->longname, "Line6 %s at USB %s", line6->properties->name, dev_name(line6->ifcdev));	/* 80 chars - see asound.h */
	/* longname is 80 chars - see asound.h */
	sprintf(card->longname, "Line6 %s at USB %s", line6->properties->name,
		dev_name(line6->ifcdev));
	return 0;
}

+11 −6
Original line number Diff line number Diff line
@@ -164,15 +164,19 @@ void line6_capture_copy(struct snd_line6_pcm *line6pcm, char *fbuf, int fsize)
			       len * bytes_per_frame);
			memcpy(runtime->dma_area, fbuf + len * bytes_per_frame,
			       (frames - len) * bytes_per_frame);
		} else
			dev_err(line6pcm->line6->ifcdev, "driver bug: len = %d\n", len);	/* this is somewhat paranoid */
		} else {
			/* this is somewhat paranoid */
			dev_err(line6pcm->line6->ifcdev,
				"driver bug: len = %d\n", len);
		}
	} else {
		/* copy single chunk */
		memcpy(runtime->dma_area +
		       line6pcm->pos_in_done * bytes_per_frame, fbuf, fsize);
	}

	if ((line6pcm->pos_in_done += frames) >= runtime->buffer_size)
	line6pcm->pos_in_done += frames;
	if (line6pcm->pos_in_done >= runtime->buffer_size)
		line6pcm->pos_in_done -= runtime->buffer_size;
}

@@ -181,14 +185,15 @@ void line6_capture_check_period(struct snd_line6_pcm *line6pcm, int length)
	struct snd_pcm_substream *substream =
	    get_substream(line6pcm, SNDRV_PCM_STREAM_CAPTURE);

	if ((line6pcm->bytes_in += length) >= line6pcm->period_in) {
	line6pcm->bytes_in += length;
	if (line6pcm->bytes_in >= line6pcm->period_in) {
		line6pcm->bytes_in %= line6pcm->period_in;
		snd_pcm_period_elapsed(substream);
	}
}

/*
  Callback for completed capture URB.
 * Callback for completed capture URB.
 */
static void audio_in_callback(struct urb *urb)
{
+3 −3
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@
#endif


/**
   Development tools.
/*
 * Development tools.
 */
#define DO_DEBUG_MESSAGES    0
#define DO_DUMP_URB_SEND     DO_DEBUG_MESSAGES
+3 −4
Original line number Diff line number Diff line
@@ -634,8 +634,7 @@ int line6_write_data(struct usb_line6 *line6, int address, void *data,
				"receiving status failed (error %d)\n", ret);
			return ret;
		}
	}
	while (status == 0xff);
	} while (status == 0xff);

	if (status != 0) {
		dev_err(line6->ifcdev, "write failed (error %d)\n", ret);
+6 −4
Original line number Diff line number Diff line
@@ -71,9 +71,11 @@ do { \
} while (0)

#define CHECK_STARTUP_PROGRESS(x, n)	\
do {					\
	if ((x) >= (n))			\
		return;			\
	x = (n);
	x = (n);			\
} while (0)

extern const unsigned char line6_midi_id[3];
extern struct usb_line6 *line6_devices[LINE6_MAX_DEVICES];
Loading