mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-21 00:42:16 +00:00
staging: line6: rename MidiBuffer to avoid CamelCase
Fix checkpatch.pl warnings related to MidiBuffer: WARNING: Avoid CamelCase: <MidiBuffer> #947: FILE: staging/line6/driver.c:363: + struct MidiBuffer *mb = &line6->line6midi->midibuf_in; Rename MidiBuffer to midi_buffer. Note that "midibuf" would be another good name but sound/oss/midibuf.c already uses it for a different concept. Avoid possible confusion by using "midi_buffer" instead. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4d3f50e4e5
commit
269edc8ee9
@ -360,7 +360,7 @@ char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2,
|
|||||||
static void line6_data_received(struct urb *urb)
|
static void line6_data_received(struct urb *urb)
|
||||||
{
|
{
|
||||||
struct usb_line6 *line6 = (struct usb_line6 *)urb->context;
|
struct usb_line6 *line6 = (struct usb_line6 *)urb->context;
|
||||||
struct MidiBuffer *mb = &line6->line6midi->midibuf_in;
|
struct midi_buffer *mb = &line6->line6midi->midibuf_in;
|
||||||
int done;
|
int done;
|
||||||
|
|
||||||
if (urb->status == -ESHUTDOWN)
|
if (urb->status == -ESHUTDOWN)
|
||||||
|
@ -45,7 +45,7 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
|
|||||||
struct usb_line6 *line6 =
|
struct usb_line6 *line6 =
|
||||||
line6_rawmidi_substream_midi(substream)->line6;
|
line6_rawmidi_substream_midi(substream)->line6;
|
||||||
struct snd_line6_midi *line6midi = line6->line6midi;
|
struct snd_line6_midi *line6midi = line6->line6midi;
|
||||||
struct MidiBuffer *mb = &line6midi->midibuf_out;
|
struct midi_buffer *mb = &line6midi->midibuf_out;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned char chunk[line6->max_packet_size];
|
unsigned char chunk[line6->max_packet_size];
|
||||||
int req, done;
|
int req, done;
|
||||||
|
@ -57,12 +57,12 @@ struct snd_line6_midi {
|
|||||||
/**
|
/**
|
||||||
Buffer for incoming MIDI stream.
|
Buffer for incoming MIDI stream.
|
||||||
*/
|
*/
|
||||||
struct MidiBuffer midibuf_in;
|
struct midi_buffer midibuf_in;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Buffer for outgoing MIDI stream.
|
Buffer for outgoing MIDI stream.
|
||||||
*/
|
*/
|
||||||
struct MidiBuffer midibuf_out;
|
struct midi_buffer midibuf_out;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int line6_init_midi(struct usb_line6 *line6);
|
extern int line6_init_midi(struct usb_line6 *line6);
|
||||||
|
@ -33,23 +33,23 @@ static int midibuf_message_length(unsigned char code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int midibuf_is_empty(struct MidiBuffer *this)
|
static int midibuf_is_empty(struct midi_buffer *this)
|
||||||
{
|
{
|
||||||
return (this->pos_read == this->pos_write) && !this->full;
|
return (this->pos_read == this->pos_write) && !this->full;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int midibuf_is_full(struct MidiBuffer *this)
|
static int midibuf_is_full(struct midi_buffer *this)
|
||||||
{
|
{
|
||||||
return this->full;
|
return this->full;
|
||||||
}
|
}
|
||||||
|
|
||||||
void line6_midibuf_reset(struct MidiBuffer *this)
|
void line6_midibuf_reset(struct midi_buffer *this)
|
||||||
{
|
{
|
||||||
this->pos_read = this->pos_write = this->full = 0;
|
this->pos_read = this->pos_write = this->full = 0;
|
||||||
this->command_prev = -1;
|
this->command_prev = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int line6_midibuf_init(struct MidiBuffer *this, int size, int split)
|
int line6_midibuf_init(struct midi_buffer *this, int size, int split)
|
||||||
{
|
{
|
||||||
this->buf = kmalloc(size, GFP_KERNEL);
|
this->buf = kmalloc(size, GFP_KERNEL);
|
||||||
|
|
||||||
@ -62,14 +62,14 @@ int line6_midibuf_init(struct MidiBuffer *this, int size, int split)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void line6_midibuf_status(struct MidiBuffer *this)
|
void line6_midibuf_status(struct midi_buffer *this)
|
||||||
{
|
{
|
||||||
pr_debug("midibuf size=%d split=%d pos_read=%d pos_write=%d full=%d command_prev=%02x\n",
|
pr_debug("midibuf size=%d split=%d pos_read=%d pos_write=%d full=%d command_prev=%02x\n",
|
||||||
this->size, this->split, this->pos_read, this->pos_write,
|
this->size, this->split, this->pos_read, this->pos_write,
|
||||||
this->full, this->command_prev);
|
this->full, this->command_prev);
|
||||||
}
|
}
|
||||||
|
|
||||||
int line6_midibuf_bytes_free(struct MidiBuffer *this)
|
int line6_midibuf_bytes_free(struct midi_buffer *this)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
midibuf_is_full(this) ?
|
midibuf_is_full(this) ?
|
||||||
@ -78,7 +78,7 @@ int line6_midibuf_bytes_free(struct MidiBuffer *this)
|
|||||||
1;
|
1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int line6_midibuf_bytes_used(struct MidiBuffer *this)
|
int line6_midibuf_bytes_used(struct midi_buffer *this)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
midibuf_is_empty(this) ?
|
midibuf_is_empty(this) ?
|
||||||
@ -87,7 +87,7 @@ int line6_midibuf_bytes_used(struct MidiBuffer *this)
|
|||||||
1;
|
1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int line6_midibuf_write(struct MidiBuffer *this, unsigned char *data,
|
int line6_midibuf_write(struct midi_buffer *this, unsigned char *data,
|
||||||
int length)
|
int length)
|
||||||
{
|
{
|
||||||
int bytes_free;
|
int bytes_free;
|
||||||
@ -130,7 +130,8 @@ int line6_midibuf_write(struct MidiBuffer *this, unsigned char *data,
|
|||||||
return length + skip_active_sense;
|
return length + skip_active_sense;
|
||||||
}
|
}
|
||||||
|
|
||||||
int line6_midibuf_read(struct MidiBuffer *this, unsigned char *data, int length)
|
int line6_midibuf_read(struct midi_buffer *this, unsigned char *data,
|
||||||
|
int length)
|
||||||
{
|
{
|
||||||
int bytes_used;
|
int bytes_used;
|
||||||
int length1, length2;
|
int length1, length2;
|
||||||
@ -234,7 +235,7 @@ int line6_midibuf_read(struct MidiBuffer *this, unsigned char *data, int length)
|
|||||||
return length + repeat;
|
return length + repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
int line6_midibuf_ignore(struct MidiBuffer *this, int length)
|
int line6_midibuf_ignore(struct midi_buffer *this, int length)
|
||||||
{
|
{
|
||||||
int bytes_used = line6_midibuf_bytes_used(this);
|
int bytes_used = line6_midibuf_bytes_used(this);
|
||||||
|
|
||||||
@ -246,7 +247,7 @@ int line6_midibuf_ignore(struct MidiBuffer *this, int length)
|
|||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
int line6_midibuf_skip_message(struct MidiBuffer *this, unsigned short mask)
|
int line6_midibuf_skip_message(struct midi_buffer *this, unsigned short mask)
|
||||||
{
|
{
|
||||||
int cmd = this->command_prev;
|
int cmd = this->command_prev;
|
||||||
|
|
||||||
@ -257,7 +258,7 @@ int line6_midibuf_skip_message(struct MidiBuffer *this, unsigned short mask)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void line6_midibuf_destroy(struct MidiBuffer *this)
|
void line6_midibuf_destroy(struct midi_buffer *this)
|
||||||
{
|
{
|
||||||
kfree(this->buf);
|
kfree(this->buf);
|
||||||
this->buf = NULL;
|
this->buf = NULL;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#ifndef MIDIBUF_H
|
#ifndef MIDIBUF_H
|
||||||
#define MIDIBUF_H
|
#define MIDIBUF_H
|
||||||
|
|
||||||
struct MidiBuffer {
|
struct midi_buffer {
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
int size;
|
int size;
|
||||||
int split;
|
int split;
|
||||||
@ -21,18 +21,18 @@ struct MidiBuffer {
|
|||||||
int command_prev;
|
int command_prev;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int line6_midibuf_bytes_used(struct MidiBuffer *mb);
|
extern int line6_midibuf_bytes_used(struct midi_buffer *mb);
|
||||||
extern int line6_midibuf_bytes_free(struct MidiBuffer *mb);
|
extern int line6_midibuf_bytes_free(struct midi_buffer *mb);
|
||||||
extern void line6_midibuf_destroy(struct MidiBuffer *mb);
|
extern void line6_midibuf_destroy(struct midi_buffer *mb);
|
||||||
extern int line6_midibuf_ignore(struct MidiBuffer *mb, int length);
|
extern int line6_midibuf_ignore(struct midi_buffer *mb, int length);
|
||||||
extern int line6_midibuf_init(struct MidiBuffer *mb, int size, int split);
|
extern int line6_midibuf_init(struct midi_buffer *mb, int size, int split);
|
||||||
extern int line6_midibuf_read(struct MidiBuffer *mb, unsigned char *data,
|
extern int line6_midibuf_read(struct midi_buffer *mb, unsigned char *data,
|
||||||
int length);
|
int length);
|
||||||
extern void line6_midibuf_reset(struct MidiBuffer *mb);
|
extern void line6_midibuf_reset(struct midi_buffer *mb);
|
||||||
extern int line6_midibuf_skip_message(struct MidiBuffer *mb,
|
extern int line6_midibuf_skip_message(struct midi_buffer *mb,
|
||||||
unsigned short mask);
|
unsigned short mask);
|
||||||
extern void line6_midibuf_status(struct MidiBuffer *mb);
|
extern void line6_midibuf_status(struct midi_buffer *mb);
|
||||||
extern int line6_midibuf_write(struct MidiBuffer *mb, unsigned char *data,
|
extern int line6_midibuf_write(struct midi_buffer *mb, unsigned char *data,
|
||||||
int length);
|
int length);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user