A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p
@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
20 files changed:
struct best *bp;
for (i = 0; i < END; i++) {
struct best *bp;
for (i = 0; i < END; i++) {
- best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */;
+ best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */
default :
snd_BUG();
return -EINVAL;
default :
snd_BUG();
return -EINVAL;
return vx_set_stream_format(chip, pipe, header);
}
return vx_set_stream_format(chip, pipe, header);
}
hw = emu->hw;
for (i = 0; i < END; i++) {
hw = emu->hw;
for (i = 0; i < END; i++) {
- best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */;
+ best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */
/* Note: we leave the upper bits in place */
dst++;
/* Note: we leave the upper bits in place */
dst++;
if(copy_to_user(&(buf)[p], fixit, l))
return -EFAULT;
if(copy_to_user(&(buf)[p], fixit, l))
return -EFAULT;
DMAbuf_rmchars(dev, buf_no, l);
DMAbuf_rmchars(dev, buf_no, l);
for (i = 0; i < 18; i++)
pv_map[i].ioaddr = devc->left_io;
for (i = 0; i < 18; i++)
pv_map[i].ioaddr = devc->left_io;
conf_printf2(devc->fm_info.name, ioaddr, 0, -1, -1);
for (i = 0; i < SBFM_MAXINSTR; i++)
conf_printf2(devc->fm_info.name, ioaddr, 0, -1, -1);
for (i = 0; i < SBFM_MAXINSTR; i++)
{
/*_____ Send the next byte */
outw (*block++, REG (PSS_DATA));
{
/*_____ Send the next byte */
outw (*block++, REG (PSS_DATA));
default:
printk (KERN_ERR "Invalid esstype=%d specified\n", devc->sbmo.esstype);
return 0;
default:
printk (KERN_ERR "Invalid esstype=%d specified\n", devc->sbmo.esstype);
return 0;
if (submodel != -1) {
devc->submodel = submodel;
sprintf (modelname, "ES%d", devc->sbmo.esstype);
chip = modelname;
if (submodel != -1) {
devc->submodel = submodel;
sprintf (modelname, "ES%d", devc->sbmo.esstype);
chip = modelname;
if (chip == NULL && (ess_minor & 0x0f) < 8) {
chip = "ES688";
if (chip == NULL && (ess_minor & 0x0f) < 8) {
chip = "ES688";
#ifdef FKS_TEST
FKS_test (devc);
#endif
#ifdef FKS_TEST
FKS_test (devc);
#endif
*/
if (chip == NULL && devc->sbmo.esstype == ESSTYPE_LIKE20) {
chip = "ES1688";
*/
if (chip == NULL && devc->sbmo.esstype == ESSTYPE_LIKE20) {
chip = "ES1688";
if (chip == NULL) {
int type;
if (chip == NULL) {
int type;
if ((type & 0x00ff) != ((type >> 8) & 0x00ff)) {
printk ("ess_init: Unrecognized %04x\n", type);
}
if ((type & 0x00ff) != ((type >> 8) & 0x00ff)) {
printk ("ess_init: Unrecognized %04x\n", type);
}
#if 0
/*
* this one failed:
#if 0
/*
* this one failed:
chip = "ES1788";
devc->submodel = SUBMDL_ES1788;
}
chip = "ES1788";
devc->submodel = SUBMDL_ES1788;
}
if (chip == NULL) {
chip = "ES1688";
if (chip == NULL) {
chip = "ES1688";
printk ( KERN_INFO "ESS chip %s %s%s\n"
, chip
printk ( KERN_INFO "ESS chip %s %s%s\n"
, chip
default:
printk(KERN_ERR "ESS1887: Invalid DMA16 %d\n", dma);
return 0;
default:
printk(KERN_ERR "ESS1887: Invalid DMA16 %d\n", dma);
return 0;
ess_chgmixer (devc, 0x78, 0x20, dma16_bits);
ess_chgmixer (devc, 0x7d, 0x07, dma_bits);
}
ess_chgmixer (devc, 0x78, 0x20, dma16_bits);
ess_chgmixer (devc, 0x7d, 0x07, dma_bits);
}
udelay(20);
outb(((unsigned char) (value & 0xff)), MIXER_DATA);
udelay(20);
udelay(20);
outb(((unsigned char) (value & 0xff)), MIXER_DATA);
udelay(20);
spin_unlock_irqrestore(&devc->lock, flags);
}
spin_unlock_irqrestore(&devc->lock, flags);
}
ess_chgmixer(devc, 0x7a, 0x18, 0x08);
ess_chgmixer(devc, 0x1c, 0x07, 0x07);
break;
ess_chgmixer(devc, 0x7a, 0x18, 0x08);
ess_chgmixer(devc, 0x1c, 0x07, 0x07);
break;
/*
* Call set_recmask for proper initialization
*/
/*
* Call set_recmask for proper initialization
*/
case MDL_SMW:
if (devc->model == MDL_ESS && ess_set_recmask (devc, &devmask)) {
break;
case MDL_SMW:
if (devc->model == MDL_ESS && ess_set_recmask (devc, &devmask)) {
break;
if (devmask != SOUND_MASK_MIC &&
devmask != SOUND_MASK_LINE &&
devmask != SOUND_MASK_CD)
if (devmask != SOUND_MASK_MIC &&
devmask != SOUND_MASK_LINE &&
devmask != SOUND_MASK_CD)
if (devc->model != MDL_ESS || !ess_mixer_reset (devc)) {
set_recmask(devc, SOUND_MASK_MIC);
if (devc->model != MDL_ESS || !ess_mixer_reset (devc)) {
set_recmask(devc, SOUND_MASK_MIC);
}
int sb_mixer_init(sb_devc * devc, struct module *owner)
}
int sb_mixer_init(sb_devc * devc, struct module *owner)
{
def_tmr.expires = (1) + jiffies;
add_timer(&def_tmr);
{
def_tmr.expires = (1) + jiffies;
add_timer(&def_tmr);
{
def_tmr.expires = (1) + jiffies;
add_timer(&def_tmr);
{
def_tmr.expires = (1) + jiffies;
add_timer(&def_tmr);
{
/* printk("Midi6850: Midi busy\n");*/
return -EBUSY;
{
/* printk("Midi6850: Midi busy\n");*/
return -EBUSY;
uart6850_cmd(UART_RESET);
uart6850_input_loop();
uart6850_cmd(UART_RESET);
uart6850_input_loop();
hpi_ctl.dst_node_type,
hpi_ctl.dst_node_index);
continue;
hpi_ctl.dst_node_type,
hpi_ctl.dst_node_index);
continue;
if (err < 0)
return err;
}
if (err < 0)
return err;
}
if (!gp) {
printk(KERN_ERR "vortex: cannot allocate memory for gameport\n");
return -ENOMEM;
if (!gp) {
printk(KERN_ERR "vortex: cannot allocate memory for gameport\n");
return -ENOMEM;
gameport_set_name(gp, "AU88x0 Gameport");
gameport_set_phys(gp, "pci%s/gameport0", pci_name(vortex->pci_dev));
gameport_set_name(gp, "AU88x0 Gameport");
gameport_set_phys(gp, "pci%s/gameport0", pci_name(vortex->pci_dev));
case 4:
mixin = p->mixin[i];
break;
case 4:
mixin = p->mixin[i];
break;
vol = p->vol[i];
vortex_mix_setinputvolumebyte(vortex,
vortex->mixplayb[i], mixin, vol);
vol = p->vol[i];
vortex_mix_setinputvolumebyte(vortex,
vortex->mixplayb[i], mixin, vol);
int i;
for (i = 0; i < V_END; i++) {
int i;
for (i = 0; i < V_END; i++) {
- best[i].time = (unsigned int)-1; /* XXX MAX_?INT really */;
+ best[i].time = (unsigned int)-1; /* XXX MAX_?INT really */
runtime->hw.channels_min =
runtime->hw.channels_max = 16;
break;
runtime->hw.channels_min =
runtime->hw.channels_max = 16;
break;
#endif
#if 0
/* For 96kHz */
#endif
#if 0
/* For 96kHz */
case DEVICE_INTEL_ICH4:
chip->spdif_idx = ICHD_SPBAR;
break;
case DEVICE_INTEL_ICH4:
chip->spdif_idx = ICHD_SPBAR;
break;
}
chip->in_ac97_init = 1;
}
chip->in_ac97_init = 1;
if ((err = snd_card_register(chip->card)) < 0)
return err;
if ((err = snd_card_register(chip->card)) < 0)
return err;
snd_printdd("miXart firmware downloaded and successfully set up\n");
snd_printdd("miXart firmware downloaded and successfully set up\n");
default:
swval = &amd->pgain;
break;
default:
swval = &amd->pgain;
break;
ucontrol->value.integer.value[0] = *swval;
ucontrol->value.integer.value[0] = *swval;
default:
swval = &amd->pgain;
break;
default:
swval = &amd->pgain;
break;
spin_lock_irqsave(&amd->lock, flags);
spin_lock_irqsave(&amd->lock, flags);
break;
default:
printk(KERN_ERR "DBRI reverse_bytes: unsupported length\n");
break;
default:
printk(KERN_ERR "DBRI reverse_bytes: unsupported length\n");