ALSA: sb: Fix sparse warning wrt PCM format type
The PCM format type is with __bitwise, and it can't be converted from integer implicitly. Instead of an ugly cast, declare the function argument of snd_sb_csp_autoload() with the proper snd_pcm_format_t type. This fixes the sparse warnings like: sound/isa/sb/sb16_csp.c:743:22: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
55ff2d1ea5
commit
e5d3765b6c
|
@ -46,7 +46,7 @@ enum {
|
||||||
struct snd_sb_csp_ops {
|
struct snd_sb_csp_ops {
|
||||||
int (*csp_use) (struct snd_sb_csp * p);
|
int (*csp_use) (struct snd_sb_csp * p);
|
||||||
int (*csp_unuse) (struct snd_sb_csp * p);
|
int (*csp_unuse) (struct snd_sb_csp * p);
|
||||||
int (*csp_autoload) (struct snd_sb_csp * p, int pcm_sfmt, int play_rec_mode);
|
int (*csp_autoload) (struct snd_sb_csp * p, snd_pcm_format_t pcm_sfmt, int play_rec_mode);
|
||||||
int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels);
|
int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels);
|
||||||
int (*csp_stop) (struct snd_sb_csp * p);
|
int (*csp_stop) (struct snd_sb_csp * p);
|
||||||
int (*csp_qsound_transfer) (struct snd_sb_csp * p);
|
int (*csp_qsound_transfer) (struct snd_sb_csp * p);
|
||||||
|
|
|
@ -93,7 +93,7 @@ static int snd_sb_csp_riff_load(struct snd_sb_csp * p,
|
||||||
struct snd_sb_csp_microcode __user * code);
|
struct snd_sb_csp_microcode __user * code);
|
||||||
static int snd_sb_csp_unload(struct snd_sb_csp * p);
|
static int snd_sb_csp_unload(struct snd_sb_csp * p);
|
||||||
static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags);
|
static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags);
|
||||||
static int snd_sb_csp_autoload(struct snd_sb_csp * p, int pcm_sfmt, int play_rec_mode);
|
static int snd_sb_csp_autoload(struct snd_sb_csp * p, snd_pcm_format_t pcm_sfmt, int play_rec_mode);
|
||||||
static int snd_sb_csp_check_version(struct snd_sb_csp * p);
|
static int snd_sb_csp_check_version(struct snd_sb_csp * p);
|
||||||
|
|
||||||
static int snd_sb_csp_use(struct snd_sb_csp * p);
|
static int snd_sb_csp_use(struct snd_sb_csp * p);
|
||||||
|
@ -726,7 +726,7 @@ static int snd_sb_csp_firmware_load(struct snd_sb_csp *p, int index, int flags)
|
||||||
* autoload hardware codec if necessary
|
* autoload hardware codec if necessary
|
||||||
* return 0 if CSP is loaded and ready to run (p->running != 0)
|
* return 0 if CSP is loaded and ready to run (p->running != 0)
|
||||||
*/
|
*/
|
||||||
static int snd_sb_csp_autoload(struct snd_sb_csp * p, int pcm_sfmt, int play_rec_mode)
|
static int snd_sb_csp_autoload(struct snd_sb_csp * p, snd_pcm_format_t pcm_sfmt, int play_rec_mode)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
@ -736,7 +736,7 @@ static int snd_sb_csp_autoload(struct snd_sb_csp * p, int pcm_sfmt, int play_rec
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
/* autoload microcode only if requested hardware codec is not already loaded */
|
/* autoload microcode only if requested hardware codec is not already loaded */
|
||||||
if (((1 << pcm_sfmt) & p->acc_format) && (play_rec_mode & p->mode)) {
|
if (((1U << (__force int)pcm_sfmt) & p->acc_format) && (play_rec_mode & p->mode)) {
|
||||||
p->running = SNDRV_SB_CSP_ST_AUTO;
|
p->running = SNDRV_SB_CSP_ST_AUTO;
|
||||||
} else {
|
} else {
|
||||||
switch (pcm_sfmt) {
|
switch (pcm_sfmt) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user