usb: gadget: remove __devexit in f_uac2

usb: gadget: remove __devexit in f_uac2

avoids the following section missmatch
|WARNING: drivers/usb/gadget/g_audio.o(.init.text+0x2e7): Section
|mismatch in reference from the function afunc_bind() to the function
|.devexit.text:snd_uac2_remove()
|The function __init afunc_bind() references
|a function __devexit snd_uac2_remove().
|This is often seen when error handling in the init function
|uses functionality in the exit path.
|The fix is often to remove the __devexit annotation of
|snd_uac2_remove() so it may be used outside an exit section.

Signed-off-by: Sebastian Andrzej Siewior <265264fed90bdf8e813a354375ec16f47ebdb1c5@linutronix.de>
Signed-off-by: Felipe Balbi <94dddeeef08b001e003cce128ddc162a4e2c6cd2@ti.com>

--- drivers/usb/gadget/f_uac2.c
+++ drivers/usb/gadget/f_uac2.c
@@ -463,7 +463,7 @@
 	return err;
 }

-static int __devexit snd_uac2_remove(struct platform_device *pdev)
+static int snd_uac2_remove(struct platform_device *pdev)
 {
 	struct snd_card *card = platform_get_drvdata(pdev);


EHCI: turn off remote wakeup during shutdown

This patch (as850b) disables remote wakeup (and everything else!) on
all EHCI ports when the shutdown() method is called.  If remote wakeup
is left active then some systems will reboot instead of powering off.
This fixes Bugzilla #7828.

Signed-off-by: Alan Stern <75ea6bb7bfc1186f92d26164de5f9268c9a45b59@rowland.harvard.edu>
Cc: David Brownell <e543181633fc0fc2787945ef377537d9112d0c96@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/host/ehci-hcd.c
+++ drivers/usb/host/ehci-hcd.c
@@ -299,6 +299,19 @@
 	spin_unlock_irqrestore (&ehci->lock, flags);
 }

+/* On some systems, leaving remote wakeup enabled prevents system shutdown.
+ * The firmware seems to think that powering off is a wakeup event!
+ * This routine turns off remote wakeup and everything else, on all ports.
+ */
+static void ehci_turn_off_all_ports(struct ehci_hcd *ehci)
+{
+	int	port = HCS_N_PORTS(ehci->hcs_params);
+
+	while (port--)
+		ehci_writel(ehci, PORT_RWC_BITS,
+				&ehci->regs->port_status[port]);
+}
+
 /* ehci_shutdown kick in for silicon on any bus (not just pci, etc).
  * This forcibly disables dma and IRQs, helping kexec and other cases
  * where the next system software may expect clean state.
@@ -310,9 +323,13 @@

 	ehci = hcd_to_ehci (hcd);
 	(void) ehci_halt (ehci);
+	ehci_turn_off_all_ports(ehci);

 	/* make BIOS/etc use companion controller during reboot */
 	ehci_writel(ehci, 0, &ehci->regs->configured_flag);
+
+	/* unblock posted writes */
+	ehci_readl(ehci, &ehci->regs->configured_flag);
 }

 static void ehci_port_power (struct ehci_hcd *ehci, int is_on)


ALSA: hda - Fix forgotten ifdef CONFIG_SND_HDA_PATCH_LOADER

The firmware callback must be protected by that ifdef.

Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

--- sound/pci/hda/hda_intel.c
+++ sound/pci/hda/hda_intel.c
@@ -3159,6 +3159,7 @@
 #endif
 }

+#ifdef CONFIG_SND_HDA_PATCH_LOADER
 /* callback from request_firmware_nowait() */
 static void azx_firmware_cb(const struct firmware *fw, void *context)
 {
@@ -3183,6 +3184,7 @@
 	snd_card_free(card);
 	pci_set_drvdata(pci, NULL);
 }
+#endif

 static int __devinit azx_probe(struct pci_dev *pci,
 			       const struct pci_device_id *pci_id)


Add some tests that don't go as well as I'd like.

--- examples/rmc-test.c
+++ examples/rmc-test.c
@@ -145,3 +145,35 @@
     VEDGE(pre, fuckoff);
     L(fuckoff, *p = 1);
 }
+
+
+// Looping MP recv test.
+int mp_recv(int *flag, int *data) {
+    int rf;
+    XEDGE(rflag, rdata);
+    do {
+        L(rflag, rf = *flag);
+    } while (rf == 0);
+    L(rdata, int rd = *data);
+    return rd;
+}
+
+// XXX: We fail to use an isync here because the very restricted
+// pattern matching we use to detect control deps doesn't find
+// this. We should be less bad.
+//
+// Actually, we handle this extra really badly and miscompile this
+// code if we aren't depending on the branch! LLVM optimizes this into
+// code that reads the flag *once* and then loops on that register.
+// I'm not sure how the RMC story interacts with this sort of thing.
+// Adding a XEDGE(rflag, rflag) fixes it...  As does making flag
+// volatile...
+int mp_recv_bang(int *flag, int *data) {
+    int rf;
+    XEDGE(rflag, rdata);
+    do {
+        L(rflag, rf = *flag);
+    } while (!rf);
+    L(rdata, int rd = *data);
+    return rd;
+}


USB: u132-hcd.c - Fix a warning when CONFIG_PM=n

I noticed this warning with CONFING_PM=n

...

drivers/usb/host/u132-hcd.c:1525: warning: 'port_power' defined but not used

...

Signed-off-by: Gabriel Craciunescu <07e9a5a6ffe7af86b6541e1471a15bbe0d63c5fd@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/host/u132-hcd.c
+++ drivers/usb/host/u132-hcd.c
@@ -1520,11 +1520,14 @@
                 }
         }
 }
+#ifdef CONFIG_PM

 static void port_power(struct u132 *u132, int pn, int is_on)
 {
         u132->port[pn].power = is_on;
 }
+
+#endif

 static void u132_power(struct u132 *u132, int is_on)
 {


ALSA: hda - Revert the check of NO_PRESENCE pincfg default bit

The implementation on commit [08a1f5eb: ALSA: hda - Check NO_PRESENCE
pincfg default bit] seems like a mis-interpretation of specification.
The spec gives the reversed bit definition.  But, following the spec
also causes to change so many existing device configurations, thus we
can't change it so easily for now.  For 3.2-rc1, it's safer to revert
this check (actually this patch comments out the code).

We may re-introduced the fixed version once after the wider test-case
coverages are done.

Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

--- sound/pci/hda/hda_local.h
+++ sound/pci/hda/hda_local.h
@@ -511,8 +511,11 @@
 static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid)
 {
 	return (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT) &&
-		!(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid) &
-		  AC_DEFCFG_MISC_NO_PRESENCE)) &&
+		/* disable MISC_NO_PRESENCE check because it may break too
+		 * many devices
+		 */
+		/*(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid) &
+		  AC_DEFCFG_MISC_NO_PRESENCE)) &&*/
 		(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP);
 }


Teach bdm sync-sender to work with modern ION versions.

This supports INB-1.1.0 and the Bioserve branch.  It drops support for
the old obsolete "ION 1.0" that no one can get any more.

--- data-manager/server/sync-send.c
+++ data-manager/server/sync-send.c
@@ -460,18 +460,34 @@
     }

     if ( config->ion.bundle_size ) {
-        g_log(BDM_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,
+        int r;
+        Object unused_new_bundle;
+
+        g_log(BDM_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
             "Sending bundle with payload of %lu bytes",
             (unsigned long)config->ion.bundle_size);
-        if (bp_send(config->ion.sap, BP_BLOCKING, config->sync_recipient,
-                        NULL, 300,
-                        BP_STD_PRIORITY, SourceCustodyRequired,
-                        0, 0, config->ion.bundleZco) < 1)
-        {
-                putSysErrmsg("bpsource can't send ADU", NULL);
-                return -1;
+
+        r = bp_send(
+            config->ion.sap,
+            BP_BLOCKING,
+            config->sync_recipient,
+            NULL,                     // report-to EID
+            300,                      // TTL in seconds
+            BP_STD_PRIORITY,          // class of service
+            SourceCustodyRequired,
+            0,                        // reporting flags - all disabled
+            0,                        // app-level ack requested - what's this doing in BP?!
+            NULL,                     // extended CoS - not used when CoS is STD_PRIORITY as above
+            config->ion.bundleZco,
+            &unused_new_bundle        // handle to the bundle in the BA, we dont need it (wish we could pass in NULL here)
+        );
+
+        if (r < 1) {
+            g_log(BDM_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "error sending bundle!");
+            return -1;
         }
     } else {
+        g_log(BDM_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "no bundle to send!");
         zco_destroy_reference(config->ion.sdr, config->ion.bundleZco);
     }


USB: u132-hcd: Fix seperate word in printk message

This patch fix seperated word in printk message.

Signed-off-by: Masanari Iida <f31bb8ac2957d045575b3081e813605474613a21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


ALSA: hda - Fix jack-detection on non-VT1708 VIA codecs

Move codec init verb which is only applicatable for VT1708.

I've found the root cause that jack plugged in can't be detected.
The verb in vt1708_init_verbs is used to power down jack detect circuit.
This verb is only applicable to VT1708. vt1708 didn't implement jack
detect function in hardware, so we should shut down this function to
avoid noise. But for other codecs, hardware implement jack detect
function. If sending this verb during initialization, jack detect will
be invalid. So I move this verb from via_parse_auto_config() to
patch_vt1708().

Signed-off-by: Lydia Wang <070ba3d7e30dfd7312770a44b7d1511cf086710e@viatech.com.cn>
Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

--- sound/pci/hda/patch_via.c
+++ sound/pci/hda/patch_via.c
@@ -2338,7 +2338,6 @@
 	if (spec->kctls.list)
 		spec->mixers[spec->num_mixers++] = spec->kctls.list;

-	spec->init_verbs[spec->num_iverbs++] = vt1708_init_verbs;

 	if (spec->hp_dac_nid && spec->hp_dep_path.depth) {
 		err = via_hp_build(codec);
@@ -2503,6 +2502,8 @@
 	/* disable 32bit format on VT1708 */
 	if (codec->vendor_id == 0x11061708)
 		spec->stream_analog_playback = &vt1708_pcm_analog_s16_playback;
+
+	spec->init_verbs[spec->num_iverbs++] = vt1708_init_verbs;

 	codec->patch_ops = via_patch_ops;


xhci: Check size rather then number of streams when allocating stream ctxs

Before this a device needing ie 32 stream ctxs would end up with an entry from
the small_streams_pool which has 256 bytes entries, where as 32 stream ctxs
need 512 bytes. Things actually keep running for a surprisingly long time
before crashing because of this.

Signed-off-by: Hans de Goede <9fa1be1a5b5729e4c6b404f34c9ce49ff4882fd8@redhat.com>
Signed-off-by: Sarah Sharp <d4c4fc5069677be84f589aa6e14eedffef9ba12f@linux.intel.com>


ALSA: hda - Remove dead GPIO code for VIA codec

From what I can conclude all GPIO handling was removed in 2009.
Remove dead code remnants.

Signed-off-by: David Henningsson <9fb354e0a5603a0331399c18f4aa5aab2f9d9c5b@canonical.com>
Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

--- sound/pci/hda/patch_via.c
+++ sound/pci/hda/patch_via.c
@@ -299,7 +299,6 @@

 #define VIA_JACK_EVENT		0x20
 #define VIA_HP_EVENT		0x01
-#define VIA_GPIO_EVENT		0x02
 #define VIA_LINE_EVENT		0x03

 enum {
@@ -1685,50 +1684,6 @@
 	via_line_automute(codec, present);
 }

-static void via_gpio_control(struct hda_codec *codec)
-{
-	unsigned int gpio_data;
-	unsigned int vol_counter;
-	unsigned int vol;
-	unsigned int master_vol;
-
-	struct via_spec *spec = codec->spec;
-
-	gpio_data = snd_hda_codec_read(codec, codec->afg, 0,
-				       AC_VERB_GET_GPIO_DATA, 0) & 0x03;
-
-	vol_counter = (snd_hda_codec_read(codec, codec->afg, 0,
-					  0xF84, 0) & 0x3F0000) >> 16;
-
-	vol = vol_counter & 0x1F;
-	master_vol = snd_hda_codec_read(codec, 0x1A, 0,
-					AC_VERB_GET_AMP_GAIN_MUTE,
-					AC_AMP_GET_INPUT);
-
-	if (gpio_data == 0x02) {
-		/* unmute line out */
-		snd_hda_set_pin_ctl(codec, spec->autocfg.line_out_pins[0],
-				    PIN_OUT);
-		if (vol_counter & 0x20) {
-			/* decrease volume */
-			if (vol > master_vol)
-				vol = master_vol;
-			snd_hda_codec_amp_stereo(codec, 0x1A, HDA_INPUT,
-						 0, HDA_AMP_VOLMASK,
-						 master_vol-vol);
-		} else {
-			/* increase volume */
-			snd_hda_codec_amp_stereo(codec, 0x1A, HDA_INPUT, 0,
-					 HDA_AMP_VOLMASK,
-					 ((master_vol+vol) > 0x2A) ? 0x2A :
-					  (master_vol+vol));
-		}
-	} else if (!(gpio_data & 0x02)) {
-		/* mute line out */
-		snd_hda_set_pin_ctl(codec, spec->autocfg.line_out_pins[0], 0);
-	}
-}
-
 /* unsolicited event for jack sensing */
 static void via_unsol_event(struct hda_codec *codec,
 				  unsigned int res)
@@ -1743,8 +1698,6 @@

 	if (res == VIA_HP_EVENT || res == VIA_LINE_EVENT)
 		via_hp_automute(codec);
-	else if (res == VIA_GPIO_EVENT)
-		via_gpio_control(codec);
 	snd_hda_jack_report_sync(codec);
 }


USB: option: blacklist network interface on ZTE MF880

The driver description files gives these names to the vendor specific
functions on this modem:

 diag: VID_19D2&PID_0284&MI_00
 nmea: VID_19D2&PID_0284&MI_01
 at:   VID_19D2&PID_0284&MI_02
 mdm:  VID_19D2&PID_0284&MI_03
 net:  VID_19D2&PID_0284&MI_04

Signed-off-by: Bjørn Mork <8a2957e0063f2abf61bd145b6236a74a3708ac54@mork.no>
Cc: stable <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/usb/serial/option.c
+++ drivers/usb/serial/option.c
@@ -926,7 +926,8 @@
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
 	  .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) },
-	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */
+	  .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
 	  .driver_info = (kernel_ulong_t)&net_intf4_blacklist },


fu-engine: When removing activation flag match the correct version

--- src/fu-engine.c
+++ src/fu-engine.c
@@ -4222,6 +4222,7 @@
 			const gchar *csum = g_ptr_array_index (checksums, i);
 			fu_device_add_checksum (dev_history, csum);
 		}
+		fu_device_set_version (dev_history, fu_device_get_version (dev));
 		fu_device_remove_flag (dev_history, FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION);
 		fu_device_set_update_state (dev_history, FWUPD_UPDATE_STATE_SUCCESS);
 		return fu_history_modify_device (self->history, dev_history,


ALSA: hda - VIA: Fix independent headphone no sound issue

Modify via_independent_hp_put() function to support VT1718S and VT1812
codecs, and fix independent headphone no sound issue.

Signed-off-by: Lydia Wang <070ba3d7e30dfd7312770a44b7d1511cf086710e@viatech.com.cn>
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>
Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

--- sound/pci/hda/patch_via.c
+++ sound/pci/hda/patch_via.c
@@ -1191,8 +1191,16 @@
 	/* Get Independent Mode index of headphone pin widget */
 	spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
 		? 1 : 0;
-	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, pinsel);
-
+	if (spec->codec_type == VT1718S)
+		snd_hda_codec_write(codec, nid, 0,
+				    AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0);
+	else
+		snd_hda_codec_write(codec, nid, 0,
+				    AC_VERB_SET_CONNECT_SEL, pinsel);
+
+	if (spec->codec_type == VT1812)
+		snd_hda_codec_write(codec, 0x35, 0,
+				    AC_VERB_SET_CONNECT_SEL, pinsel);
 	if (spec->multiout.hp_nid && spec->multiout.hp_nid
 	    != spec->multiout.dac_nids[HDA_FRONT])
 		snd_hda_codec_setup_stream(codec, spec->multiout.hp_nid,
@@ -1211,6 +1219,8 @@
 		activate_ctl(codec, "Headphone Playback Switch",
 			     spec->hp_independent_mode);
 	}
+	/* update jack power state */
+	set_jack_power_state(codec);
 	return 0;
 }


USB option driver K3765/K4505 avoid CDC_DATA interface

Currently the Option driver avoids binding interface 1 on Huawei K3765
and K4505 broadband modems as it should be handled by the cdc_ether
driver instead. This patch ensures we don't bind the interface 2
on those devices as that is CDC_DATA.

Signed-off-by: Andrew Bird <0b305cf4b094d91e2a96dc79716722da3c21f5b0@spheresystems.co.uk>
Cc: stable <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/serial/option.c
+++ drivers/usb/serial/option.c
@@ -1235,7 +1235,8 @@
 		(serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K3765 ||
 			serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K4505 ||
 			serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K4605) &&
-		serial->interface->cur_altsetting->desc.bInterfaceNumber == 1)
+		(serial->interface->cur_altsetting->desc.bInterfaceNumber == 1 ||
+			serial->interface->cur_altsetting->desc.bInterfaceNumber == 2))
 		return -ENODEV;

 	/* Don't bind network interface on Samsung GT-B3730, it is handled by a separate module */


ASoC: AD1980 codec: add multi-channel function support

We added multi-channel function to this codec driver and Blackfin ASoC driver as well.
It was tested on Blackfin hardware.

Signed-off-by: Cliff Cai <c2a2d640411a9ea91ab6abd6e9e9e46272f72647@analog.com>
Signed-off-by: Bryan Wu <956b36c0f472d2edb239225c10f7e4411d1efbb9@kernel.org>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- sound/soc/codecs/ad1980.c
+++ sound/soc/codecs/ad1980.c
@@ -85,6 +85,9 @@
 SOC_DOUBLE("Surround Playback Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1),
 SOC_DOUBLE("Surround Playback Switch", AC97_SURROUND_MASTER, 15, 7, 1, 1),

+SOC_DOUBLE("Center/LFE Playback Volume", AC97_CENTER_LFE_MASTER, 8, 0, 31, 1),
+SOC_DOUBLE("Center/LFE Playback Switch", AC97_CENTER_LFE_MASTER, 15, 7, 1, 1),
+
 SOC_ENUM("Capture Source", ad1980_cap_src),

 SOC_SINGLE("Mic Boost Switch", AC97_MIC, 6, 1, 0),
@@ -145,7 +148,7 @@
 	.playback = {
 		.stream_name = "Playback",
 		.channels_min = 2,
-		.channels_max = 2,
+		.channels_max = 6,
 		.rates = SNDRV_PCM_RATE_48000,
 		.formats = SNDRV_PCM_FMTBIT_S16_LE, },
 	.capture = {
@@ -192,6 +195,7 @@
 	struct snd_soc_codec *codec;
 	int ret = 0;
 	u16 vendor_id2;
+	u16 ext_status;

 	printk(KERN_INFO "AD1980 SoC Audio Codec\n");

@@ -253,9 +257,16 @@
 				"supported\n");
 	}

-	ac97_write(codec, AC97_MASTER, 0x0000); /* unmute line out volume */
-	ac97_write(codec, AC97_PCM, 0x0000);	/* unmute PCM out volume */
-	ac97_write(codec, AC97_REC_GAIN, 0x0000);/* unmute record volume */
+	/* unmute captures and playbacks volume */
+	ac97_write(codec, AC97_MASTER, 0x0000);
+	ac97_write(codec, AC97_PCM, 0x0000);
+	ac97_write(codec, AC97_REC_GAIN, 0x0000);
+	ac97_write(codec, AC97_CENTER_LFE_MASTER, 0x0000);
+	ac97_write(codec, AC97_SURROUND_MASTER, 0x0000);
+
+	/*power on LFE/CENTER/Surround DACs*/
+	ext_status = ac97_read(codec, AC97_EXTENDED_STATUS);
+	ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800);

 	ad1980_add_controls(codec);
 	ret = snd_soc_register_card(socdev);


[t:3976] merging 3976 to mainline

[t:3976] merging 3976 to mainline

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@35849 c7de825b-a66e-492c-adef-691d508d4ae1

--- newbrt/brt.c
+++ newbrt/brt.c
@@ -5687,8 +5687,7 @@
     OMT snapshot_txnids = logger ? logger->snapshot_txnids : NULL;
     OMT live_list_reverse = logger ? logger->live_list_reverse : NULL;
     MSN max_msn_applied = MIN_MSN;
-    // Temporary fix for #3976
-    if (true || toku_omt_size(bnc->broadcast_list) > 0) {
+    if (toku_omt_size(bnc->broadcast_list) > 0) {
         const int buffer_size = (stale_ube - stale_lbi) + (fresh_ube - fresh_lbi) + toku_omt_size(bnc->broadcast_list);
         long *XMALLOC_N(buffer_size, offsets);

@@ -5707,17 +5706,71 @@
         }

         toku_free(offsets);
-    } else {
+    } else if (stale_lbi == stale_ube) {
         struct iterate_do_brt_leaf_put_cmd_extra iter_extra = { .t = t, .bn = bn, .se = se, .ancestor = ancestor, .childnum = childnum, .snapshot_txnids = snapshot_txnids, .live_list_reverse = live_list_reverse, .max_msn_applied = &max_msn_applied };
-        if (!bn->stale_ancestor_messages_applied) {
-            r = toku_omt_iterate_on_range(bnc->stale_message_tree, stale_lbi, stale_ube, iterate_do_brt_leaf_put_cmd, &iter_extra); assert_zero(r);
-        }
         struct iterate_do_brt_leaf_put_cmd_and_move_to_stale_extra iter_amts_extra = { .brt = t, .iter_extra = &iter_extra, .bnc = bnc };
         r = toku_omt_iterate_on_range(bnc->fresh_message_tree, fresh_lbi, fresh_ube, iterate_do_brt_leaf_put_cmd_and_move_to_stale, &iter_amts_extra); assert_zero(r);
+    } else if (fresh_lbi == fresh_ube) {
+        struct iterate_do_brt_leaf_put_cmd_extra iter_extra = { .t = t, .bn = bn, .se = se, .ancestor = ancestor, .childnum = childnum, .snapshot_txnids = snapshot_txnids, .live_list_reverse = live_list_reverse, .max_msn_applied = &max_msn_applied };
+        r = toku_omt_iterate_on_range(bnc->stale_message_tree, stale_lbi, stale_ube, iterate_do_brt_leaf_put_cmd, &iter_extra); assert_zero(r);
+    } else {
+        long *XMALLOC_N(fresh_ube - fresh_lbi, fresh_offsets_to_move);
+        u_int32_t stale_i = stale_lbi, fresh_i = fresh_lbi;
+        OMTVALUE stale_v, fresh_v;
+        r = toku_omt_fetch(bnc->stale_message_tree, stale_i, &stale_v); assert_zero(r);
+        r = toku_omt_fetch(bnc->fresh_message_tree, fresh_i, &fresh_v); assert_zero(r);
+        struct toku_fifo_entry_key_msn_cmp_extra extra = { .cmp_extra = t->db, .cmp = t->compare_fun, .fifo = bnc->buffer };
+        while (stale_i < stale_ube && fresh_i < fresh_ube) {
+            const long stale_offset = (long) stale_v;
+            const long fresh_offset = (long) fresh_v;
+            int c = toku_fifo_entry_key_msn_cmp(&extra, &stale_offset, &fresh_offset);
+            if (c < 0) {
+                const struct fifo_entry *stale_entry = toku_fifo_get_entry(bnc->buffer, stale_offset);
+                do_brt_leaf_put_cmd(t, bn, se, ancestor, childnum, snapshot_txnids, live_list_reverse, &max_msn_applied, stale_entry);
+                stale_i++;
+                if (stale_i != stale_ube) {
+                    r = toku_omt_fetch(bnc->stale_message_tree, stale_i, &stale_v); assert_zero(r);
+                }
+            } else if (c > 0) {
+                fresh_offsets_to_move[fresh_i - fresh_lbi] = fresh_offset;
+                const struct fifo_entry *fresh_entry = toku_fifo_get_entry(bnc->buffer, fresh_offset);
+                do_brt_leaf_put_cmd(t, bn, se, ancestor, childnum, snapshot_txnids, live_list_reverse, &max_msn_applied, fresh_entry);
+                fresh_i++;
+                if (fresh_i != fresh_ube) {
+                    r = toku_omt_fetch(bnc->fresh_message_tree, fresh_i, &fresh_v); assert_zero(r);
+                }
+            } else {
+                // there is a message in both trees
+                assert(false);
+            }
+        }
+        while (stale_i < stale_ube) {
+            const long stale_offset = (long) stale_v;
+            const struct fifo_entry *stale_entry = toku_fifo_get_entry(bnc->buffer, stale_offset);
+            do_brt_leaf_put_cmd(t, bn, se, ancestor, childnum, snapshot_txnids, live_list_reverse, &max_msn_applied, stale_entry);
+            stale_i++;
+            if (stale_i != stale_ube) {
+                r = toku_omt_fetch(bnc->stale_message_tree, stale_i, &stale_v); assert_zero(r);
+            }
+        }
+        while (fresh_i < fresh_ube) {
+            const long fresh_offset = (long) fresh_v;
+            fresh_offsets_to_move[fresh_i - fresh_lbi] = fresh_offset;
+            const struct fifo_entry *fresh_entry = toku_fifo_get_entry(bnc->buffer, fresh_offset);
+            do_brt_leaf_put_cmd(t, bn, se, ancestor, childnum, snapshot_txnids, live_list_reverse, &max_msn_applied, fresh_entry);
+            fresh_i++;
+            if (fresh_i != fresh_ube) {
+                r = toku_omt_fetch(bnc->fresh_message_tree, fresh_i, &fresh_v); assert_zero(r);
+            }
+        }
+        for (u_int32_t i = 0; i < fresh_ube - fresh_lbi; ++i) {
+            r = move_to_stale((OMTVALUE) fresh_offsets_to_move[i], i + fresh_lbi, t, bnc); assert_zero(r);
+        }
+        toku_free(fresh_offsets_to_move);
     }
     // we can't delete things inside move_to_stale because that happens
     // inside an iteration, instead we have to delete from fresh after
-    for (unsigned int i = 0; i < fresh_ube - fresh_lbi; ++i) {
+    for (u_int32_t ube = fresh_ube; fresh_lbi < ube; --ube) {
         r = toku_omt_delete_at(bnc->fresh_message_tree, fresh_lbi); assert_zero(r);
     }
     if (max_msn_applied.msn > bn->max_msn_applied.msn) {


video: atmel_lcdfb: ensure the hardware is initialized with the correct mode

If no driver takeover the atmel_lcdfb, the lcd won't be in a working state
since atmel_lcdfb_set_par() will never be called. Enabling a driver which does,
like fbcon, will call the function and put atmel_lcdfb in a working state.

Fixes: b985172b328a (video: atmel_lcdfb: add device tree suport)

Signed-off-by: Antoine Ténart <7fc24f17b07747ca12864f96f551beca43e4577d@free-electrons.com>
Reported-by: Alexandre Belloni <a7228e626ecf0022ac91fc1cd8db88e71d0e5e0e@free-electrons.com>
Acked-by: Alexandre Belloni <a7228e626ecf0022ac91fc1cd8db88e71d0e5e0e@free-electrons.com>
Acked-by: Nicolas Ferre <45b517be0e5ec6dc3a39715767c1d18e090d39b4@atmel.com>
Signed-off-by: Tomi Valkeinen <e1ca4dbb8be1acaf20734fecd2da10ed1d46a9bb@ti.com>


Use "SetLastError" for errors in "GetProcAddress".

--- MemoryModule.c
+++ MemoryModule.c
@@ -448,12 +448,14 @@
 	PIMAGE_DATA_DIRECTORY directory = GET_HEADER_DICTIONARY((PMEMORYMODULE)module, IMAGE_DIRECTORY_ENTRY_EXPORT);
 	if (directory->Size == 0) {
 		// no export table found
+		SetLastError(ERROR_PROC_NOT_FOUND);
 		return NULL;
 	}

 	exports = (PIMAGE_EXPORT_DIRECTORY) (codeBase + directory->VirtualAddress);
 	if (exports->NumberOfNames == 0 || exports->NumberOfFunctions == 0) {
 		// DLL doesn't export anything
+		SetLastError(ERROR_PROC_NOT_FOUND);
 		return NULL;
 	}

@@ -469,11 +471,13 @@

 	if (idx == -1) {
 		// exported symbol not found
+		SetLastError(ERROR_PROC_NOT_FOUND);
 		return NULL;
 	}

 	if ((DWORD)idx > exports->NumberOfFunctions) {
 		// name <-> ordinal number don't match
+		SetLastError(ERROR_PROC_NOT_FOUND);
 		return NULL;
 	}


ASoC: ad1980: fix codec name

ASoC: ad1980: fix codec name

The codec name should not have a "-codec" suffix since this is not part of
a MFD.  This was incorrectly changed during the multi-component updated.

Signed-off-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@gentoo.org>
Acked-by: Liam Girdwood <a57ef363056e61beffa2efa59c68550d40db03b0@ti.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>


stm32/rfcore: Enable RX IRQ on BLE IPCC channel for better performance.

Before this change there was up to a 128ms delay on incoming payloads from
CPU2 as it was polled by SysTick.  Now the RX IRQ immediately schedules the
PendSV.

--- ports/stm32/rfcore.c
+++ ports/stm32/rfcore.c
@@ -164,6 +164,9 @@
 STATIC tl_list_node_t ipcc_mem_ble_evt_queue; // mem1
 STATIC uint8_t ipcc_membuf_ble_hci_acl_data_buf[272]; // mem2

+// Set by the RX IRQ handler on incoming HCI payload.
+STATIC volatile bool had_ble_irq = false;
+
 /******************************************************************************/
 // Transport layer linked list

@@ -208,6 +211,13 @@

     // Start IPCC peripheral
     __HAL_RCC_IPCC_CLK_ENABLE();
+
+    // Enable receive IRQ on the BLE channel.
+    LL_C1_IPCC_EnableIT_RXO(IPCC);
+    LL_C1_IPCC_DisableReceiveChannel(IPCC, LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+    LL_C1_IPCC_EnableReceiveChannel(IPCC, IPCC_CH_BLE);
+    NVIC_SetPriority(IPCC_C1_RX_IRQn, irq_pri);
+    HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);

     // Device info table will be populated by FUS/WS on CPU2 boot.

@@ -360,10 +370,10 @@
 }

 STATIC void tl_check_msg_ble(volatile tl_list_node_t *head, parse_hci_info_t *parse) {
-    if (LL_C2_IPCC_IsActiveFlag_CHx(IPCC, IPCC_CH_BLE)) {
+    if (had_ble_irq) {
         tl_process_msg(head, IPCC_CH_BLE, parse);

-        LL_C1_IPCC_ClearFlag_CHx(IPCC, IPCC_CH_BLE);
+        had_ble_irq = false;
     }
 }

@@ -404,7 +414,7 @@

 STATIC int tl_ble_wait_resp(void) {
     uint32_t t0 = mp_hal_ticks_ms();
-    while (!LL_C2_IPCC_IsActiveFlag_CHx(IPCC, IPCC_CH_BLE)) {
+    while (!had_ble_irq) {
         if (mp_hal_ticks_ms() - t0 > BLE_ACK_TIMEOUT_MS) {
             printf("tl_ble_wait_resp: timeout\n");
             return -MP_ETIMEDOUT;
@@ -553,4 +563,26 @@
     tl_ble_hci_cmd_resp(HCI_OPCODE(OGF_VENDOR, OCF_SET_TX_POWER), 2, buf);
 }

+// IPCC IRQ Handlers
+void IPCC_C1_TX_IRQHandler(void) {
+    IRQ_ENTER(IPCC_C1_TX_IRQn);
+    IRQ_EXIT(IPCC_C1_TX_IRQn);
+}
+
+void IPCC_C1_RX_IRQHandler(void) {
+    IRQ_ENTER(IPCC_C1_RX_IRQn);
+
+    if (LL_C2_IPCC_IsActiveFlag_CHx(IPCC, IPCC_CH_BLE)) {
+        had_ble_irq = true;
+
+        LL_C1_IPCC_ClearFlag_CHx(IPCC, IPCC_CH_BLE);
+
+        // Schedule PENDSV to process incoming HCI payload.
+        extern void mp_bluetooth_hci_poll_wrapper(uint32_t ticks_ms);
+        mp_bluetooth_hci_poll_wrapper(0);
+    }
+
+    IRQ_EXIT(IPCC_C1_RX_IRQn);
+}
+
 #endif // defined(STM32WB)


proposal to fix #94

proposal to fix #94

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@4560 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/projects/library/seqan/sequence/string_cstyle.h
+++ seqan/projects/library/seqan/sequence/string_cstyle.h
@@ -243,7 +243,8 @@
 	{
 SEQAN_CHECKPOINT
 		me.data_end = new_end;
-		*new_end = TValue(); //??? ist das wirklich sinnvoll fuer typen, die weder char noch wchar_t sind?
+		if (new_end != NULL)
+			*new_end = TValue(); //??? ist das wirklich sinnvoll fuer typen, die weder char noch wchar_t sind?
 	}

 //____________________________________________________________________________
@@ -793,15 +794,43 @@
 ..remarks:Notational sugar.
 */

+template <typename TValue>
+inline TValue *
+toCString(TValue * me)
+{
+SEQAN_CHECKPOINT
+	return me;
+}
+
+template <typename TValue>
+inline TValue const *
+toCString(TValue const * me)
+{
+SEQAN_CHECKPOINT
+	return me;
+}
+
 template <typename T>
 inline typename Value<T>::Type *
 toCString(T & me)
 {
 SEQAN_CHECKPOINT
-	return String<typename Value<T>::Type, CStyle>(me);
-}
-
-
+	typedef typename Value<T>::Type TValue;
+	typename Size<T>::Type len = length(me);
+	if (len >= capacity(me))
+		reserve(me, len + 1);
+	if (end(me) != NULL)
+		*end(me) = TValue();
+	return begin(me);
+}
+
+template <typename T>
+inline typename Value<T>::Type *
+toCString(T const & me)
+{
+SEQAN_CHECKPOINT
+	return toCString(const_cast<T&>(me));
+}
 //////////////////////////////////////////////////////////////////////////////

 } //namespace SEQAN_NAMESPACE_MAIN


ASoC: Use data based init for ak4535 DAPM

Signed-off-by: Lu Guanqun <2dad72ae5fe48bf7bd43ddccece96ab3f4a6c25d@intel.com>
Acked-by: Liam Girdwood <a57ef363056e61beffa2efa59c68550d40db03b0@ti.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- sound/soc/codecs/ak4535.c
+++ sound/soc/codecs/ak4535.c
@@ -230,7 +230,7 @@
 	SND_SOC_DAPM_INPUT("AIN"),
 };

-static const struct snd_soc_dapm_route audio_map[] = {
+static const struct snd_soc_dapm_route ak4535_audio_map[] = {
 	/*stereo mixer */
 	{"Stereo Mixer", "Playback Switch", "DAC"},
 	{"Stereo Mixer", "Mic Sidetone Switch", "Mic"},
@@ -286,17 +286,6 @@
 	{"Input Mixer", "Mic Capture Switch", "Mic"},
 	{"Input Mixer", "Aux Capture Switch", "Aux In"},
 };
-
-static int ak4535_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, ak4535_dapm_widgets,
-				  ARRAY_SIZE(ak4535_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-	return 0;
-}

 static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai,
 	int clk_id, unsigned int freq, int dir)
@@ -457,8 +446,6 @@

 	snd_soc_add_controls(codec, ak4535_snd_controls,
 				ARRAY_SIZE(ak4535_snd_controls));
-	ak4535_add_widgets(codec);
-
 	return 0;
 }

@@ -480,6 +467,10 @@
 	.reg_cache_size = ARRAY_SIZE(ak4535_reg),
 	.reg_word_size = sizeof(u8),
 	.reg_cache_default = ak4535_reg,
+	.dapm_widgets = ak4535_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(ak4535_dapm_widgets),
+	.dapm_routes = ak4535_audio_map,
+	.num_dapm_routes = ARRAY_SIZE(ak4535_audio_map),
 };

 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)


ALSA: make the CS4270 driver a new-style I2C driver

Update the CS4270 ALSA device driver to use the new-style I2C interface.
Starting with the 2.6.27 PowerPC kernel, I2C devices that have entries in the
device trees can no longer be probed by old-style I2C drivers.  The device
tree for Freescale MPC8610 HPCD has included an entry for the CS4270 since
2.6.25, but that entry was previously ignored by the PowerPC I2C subsystem.
Since that's no longer the case, the best solution is to update the CS4270
driver to a new-style interface, rather than try to revert the behavior of
new PowerPC I2C subsystem.

Signed-off-by: Timur Tabi <4ea348ebd818e67772cb0086d44dc1b57ba54129@freescale.com>
Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

--- sound/soc/codecs/cs4270.c
+++ sound/soc/codecs/cs4270.c
@@ -490,34 +490,7 @@

 #endif

-static int cs4270_i2c_probe(struct i2c_adapter *adap, int addr, int kind);
-
-/*
- * Notify the driver that a new I2C bus has been found.
- *
- * This function is called for each I2C bus in the system.  The function
- * then asks the I2C subsystem to probe that bus at the addresses on which
- * our device (the CS4270) could exist.  If a device is found at one of
- * those addresses, then our probe function (cs4270_i2c_probe) is called.
- */
-static int cs4270_i2c_attach(struct i2c_adapter *adapter)
-{
-	return i2c_probe(adapter, &addr_data, cs4270_i2c_probe);
-}
-
-static int cs4270_i2c_detach(struct i2c_client *client)
-{
-	struct snd_soc_codec *codec = i2c_get_clientdata(client);
-
-	i2c_detach_client(client);
-	codec->control_data = NULL;
-
-	kfree(codec->reg_cache);
-	codec->reg_cache = NULL;
-
-	kfree(client);
-	return 0;
-}
+static int cs4270_i2c_probe(struct i2c_client *, const struct i2c_device_id *);

 /* A list of non-DAPM controls that the CS4270 supports */
 static const struct snd_kcontrol_new cs4270_snd_controls[] = {
@@ -525,14 +498,19 @@
 		CS4270_VOLA, CS4270_VOLB, 0, 0xFF, 1)
 };

+static const struct i2c_device_id cs4270_id[] = {
+	{"cs4270", 0},
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, cs4270_id);
+
 static struct i2c_driver cs4270_i2c_driver = {
 	.driver = {
 		.name = "CS4270 I2C",
 		.owner = THIS_MODULE,
 	},
-	.id =             I2C_DRIVERID_CS4270,
-	.attach_adapter = cs4270_i2c_attach,
-	.detach_client =  cs4270_i2c_detach,
+	.id_table = cs4270_id,
+	.probe = cs4270_i2c_probe,
 };

 /*
@@ -561,11 +539,11 @@
  * Note: snd_soc_new_pcms() must be called before this function can be called,
  * because of snd_ctl_add().
  */
-static int cs4270_i2c_probe(struct i2c_adapter *adapter, int addr, int kind)
+static int cs4270_i2c_probe(struct i2c_client *i2c_client,
+	const struct i2c_device_id *id)
 {
 	struct snd_soc_device *socdev = cs4270_socdev;
 	struct snd_soc_codec *codec = socdev->codec;
-	struct i2c_client *i2c_client = NULL;
 	int i;
 	int ret = 0;

@@ -578,12 +556,6 @@

 	/* Note: codec_dai->codec is NULL here */

-	i2c_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-	if (!i2c_client) {
-		printk(KERN_ERR "cs4270: could not allocate I2C client\n");
-		return -ENOMEM;
-	}
-
 	codec->reg_cache = kzalloc(CS4270_NUMREGS, GFP_KERNEL);
 	if (!codec->reg_cache) {
 		printk(KERN_ERR "cs4270: could not allocate register cache\n");
@@ -591,13 +563,6 @@
 		goto error;
 	}

-	i2c_set_clientdata(i2c_client, codec);
-	strcpy(i2c_client->name, "CS4270");
-
-	i2c_client->driver = &cs4270_i2c_driver;
-	i2c_client->adapter = adapter;
-	i2c_client->addr = addr;
-
 	/* Verify that we have a CS4270 */

 	ret = i2c_smbus_read_byte_data(i2c_client, CS4270_CHIPID);
@@ -612,17 +577,9 @@
 		goto error;
 	}

-	printk(KERN_INFO "cs4270: found device at I2C address %X\n", addr);
+	printk(KERN_INFO "cs4270: found device at I2C address %X\n",
+		i2c_client->addr);
 	printk(KERN_INFO "cs4270: hardware revision %X\n", ret & 0xF);
-
-	/* Tell the I2C layer a new client has arrived */
-
-	ret = i2c_attach_client(i2c_client);
-	if (ret) {
-		printk(KERN_ERR "cs4270: could not attach codec, "
-			"I2C address %x, error code %i\n", addr, ret);
-		goto error;
-	}

 	codec->control_data = i2c_client;
 	codec->read = cs4270_read_reg_cache;
@@ -647,6 +604,8 @@
 		if (ret < 0)
 			goto error;
 	}
+
+	i2c_set_clientdata(i2c_client, codec);

 	return 0;


ASoC: Remove redundant set_bias_level() from WM5100 remove()

The framework should bring the device down before it calls the driver.

Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- sound/soc/codecs/wm5100.c
+++ sound/soc/codecs/wm5100.c
@@ -2562,7 +2562,6 @@
 	struct wm5100_priv *wm5100 = snd_soc_codec_get_drvdata(codec);
 	struct i2c_client *i2c = to_i2c_client(codec->dev);

-	wm5100_set_bias_level(codec, SND_SOC_BIAS_OFF);
 	if (wm5100->pdata.hp_pol) {
 		gpio_free(wm5100->pdata.hp_pol);
 	}


Use standard __declspec keyword instead of _declspec. Bug #202826 r=wtc

--- pr/include/prtypes.h
+++ pr/include/prtypes.h
@@ -79,20 +79,15 @@
 ***********************************************************************/
 #if defined(WIN32)

-#if defined(__GNUC__)
-#undef _declspec
-#define _declspec(x) __declspec(x)
-#endif
-
-#define PR_EXPORT(__type) extern _declspec(dllexport) __type
-#define PR_EXPORT_DATA(__type) extern _declspec(dllexport) __type
-#define PR_IMPORT(__type) _declspec(dllimport) __type
-#define PR_IMPORT_DATA(__type) _declspec(dllimport) __type
-
-#define PR_EXTERN(__type) extern _declspec(dllexport) __type
-#define PR_IMPLEMENT(__type) _declspec(dllexport) __type
-#define PR_EXTERN_DATA(__type) extern _declspec(dllexport) __type
-#define PR_IMPLEMENT_DATA(__type) _declspec(dllexport) __type
+#define PR_EXPORT(__type) extern __declspec(dllexport) __type
+#define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
+#define PR_IMPORT(__type) __declspec(dllimport) __type
+#define PR_IMPORT_DATA(__type) __declspec(dllimport) __type
+
+#define PR_EXTERN(__type) extern __declspec(dllexport) __type
+#define PR_IMPLEMENT(__type) __declspec(dllexport) __type
+#define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
+#define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type

 #define PR_CALLBACK
 #define PR_CALLBACK_DECL


ASoC: wm5110: Correct DSP4R Mixer control name

Signed-off-by: Charles Keepax <8e4aa0015eb43ed5ca66aaca3fb498609e1e427c@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org

--- sound/soc/codecs/wm5110.c
+++ sound/soc/codecs/wm5110.c
@@ -190,7 +190,7 @@
 ARIZONA_MIXER_CONTROLS("DSP3L", ARIZONA_DSP3LMIX_INPUT_1_SOURCE),
 ARIZONA_MIXER_CONTROLS("DSP3R", ARIZONA_DSP3RMIX_INPUT_1_SOURCE),
 ARIZONA_MIXER_CONTROLS("DSP4L", ARIZONA_DSP4LMIX_INPUT_1_SOURCE),
-ARIZONA_MIXER_CONTROLS("DSP5R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE),
+ARIZONA_MIXER_CONTROLS("DSP4R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE),

 ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE),
 ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE),


ASoC: Automatically manage WM8350 sloping stopband filter

For best performance the DAC sloping stopband filter should be enabled
below 24kHz and not enabled above that so remove the user visible
control for this and do it autonomously in the driver.

Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- sound/soc/codecs/wm8350.c
+++ sound/soc/codecs/wm8350.c
@@ -406,7 +406,6 @@
 static const char *wm8350_pol[] = { "Normal", "Inv R", "Inv L", "Inv L & R" };
 static const char *wm8350_dacmutem[] = { "Normal", "Soft" };
 static const char *wm8350_dacmutes[] = { "Fast", "Slow" };
-static const char *wm8350_dacfilter[] = { "Normal", "Sloping" };
 static const char *wm8350_adcfilter[] = { "None", "High Pass" };
 static const char *wm8350_adchp[] = { "44.1kHz", "8kHz", "16kHz", "32kHz" };
 static const char *wm8350_lr[] = { "Left", "Right" };
@@ -416,7 +415,6 @@
 	SOC_ENUM_SINGLE(WM8350_DAC_CONTROL, 0, 4, wm8350_pol),
 	SOC_ENUM_SINGLE(WM8350_DAC_MUTE_VOLUME, 14, 2, wm8350_dacmutem),
 	SOC_ENUM_SINGLE(WM8350_DAC_MUTE_VOLUME, 13, 2, wm8350_dacmutes),
-	SOC_ENUM_SINGLE(WM8350_DAC_MUTE_VOLUME, 12, 2, wm8350_dacfilter),
 	SOC_ENUM_SINGLE(WM8350_ADC_CONTROL, 15, 2, wm8350_adcfilter),
 	SOC_ENUM_SINGLE(WM8350_ADC_CONTROL, 8, 4, wm8350_adchp),
 	SOC_ENUM_SINGLE(WM8350_ADC_CONTROL, 0, 4, wm8350_pol),
@@ -444,10 +442,9 @@
 				0, 255, 0, dac_pcm_tlv),
 	SOC_ENUM("Playback PCM Mute Function", wm8350_enum[2]),
 	SOC_ENUM("Playback PCM Mute Speed", wm8350_enum[3]),
-	SOC_ENUM("Playback PCM Filter", wm8350_enum[4]),
-	SOC_ENUM("Capture PCM Filter", wm8350_enum[5]),
-	SOC_ENUM("Capture PCM HP Filter", wm8350_enum[6]),
-	SOC_ENUM("Capture ADC Inversion", wm8350_enum[7]),
+	SOC_ENUM("Capture PCM Filter", wm8350_enum[4]),
+	SOC_ENUM("Capture PCM HP Filter", wm8350_enum[5]),
+	SOC_ENUM("Capture ADC Inversion", wm8350_enum[6]),
 	SOC_WM8350_DOUBLE_R_TLV("Capture PCM Volume",
 				WM8350_ADC_DIGITAL_VOLUME_L,
 				WM8350_ADC_DIGITAL_VOLUME_R,
@@ -993,6 +990,7 @@
 				struct snd_soc_dai *codec_dai)
 {
 	struct snd_soc_codec *codec = codec_dai->codec;
+	struct wm8350 *wm8350 = codec->control_data;
 	u16 iface = wm8350_codec_read(codec, WM8350_AI_FORMATING) &
 	    ~WM8350_AIF_WL_MASK;

@@ -1012,6 +1010,19 @@
 	}

 	wm8350_codec_write(codec, WM8350_AI_FORMATING, iface);
+
+	/* The sloping stopband filter is recommended for use with
+	 * lower sample rates to improve performance.
+	 */
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+		if (params_rate(params) < 24000)
+			wm8350_set_bits(wm8350, WM8350_DAC_MUTE_VOLUME,
+					WM8350_DAC_SB_FILT);
+		else
+			wm8350_clear_bits(wm8350, WM8350_DAC_MUTE_VOLUME,
+					  WM8350_DAC_SB_FILT);
+	}
+
 	return 0;
 }


ASoC: Shuffle WM8731 SPI and I2C device registration

This is a pure code motion patch intended to improve reviewability of a
following patch moving WM8731 to use more standard device registration.

Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- sound/soc/codecs/wm8731.c
+++ sound/soc/codecs/wm8731.c
@@ -35,6 +35,11 @@
 struct wm8731_priv {
 	unsigned int sysclk;
 };
+
+#ifdef CONFIG_SPI_MASTER
+static int wm8731_spi_write(struct spi_device *spi, const char *data, int len);
+static struct spi_driver wm8731_spi_driver;
+#endif

 /*
  * wm8731 register cache
@@ -544,54 +549,9 @@

 static struct snd_soc_device *wm8731_socdev;

+
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-
-/*
- * WM8731 2 wire address is determined by GPIO5
- * state during powerup.
- *    low  = 0x1a
- *    high = 0x1b
- */
-
-static int wm8731_i2c_probe(struct i2c_client *i2c,
-			    const struct i2c_device_id *id)
-{
-	struct snd_soc_device *socdev = wm8731_socdev;
-	struct snd_soc_codec *codec = socdev->card->codec;
-	int ret;
-
-	i2c_set_clientdata(i2c, codec);
-	codec->control_data = i2c;
-
-	ret = wm8731_init(socdev);
-	if (ret < 0)
-		pr_err("failed to initialise WM8731\n");
-
-	return ret;
-}
-
-static int wm8731_i2c_remove(struct i2c_client *client)
-{
-	struct snd_soc_codec *codec = i2c_get_clientdata(client);
-	kfree(codec->reg_cache);
-	return 0;
-}
-
-static const struct i2c_device_id wm8731_i2c_id[] = {
-	{ "wm8731", 0 },
-	{ }
-};
-MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id);
-
-static struct i2c_driver wm8731_i2c_driver = {
-	.driver = {
-		.name = "WM8731 I2C Codec",
-		.owner = THIS_MODULE,
-	},
-	.probe =    wm8731_i2c_probe,
-	.remove =   wm8731_i2c_remove,
-	.id_table = wm8731_i2c_id,
-};
+static struct i2c_driver wm8731_i2c_driver;

 static int wm8731_add_i2c_device(struct platform_device *pdev,
 				 const struct wm8731_setup_data *setup)
@@ -633,62 +593,6 @@
 	return -ENODEV;
 }
 #endif
-
-#if defined(CONFIG_SPI_MASTER)
-static int __devinit wm8731_spi_probe(struct spi_device *spi)
-{
-	struct snd_soc_device *socdev = wm8731_socdev;
-	struct snd_soc_codec *codec = socdev->card->codec;
-	int ret;
-
-	codec->control_data = spi;
-
-	ret = wm8731_init(socdev);
-	if (ret < 0)
-		dev_err(&spi->dev, "failed to initialise WM8731\n");
-
-	return ret;
-}
-
-static int __devexit wm8731_spi_remove(struct spi_device *spi)
-{
-	return 0;
-}
-
-static struct spi_driver wm8731_spi_driver = {
-	.driver = {
-		.name	= "wm8731",
-		.bus	= &spi_bus_type,
-		.owner	= THIS_MODULE,
-	},
-	.probe		= wm8731_spi_probe,
-	.remove		= __devexit_p(wm8731_spi_remove),
-};
-
-static int wm8731_spi_write(struct spi_device *spi, const char *data, int len)
-{
-	struct spi_transfer t;
-	struct spi_message m;
-	u8 msg[2];
-
-	if (len <= 0)
-		return 0;
-
-	msg[0] = data[0];
-	msg[1] = data[1];
-
-	spi_message_init(&m);
-	memset(&t, 0, (sizeof t));
-
-	t.tx_buf = &msg[0];
-	t.len = len;
-
-	spi_message_add_tail(&t, &m);
-	spi_sync(spi, &m);
-
-	return len;
-}
-#endif /* CONFIG_SPI_MASTER */

 static int wm8731_probe(struct platform_device *pdev)
 {
@@ -772,6 +676,111 @@
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8731);

+#if defined(CONFIG_SPI_MASTER)
+static int __devinit wm8731_spi_probe(struct spi_device *spi)
+{
+	struct snd_soc_device *socdev = wm8731_socdev;
+	struct snd_soc_codec *codec = socdev->card->codec;
+	int ret;
+
+	codec->control_data = spi;
+
+	ret = wm8731_init(socdev);
+	if (ret < 0)
+		dev_err(&spi->dev, "failed to initialise WM8731\n");
+
+	return ret;
+}
+
+static int __devexit wm8731_spi_remove(struct spi_device *spi)
+{
+	return 0;
+}
+
+static struct spi_driver wm8731_spi_driver = {
+	.driver = {
+		.name	= "wm8731",
+		.bus	= &spi_bus_type,
+		.owner	= THIS_MODULE,
+	},
+	.probe		= wm8731_spi_probe,
+	.remove		= __devexit_p(wm8731_spi_remove),
+};
+
+static int wm8731_spi_write(struct spi_device *spi, const char *data, int len)
+{
+	struct spi_transfer t;
+	struct spi_message m;
+	u8 msg[2];
+
+	if (len <= 0)
+		return 0;
+
+	msg[0] = data[0];
+	msg[1] = data[1];
+
+	spi_message_init(&m);
+	memset(&t, 0, (sizeof t));
+
+	t.tx_buf = &msg[0];
+	t.len = len;
+
+	spi_message_add_tail(&t, &m);
+	spi_sync(spi, &m);
+
+	return len;
+}
+#endif /* CONFIG_SPI_MASTER */
+
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+/*
+ * WM8731 2 wire address is determined by GPIO5
+ * state during powerup.
+ *    low  = 0x1a
+ *    high = 0x1b
+ */
+
+static int wm8731_i2c_probe(struct i2c_client *i2c,
+			    const struct i2c_device_id *id)
+{
+	struct snd_soc_device *socdev = wm8731_socdev;
+	struct snd_soc_codec *codec = socdev->card->codec;
+	int ret;
+
+	i2c_set_clientdata(i2c, codec);
+	codec->control_data = i2c;
+
+	ret = wm8731_init(socdev);
+	if (ret < 0)
+		pr_err("failed to initialise WM8731\n");
+
+	return ret;
+}
+
+static int wm8731_i2c_remove(struct i2c_client *client)
+{
+	struct snd_soc_codec *codec = i2c_get_clientdata(client);
+	kfree(codec->reg_cache);
+	return 0;
+}
+
+static const struct i2c_device_id wm8731_i2c_id[] = {
+	{ "wm8731", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id);
+
+static struct i2c_driver wm8731_i2c_driver = {
+	.driver = {
+		.name = "WM8731 I2C Codec",
+		.owner = THIS_MODULE,
+	},
+	.probe =    wm8731_i2c_probe,
+	.remove =   wm8731_i2c_remove,
+	.id_table = wm8731_i2c_id,
+};
+#endif
+
 static int __init wm8731_modinit(void)
 {
 	return snd_soc_register_dai(&wm8731_dai);


ASoC: wm8804: Remove superfluous const

ASoC: wm8804: Remove superfluous const

As SOC_ENUM_SINGLE_DECL() itself contains const modifier now, we can
reduce const from its users.

Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>
Acked-by: Liam Girdwood <1c687ae09fa7f11acd34075a0ae6b39df2be9341@linux.intel.com>
Acked-by: Charles Keepax <8e4aa0015eb43ed5ca66aaca3fb498609e1e427c@opensource.wolfsonmicro.com>
Acked-by: Lars-Peter Clausen <3318dc5ce3e4fb7c28a0b841b6801c884e1d0896@metafoo.de>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>


ASoC: Remove volatility from WM8900 POWER1 register

Not all bits can be read back from POWER1 so avoid corruption when using
a read/modify/write cycle by marking it non-volatile - the only thing we
read back from it is the chip revision which has diagnostic value only.
We can re-add later but that's a more invasive change than is suitable
for a bugfix.

Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <a57ef363056e61beffa2efa59c68550d40db03b0@slimlogic.co.uk>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org

--- sound/soc/codecs/wm8900.c
+++ sound/soc/codecs/wm8900.c
@@ -186,7 +186,6 @@
 {
 	switch (reg) {
 	case WM8900_REG_ID:
-	case WM8900_REG_POWER1:
 		return 1;
 	default:
 		return 0;
@@ -1200,11 +1199,6 @@
 		return -ENODEV;
 	}

-	/* Read back from the chip */
-	reg = snd_soc_read(codec, WM8900_REG_POWER1);
-	reg = (reg >> 12) & 0xf;
-	dev_info(codec->dev, "WM8900 revision %d\n", reg);
-
 	wm8900_reset(codec);

 	/* Turn the chip on */


ASoC: wm8904: Use SOC_ENUM_SINGLE_DECL()

Just replace with the helper macro.  No functional change at all.

Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>
Acked-by: Liam Girdwood <1c687ae09fa7f11acd34075a0ae6b39df2be9341@linux.intel.com>
Acked-by: Charles Keepax <8e4aa0015eb43ed5ca66aaca3fb498609e1e427c@opensource.wolfsonmicro.com>
Acked-by: Lars-Peter Clausen <3318dc5ce3e4fb7c28a0b841b6801c884e1d0896@metafoo.de>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>

--- sound/soc/codecs/wm8904.c
+++ sound/soc/codecs/wm8904.c
@@ -552,18 +552,20 @@
 	"Single-Ended", "Differential Line", "Differential Mic"
 };

-static const struct soc_enum lin_mode =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_LEFT_INPUT_1, 0, 3, input_mode_text);
-
-static const struct soc_enum rin_mode =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_RIGHT_INPUT_1, 0, 3, input_mode_text);
+static SOC_ENUM_SINGLE_DECL(lin_mode,
+			    WM8904_ANALOGUE_LEFT_INPUT_1, 0,
+			    input_mode_text);
+
+static SOC_ENUM_SINGLE_DECL(rin_mode,
+			    WM8904_ANALOGUE_RIGHT_INPUT_1, 0,
+			    input_mode_text);

 static const char *hpf_mode_text[] = {
 	"Hi-fi", "Voice 1", "Voice 2", "Voice 3"
 };

-static const struct soc_enum hpf_mode =
-	SOC_ENUM_SINGLE(WM8904_ADC_DIGITAL_0, 5, 4, hpf_mode_text);
+static SOC_ENUM_SINGLE_DECL(hpf_mode, WM8904_ADC_DIGITAL_0, 5,
+			    hpf_mode_text);

 static int wm8904_adc_osr_put(struct snd_kcontrol *kcontrol,
 			      struct snd_ctl_elem_value *ucontrol)
@@ -611,8 +613,7 @@
 	"ADC", "DAC"
 };

-static const struct soc_enum drc_path =
-	SOC_ENUM_SINGLE(WM8904_DRC_0, 14, 2, drc_path_text);
+static SOC_ENUM_SINGLE_DECL(drc_path, WM8904_DRC_0, 14, drc_path_text);

 static const struct snd_kcontrol_new wm8904_dac_snd_controls[] = {
 SOC_SINGLE_TLV("Digital Playback Boost Volume",
@@ -858,14 +859,14 @@
 	"IN1L", "IN2L", "IN3L"
 };

-static const struct soc_enum lin_enum =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_LEFT_INPUT_1, 2, 3, lin_text);
+static SOC_ENUM_SINGLE_DECL(lin_enum, WM8904_ANALOGUE_LEFT_INPUT_1, 2,
+			    lin_text);

 static const struct snd_kcontrol_new lin_mux =
 	SOC_DAPM_ENUM("Left Capture Mux", lin_enum);

-static const struct soc_enum lin_inv_enum =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_LEFT_INPUT_1, 4, 3, lin_text);
+static SOC_ENUM_SINGLE_DECL(lin_inv_enum, WM8904_ANALOGUE_LEFT_INPUT_1, 4,
+			    lin_text);

 static const struct snd_kcontrol_new lin_inv_mux =
 	SOC_DAPM_ENUM("Left Capture Inveting Mux", lin_inv_enum);
@@ -874,14 +875,14 @@
 	"IN1R", "IN2R", "IN3R"
 };

-static const struct soc_enum rin_enum =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_RIGHT_INPUT_1, 2, 3, rin_text);
+static SOC_ENUM_SINGLE_DECL(rin_enum, WM8904_ANALOGUE_RIGHT_INPUT_1, 2,
+			    rin_text);

 static const struct snd_kcontrol_new rin_mux =
 	SOC_DAPM_ENUM("Right Capture Mux", rin_enum);

-static const struct soc_enum rin_inv_enum =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_RIGHT_INPUT_1, 4, 3, rin_text);
+static SOC_ENUM_SINGLE_DECL(rin_inv_enum, WM8904_ANALOGUE_RIGHT_INPUT_1, 4,
+			    rin_text);

 static const struct snd_kcontrol_new rin_inv_mux =
 	SOC_DAPM_ENUM("Right Capture Inveting Mux", rin_inv_enum);
@@ -890,26 +891,26 @@
 	"Left", "Right"
 };

-static const struct soc_enum aifoutl_enum =
-	SOC_ENUM_SINGLE(WM8904_AUDIO_INTERFACE_0, 7, 2, aif_text);
+static SOC_ENUM_SINGLE_DECL(aifoutl_enum, WM8904_AUDIO_INTERFACE_0, 7,
+			    aif_text);

 static const struct snd_kcontrol_new aifoutl_mux =
 	SOC_DAPM_ENUM("AIFOUTL Mux", aifoutl_enum);

-static const struct soc_enum aifoutr_enum =
-	SOC_ENUM_SINGLE(WM8904_AUDIO_INTERFACE_0, 6, 2, aif_text);
+static SOC_ENUM_SINGLE_DECL(aifoutr_enum, WM8904_AUDIO_INTERFACE_0, 6,
+			    aif_text);

 static const struct snd_kcontrol_new aifoutr_mux =
 	SOC_DAPM_ENUM("AIFOUTR Mux", aifoutr_enum);

-static const struct soc_enum aifinl_enum =
-	SOC_ENUM_SINGLE(WM8904_AUDIO_INTERFACE_0, 5, 2, aif_text);
+static SOC_ENUM_SINGLE_DECL(aifinl_enum, WM8904_AUDIO_INTERFACE_0, 5,
+			    aif_text);

 static const struct snd_kcontrol_new aifinl_mux =
 	SOC_DAPM_ENUM("AIFINL Mux", aifinl_enum);

-static const struct soc_enum aifinr_enum =
-	SOC_ENUM_SINGLE(WM8904_AUDIO_INTERFACE_0, 4, 2, aif_text);
+static SOC_ENUM_SINGLE_DECL(aifinr_enum, WM8904_AUDIO_INTERFACE_0, 4,
+			    aif_text);

 static const struct snd_kcontrol_new aifinr_mux =
 	SOC_DAPM_ENUM("AIFINR Mux", aifinr_enum);
@@ -991,26 +992,26 @@
 	"DAC", "Bypass"
 };

-static const struct soc_enum hpl_enum =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_OUT12_ZC, 3, 2, out_mux_text);
+static SOC_ENUM_SINGLE_DECL(hpl_enum, WM8904_ANALOGUE_OUT12_ZC, 3,
+			    out_mux_text);

 static const struct snd_kcontrol_new hpl_mux =
 	SOC_DAPM_ENUM("HPL Mux", hpl_enum);

-static const struct soc_enum hpr_enum =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_OUT12_ZC, 2, 2, out_mux_text);
+static SOC_ENUM_SINGLE_DECL(hpr_enum, WM8904_ANALOGUE_OUT12_ZC, 2,
+			    out_mux_text);

 static const struct snd_kcontrol_new hpr_mux =
 	SOC_DAPM_ENUM("HPR Mux", hpr_enum);

-static const struct soc_enum linel_enum =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_OUT12_ZC, 1, 2, out_mux_text);
+static SOC_ENUM_SINGLE_DECL(linel_enum, WM8904_ANALOGUE_OUT12_ZC, 1,
+			    out_mux_text);

 static const struct snd_kcontrol_new linel_mux =
 	SOC_DAPM_ENUM("LINEL Mux", linel_enum);

-static const struct soc_enum liner_enum =
-	SOC_ENUM_SINGLE(WM8904_ANALOGUE_OUT12_ZC, 0, 2, out_mux_text);
+static SOC_ENUM_SINGLE_DECL(liner_enum, WM8904_ANALOGUE_OUT12_ZC, 0,
+			    out_mux_text);

 static const struct snd_kcontrol_new liner_mux =
 	SOC_DAPM_ENUM("LINER Mux", liner_enum);
@@ -1019,14 +1020,14 @@
 	"None", "Left", "Right"
 };

-static const struct soc_enum dacl_sidetone_enum =
-	SOC_ENUM_SINGLE(WM8904_DAC_DIGITAL_0, 2, 3, sidetone_text);
+static SOC_ENUM_SINGLE_DECL(dacl_sidetone_enum, WM8904_DAC_DIGITAL_0, 2,
+			    sidetone_text);

 static const struct snd_kcontrol_new dacl_sidetone_mux =
 	SOC_DAPM_ENUM("Left Sidetone Mux", dacl_sidetone_enum);

-static const struct soc_enum dacr_sidetone_enum =
-	SOC_ENUM_SINGLE(WM8904_DAC_DIGITAL_0, 0, 3, sidetone_text);
+static SOC_ENUM_SINGLE_DECL(dacr_sidetone_enum, WM8904_DAC_DIGITAL_0, 0,
+			    sidetone_text);

 static const struct snd_kcontrol_new dacr_sidetone_mux =
 	SOC_DAPM_ENUM("Right Sidetone Mux", dacr_sidetone_enum);


ASoC: wm8960: Move register initialisation to I2C driver probe()

We must ensure that the clocking configuration is valid as rapidly as possible.
And do software reset before the others registers updates, or the registers
will be reset to the default state.

Signed-off-by: Zidan Wang <48827f0427c38e72e9beec206f03938a11baced9@freescale.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@kernel.org>


ASoC: wm8962: Fix word length configuration

Signed-off-by: Susan Gao <0e2d04d3fb1a7848007147046ee85d146bb3acda@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org

--- sound/soc/codecs/wm8962.c
+++ sound/soc/codecs/wm8962.c
@@ -3159,13 +3159,13 @@
 	case SNDRV_PCM_FORMAT_S16_LE:
 		break;
 	case SNDRV_PCM_FORMAT_S20_3LE:
-		aif0 |= 0x40;
+		aif0 |= 0x4;
 		break;
 	case SNDRV_PCM_FORMAT_S24_LE:
-		aif0 |= 0x80;
+		aif0 |= 0x8;
 		break;
 	case SNDRV_PCM_FORMAT_S32_LE:
-		aif0 |= 0xc0;
+		aif0 |= 0xc;
 		break;
 	default:
 		return -EINVAL;


ASoC: wm8985: Convert to params_width()

ASoC: wm8985: Convert to params_width()

The CODEC doesn't care how data is laid out in memory.

Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>
Acked-by: Charles Keepax <8e4aa0015eb43ed5ca66aaca3fb498609e1e427c@opensource.wolfsonmicro.com>


ASoC: wm8995: Use IS_ENABLED() macro

ASoC: wm8995: Use IS_ENABLED() macro

Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <679188261afeb60eb822cd934fd7b46a48ddd743@freescale.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>


ASoC: wm8996: ensure lower bounds of 1 for timeout

wait_for_completion_timeout can be called with timeout == 0 due to
msecs_to_jiffies(2) == 1 for HZ < 1000 and usecs_to_jiffies(300) == 1
for all reasonable values of HZ, thus the following timeout /= 2; sets
timeout to 0. This patch simply adds a lower-bounds of 1.

Signed-off-by: Nicholas Mc Guire <1f1947151fff46847c7ab253c8b8ee2fc7e63b14@osadl.org>
Acked-by: Charles Keepax <8e4aa0015eb43ed5ca66aaca3fb498609e1e427c@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@kernel.org>


ASoC: bells: Correct typo in sub speaker DAI name for WM5110

Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- sound/soc/samsung/bells.c
+++ sound/soc/samsung/bells.c
@@ -212,7 +212,7 @@
 	{
 		.name = "Sub",
 		.stream_name = "Sub",
-		.cpu_dai_name = "wm5102-aif3",
+		.cpu_dai_name = "wm5110-aif3",
 		.codec_dai_name = "wm9081-hifi",
 		.codec_name = "wm9081.1-006c",
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF


ALSA: 6fire: Use snd_ctl_enum_info()

ALSA: 6fire: Use snd_ctl_enum_info()

... and reduce the open codes.  Also add missing const to text arrays.

Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>


removed commented code

removed commented code

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@7976 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- visualization/include/pcl/visualization/pcl_visualizer.h
+++ visualization/include/pcl/visualization/pcl_visualizer.h
@@ -564,11 +564,6 @@
                           const PointCloudColorHandler<PointT> &color_handler,
                           const std::string &id = "cloud");

-//        bool
-//        updatePointCloud (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr &cloud,
-//                          const PointCloudColorHandlerRGBField<pcl::PointXYZRGB> &color_handler,
-//                          const std::string &id = "cloud");
-
         /** \brief Add a Point Cloud (templated) to screen.
           * \param[in] cloud the input point cloud dataset
           * \param[in] geometry_handler use a geometry handler object to extract the XYZ data


Fix mouse click glitches with forms enabled pdfapp.

When clicking on a form field, especially with breakpoints in play,
it is possible for the up/down click logic to get confused.

Improve it by using a flag to avoid processing a down click twice.

--- apps/pdfapp.c
+++ apps/pdfapp.c
@@ -999,6 +999,7 @@
 	fz_link *link;
 	fz_matrix ctm;
 	fz_point p;
+	int processed = 0;

 	p.x = x - app->panx + rect.x0;
 	p.y = y - app->pany + rect.y0;
@@ -1037,7 +1038,7 @@
 			app->nowaitcursor = 1;
 			pdfapp_showpage(app, 1, 1, 1);
 			app->nowaitcursor = 0;
-			return;
+			processed = 1;
 		}
 	}

@@ -1051,7 +1052,7 @@
 	if (link)
 	{
 		wincursor(app, HAND);
-		if (btn == 1 && state == 1)
+		if (btn == 1 && state == 1 && !processed)
 		{
 			if (link->dest.kind == FZ_LINK_URI)
 				pdfapp_gotouri(app, link->dest.ld.uri.uri);
@@ -1065,7 +1066,7 @@
 		wincursor(app, ARROW);
 	}

-	if (state == 1)
+	if (state == 1 && !processed)
 	{
 		if (btn == 1 && !app->iscopying)
 		{
@@ -1126,8 +1127,7 @@
 			if (app->selr.x0 < app->selr.x1 && app->selr.y0 < app->selr.y1)
 				windocopy(app);
 		}
-		if (app->ispanning)
-			app->ispanning = 0;
+		app->ispanning = 0;
 	}

 	else if (app->ispanning)


Add list LinkDef file for JPetTreeHeader

Former-commit-id: d29d9e972116a48db9d1c60dc16d6f69a010a693

error: pathspec 'JPetTreeHeader/JPetTreeHeaderLinkDef.h' did not match any file(s) known to git

--- JPetTreeHeader/JPetTreeHeaderLinkDef.h
+++ JPetTreeHeader/JPetTreeHeaderLinkDef.h
@@ -0,0 +1,8 @@
+#ifdef __CINT__
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ nestedclasses;
+#pragma link C++ struct JPetTreeHeader::ProcessingStageInfo+;
+#pragma link C++ class JPetTreeHeader;
+#endif


[Graph]: expose more info in page vertex.

--- apps/vertex.h
+++ apps/vertex.h
@@ -375,7 +375,9 @@
 class TS_page_vertex: public page_vertex
 {
 public:
+	virtual int get_num_edges() const = 0;
 	virtual int get_num_edges(int timestamp, edge_type type) const = 0;
+	virtual int get_num_timestamps() const = 0;
 	virtual page_byte_array::const_iterator<vertex_id_t> get_neigh_begin(
 			int timestamp, edge_type type) const = 0;
 	virtual page_byte_array::const_iterator<vertex_id_t> get_neigh_end(
@@ -738,6 +740,14 @@

 	virtual vertex_id_t get_id() const {
 		return id;
+	}
+
+	virtual int get_num_edges() const {
+		return num_edges;
+	}
+
+	virtual int get_num_timestamps() const {
+		return num_timestamps;
 	}

 	virtual int get_num_edges(int timestamp, edge_type type) const {


routine to mask poorly called regions

routine to mask poorly called regions

--- phase.c
+++ phase.c
@@ -8,8 +8,10 @@
 #define MAX_VARS 256
 #define FLIP_PENALTY 2
 #define FLIP_THRES 4
+#define MASK_THRES 3

 #define PHASE_FIX_CHIMERA 0x1
+#define PHASE_MASK_POOR   0x2

 typedef struct {
 	int flag, k, min_mapQ, min_varQ; // initialized in the main function
@@ -222,6 +224,35 @@
 	return pcnt;
 }

+static uint64_t *maskreg(int vpos, const uint64_t *pcnt, int *_n)
+{
+	int i, max = 0, score = 0, max_i = -1, m = 0, n = 0, beg = 0;
+	uint64_t *list = 0;
+	for (i = 0; i < vpos; ++i) {
+		uint64_t x = pcnt[i];
+		int c = (x>>16&0xffff) + (x>>48&0xffff);
+		int pre = score;
+		//printf("%d\t%d\t%d\t%d\t%d\n", i, c, score, max, beg);
+		score += c - 1;
+		if ((x>>16&0xffff) > (x&0xffff)) score += (x>>16&0xffff) - (x&0xffff); // further penalty when there are more out-of-phase alleles
+		if ((x>>48&0xffff) > (x>>32&0xffff)) score += (x>>48&0xffff) - (x>>32&0xffff);
+		if (score < 0) score = 0;
+		if (pre == 0 && score > 0) beg = i; // change from zero to non-zero
+		if ((i == vpos - 1 || score == 0) && max >= MASK_THRES) {
+			if (n == m) {
+				m = m? m<<1 : 4;
+				list = realloc(list, m * 8);
+			}
+			list[n++] = (uint64_t)beg<<32 | max_i;
+			i = max_i; // reset i to max_i
+			score = 0;
+		} else if (score > max) max = score, max_i = i;
+		if (score == 0) max = 0;
+	}
+	*_n = n;
+	return list;
+}
+
 static int filter(int vpos, const uint64_t *pcnt, const int8_t *path, uint64_t *cns, nseq_t *hash)
 {
 	int8_t *flt;
@@ -269,12 +300,19 @@
 	if (vpos == 0) return 0;
 	printf("BL\t%s\t%d\t%d\n", chr, (int)(cns[0]>>32), (int)(cns[vpos-1]>>32));
 	{ // phase
-		int **cnt;
+		int **cnt, n_masked;
+		uint64_t *mask = 0;
 		cnt = count_all(o->k, vpos, hash);
 		path = dynaprog(o->k, vpos, cnt);
 		for (i = 0; i < vpos; ++i) free(cnt[i]);
 		free(cnt);
-		pcnt = fragphase(vpos, path, hash, o->flag & PHASE_FIX_CHIMERA);
+		pcnt = fragphase(vpos, path, hash, 0);
+		mask = maskreg(vpos, pcnt, &n_masked);
+		for (i = 0; i < n_masked; ++i)
+			printf("MK\t%d\t%d\n", (int)(mask[i]>>32) + vpos_shift + 1, (int)mask[i] + vpos_shift + 1);
+		//free(pcnt);
+		//pcnt = fragphase(vpos, path, hash, o->flag & PHASE_FIX_CHIMERA);
+		free(mask);
 		if (0 && (vpos = filter(vpos, pcnt, path, cns, hash)) < ori_vpos) {
 			free(path); free(pcnt);
 			cnt = count_all(o->k, vpos, hash);
@@ -337,14 +375,15 @@
 	uint64_t *cns = 0;
 	phaseopt_t conf;

-	conf.flag = PHASE_FIX_CHIMERA;
+	conf.flag = PHASE_FIX_CHIMERA | PHASE_MASK_POOR;
 	conf.min_varQ = 40; conf.min_mapQ = 10; conf.k = 7;
-	while ((c = getopt(argc, argv, "Fq:Q:k:")) >= 0) {
+	while ((c = getopt(argc, argv, "FMq:Q:k:")) >= 0) {
 		switch (c) {
 			case 'q': conf.min_varQ = atoi(optarg); break;
 			case 'Q': conf.min_mapQ = atoi(optarg); break;
 			case 'k': conf.k = atoi(optarg); break;
 			case 'F': conf.flag &= ~PHASE_FIX_CHIMERA; break;
+			case 'M': conf.flag &= ~PHASE_MASK_POOR; break;
 		}
 	}
 	if (argc == optind) {


fix init function return

fix init function return

--- judge_client/bindings/Python/_judger.c
+++ judge_client/bindings/Python/_judger.c
@@ -163,4 +163,5 @@
     PyModule_AddIntConstant(module, "ERROR_SETUID_FAILED", SETUID_FAILED);
     PyModule_AddIntConstant(module, "ERROR_EXECVE_FAILED", EXECVE_FAILED);
     PyModule_AddIntConstant(module, "ERROR_SPJ_ERROR", SPJ_ERROR);
+    return module;
 }


Fix stack overflow when debug enabled in MbedTLS wrapper

Fixes #63

--- platform/linux/mbedtls/network_mbedtls_wrapper.c
+++ platform/linux/mbedtls/network_mbedtls_wrapper.c
@@ -27,8 +27,16 @@
 #include "network_interface.h"
 #include "network_platform.h"

+
 /* This is the value used for ssl read timeout */
 #define IOT_SSL_READ_TIMEOUT 10
+
+/* This defines the value of the debug buffer that gets allocated.
+ * The value can be altered based on memory constraints
+ */
+#ifdef ENABLE_IOT_DEBUG
+#define MBEDTLS_DEBUG_BUFFER_SIZE 2048
+#endif

 /*
  * This is a function to do further verification if needed on the cert received
@@ -93,8 +101,9 @@
 	TLSDataParams *tlsDataParams = NULL;
 	char portBuffer[6];
 	char vrfy_buf[512];
-#ifdef IOT_DEBUG
-	unsigned char buf[MBEDTLS_SSL_MAX_CONTENT_LEN + 1];
+
+#ifdef ENABLE_IOT_DEBUG
+	unsigned char buf[MBEDTLS_DEBUG_BUFFER_SIZE];
 #endif

 	if(NULL == pNetwork) {
@@ -248,7 +257,7 @@
 		ret = SUCCESS;
 	}

-#ifdef IOT_DEBUG
+#ifdef ENABLE_IOT_DEBUG
 	if (mbedtls_ssl_get_peer_cert(&(tlsDataParams->ssl)) != NULL) {
 		IOT_DEBUG("  . Peer certificate information    ...\n");
 		mbedtls_x509_crt_info((char *) buf, sizeof(buf) - 1, "      ", mbedtls_ssl_get_peer_cert(&(tlsDataParams->ssl)));


occured -> occurred

occured -> occurred

--- Library/Sources/SCAssetExportSession.h
+++ Library/Sources/SCAssetExportSession.h
@@ -59,7 +59,7 @@
 @property (readonly, nonatomic) SCAudioConfiguration *__nonnull audioConfiguration;

 /**
- If an error occured during the export, this will contain that error
+ If an error occurred during the export, this will contain that error
  */
 @property (readonly, nonatomic) NSError *__nullable error;


Now printDot is passed to the assembleLine function, and we use that to print the desymbolication and arithmetic resolution stage results

git-svn-id: 78cc2a864430e58e1a02096a179e3ea8e4996a78@883 96dfbd92-d197-e211-9ca9-00110a534b34

--- as6502/main.c
+++ as6502/main.c
@@ -40,14 +40,16 @@
 #define MAX_LINE_LEN		80
 #define MAX_FILENAME_LEN	255

-static uint16_t assembleLine(ld6502_object_blob *blob, as6502_token *head, as6502_symbol_table *table, int printProcess, uint16_t offset) {
+static uint16_t assembleLine(ld6502_object_blob *blob, as6502_token *head, as6502_symbol_table *table, int printProcess, int printDot, uint16_t offset) {
 	uint8_t opcode, low, high;
 	int addrLen;
 	v6502_address_mode mode;

 	as6502_token *desymedHead = as6502_desymbolicateExpression(table, head, 0x600, offset, YES);
 	desymedHead = as6502_resolveArithmeticInExpression(desymedHead);
+	if (printDot) as6502_printDotRankForList(stdout, desymedHead);
 	as6502_instructionForExpression(&opcode, &low, &high, &mode, desymedHead);
+	if (printDot) as6502_printDotRankForList(stdout, desymedHead);
 	as6502_tokenListDestroy(desymedHead);

 	addrLen = as6502_instructionLengthForAddressMode(mode);
@@ -222,7 +224,7 @@
 		}
 		// Normal instructions
 		else {
-			address += assembleLine(&obj->blobs[currentBlob], head, obj->table, printProcess, address);
+			address += assembleLine(&obj->blobs[currentBlob], head, obj->table, printProcess, printDot, address);
 		}

 		as6502_tokenListDestroy(head);


Added handleCon function to handle connector parsing and internal representation

--- src/functions.h
+++ src/functions.h
@@ -1,6 +1,8 @@
 #include <cstdlib>
 #include <string>
 #include <vector>
+#include <cctype>
+

 #define GETWORD   0
@@ -57,4 +59,112 @@

+void handleCon(vector<Command>& cmds, vector<char*>& cmd, const string& line,
+       int& mode, unsigned& i, bool& se)
+{
+  switch(line[i])
+  {
+    case '&':
+      // make sure we don't access past what we're supposed to
+      if (i + 1 < line.size() && line[i+1] == '&')
+      {
+        i++;
+        // check if there's more to parse after this command
+        if (i + 1 < line.size())
+        {
+          // there is
+          if (isCon(line[i + 1]))
+          {
+            // unfortunately, the next thing is a connector. This is a syntax error.
+            se = true;
+            break;
+          }
+          else if (isspace(line[i + 1])) // it's a space. go into TRIMSPACE mode
+          {
+            mode = TRIMSPACE;
+          }
+          else // it's neither a connector nor a space: must be a word
+          {
+            mode = GETWORD;
+          }
+        }
+        cmd.connector = AND; // the command has an "and" connector
+        cmds.push_back(cmd); // add the command to the vector of commands that need to be executed
+        // prep cmd for next use
+        cmd.args.clear(); // remove command and arguments for the next bit of parsing
+        cmd.connector = NONE;
+      }
+      else // if the next thing isn't another &, syntax error
+      {
+        se = true;
+      }
+      break;
+    case '|':
+      // make sure we don't access past what we're supposed to
+      if (i + 1 < line.size() && line[i+1] == '|')
+      {
+        i++;
+        // check if there's more to parse after this command
+        if (i + 1 < line.size())
+        {
+          // there is
+          if (isCon(line[i + 1]))
+          {
+            // unfortunately, the next thing is a connector. This is a syntax error.
+            se = true;
+            break;
+          }
+          else if (isspace(line[i + 1])) // it's a space. go into TRIMSPACE mode
+          {
+            mode = TRIMSPACE;
+          }
+          else // it's neither a connector nor a space: must be a word
+          {
+            mode = GETWORD;
+          }
+        }
+        cmd.connector = OR; // the command has an "or" connector
+        cmds.push_back(cmd); // add the command to the vector of commands that need to be executed
+        // prep cmd for next use
+        cmd.args.clear(); // remove command and arguments for the next bit of parsing
+        cmd.connector = NONE;
+      }
+      else // if the next thing isn't another |, syntax error (for now. :P)
+      {
+        se = true;
+      }
+      break;
+    case ';':
+      // check if there's more to parse after this command
+      if (i + 1 < line.size())
+      {
+        // there is
+        if (isCon(line[i + 1]))
+        {
+          // unfortunately, the next thing is a connector. This is a syntax error.
+          se = true;
+          break;
+        }
+        else if (isspace(line[i + 1])) // it's a space. go into TRIMSPACE mode
+        {
+          mode = TRIMSPACE;
+        }
+        else // it's neither a connector nor a space: must be a word
+        {
+          mode = GETWORD;
+        }
+      }
+      cmd.connector = SEMI; // the command has an "and" connector
+      cmds.push_back(cmd); // add the command to the vector of commands that need to be executed
+      // prep cmd for next use
+      cmd.args.clear(); // remove command and arguments for the next bit of parsing
+      cmd.connector = NONE;
+      break;
+    default:
+      printf("There's a connector, but I don't know what it is. help.\n");
+      se = true;
+  }
+}

+
+


GB Memory: More logging

GB Memory: More logging

--- src/gb/memory.c
+++ src/gb/memory.c
@@ -342,6 +342,10 @@
 		}
 		_switchBank(memory, bank | (memory->currentBank & 0x60));
 		break;
+	default:
+		// TODO
+		mLOG(GB_MBC, STUB, "MBC1 unknown address: %04X:%02X", address, value);
+		break;
 	}
 }

@@ -380,6 +384,10 @@
 			mLOG(GB_MBC, STUB, "MBC3 RTC unimplemented", value);
 		}
 		break;
+	default:
+		// TODO
+		mLOG(GB_MBC, STUB, "MBC3 unknown address: %04X:%02X", address, value);
+		break;
 	}
 }

@@ -406,9 +414,12 @@
 			break;
 		}
 		break;
-		break;
 	case 0x1:
 		_switchBank(memory, bank);
+		break;
+	default:
+		// TODO
+		mLOG(GB_MBC, STUB, "MBC5 unknown address: %04X:%02X", address, value);
 		break;
 	}
 }


Print total number of collect runs in stats.

--- src/gc/gc_gms.c
+++ src/gc/gc_gms.c
@@ -2027,7 +2027,7 @@
     MarkSweep_GC     *self = (MarkSweep_GC *)interp->gc_sys->gc_private;
     size_t            i;

-    fprintf(stderr, "%s\ngen: %d\n", header, gen);
+    fprintf(stderr, "%s\ntotal: %d\ngen: %d\n", header, interp->gc_sys->stats.gc_mark_runs, gen);

 #ifndef NDEBUG
     fprintf(stderr, "dirty: %d\nwork: %d\n",


headerized

headerized

git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@19539 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

--- src/gc/gc_ims.c
+++ src/gc/gc_ims.c
@@ -327,10 +327,6 @@

 =head1 FUNCTIONS

-=over 4
-
-=cut
-
 */

 #include "parrot/parrot.h"
@@ -347,26 +343,48 @@
     void *arg );

 static void gc_ims_add_free_object( Interp *interp,
-    Small_Object_Pool *pool,
-    void *to_add );
-
-static void gc_ims_alloc_objects( Interp *interp, Small_Object_Pool *pool );
-static void * gc_ims_get_free_object( Interp *interp,
-    Small_Object_Pool *pool );
-
-static void gc_ims_pool_init( Interp *interp, Small_Object_Pool *pool );
+    Small_Object_Pool *pool /*NN*/,
+    void *to_add )
+        __attribute__nonnull__(2);
+
+static void gc_ims_alloc_objects( Interp *interp /*NN*/,
+    Small_Object_Pool *pool /*NN*/ )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void * gc_ims_get_free_object( Interp *interp /*NN*/,
+    Small_Object_Pool *pool /*NN*/ )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void gc_ims_pool_init( Interp *interp, Small_Object_Pool *pool /*NN*/ )
+        __attribute__nonnull__(2);
+
 static int parrot_gc_ims_collect( Interp* interp, int check_only );
-static int parrot_gc_ims_collect( Interp* interp, int check_only );
-static void parrot_gc_ims_deinit( Interp* interp );
-static void parrot_gc_ims_mark( Interp* interp );
-static void parrot_gc_ims_reinit( Interp* interp );
-static void parrot_gc_ims_run( Interp *interp, int flags );
-static void parrot_gc_ims_run_increment( Interp* interp );
-static void parrot_gc_ims_sweep( Interp* interp );
-static int sweep_cb( Interp *interp,
-    Small_Object_Pool *pool,
+static void parrot_gc_ims_deinit( Interp* interp /*NN*/ )
+        __attribute__nonnull__(1);
+
+static void parrot_gc_ims_mark( Interp* interp /*NN*/ )
+        __attribute__nonnull__(1);
+
+static void parrot_gc_ims_reinit( Interp* interp /*NN*/ )
+        __attribute__nonnull__(1);
+
+static void parrot_gc_ims_run( Interp *interp /*NN*/, int flags )
+        __attribute__nonnull__(1);
+
+static void parrot_gc_ims_run_increment( Interp* interp /*NN*/ )
+        __attribute__nonnull__(1);
+
+static void parrot_gc_ims_sweep( Interp* interp /*NN*/ )
+        __attribute__nonnull__(1);
+
+static int sweep_cb( Interp *interp /*NN*/,
+    Small_Object_Pool *pool /*NN*/,
     int flag,
-    void *arg );
+    void *arg )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);

 /* HEADERIZER END: static */

@@ -440,32 +458,29 @@

 /*

-=item C<static void gc_ims_add_free_object(Interp *interp,
-        Small_Object_Pool *pool, void *to_add)>
+FUNCDOC: gc_ims_add_free_object

 Add object C<to_add> to the free_list in the given pool.
 C<pool->num_free_objects> has to be updated by the caller.

-=item C<static void *
-gc_ims_get_free_object(Interp *, Small_Object_Pool *pool)>
+FUNCDOC: gc_ims_get_free_object

 Get a new object off the free_list in the given pool.

-=item C<static void
-gc_ims_alloc_objects(Interp *, Small_Object_Pool *pool)>
+FUNCDOC: gc_ims_alloc_objects

 Allocate new objects for the given pool.

-=cut
-
 */

 static void
-gc_ims_add_free_object(Interp *interp, Small_Object_Pool *pool, void *to_add)
+gc_ims_add_free_object(Interp *interp, Small_Object_Pool *pool /*NN*/, void *to_add)
 {
     *(void **)to_add = pool->free_list;
     pool->free_list  = to_add;
-#if ! DISABLE_GC_DEBUG
+#if DISABLE_GC_DEBUG
+    UNUSED(interp);
+#else
     if (GC_DEBUG(interp)) {
         if (pool == interp->arena_base->pmc_pool) {
             PMC * const p = (PMC *)to_add;
@@ -477,14 +492,12 @@

 static void *
-gc_ims_get_free_object(Interp *interp, Small_Object_Pool *pool)
+gc_ims_get_free_object(Interp *interp /*NN*/, Small_Object_Pool *pool /*NN*/)
 {
     PObj *ptr;
-    Arenas *arena_base;
-    Gc_ims_private *g_ims;
-
-    arena_base = interp->arena_base;
-    g_ims      = (Gc_ims_private *)arena_base->gc_private;
+    Arenas * const arena_base    = interp->arena_base;
+    Gc_ims_private * const g_ims = (Gc_ims_private *)arena_base->gc_private;
+
     if (++g_ims->allocations >= g_ims->alloc_trigger) {
         g_ims->allocations = 0;
         parrot_gc_ims_run_increment(interp);
@@ -505,7 +518,7 @@
 }

 static void
-gc_ims_alloc_objects(Interp *interp, Small_Object_Pool *pool)
+gc_ims_alloc_objects(Interp *interp /*NN*/, Small_Object_Pool *pool /*NN*/)
 {
     Small_Object_Arena *new_arena;
     size_t size;
@@ -526,7 +539,7 @@
 }

 static void
-gc_ims_pool_init(Interp *interp, Small_Object_Pool *pool)
+gc_ims_pool_init(SHIM_INTERP, Small_Object_Pool *pool /*NN*/)
 {
     pool->add_free_object = gc_ims_add_free_object;
     pool->get_free_object = gc_ims_get_free_object;
@@ -535,7 +548,7 @@
 }

 static void
-parrot_gc_ims_deinit(Interp* interp)
+parrot_gc_ims_deinit(Interp* interp /*NN*/)
 {
     Arenas * const arena_base = interp->arena_base;

@@ -545,15 +558,13 @@

 /*

-=item C<void Parrot_gc_ims_init(Interp* interp)>
+FUNCDOC: Parrot_gc_ims_init

 Initialize the state structures of the gc system. Called immediately before
 creation of memory pools. This function must set the function pointers
 for C<add_free_object_fn>, C<get_free_object_fn>, C<alloc_objects_fn>, and
 C<more_objects_fn>.

-=cut
-
 */

 PARROT_API
@@ -578,16 +589,14 @@

 /*

-=item C<static void parrot_gc_ims_reinit(Interp*)>
+FUNCDOC: parrot_gc_ims_reinit

 Reinitialize the collector for the next collection cycle.

-=cut
-
 */

 static void
-parrot_gc_ims_reinit(Interp* interp)
+parrot_gc_ims_reinit(Interp* interp /*NN*/)
 {
     Gc_ims_private *g_ims;
     Arenas * const arena_base = interp->arena_base;
@@ -607,19 +616,17 @@

 /*

-=item C<static void parrot_gc_ims_mark(Interp*)>
+FUNCDOC: parrot_gc_ims_mark

 Mark a bunch of children.

 The work depends on item counts with and without a next_for_GC field.
 The former are marked immediately, only the latter need real work here.

-=cut
-
 */

 static void
-parrot_gc_ims_mark(Interp* interp)
+parrot_gc_ims_mark(Interp* interp /*NN*/)
 {
     size_t todo;
     double work_factor;
@@ -650,17 +657,16 @@

 /*

-=item C<static void parrot_gc_ims_sweep(Interp*)>
+FUNCDOC: parrot_gc_ims_sweep

 Free unused objects in all header pools.
+
 TODO split work per pool.

-=cut
-
 */

 static int
-sweep_cb(Interp *interp, Small_Object_Pool *pool, int flag, void *arg)
+sweep_cb(Interp *interp /*NN*/, Small_Object_Pool *pool /*NN*/, int flag, void *arg)
 {
     int * const n_obj = (int *) arg;

@@ -672,7 +678,7 @@
 }

 static void
-parrot_gc_ims_sweep(Interp* interp)
+parrot_gc_ims_sweep(Interp* interp /*NN*/)
 {
     Arenas * const arena_base = interp->arena_base;
     Gc_ims_private *g_ims;
@@ -706,23 +712,14 @@

 /*

-=item C<static void parrot_gc_ims_collect(Interp*)>
+FUNCDOC: parrot_gc_ims_collect

 Run the copying collector in memory pools, if it could yield some free
 memory.

-=cut
-
-*/
-#if GC_IS_MALLOC
-static int
-parrot_gc_ims_collect(Interp* interp, int check_only)
-{
-    return 0;
-}
-
-#else
-
+*/
+
+#if !GC_IS_MALLOC
 static int
 collect_cb(Interp *interp, Small_Object_Pool *pool, int flag, void *arg)
 {
@@ -758,10 +755,15 @@
     }
     return 0;
 }
+#endif

 static int
 parrot_gc_ims_collect(Interp* interp, int check_only)
 {
+#if GC_IS_MALLOC
+    UNUSED(interp);
+    UNUSED(check_only);
+#else
     Arenas * const arena_base = interp->arena_base;
     Gc_ims_private *g_ims;
     int ret;
@@ -778,23 +780,21 @@
     if (interp->profile)
         Parrot_dod_profile_end(interp, PARROT_PROF_GC);
     g_ims->state = GC_IMS_FINISHED;
+#endif
     return 0;
 }
-#endif
-
-/*
-
-=item C<static void parrot_gc_ims_run_increment(Interp* interp)>
+
+/*
+
+FUNCDOC: parrot_gc_ims_run_increment

 Run one increment of collection. This function is triggered by object
 allocation.

-=cut
-
 */

 static void
-parrot_gc_ims_run_increment(Interp* interp)
+parrot_gc_ims_run_increment(Interp* interp /*NN*/)
 {
     Arenas * const arena_base    = interp->arena_base;
     Gc_ims_private * const g_ims = (Gc_ims_private *)arena_base->gc_private;
@@ -858,20 +858,17 @@

 /*

-=item C<void
-parrot_gc_ims_run(Interp *interp, int flags)>
+FUNCDOC: parrot_gc_ims_run

 Interface to C<Parrot_do_dod_run>. C<flags> is one of:

   DOD_lazy_FLAG   ... timely destruction
   DOD_finish_FLAG ... run until live bits are clear

-=cut
-
 */

 static void
-parrot_gc_ims_run(Interp *interp, int flags)
+parrot_gc_ims_run(Interp *interp /*NN*/, int flags)
 {
     int lazy;
     Arenas * const arena_base    = interp->arena_base;
@@ -950,13 +947,11 @@

 /*

-=item C<void Parrot_dod_ims_wb(Interp*, PMC *agg, PMC *new)>
+FUNCDOC: Parrot_dod_ims_wb

 Write barrier called by the DOD_WRITE_BARRIER macro. Always when storing
 a white object into a black aggregate, either the object must
 be greyed or the aggregate must be rescanned - by greying it.
-
-=cut

 */

@@ -979,8 +974,6 @@

 /*

-=back
-
 =head1 SEE ALSO

 F<src/dod.c>, F<include/parrot/dod.h>, F<include/parrot/pobj.h>,
@@ -988,8 +981,6 @@
 =head1 HISTORY

 Initial version by leo (2004.08.12 - 2004.08.15)
-
-=cut

 */


Use combination of Pool.is_maybe_owned and PObj flags in GC.is_*_ptr.

This gives about 30% speed up on stress_strings by avoiding expensive
testing of all live objects.

git-svn-id: 0925b7c4d71351b4fea77b99f2cfcd1a0170cafc@49676 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

--- src/gc/gc_ms2.c
+++ src/gc/gc_ms2.c
@@ -1723,11 +1723,14 @@
     if (!obj || !item)
         return 0;

-    if (!Parrot_gc_pool_is_owned(interp, pool, item))
+    if (!Parrot_gc_pool_is_maybe_owned(interp, pool, item))
         return 0;

     /* black or white objects marked already. */
     if (PObj_is_live_or_free_TESTALL(obj))
+        return 0;
+
+    if (!Parrot_gc_pool_is_owned(interp, pool, item))
         return 0;

     /* Pool.is_owned isn't precise enough (yet) */


ALMATH: support AXIS_MASK_PLANEZ

ALMATH: support AXIS_MASK_PLANEZ

Change-Id: Iac36cbdaa842b7fc007450820a939a59d3f1ec37

--- almath/types/alaxismask.h
+++ almath/types/alaxismask.h
@@ -17,34 +17,36 @@
     /// <summary>
     /// Definition of an AXIS_MASK as a bit set.
     ///
-    /// static const int AXIS_MASK_X    =  1 \n
-    /// static const int AXIS_MASK_Y    =  2 \n
-    /// static const int AXIS_MASK_XY   =  3 \n
-    /// static const int AXIS_MASK_Z    =  4 \n
-    /// static const int AXIS_MASK_WX   =  8 \n
-    /// static const int AXIS_MASK_WY   = 16 \n
-    /// static const int AXIS_MASK_WZ   = 32 \n
-    /// static const int AXIS_MASK_WYWZ = 48 \n
-    /// static const int AXIS_MASK_ALL  = 63 \n
-    /// static const int AXIS_MASK_VEL  =  7 \n
-    /// static const int AXIS_MASK_ROT  = 56 \n
-    /// static const int AXIS_MASK_NONE =  0 \n
+    /// static const int AXIS_MASK_X      =  1 \n
+    /// static const int AXIS_MASK_Y      =  2 \n
+    /// static const int AXIS_MASK_XY     =  3 \n
+    /// static const int AXIS_MASK_Z      =  4 \n
+    /// static const int AXIS_MASK_WX     =  8 \n
+    /// static const int AXIS_MASK_WY     = 16 \n
+    /// static const int AXIS_MASK_WZ     = 32 \n
+    /// static const int AXIS_MASK_WYWZ   = 48 \n
+    /// static const int AXIS_MASK_ALL    = 63 \n
+    /// static const int AXIS_MASK_VEL    =  7 \n
+    /// static const int AXIS_MASK_ROT    = 56 \n
+    /// static const int AXIS_MASK_NONE   =  0 \n
+    /// static const int AXIS_MASK_PLANEZ = 28 \n
     /// </summary>
     /// \ingroup Types
     typedef std::bitset<6> AXIS_MASK;

-    static const int AXIS_MASK_X    =  1;
-    static const int AXIS_MASK_Y    =  2;
-    static const int AXIS_MASK_XY   =  3;
-    static const int AXIS_MASK_Z    =  4;
-    static const int AXIS_MASK_WX   =  8;
-    static const int AXIS_MASK_WY   = 16;
-    static const int AXIS_MASK_WZ   = 32;
-    static const int AXIS_MASK_WYWZ = 48;
-    static const int AXIS_MASK_ALL  = 63;
-    static const int AXIS_MASK_VEL  =  7;
-    static const int AXIS_MASK_ROT  = 56;
-    static const int AXIS_MASK_NONE =  0;
+    static const int AXIS_MASK_X      =  1;
+    static const int AXIS_MASK_Y      =  2;
+    static const int AXIS_MASK_XY     =  3;
+    static const int AXIS_MASK_Z      =  4;
+    static const int AXIS_MASK_WX     =  8;
+    static const int AXIS_MASK_WY     = 16;
+    static const int AXIS_MASK_WZ     = 32;
+    static const int AXIS_MASK_WYWZ   = 48;
+    static const int AXIS_MASK_ALL    = 63;
+    static const int AXIS_MASK_VEL    =  7;
+    static const int AXIS_MASK_ROT    = 56;
+    static const int AXIS_MASK_NONE   =  0;
+    static const int AXIS_MASK_PLANEZ = 28; // Z + WX + WY

     /// <summary> Validates an AxisMask. </summary>
     /// <param name="pAxisMask"> An Axis Mask. </param>


Allow you to choose any Computed field for your texture coordinates for an iso_surface.

--- source/finite_element/finite_element_to_graphics_object.c
+++ source/finite_element/finite_element_to_graphics_object.c
@@ -3776,8 +3776,6 @@
 									vertex_list[i].blur=0;
 								}
 								data_index = 0;
-								texturemap_counter = 0;
-								texturemap_index_counter = 0;
 								/*???Mark.  THIS CODE NEEDS TO BE DOCTORED.  end */
 								/* calculate the points in the specified coordinate system */
 								v_count=0;


returning in feature_adaptive_eval for out of bounds subpatch ID

--- kernels/subdiv/feature_adaptive_eval.h
+++ kernels/subdiv/feature_adaptive_eval.h
@@ -214,6 +214,7 @@
             const unsigned l = (unsigned) floor(0.5f*uv.x); const float u = 2.0f*frac(0.5f*uv.x)-0.5f;
             const unsigned h = (unsigned) floor(0.5f*uv.y); const float v = 2.0f*frac(0.5f*uv.y)-0.5f;
             const unsigned i = 4*h+l; assert(i<N);
+            if (i >= N) return;

 #if PATCH_USE_GREGORY == 2
             BezierCurve borders[2]; patch.getLimitBorder(borders,i);


Add C implementation for problem 4.

Add C implementation for problem 4.

error: pathspec 'problem_4/solution.c' did not match any file(s) known to git

--- problem_4/solution.c
+++ problem_4/solution.c
@@ -0,0 +1,51 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+void reverse_string(char *str){
+    // skip null
+    if (str == 0){ return; }
+    // skip empty string
+    if (*str == 0){ return; }
+    // get range
+    char *start = str;
+    char *end = start + strlen(str) - 1; // -1 for \0
+    char temp;
+    // reverse
+    while (end > start){
+    	temp = *start;
+    	*start = *end;
+    	*end = temp;
+    	++start;
+    	--end;
+    }
+}
+
+int is_palindrome_number(int n){
+  char n_str[10], r_str[10];
+  snprintf(n_str, sizeof(n_str), "%d", n); // convert int to str
+  snprintf(r_str, sizeof(r_str), "%d", n);
+  reverse_string(0);
+  reverse_string(r_str);
+  if(strcmp(n_str, r_str) == 0){
+    return 0;
+  }else{
+    return -1;
+  }
+}
+
+int main(int argc, char *argv[]){
+  int x, y, v, largest_number;
+  for(x = 100; x < 999; x++){
+    for(y = 100; y < 999; y++){
+      v = x * y;
+      if(v > largest_number){
+        if(is_palindrome_number(v) == 0){
+          largest_number = v;
+        }
+      }
+    }
+  }
+  printf("%d\n", largest_number);
+}


indentation

indentation

--- OOps/str_ops.c
+++ OOps/str_ops.c
@@ -230,8 +230,10 @@
       ss = get_arg_string(csound, *p->indx);
       if(ss == NULL){
       if (UNLIKELY(((OPDS*) p)->insdshead->pds != NULL))
-      return csoundPerfError(csound, ((OPDS*)p)->insdshead, "NULL string \n");
-      else return csoundInitError(csound, "NULL string \n");
+        return csoundPerfError(csound, ((OPDS*)p)->insdshead,
+                               Str("NULL string \n"));
+      else
+        return csoundInitError(csound, Str("NULL string \n"));
     }
       if (p->r->data == NULL) {
         p->r->data = cs_strdup(csound, ss);


preproc: fix uninitialized variables

preproc: fix uninitialized variables

Fix uninitialized variables (not just warnings, actual bugs.)

Signed-off-by: H. Peter Anvin (Intel) <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com>

--- asm/preproc.c
+++ asm/preproc.c
@@ -2315,7 +2315,8 @@
     int nparam = 0;
     enum sparmflags flags;
     struct smac_param *params = NULL;
-    bool err, done, greedy;
+    bool err, done;
+    bool greedy = false;
     Token **tn = *tpp;
     Token *t = *tn;
     Token *name;
@@ -2346,7 +2347,7 @@

     name = NULL;
     flags = 0;
-    err = done = greedy = false;
+    err = done = false;

     while (!done) {
         if (!t || !t->type) {
@@ -4399,6 +4400,8 @@
                 type = TOK_ID;
                 text = nasm_strdup(mac->iname);
                 change = true;
+            } else {
+                change = false;
             }
             break;

@@ -4407,6 +4410,8 @@
                 type = TOK_ID;
                 text = nasm_strdup(mac->name);
                 change = true;
+            } else {
+                change = false;
             }
             break;


Add iterator traits aliases to ConstPointerContainer::ConstIterator (#634)

* Add iterator traits aliases.

* Add a few more pieces to make more compliant with the input iterator requirements.

--- include/onnxruntime/core/common/const_pointer_container.h
+++ include/onnxruntime/core/common/const_pointer_container.h
@@ -20,17 +20,41 @@
   class ConstIterator {
    public:
     using const_iterator = typename Container::const_iterator;
+    using iterator_category = std::input_iterator_tag;
+    using value_type = T*;
+    using difference_type = std::ptrdiff_t;
+    using pointer = T**;
+    using reference = T*&;

     /** Construct iterator for container that will return const T* entries.*/
-    explicit ConstIterator(const_iterator position) noexcept : current_(position) {}
+    explicit ConstIterator(const_iterator position) noexcept : current_{position}, item_{nullptr} {}
+    ConstIterator(const ConstIterator& other) = default;
+    ConstIterator& operator=(const ConstIterator& other) = default;

     bool operator==(const ConstIterator& other) const noexcept { return current_ == other.current_; }
     bool operator!=(const ConstIterator& other) const noexcept { return current_ != other.current_; }
-    void operator++() { ++current_; }
-    const T* operator*() { return *current_; }
+
+    ConstIterator& operator++() {
+      ++current_;
+      return *this;
+    }
+
+    ConstIterator operator++(int) {
+      ConstIterator tmp{*this};
+      ++(*this);
+      return tmp;
+    }
+
+    const T*& operator*() const {
+      item_ = *current_;
+      return item_;
+    }
+
+    const T** operator->() const { return &(operator*()); };

    private:
     const_iterator current_;
+    mutable const T* item_;
   };

   /**


network: Fix trying to register NetworkServer interface multiple times

This also removes the limitation of only accepting nap as UUID, now all
PAN UUID are supported including their friendly names.

--- profiles/network/server.c
+++ profiles/network/server.c
@@ -72,7 +72,6 @@
 /* Main server structure */
 struct network_server {
 	bdaddr_t	src;		/* Bluetooth Local Address */
-	char		*iface;		/* DBus interface */
 	char		*name;		/* Server service name */
 	char		*bridge;	/* Bridge name */
 	uint32_t	record_id;	/* Service record id */
@@ -104,6 +103,22 @@
 		struct network_server *ns = list->data;

 		if (ns->id == id)
+			return ns;
+	}
+
+	return NULL;
+}
+
+static struct network_server *find_server_by_uuid(GSList *list,
+							const char *uuid)
+{
+	for (; list; list = list->next) {
+		struct network_server *ns = list->data;
+
+		if (strcasecmp(uuid, bnep_uuid(ns->id)) == 0)
+			return ns;
+
+		if (strcasecmp(uuid, bnep_name(ns->id)) == 0)
 			return ns;
 	}

@@ -624,7 +639,8 @@
 static DBusMessage *register_server(DBusConnection *conn,
 				DBusMessage *msg, void *data)
 {
-	struct network_server *ns = data;
+	struct network_adapter *na = data;
+	struct network_server *ns;
 	DBusMessage *reply;
 	const char *uuid, *bridge;

@@ -632,7 +648,8 @@
 				DBUS_TYPE_STRING, &bridge, DBUS_TYPE_INVALID))
 		return btd_error_invalid_args(msg);

-	if (g_strcmp0(uuid, "nap"))
+	ns = find_server_by_uuid(na->servers, uuid);
+	if (ns == NULL)
 		return btd_error_failed(msg, "Invalid UUID");

 	if (ns->record_id)
@@ -693,8 +710,10 @@
 	g_free(na);
 }

-static void server_free(struct network_server *ns)
-{
+static void server_free(void *data)
+{
+	struct network_server *ns = data;
+
 	if (!ns)
 		return;

@@ -703,7 +722,6 @@
 	if (ns->record_id)
 		remove_record_from_server(ns->record_id);

-	g_free(ns->iface);
 	g_free(ns->name);
 	g_free(ns->bridge);

@@ -712,17 +730,12 @@

 static void path_unregister(void *data)
 {
-	struct network_server *ns = data;
-	struct network_adapter *na = ns->na;
+	struct network_adapter *na = data;

 	DBG("Unregistered interface %s on path %s",
-		ns->iface, adapter_get_path(na->adapter));
-
-	na->servers = g_slist_remove(na->servers, ns);
-	server_free(ns);
-
-	if (na->servers)
-		return;
+		NETWORK_SERVER_INTERFACE, adapter_get_path(na->adapter));
+
+	g_slist_free_full(na->servers, server_free);

 	adapters = g_slist_remove(adapters, na);
 	adapter_free(na);
@@ -786,29 +799,33 @@

 	ns = g_new0(struct network_server, 1);

-	ns->iface = g_strdup(NETWORK_SERVER_INTERFACE);
 	ns->name = g_strdup("Network service");

 	path = adapter_get_path(adapter);

+	if (g_slist_length(na->servers) > 0)
+		goto done;
+
 	if (!g_dbus_register_interface(btd_get_dbus_connection(),
-					path, ns->iface,
+					path, NETWORK_SERVER_INTERFACE,
 					server_methods, NULL, NULL,
-					ns, path_unregister)) {
+					na, path_unregister)) {
 		error("D-Bus failed to register %s interface",
-				ns->iface);
+						NETWORK_SERVER_INTERFACE);
 		server_free(ns);
 		return -1;
 	}

+	DBG("Registered interface %s on path %s", NETWORK_SERVER_INTERFACE,
+									path);
+
+done:
 	bacpy(&ns->src, adapter_get_address(adapter));
 	ns->id = id;
 	ns->na = na;
 	ns->record_id = 0;
 	na->servers = g_slist_append(na->servers, ns);

-	DBG("Registered interface %s on path %s", ns->iface, path);
-
 	return 0;
 }

@@ -825,8 +842,15 @@
 	if (!ns)
 		return -EINVAL;

+	na->servers = g_slist_remove(na->servers, ns);
+	server_free(ns);
+
+	if (g_slist_length(na->servers) > 0)
+		return 0;
+
 	g_dbus_unregister_interface(btd_get_dbus_connection(),
-					adapter_get_path(adapter), ns->iface);
+						adapter_get_path(adapter),
+						NETWORK_SERVER_INTERFACE);

 	return 0;
 }


GPR#221: add forgotten CAMLnoreturn_end

GPR#221: add forgotten CAMLnoreturn_end

git-svn-id: e7e61699ce1738538ffebb75374fbea0924bc775@16321 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

--- asmrun/fail.c
+++ asmrun/fail.c
@@ -47,7 +47,7 @@

 /* Exception raising */

-CAMLnoreturn_start extern void caml_raise_exception (value bucket);
+CAMLnoreturn_start extern void caml_raise_exception (value bucket) CAMLnoreturn_end;

 char * caml_exception_pointer = NULL;