s/0L/0/g

s/0L/0/g

svn path=/trunk/KDE/kdepim/; revision=422871

--- kioslaves/imap4/imapparser.h
+++ kioslaves/imap4/imapparser.h
@@ -339,7 +339,7 @@

   /** parse a literal or word, may require more data */
   QCString parseLiteralC(parseString & inWords, bool relay = false,
-                           bool stopAtBracket = false, int *outlen = 0L);
+                           bool stopAtBracket = false, int *outlen = 0);
   inline QByteArray parseLiteral (parseString & inWords, bool relay = false,
                            bool stopAtBracket = false) {
     int len = 0; // string size
@@ -356,7 +356,7 @@

   /** parse one word (maybe quoted) upto next space " ) ] } */
   static QCString parseOneWordC (parseString & inWords,
-    bool stopAtBracket = FALSE, int *len = 0L);
+    bool stopAtBracket = FALSE, int *len = 0);
   static inline QByteArray parseOneWord (parseString & inWords,
     bool stopAtBracket = FALSE) {
     int len = 0; // string size


msm: kgsl: Add A305 GPU identification for msm8930 V1.2

In msm8930 V1.2, there are few HW fixes added for A305 GPU,
communicate new chipid to userspace driver to remove SW workarounds.

Change-Id: I51f272a39cb2cc60541607af9fa9be70cc838cb3
Signed-off-by: Sudhakara Rao Tentu <252112692c6be09ecd58117afffb9a7457d6a2ba@codeaurora.org>


Fix compile issue when RAND = UDEV.

Fix compile issue when RAND = UDEV.

--- src/rand/relic_rand_core.c
+++ src/rand/relic_rand_core.c
@@ -142,7 +142,7 @@

 #endif /* RAND == UDEV */

-#if RAND != UDEV && RAND != CALL
+#if RAND != CALL
 	core_get()->seeded = 0;
 	rand_seed(buf, SEED_SIZE);
 #else


hid: egalax: Report zero as minimum pressure

The firmware reports a logical minimum of one, but in order for
userspace applications to correctly map all reported values to
non-zero pressure, the driver needs to report a logical minimum of
zero.  Fixed with this patch.

Tested-by: Philipp Merkel <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@philmerk.de>
Cc: Stephane Chatty <8869899ee8011d5ab6098b5e50f006d50dff5fc7@enac.fr>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>
Signed-off-by: Henrik Rydberg <b7088a9c70345a9ab94cacab3cc3888d0a7dc884@euromail.se>

--- drivers/hid/hid-egalax.c
+++ drivers/hid/hid-egalax.c
@@ -90,6 +90,7 @@
 			set_abs(input, ABS_MT_TRACKING_ID, field, 0);
 			return 1;
 		case HID_DG_TIPPRESSURE:
+			field->logical_minimum = 0;
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_PRESSURE);
 			set_abs(input, ABS_MT_PRESSURE, field, 0);


HID: roccat: Remove empty function definitions for roccat chardev

Roccat chardev is a dependency of all device specific drivers, so
the empty definitions are not needed anymore.

Signed-off-by: Stefan Achatz <c509a082fbe59d85124e87a999e8aedefdbcca30@users.sourceforge.net>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>

--- drivers/hid/hid-roccat.h
+++ drivers/hid/hid-roccat.h
@@ -15,18 +15,8 @@
 #include <linux/hid.h>
 #include <linux/types.h>

-#if defined(CONFIG_HID_ROCCAT) || defined(CONFIG_HID_ROCCAT_MODULE)
 int roccat_connect(struct class *klass, struct hid_device *hid);
 void roccat_disconnect(int minor);
 int roccat_report_event(int minor, u8 const *data, int len);
-#else
-static inline int roccat_connect(struct class *klass,
-		struct hid_device *hid) { return -1; }
-static inline void roccat_disconnect(int minor) {}
-static inline int roccat_report_event(int minor, u8 const *data, int len)
-{
-	return 0;
-}
-#endif

 #endif


iio:ad7793: Add support for the ad7796 and ad7797

The ad7796 and ad7797 are similar to the ad7792 and ad7793 but only have a
single differential input instead of two. Also some other features are missing
like the programmable gain amplifier and also not all sampling frequencies
supported by the ad7792/ad7793 are supported by the ad7796/ad7797. This patch
adds new feature flags for the features not present in the ad7796/ad7797. The
patch also adds a struct iio_info field to the chip_info struct, this becomes
necessary since the ad7796/ad7797 needs a special set of sysfs attributes.

Signed-off-by: Lars-Peter Clausen <3318dc5ce3e4fb7c28a0b841b6801c884e1d0896@metafoo.de>
Signed-off-by: Jonathan Cameron <09f65b71b7655725897b2fd41a09a0cefe2e1ace@kernel.org>

--- drivers/iio/adc/ad7793.c
+++ drivers/iio/adc/ad7793.c
@@ -106,6 +106,8 @@
 #define AD7793_ID		0xB
 #define AD7794_ID		0xF
 #define AD7795_ID		0xF
+#define AD7796_ID		0xA
+#define AD7797_ID		0xB
 #define AD7798_ID		0x8
 #define AD7799_ID		0x9
 #define AD7793_ID_MASK		0xF
@@ -136,12 +138,17 @@
 #define AD7793_FLAG_HAS_REFSEL		BIT(1)
 #define AD7793_FLAG_HAS_VBIAS		BIT(2)
 #define AD7793_HAS_EXITATION_CURRENT	BIT(3)
+#define AD7793_FLAG_HAS_GAIN		BIT(4)
+#define AD7793_FLAG_HAS_BUFFER		BIT(5)

 struct ad7793_chip_info {
 	unsigned int id;
 	const struct iio_chan_spec *channels;
 	unsigned int num_channels;
 	unsigned int flags;
+
+	const struct iio_info *iio_info;
+	const u16 *sample_freq_avail;
 };

 struct ad7793_state {
@@ -162,6 +169,8 @@
 	ID_AD7793,
 	ID_AD7794,
 	ID_AD7795,
+	ID_AD7796,
+	ID_AD7797,
 	ID_AD7798,
 	ID_AD7799,
 };
@@ -283,7 +292,7 @@
 		st->conf |= AD7793_CONF_REFSEL(pdata->refsel);
 	if (st->chip_info->flags & AD7793_FLAG_HAS_VBIAS)
 		st->conf |= AD7793_CONF_VBIAS(pdata->bias_voltage);
-	if (pdata->buffered)
+	if (pdata->buffered || !(st->chip_info->flags & AD7793_FLAG_HAS_BUFFER))
 		st->conf |= AD7793_CONF_BUF;
 	if (pdata->boost_enable &&
 		(st->chip_info->flags & AD7793_FLAG_HAS_VBIAS))
@@ -293,6 +302,9 @@
 	if (pdata->unipolar)
 		st->conf |= AD7793_CONF_UNIPOLAR;

+	if (!(st->chip_info->flags & AD7793_FLAG_HAS_GAIN))
+		st->conf |= AD7793_CONF_GAIN(7);
+
 	ret = ad7793_set_mode(&st->sd, AD_SD_MODE_IDLE);
 	if (ret)
 		goto out;
@@ -330,8 +342,11 @@
 	return ret;
 }

-static const u16 sample_freq_avail[16] = {0, 470, 242, 123, 62, 50, 39, 33, 19,
-					  17, 16, 12, 10, 8, 6, 4};
+static const u16 ad7793_sample_freq_avail[16] = {0, 470, 242, 123, 62, 50, 39,
+					33, 19, 17, 16, 12, 10, 8, 6, 4};
+
+static const u16 ad7797_sample_freq_avail[16] = {0, 0, 0, 123, 62, 50, 0,
+					33, 0, 17, 16, 12, 10, 8, 6, 4};

 static ssize_t ad7793_read_frequency(struct device *dev,
 		struct device_attribute *attr,
@@ -341,7 +356,7 @@
 	struct ad7793_state *st = iio_priv(indio_dev);

 	return sprintf(buf, "%d\n",
-		       sample_freq_avail[AD7793_MODE_RATE(st->mode)]);
+	       st->chip_info->sample_freq_avail[AD7793_MODE_RATE(st->mode)]);
 }

 static ssize_t ad7793_write_frequency(struct device *dev,
@@ -365,10 +380,13 @@
 	if (ret)
 		return ret;

+	if (lval == 0)
+		return -EINVAL;
+
 	ret = -EINVAL;

-	for (i = 0; i < ARRAY_SIZE(sample_freq_avail); i++)
-		if (lval == sample_freq_avail[i]) {
+	for (i = 0; i < 16; i++)
+		if (lval == st->chip_info->sample_freq_avail[i]) {
 			mutex_lock(&indio_dev->mlock);
 			st->mode &= ~AD7793_MODE_RATE(-1);
 			st->mode |= AD7793_MODE_RATE(i);
@@ -388,6 +406,9 @@
 static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(
 	"470 242 123 62 50 39 33 19 17 16 12 10 8 6 4");

+static IIO_CONST_ATTR_NAMED(sampling_frequency_available_ad7797,
+	sampling_frequency_available, "123 62 50 33 17 16 12 10 8 6 4");
+
 static ssize_t ad7793_show_scale_available(struct device *dev,
 			struct device_attribute *attr, char *buf)
 {
@@ -417,6 +438,16 @@

 static const struct attribute_group ad7793_attribute_group = {
 	.attrs = ad7793_attributes,
+};
+
+static struct attribute *ad7797_attributes[] = {
+	&iio_dev_attr_sampling_frequency.dev_attr.attr,
+	&iio_const_attr_sampling_frequency_available_ad7797.dev_attr.attr,
+	NULL
+};
+
+static const struct attribute_group ad7797_attribute_group = {
+	.attrs = ad7797_attributes,
 };

 static int ad7793_read_raw(struct iio_dev *indio_dev,
@@ -544,6 +575,15 @@
 	.driver_module = THIS_MODULE,
 };

+static const struct iio_info ad7797_info = {
+	.read_raw = &ad7793_read_raw,
+	.write_raw = &ad7793_write_raw,
+	.write_raw_get_fmt = &ad7793_write_raw_get_fmt,
+	.attrs = &ad7793_attribute_group,
+	.validate_trigger = ad_sd_validate_trigger,
+	.driver_module = THIS_MODULE,
+};
+
 #define DECLARE_AD7793_CHANNELS(_name, _b, _sb, _s) \
 const struct iio_chan_spec _name##_channels[] = { \
 	AD_SD_DIFF_CHANNEL(0, 0, 0, AD7793_CH_AIN1P_AIN1M, (_b), (_sb), (_s)), \
@@ -569,6 +609,15 @@
 	IIO_CHAN_SOFT_TIMESTAMP(9), \
 }

+#define DECLARE_AD7797_CHANNELS(_name, _b, _sb) \
+const struct iio_chan_spec _name##_channels[] = { \
+	AD_SD_DIFF_CHANNEL(0, 0, 0, AD7793_CH_AIN1P_AIN1M, (_b), (_sb), 0), \
+	AD_SD_SHORTED_CHANNEL(1, 0, AD7793_CH_AIN1M_AIN1M, (_b), (_sb), 0), \
+	AD_SD_TEMP_CHANNEL(2, AD7793_CH_TEMP, (_b), (_sb), 0), \
+	AD_SD_SUPPLY_CHANNEL(3, 3, AD7793_CH_AVDD_MONITOR, (_b), (_sb), 0), \
+	IIO_CHAN_SOFT_TIMESTAMP(4), \
+}
+
 #define DECLARE_AD7799_CHANNELS(_name, _b, _sb) \
 const struct iio_chan_spec _name##_channels[] = { \
 	AD_SD_DIFF_CHANNEL(0, 0, 0, AD7793_CH_AIN1P_AIN1M, (_b), (_sb), 0), \
@@ -584,6 +633,8 @@
 static DECLARE_AD7793_CHANNELS(ad7793, 24, 32, 0);
 static DECLARE_AD7795_CHANNELS(ad7794, 16, 32);
 static DECLARE_AD7795_CHANNELS(ad7795, 24, 32);
+static DECLARE_AD7797_CHANNELS(ad7796, 16, 16);
+static DECLARE_AD7797_CHANNELS(ad7797, 24, 32);
 static DECLARE_AD7799_CHANNELS(ad7798, 16, 16);
 static DECLARE_AD7799_CHANNELS(ad7799, 24, 32);

@@ -592,56 +643,100 @@
 		.id = AD7785_ID,
 		.channels = ad7785_channels,
 		.num_channels = ARRAY_SIZE(ad7785_channels),
+		.iio_info = &ad7793_info,
+		.sample_freq_avail = ad7793_sample_freq_avail,
 		.flags = AD7793_FLAG_HAS_CLKSEL |
 			AD7793_FLAG_HAS_REFSEL |
 			AD7793_FLAG_HAS_VBIAS |
-			AD7793_HAS_EXITATION_CURRENT,
+			AD7793_HAS_EXITATION_CURRENT |
+			AD7793_FLAG_HAS_GAIN |
+			AD7793_FLAG_HAS_BUFFER,
 	},
 	[ID_AD7792] = {
 		.id = AD7792_ID,
 		.channels = ad7792_channels,
 		.num_channels = ARRAY_SIZE(ad7792_channels),
+		.iio_info = &ad7793_info,
+		.sample_freq_avail = ad7793_sample_freq_avail,
 		.flags = AD7793_FLAG_HAS_CLKSEL |
 			AD7793_FLAG_HAS_REFSEL |
 			AD7793_FLAG_HAS_VBIAS |
-			AD7793_HAS_EXITATION_CURRENT,
+			AD7793_HAS_EXITATION_CURRENT |
+			AD7793_FLAG_HAS_GAIN |
+			AD7793_FLAG_HAS_BUFFER,
 	},
 	[ID_AD7793] = {
 		.id = AD7793_ID,
 		.channels = ad7793_channels,
 		.num_channels = ARRAY_SIZE(ad7793_channels),
+		.iio_info = &ad7793_info,
+		.sample_freq_avail = ad7793_sample_freq_avail,
 		.flags = AD7793_FLAG_HAS_CLKSEL |
 			AD7793_FLAG_HAS_REFSEL |
 			AD7793_FLAG_HAS_VBIAS |
-			AD7793_HAS_EXITATION_CURRENT,
+			AD7793_HAS_EXITATION_CURRENT |
+			AD7793_FLAG_HAS_GAIN |
+			AD7793_FLAG_HAS_BUFFER,
 	},
 	[ID_AD7794] = {
 		.id = AD7794_ID,
 		.channels = ad7794_channels,
 		.num_channels = ARRAY_SIZE(ad7794_channels),
+		.iio_info = &ad7793_info,
+		.sample_freq_avail = ad7793_sample_freq_avail,
 		.flags = AD7793_FLAG_HAS_CLKSEL |
 			AD7793_FLAG_HAS_REFSEL |
 			AD7793_FLAG_HAS_VBIAS |
-			AD7793_HAS_EXITATION_CURRENT,
+			AD7793_HAS_EXITATION_CURRENT |
+			AD7793_FLAG_HAS_GAIN |
+			AD7793_FLAG_HAS_BUFFER,
 	},
 	[ID_AD7795] = {
 		.id = AD7795_ID,
 		.channels = ad7795_channels,
 		.num_channels = ARRAY_SIZE(ad7795_channels),
+		.iio_info = &ad7793_info,
+		.sample_freq_avail = ad7793_sample_freq_avail,
 		.flags = AD7793_FLAG_HAS_CLKSEL |
 			AD7793_FLAG_HAS_REFSEL |
 			AD7793_FLAG_HAS_VBIAS |
-			AD7793_HAS_EXITATION_CURRENT,
+			AD7793_HAS_EXITATION_CURRENT |
+			AD7793_FLAG_HAS_GAIN |
+			AD7793_FLAG_HAS_BUFFER,
+	},
+	[ID_AD7796] = {
+		.id = AD7796_ID,
+		.channels = ad7796_channels,
+		.num_channels = ARRAY_SIZE(ad7796_channels),
+		.iio_info = &ad7797_info,
+		.sample_freq_avail = ad7797_sample_freq_avail,
+		.flags = AD7793_FLAG_HAS_CLKSEL,
+	},
+	[ID_AD7797] = {
+		.id = AD7797_ID,
+		.channels = ad7797_channels,
+		.num_channels = ARRAY_SIZE(ad7797_channels),
+		.iio_info = &ad7797_info,
+		.sample_freq_avail = ad7797_sample_freq_avail,
+		.flags = AD7793_FLAG_HAS_CLKSEL,
 	},
 	[ID_AD7798] = {
 		.id = AD7798_ID,
 		.channels = ad7798_channels,
 		.num_channels = ARRAY_SIZE(ad7798_channels),
+		.iio_info = &ad7793_info,
+		.sample_freq_avail = ad7793_sample_freq_avail,
+		.flags = AD7793_FLAG_HAS_GAIN |
+			AD7793_FLAG_HAS_BUFFER,
 	},
 	[ID_AD7799] = {
 		.id = AD7799_ID,
 		.channels = ad7799_channels,
 		.num_channels = ARRAY_SIZE(ad7799_channels),
+		.iio_info = &ad7793_info,
+		.sample_freq_avail = ad7793_sample_freq_avail,
+		.flags = AD7793_FLAG_HAS_GAIN |
+			AD7793_FLAG_HAS_BUFFER,
 	},
 };

@@ -702,7 +797,7 @@
 	indio_dev->modes = INDIO_DIRECT_MODE;
 	indio_dev->channels = st->chip_info->channels;
 	indio_dev->num_channels = st->chip_info->num_channels;
-	indio_dev->info = &ad7793_info;
+	indio_dev->info = st->chip_info->iio_info;

 	ret = ad_sd_setup_buffer_and_trigger(indio_dev);
 	if (ret)
@@ -757,6 +852,8 @@
 	{"ad7793", ID_AD7793},
 	{"ad7794", ID_AD7794},
 	{"ad7795", ID_AD7795},
+	{"ad7796", ID_AD7796},
+	{"ad7797", ID_AD7797},
 	{"ad7798", ID_AD7798},
 	{"ad7799", ID_AD7799},
 	{}


leds: leds-gpio: Use dev_info instead of printk

Fixes the following checkpatch warning:
WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
FILE: leds/leds-gpio.c:105:
		printk(KERN_INFO "Skipping unavailable LED gpio %d (%s)\n",

Signed-off-by: Sachin Kamat <1c3b1584a6008857f36c03c58f657c0fc16fc09e@linaro.org>
Signed-off-by: Bryan Wu <956b36c0f472d2edb239225c10f7e4411d1efbb9@gmail.com>

--- drivers/leds/leds-gpio.c
+++ drivers/leds/leds-gpio.c
@@ -102,7 +102,7 @@

 	/* skip leds that aren't available */
 	if (!gpio_is_valid(template->gpio)) {
-		printk(KERN_INFO "Skipping unavailable LED gpio %d (%s)\n",
+		dev_info(parent, "Skipping unavailable LED gpio %d (%s)\n",
 				template->gpio, template->name);
 		return 0;
 	}


mfd: htc-i2cpld: Fix %d confusingly prefixed with 0x in format string

Signed-off-by: Hans Wennborg <8800578b51f022c8d8adb9606a8b3db4fedbdac6@hanshq.net>
Signed-off-by: Lee Jones <630e34333487a351a857f6b705e04d30b37c1629@linaro.org>


mfd: htc-i2cpld: Remove unused code

mfd: htc-i2cpld: Remove unused code

Removed code unused in this function.

Signed-off-by: Sachin Kamat <1c3b1584a6008857f36c03c58f657c0fc16fc09e@samsung.com>
Signed-off-by: Lee Jones <630e34333487a351a857f6b705e04d30b37c1629@linaro.org>


mfd: Clean timberdale error handling code up

In the first three cases, ioremap has been called, so iounmap is needed.  A
new label for this is introduced, to differentiate it from err_msix, which
is the first point at which msix_entries actually needs to be freed.

Signed-off-by: Julia Lawall <b43b0ad1e8108e7ab870d7a54feac93ae8b8600e@diku.dk>
Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>

--- drivers/mfd/timberdale.c
+++ drivers/mfd/timberdale.c
@@ -697,7 +697,7 @@
 		dev_err(&dev->dev, "The driver supports an older "
 			"version of the FPGA, please update the driver to "
 			"support %d.%d\n", priv->fw.major, priv->fw.minor);
-		goto err_ioremap;
+		goto err_config;
 	}
 	if (priv->fw.major < TIMB_SUPPORTED_MAJOR ||
 		priv->fw.minor < TIMB_REQUIRED_MINOR) {
@@ -705,13 +705,13 @@
 			"please upgrade the FPGA to at least: %d.%d\n",
 			priv->fw.major, priv->fw.minor,
 			TIMB_SUPPORTED_MAJOR, TIMB_REQUIRED_MINOR);
-		goto err_ioremap;
+		goto err_config;
 	}

 	msix_entries = kzalloc(TIMBERDALE_NR_IRQS * sizeof(*msix_entries),
 		GFP_KERNEL);
 	if (!msix_entries)
-		goto err_ioremap;
+		goto err_config;

 	for (i = 0; i < TIMBERDALE_NR_IRQS; i++)
 		msix_entries[i].entry = i;
@@ -825,6 +825,8 @@
 err_create_file:
 	pci_disable_msix(dev);
 err_msix:
+	kfree(msix_entries);
+err_config:
 	iounmap(priv->ctl_membase);
 err_ioremap:
 	release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE);
@@ -833,7 +835,6 @@
 err_start:
 	pci_disable_device(dev);
 err_enable:
-	kfree(msix_entries);
 	kfree(priv);
 	pci_set_drvdata(dev, NULL);
 	return -ENODEV;


mfd: use shorter set_current_state()

mfd: use shorter set_current_state()

Since this routine declares a separate "tsk" pointer for no other reason than
to call set_task_state(), get rid of it and just invoke set_current_state().

Signed-off-by: Robert P. J. Day <01aa5cd9a29907856ec6ddeebcb643ede4c45b8b@crashcourse.ca>
Cc: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>
Cc: Dmitry Torokhov <10a8c465cefc9bdd6c925e26964d23c90f1141cc@mail.ru>
Cc: Nicolas Pitre <d659c10e27d52b00987b65e85d99bce5480adcae@cam.org>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- drivers/mfd/ucb1x00-ts.c
+++ drivers/mfd/ucb1x00-ts.c
@@ -204,8 +204,7 @@
 static int ucb1x00_thread(void *_ts)
 {
 	struct ucb1x00_ts *ts = _ts;
-	struct task_struct *tsk = current;
-	DECLARE_WAITQUEUE(wait, tsk);
+	DECLARE_WAITQUEUE(wait, current);
 	int valid = 0;

 	set_freezable();
@@ -234,7 +233,7 @@

 		if (ucb1x00_ts_pen_down(ts)) {
-			set_task_state(tsk, TASK_INTERRUPTIBLE);
+			set_current_state(TASK_INTERRUPTIBLE);

 			ucb1x00_enable_irq(ts->ucb, UCB_IRQ_TSPX, machine_is_collie() ? UCB_RISING : UCB_FALLING);
 			ucb1x00_disable(ts->ucb);
@@ -262,7 +261,7 @@
 				valid = 1;
 			}

-			set_task_state(tsk, TASK_INTERRUPTIBLE);
+			set_current_state(TASK_INTERRUPTIBLE);
 			timeout = HZ / 100;
 		}


mmc: sdhci: Remove blank line

mmc: sdhci: Remove blank line

While merging the sdhci patchset from Russell King, somehow a blank
line was left behind. Let's correct the formatting.

Cc: Chris Ball <711c73f64afdce07b7e38039a96d2224209e9a6c@printf.net>
Cc: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>
Signed-off-by: Ulf Hansson <fe47b31f388f85ce6ddf64bf3a0cf6b46077d0e6@linaro.org>


netconsole: enable netconsole can make net_device refcnt incorrent

There is no check if netconsole is enabled current.
so when exec echo 1 > enabled;
the reference of net_device will increment always.

Signed-off-by: Gao feng <7e9c653c8ec3abfdd967a0616fd143ca77e7b405@cn.fujitsu.com>
Acked-by: Flavio Leitner <aad92d04492d3e9d68113c6843d4514145c8ed06@redhat.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/netconsole.c
+++ drivers/net/netconsole.c
@@ -307,6 +307,11 @@
 		return err;
 	if (enabled < 0 || enabled > 1)
 		return -EINVAL;
+	if (enabled == nt->enabled) {
+		printk(KERN_INFO "netconsole: network logging has already %s\n",
+				nt->enabled ? "started" : "stopped");
+		return -EINVAL;
+	}

 	if (enabled) {	/* 1 */


net: phy: micrel: disable NAND-tree for KSZ8021, KSZ8031, KSZ8051, KSZ8081

NAND-tree is used to check wiring between MAC and PHY using NAND gates
on the PHY side, hence the name.

NAND-tree initial status is latched at reset by probing the IRQ pin.
However some devices are sharing the PHY IRQ pin with other peripherals
such as Atmel SAMA5D[34]x-EK boards when using the optional TM7000
display module, therefore they are switching the PHY in NAND-tree test
mode depending on the current IRQ line status at reset.

This patch ensure PHY is not in NAND-tree test mode for all Micrel PHYs
using IRQ line as a NAND-tree toggle mode at reset.

Signed-off-by: Sylvain Rochet <94c8fcb6911ae9a7ae147779ed948a4edf8546ae@finsecur.com>
Signed-off-by: Boris Brezillon <4e91513d4f418754031d3d36b3fc73980c40a38c@free-electrons.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>


Added redrawing on example player resize. #90

--- examples/player_example.c
+++ examples/player_example.c
@@ -206,6 +206,12 @@
   return ret;
 }

+void player_example_display_frame(player_example *player) {
+  SDL_RenderClear(player->renderer);
+  SDL_RenderCopy(player->renderer, player->texture, NULL, NULL);
+  SDL_RenderPresent(player->renderer);
+}
+
 void player_example_handle_event(player_example *player, SDL_Event *event) {
   switch (event->type) {
     case SDL_QUIT: {
@@ -257,11 +263,22 @@
           player->fullscreen = !player->fullscreen;
           SDL_SetWindowFullscreen(player->screen,
               player->fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
+          img_to_rgb(player->texture, &player->img, player->plane_mask);
+          player_example_display_frame(player);
           break;
         }
         default: break;
       }
       break;
+    }
+    case SDL_WINDOWEVENT: {
+      switch (event->window.event) {
+        case SDL_WINDOWEVENT_RESIZED: {
+          player_example_display_frame(player);
+          break;
+        }
+        default: break;
+      }
     }
   }
 }
@@ -401,9 +418,7 @@
           if ((!player->restart) && (!player->done)) {
             wait_to_refresh(&ticks, ms_per_frame);
             img_to_rgb(player->texture, &player->img, player->plane_mask);
-            SDL_RenderClear(player->renderer);
-            SDL_RenderCopy(player->renderer, player->texture, NULL, NULL);
-            SDL_RenderPresent(player->renderer);
+            player_example_display_frame(player);
           }
           break;
         }


add NAPI support to sb1250-mac.c

add NAPI support to sb1250-mac.c

Patch to add NAPI support to sb1250-mac.c (rev 2).  This patch differs from
the last in that the NAPI support isn't marked as experimental, nor is it
configurable (ie.  once applied - NAPI is enabled all the time).  This was
based on feedback from Ralf and others.

Signed-off-by: Mark Mason <dfb59f0c8ff950313b5e348b016c8434aeb441c7@broadcom.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>

--- drivers/net/sb1250-mac.c
+++ drivers/net/sb1250-mac.c
@@ -95,19 +95,28 @@
 #endif

 #ifdef CONFIG_SBMAC_COALESCE
-static int int_pktcnt = 0;
-module_param(int_pktcnt, int, S_IRUGO);
-MODULE_PARM_DESC(int_pktcnt, "Packet count");
-
-static int int_timeout = 0;
-module_param(int_timeout, int, S_IRUGO);
-MODULE_PARM_DESC(int_timeout, "Timeout value");
+static int int_pktcnt_tx = 255;
+module_param(int_pktcnt_tx, int, S_IRUGO);
+MODULE_PARM_DESC(int_pktcnt_tx, "TX packet count");
+
+static int int_timeout_tx = 255;
+module_param(int_timeout_tx, int, S_IRUGO);
+MODULE_PARM_DESC(int_timeout_tx, "TX timeout value");
+
+static int int_pktcnt_rx = 64;
+module_param(int_pktcnt_rx, int, S_IRUGO);
+MODULE_PARM_DESC(int_pktcnt_rx, "RX packet count");
+
+static int int_timeout_rx = 64;
+module_param(int_timeout_rx, int, S_IRUGO);
+MODULE_PARM_DESC(int_timeout_rx, "RX timeout value");
 #endif

 #include <asm/sibyte/sb1250.h>
 #if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
 #include <asm/sibyte/bcm1480_regs.h>
 #include <asm/sibyte/bcm1480_int.h>
+#define R_MAC_DMA_OODPKTLOST_RX	R_MAC_DMA_OODPKTLOST
 #elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
 #include <asm/sibyte/sb1250_regs.h>
 #include <asm/sibyte/sb1250_int.h>
@@ -155,8 +164,8 @@

 #define NUMCACHEBLKS(x) (((x)+SMP_CACHE_BYTES-1)/SMP_CACHE_BYTES)

-#define SBMAC_MAX_TXDESCR	32
-#define SBMAC_MAX_RXDESCR	32
+#define SBMAC_MAX_TXDESCR	256
+#define SBMAC_MAX_RXDESCR	256

 #define ETHER_ALIGN	2
 #define ETHER_ADDR_LEN	6
@@ -185,10 +194,10 @@
 	 * associated with it.
 	 */

-	struct sbmac_softc *sbdma_eth;	        /* back pointer to associated MAC */
-	int              sbdma_channel;	/* channel number */
+	struct sbmac_softc *sbdma_eth;	    /* back pointer to associated MAC */
+	int              sbdma_channel;	    /* channel number */
 	int		 sbdma_txdir;       /* direction (1=transmit) */
-	int		 sbdma_maxdescr;	/* total # of descriptors in ring */
+	int		 sbdma_maxdescr;    /* total # of descriptors in ring */
 #ifdef CONFIG_SBMAC_COALESCE
 	int		 sbdma_int_pktcnt;  /* # descriptors rx/tx before interrupt*/
 	int		 sbdma_int_timeout; /* # usec rx/tx interrupt */
@@ -197,13 +206,16 @@
 	volatile void __iomem *sbdma_config0;	/* DMA config register 0 */
 	volatile void __iomem *sbdma_config1;	/* DMA config register 1 */
 	volatile void __iomem *sbdma_dscrbase;	/* Descriptor base address */
-	volatile void __iomem *sbdma_dscrcnt;     /* Descriptor count register */
+	volatile void __iomem *sbdma_dscrcnt;   /* Descriptor count register */
 	volatile void __iomem *sbdma_curdscr;	/* current descriptor address */
+	volatile void __iomem *sbdma_oodpktlost;/* pkt drop (rx only) */
+

 	/*
 	 * This stuff is for maintenance of the ring
 	 */

+	sbdmadscr_t     *sbdma_dscrtable_unaligned;
 	sbdmadscr_t     *sbdma_dscrtable;	/* base of descriptor table */
 	sbdmadscr_t     *sbdma_dscrtable_end; /* end of descriptor table */

@@ -286,8 +298,8 @@
 static int sbdma_add_txbuffer(sbmacdma_t *d,struct sk_buff *m);
 static void sbdma_emptyring(sbmacdma_t *d);
 static void sbdma_fillring(sbmacdma_t *d);
-static void sbdma_rx_process(struct sbmac_softc *sc,sbmacdma_t *d);
-static void sbdma_tx_process(struct sbmac_softc *sc,sbmacdma_t *d);
+static int sbdma_rx_process(struct sbmac_softc *sc,sbmacdma_t *d, int work_to_do, int poll);
+static void sbdma_tx_process(struct sbmac_softc *sc,sbmacdma_t *d, int poll);
 static int sbmac_initctx(struct sbmac_softc *s);
 static void sbmac_channel_start(struct sbmac_softc *s);
 static void sbmac_channel_stop(struct sbmac_softc *s);
@@ -308,6 +320,8 @@
 static void sbmac_set_rx_mode(struct net_device *dev);
 static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static int sbmac_close(struct net_device *dev);
+static int sbmac_poll(struct net_device *poll_dev, int *budget);
+
 static int sbmac_mii_poll(struct sbmac_softc *s,int noisy);
 static int sbmac_mii_probe(struct net_device *dev);

@@ -679,6 +693,10 @@
 			  int txrx,
 			  int maxdescr)
 {
+#ifdef CONFIG_SBMAC_COALESCE
+	int int_pktcnt, int_timeout;
+#endif
+
 	/*
 	 * Save away interesting stuff in the structure
 	 */
@@ -728,6 +746,11 @@
 		s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_DSCR_CNT);
 	d->sbdma_curdscr =
 		s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_CUR_DSCRADDR);
+	if (d->sbdma_txdir)
+		d->sbdma_oodpktlost = NULL;
+	else
+		d->sbdma_oodpktlost =
+			s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_OODPKTLOST_RX);

 	/*
 	 * Allocate memory for the ring
@@ -735,6 +758,7 @@

 	d->sbdma_maxdescr = maxdescr;

+	d->sbdma_dscrtable_unaligned =
 	d->sbdma_dscrtable = (sbdmadscr_t *)
 		kmalloc((d->sbdma_maxdescr+1)*sizeof(sbdmadscr_t), GFP_KERNEL);

@@ -765,12 +789,14 @@
 	 * Setup Rx/Tx DMA coalescing defaults
 	 */

+	int_pktcnt = (txrx == DMA_TX) ? int_pktcnt_tx : int_pktcnt_rx;
 	if ( int_pktcnt ) {
 		d->sbdma_int_pktcnt = int_pktcnt;
 	} else {
 		d->sbdma_int_pktcnt = 1;
 	}

+	int_timeout = (txrx == DMA_TX) ? int_timeout_tx : int_timeout_rx;
 	if ( int_timeout ) {
 		d->sbdma_int_timeout = int_timeout;
 	} else {
@@ -1147,28 +1173,199 @@
 #endif

 /**********************************************************************
- *  SBDMA_RX_PROCESS(sc,d)
+ *  SBDMA_RX_PROCESS(sc,d,work_to_do,poll)
  *
  *  Process "completed" receive buffers on the specified DMA channel.
- *  Note that this isn't really ideal for priority channels, since
- *  it processes all of the packets on a given channel before
- *  returning.
  *
  *  Input parameters:
- *	   sc - softc structure
- *  	   d - DMA channel context
+ *            sc - softc structure
+ *  	       d - DMA channel context
+ *    work_to_do - no. of packets to process before enabling interrupt
+ *                 again (for NAPI)
+ *          poll - 1: using polling (for NAPI)
  *
  *  Return value:
  *  	   nothing
  ********************************************************************* */

-static void sbdma_rx_process(struct sbmac_softc *sc,sbmacdma_t *d)
+static int sbdma_rx_process(struct sbmac_softc *sc,sbmacdma_t *d,
+                             int work_to_do, int poll)
 {
 	int curidx;
 	int hwidx;
 	sbdmadscr_t *dsc;
 	struct sk_buff *sb;
 	int len;
+	int work_done = 0;
+	int dropped = 0;
+
+	prefetch(d);
+
+again:
+	/* Check if the HW dropped any frames */
+	sc->sbm_stats.rx_fifo_errors
+	    += __raw_readq(sc->sbm_rxdma.sbdma_oodpktlost) & 0xffff;
+	__raw_writeq(0, sc->sbm_rxdma.sbdma_oodpktlost);
+
+	while (work_to_do-- > 0) {
+		/*
+		 * figure out where we are (as an index) and where
+		 * the hardware is (also as an index)
+		 *
+		 * This could be done faster if (for example) the
+		 * descriptor table was page-aligned and contiguous in
+		 * both virtual and physical memory -- you could then
+		 * just compare the low-order bits of the virtual address
+		 * (sbdma_remptr) and the physical address (sbdma_curdscr CSR)
+		 */
+
+		dsc = d->sbdma_remptr;
+		curidx = dsc - d->sbdma_dscrtable;
+
+		prefetch(dsc);
+		prefetch(&d->sbdma_ctxtable[curidx]);
+
+		hwidx = (int) (((__raw_readq(d->sbdma_curdscr) & M_DMA_CURDSCR_ADDR) -
+				d->sbdma_dscrtable_phys) / sizeof(sbdmadscr_t));
+
+		/*
+		 * If they're the same, that means we've processed all
+		 * of the descriptors up to (but not including) the one that
+		 * the hardware is working on right now.
+		 */
+
+		if (curidx == hwidx)
+			goto done;
+
+		/*
+		 * Otherwise, get the packet's sk_buff ptr back
+		 */
+
+		sb = d->sbdma_ctxtable[curidx];
+		d->sbdma_ctxtable[curidx] = NULL;
+
+		len = (int)G_DMA_DSCRB_PKT_SIZE(dsc->dscr_b) - 4;
+
+		/*
+		 * Check packet status.  If good, process it.
+		 * If not, silently drop it and put it back on the
+		 * receive ring.
+		 */
+
+		if (likely (!(dsc->dscr_a & M_DMA_ETHRX_BAD))) {
+
+			/*
+			 * Add a new buffer to replace the old one.  If we fail
+			 * to allocate a buffer, we're going to drop this
+			 * packet and put it right back on the receive ring.
+			 */
+
+			if (unlikely (sbdma_add_rcvbuffer(d,NULL) ==
+				      -ENOBUFS)) {
+ 				sc->sbm_stats.rx_dropped++;
+				sbdma_add_rcvbuffer(d,sb); /* re-add old buffer */
+				/* No point in continuing at the moment */
+				printk(KERN_ERR "dropped packet (1)\n");
+				d->sbdma_remptr = SBDMA_NEXTBUF(d,sbdma_remptr);
+				goto done;
+			} else {
+				/*
+				 * Set length into the packet
+				 */
+				skb_put(sb,len);
+
+				/*
+				 * Buffer has been replaced on the
+				 * receive ring.  Pass the buffer to
+				 * the kernel
+				 */
+				sb->protocol = eth_type_trans(sb,d->sbdma_eth->sbm_dev);
+				/* Check hw IPv4/TCP checksum if supported */
+				if (sc->rx_hw_checksum == ENABLE) {
+					if (!((dsc->dscr_a) & M_DMA_ETHRX_BADIP4CS) &&
+					    !((dsc->dscr_a) & M_DMA_ETHRX_BADTCPCS)) {
+						sb->ip_summed = CHECKSUM_UNNECESSARY;
+						/* don't need to set sb->csum */
+					} else {
+						sb->ip_summed = CHECKSUM_NONE;
+					}
+				}
+				prefetch(sb->data);
+				prefetch((const void *)(((char *)sb->data)+32));
+				if (poll)
+					dropped = netif_receive_skb(sb);
+				else
+					dropped = netif_rx(sb);
+
+				if (dropped == NET_RX_DROP) {
+					sc->sbm_stats.rx_dropped++;
+					d->sbdma_remptr = SBDMA_NEXTBUF(d,sbdma_remptr);
+					goto done;
+				}
+				else {
+					sc->sbm_stats.rx_bytes += len;
+					sc->sbm_stats.rx_packets++;
+				}
+			}
+		} else {
+			/*
+			 * Packet was mangled somehow.  Just drop it and
+			 * put it back on the receive ring.
+			 */
+			sc->sbm_stats.rx_errors++;
+			sbdma_add_rcvbuffer(d,sb);
+		}
+
+
+		/*
+		 * .. and advance to the next buffer.
+		 */
+
+		d->sbdma_remptr = SBDMA_NEXTBUF(d,sbdma_remptr);
+		work_done++;
+	}
+	if (!poll) {
+		work_to_do = 32;
+		goto again; /* collect fifo drop statistics again */
+	}
+done:
+	return work_done;
+}
+
+/**********************************************************************
+ *  SBDMA_TX_PROCESS(sc,d)
+ *
+ *  Process "completed" transmit buffers on the specified DMA channel.
+ *  This is normally called within the interrupt service routine.
+ *  Note that this isn't really ideal for priority channels, since
+ *  it processes all of the packets on a given channel before
+ *  returning.
+ *
+ *  Input parameters:
+ *      sc - softc structure
+ *  	 d - DMA channel context
+ *    poll - 1: using polling (for NAPI)
+ *
+ *  Return value:
+ *  	   nothing
+ ********************************************************************* */
+
+static void sbdma_tx_process(struct sbmac_softc *sc,sbmacdma_t *d, int poll)
+{
+	int curidx;
+	int hwidx;
+	sbdmadscr_t *dsc;
+	struct sk_buff *sb;
+	unsigned long flags;
+	int packets_handled = 0;
+
+	spin_lock_irqsave(&(sc->sbm_lock), flags);
+
+	if (d->sbdma_remptr == d->sbdma_addptr)
+	  goto end_unlock;
+
+	hwidx = (int) (((__raw_readq(d->sbdma_curdscr) & M_DMA_CURDSCR_ADDR) -
+			d->sbdma_dscrtable_phys) / sizeof(sbdmadscr_t));

 	for (;;) {
 		/*
@@ -1183,8 +1380,6 @@
 		 */

 		curidx = d->sbdma_remptr - d->sbdma_dscrtable;
-		hwidx = (int) (((__raw_readq(d->sbdma_curdscr) & M_DMA_CURDSCR_ADDR) -
-				d->sbdma_dscrtable_phys) / sizeof(sbdmadscr_t));

 		/*
 		 * If they're the same, that means we've processed all
@@ -1203,61 +1398,18 @@
 		sb = d->sbdma_ctxtable[curidx];
 		d->sbdma_ctxtable[curidx] = NULL;

-		len = (int)G_DMA_DSCRB_PKT_SIZE(dsc->dscr_b) - 4;
-
 		/*
-		 * Check packet status.  If good, process it.
-		 * If not, silently drop it and put it back on the
-		 * receive ring.
+		 * Stats
 		 */

-		if (!(dsc->dscr_a & M_DMA_ETHRX_BAD)) {
-
-			/*
-			 * Add a new buffer to replace the old one.  If we fail
-			 * to allocate a buffer, we're going to drop this
-			 * packet and put it right back on the receive ring.
-			 */
-
-			if (sbdma_add_rcvbuffer(d,NULL) == -ENOBUFS) {
-				sc->sbm_stats.rx_dropped++;
-				sbdma_add_rcvbuffer(d,sb); /* re-add old buffer */
-			} else {
-				/*
-				 * Set length into the packet
-				 */
-				skb_put(sb,len);
-
-				/*
-				 * Buffer has been replaced on the
-				 * receive ring.  Pass the buffer to
-				 * the kernel
-				 */
-				sc->sbm_stats.rx_bytes += len;
-				sc->sbm_stats.rx_packets++;
-				sb->protocol = eth_type_trans(sb,d->sbdma_eth->sbm_dev);
-				/* Check hw IPv4/TCP checksum if supported */
-				if (sc->rx_hw_checksum == ENABLE) {
-					if (!((dsc->dscr_a) & M_DMA_ETHRX_BADIP4CS) &&
-					    !((dsc->dscr_a) & M_DMA_ETHRX_BADTCPCS)) {
-						sb->ip_summed = CHECKSUM_UNNECESSARY;
-						/* don't need to set sb->csum */
-					} else {
-						sb->ip_summed = CHECKSUM_NONE;
-					}
-				}
-
-				netif_rx(sb);
-			}
-		} else {
-			/*
-			 * Packet was mangled somehow.  Just drop it and
-			 * put it back on the receive ring.
-			 */
-			sc->sbm_stats.rx_errors++;
-			sbdma_add_rcvbuffer(d,sb);
-		}
-
+		sc->sbm_stats.tx_bytes += sb->len;
+		sc->sbm_stats.tx_packets++;
+
+		/*
+		 * for transmits, we just free buffers.
+		 */
+
+		dev_kfree_skb_irq(sb);

 		/*
 		 * .. and advance to the next buffer.
@@ -1265,89 +1417,7 @@

 		d->sbdma_remptr = SBDMA_NEXTBUF(d,sbdma_remptr);

-	}
-}
-
-
-
-/**********************************************************************
- *  SBDMA_TX_PROCESS(sc,d)
- *
- *  Process "completed" transmit buffers on the specified DMA channel.
- *  This is normally called within the interrupt service routine.
- *  Note that this isn't really ideal for priority channels, since
- *  it processes all of the packets on a given channel before
- *  returning.
- *
- *  Input parameters:
- *      sc - softc structure
- *  	   d - DMA channel context
- *
- *  Return value:
- *  	   nothing
- ********************************************************************* */
-
-static void sbdma_tx_process(struct sbmac_softc *sc,sbmacdma_t *d)
-{
-	int curidx;
-	int hwidx;
-	sbdmadscr_t *dsc;
-	struct sk_buff *sb;
-	unsigned long flags;
-
-	spin_lock_irqsave(&(sc->sbm_lock), flags);
-
-	for (;;) {
-		/*
-		 * figure out where we are (as an index) and where
-		 * the hardware is (also as an index)
-		 *
-		 * This could be done faster if (for example) the
-		 * descriptor table was page-aligned and contiguous in
-		 * both virtual and physical memory -- you could then
-		 * just compare the low-order bits of the virtual address
-		 * (sbdma_remptr) and the physical address (sbdma_curdscr CSR)
-		 */
-
-		curidx = d->sbdma_remptr - d->sbdma_dscrtable;
-		hwidx = (int) (((__raw_readq(d->sbdma_curdscr) & M_DMA_CURDSCR_ADDR) -
-				d->sbdma_dscrtable_phys) / sizeof(sbdmadscr_t));
-
-		/*
-		 * If they're the same, that means we've processed all
-		 * of the descriptors up to (but not including) the one that
-		 * the hardware is working on right now.
-		 */
-
-		if (curidx == hwidx)
-			break;
-
-		/*
-		 * Otherwise, get the packet's sk_buff ptr back
-		 */
-
-		dsc = &(d->sbdma_dscrtable[curidx]);
-		sb = d->sbdma_ctxtable[curidx];
-		d->sbdma_ctxtable[curidx] = NULL;
-
-		/*
-		 * Stats
-		 */
-
-		sc->sbm_stats.tx_bytes += sb->len;
-		sc->sbm_stats.tx_packets++;
-
-		/*
-		 * for transmits, we just free buffers.
-		 */
-
-		dev_kfree_skb_irq(sb);
-
-		/*
-		 * .. and advance to the next buffer.
-		 */
-
-		d->sbdma_remptr = SBDMA_NEXTBUF(d,sbdma_remptr);
+		packets_handled++;

 	}

@@ -1357,8 +1427,10 @@
 	 * watermark on the transmit queue.
 	 */

-	netif_wake_queue(d->sbdma_eth->sbm_dev);
-
+	if (packets_handled)
+		netif_wake_queue(d->sbdma_eth->sbm_dev);
+
+end_unlock:
 	spin_unlock_irqrestore(&(sc->sbm_lock), flags);

 }
@@ -1432,9 +1504,9 @@

 static void sbdma_uninitctx(struct sbmacdma_s *d)
 {
-	if (d->sbdma_dscrtable) {
-		kfree(d->sbdma_dscrtable);
-		d->sbdma_dscrtable = NULL;
+	if (d->sbdma_dscrtable_unaligned) {
+		kfree(d->sbdma_dscrtable_unaligned);
+		d->sbdma_dscrtable_unaligned = d->sbdma_dscrtable = NULL;
 	}

 	if (d->sbdma_ctxtable) {
@@ -1632,15 +1704,9 @@
 #endif

 #ifdef CONFIG_SBMAC_COALESCE
-	/*
-	 * Accept any TX interrupt and EOP count/timer RX interrupts on ch 0
-	 */
 	__raw_writeq(((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_TX_CH0) |
 		       ((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_RX_CH0), s->sbm_imr);
 #else
-	/*
-	 * Accept any kind of interrupt on TX and RX DMA channel 0
-	 */
 	__raw_writeq((M_MAC_INT_CHANNEL << S_MAC_TX_CH0) |
 		       (M_MAC_INT_CHANNEL << S_MAC_RX_CH0), s->sbm_imr);
 #endif
@@ -2073,56 +2139,45 @@
 	uint64_t isr;
 	int handled = 0;

-	for (;;) {
-
-		/*
-		 * Read the ISR (this clears the bits in the real
-		 * register, except for counter addr)
-		 */
-
-		isr = __raw_readq(sc->sbm_isr) & ~M_MAC_COUNTER_ADDR;
-
-		if (isr == 0)
-			break;
-
-		handled = 1;
-
-		/*
-		 * Transmits on channel 0
-		 */
-
-		if (isr & (M_MAC_INT_CHANNEL << S_MAC_TX_CH0)) {
-			sbdma_tx_process(sc,&(sc->sbm_txdma));
+	/*
+	 * Read the ISR (this clears the bits in the real
+	 * register, except for counter addr)
+	 */
+
+	isr = __raw_readq(sc->sbm_isr) & ~M_MAC_COUNTER_ADDR;
+
+	if (isr == 0)
+		return IRQ_RETVAL(0);
+	handled = 1;
+
+	/*
+	 * Transmits on channel 0
+	 */
+
+	if (isr & (M_MAC_INT_CHANNEL << S_MAC_TX_CH0)) {
+		sbdma_tx_process(sc,&(sc->sbm_txdma), 0);
+#ifdef CONFIG_NETPOLL_TRAP
+		if (netpoll_trap()) {
+			if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
+				__netif_schedule(dev);
 		}
-
-		/*
-		 * Receives on channel 0
-		 */
-
-		/*
-		 * It's important to test all the bits (or at least the
-		 * EOP_SEEN bit) when deciding to do the RX process
-		 * particularly when coalescing, to make sure we
-		 * take care of the following:
-		 *
-		 * If you have some packets waiting (have been received
-		 * but no interrupt) and get a TX interrupt before
-		 * the RX timer or counter expires, reading the ISR
-		 * above will clear the timer and counter, and you
-		 * won't get another interrupt until a packet shows
-		 * up to start the timer again.  Testing
-		 * EOP_SEEN here takes care of this case.
-		 * (EOP_SEEN is part of M_MAC_INT_CHANNEL << S_MAC_RX_CH0)
-		 */
-
-
-		if (isr & (M_MAC_INT_CHANNEL << S_MAC_RX_CH0)) {
-			sbdma_rx_process(sc,&(sc->sbm_rxdma));
+#endif
+	}
+
+	if (isr & (M_MAC_INT_CHANNEL << S_MAC_RX_CH0)) {
+		if (netif_rx_schedule_prep(dev)) {
+			__raw_writeq(0, sc->sbm_imr);
+			__netif_rx_schedule(dev);
+			/* Depend on the exit from poll to reenable intr */
 		}
+		else {
+			/* may leave some packets behind */
+			sbdma_rx_process(sc,&(sc->sbm_rxdma),
+					 SBMAC_MAX_RXDESCR * 2, 0);
+		}
 	}
 	return IRQ_RETVAL(handled);
 }
-

 /**********************************************************************
  *  SBMAC_START_TX(skb,dev)
@@ -2252,8 +2307,6 @@
 		__raw_writeq(reg, sc->sbm_rxfilter);
 	}
 }
-
-

 #if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR) || defined(SBMAC_ETH3_HWADDR)
 /**********************************************************************
@@ -2417,6 +2470,8 @@
 	dev->do_ioctl           = sbmac_mii_ioctl;
 	dev->tx_timeout         = sbmac_tx_timeout;
 	dev->watchdog_timeo     = TX_TIMEOUT;
+	dev->poll               = sbmac_poll;
+	dev->weight             = 16;

 	dev->change_mtu         = sb1250_change_mtu;
 #ifdef CONFIG_NET_POLL_CONTROLLER
@@ -2819,7 +2874,39 @@
 	return 0;
 }

-
+static int sbmac_poll(struct net_device *dev, int *budget)
+{
+	int work_to_do;
+	int work_done;
+	struct sbmac_softc *sc = netdev_priv(dev);
+
+	work_to_do = min(*budget, dev->quota);
+	work_done = sbdma_rx_process(sc, &(sc->sbm_rxdma), work_to_do, 1);
+
+	if (work_done > work_to_do)
+		printk(KERN_ERR "%s exceeded work_to_do budget=%d quota=%d work-done=%d\n",
+		       sc->sbm_dev->name, *budget, dev->quota, work_done);
+
+	sbdma_tx_process(sc, &(sc->sbm_txdma), 1);
+
+	*budget -= work_done;
+	dev->quota -= work_done;
+
+	if (work_done < work_to_do) {
+		netif_rx_complete(dev);
+
+#ifdef CONFIG_SBMAC_COALESCE
+		__raw_writeq(((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_TX_CH0) |
+			     ((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_RX_CH0),
+			     sc->sbm_imr);
+#else
+		__raw_writeq((M_MAC_INT_CHANNEL << S_MAC_TX_CH0) |
+			     (M_MAC_INT_CHANNEL << S_MAC_RX_CH0), sc->sbm_imr);
+#endif
+	}
+
+	return (work_done >= work_to_do);
+}

 #if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR) || defined(SBMAC_ETH3_HWADDR)
 static void
@@ -2906,7 +2993,7 @@

 		/*
 		 * The R_MAC_ETHERNET_ADDR register will be set to some nonzero
-		 * value for us by the firmware if we're going to use this MAC.
+		 * value for us by the firmware if we are going to use this MAC.
 		 * If we find a zero, skip this MAC.
 		 */


Remove bogus DECREF of self. Change __str__() functions to METH_O. Change WindowsError__str__ to use PyTuple_Pack.

--- Python/exceptions.c
+++ Python/exceptions.c
@@ -226,12 +226,9 @@

 static PyObject *
-BaseException__str__(PyObject *self, PyObject *args)
-{
-    PyObject *out;
-
-    if (!PyArg_ParseTuple(args, "O:__str__", &self))
-        return NULL;
+BaseException__str__(PyObject *_self, PyObject *self)
+{
+    PyObject *out, *args;

     args = PyObject_GetAttrString(self, "args");
     if (!args)
@@ -379,7 +376,7 @@
     /* methods for the BaseException class */
     {"__getitem__", BaseException__getitem__, METH_VARARGS},
     {"__repr__", BaseException__repr__, METH_VARARGS},
-    {"__str__",     BaseException__str__, METH_VARARGS},
+    {"__str__",     BaseException__str__, METH_O},
 #ifdef Py_USING_UNICODE
     {"__unicode__",  BaseException__unicode__, METH_VARARGS},
 #endif /* Py_USING_UNICODE */
@@ -624,16 +621,12 @@

 static PyObject *
-EnvironmentError__str__(PyObject *self, PyObject *args)
-{
-    PyObject *originalself = self;
+EnvironmentError__str__(PyObject *originalself, PyObject *self)
+{
     PyObject *filename;
     PyObject *serrno;
     PyObject *strerror;
     PyObject *rtnval = NULL;
-
-    if (!PyArg_ParseTuple(args, "O:__str__", &self))
-	return NULL;

     filename = PyObject_GetAttrString(self, "filename");
     serrno = PyObject_GetAttrString(self, "errno");
@@ -694,7 +687,7 @@
 	 * but there is no StandardError__str__() function; we happen to
 	 * know that's just a pass through to BaseException__str__().
 	 */
-	rtnval = BaseException__str__(originalself, args);
+	rtnval = BaseException__str__(originalself, self);

   finally:
     Py_XDECREF(filename);
@@ -707,7 +700,7 @@
 static
 PyMethodDef EnvironmentError_methods[] = {
     {"__init__", EnvironmentError__init__, METH_VARARGS},
-    {"__str__",  EnvironmentError__str__, METH_VARARGS},
+    {"__str__",  EnvironmentError__str__, METH_O},
     {NULL, NULL}
 };

@@ -753,22 +746,20 @@
 failed:
 	/* Could not set errno. */
 	Py_XDECREF(o_errcode);
-	Py_DECREF(self);
 	Py_DECREF(result);
 	return NULL;
 }

 static PyObject *
-WindowsError__str__(PyObject *self, PyObject *args)
-{
-    PyObject *originalself = self;
+WindowsError__str__(PyObject *originalself, PyObject *self)
+{
     PyObject *filename;
     PyObject *serrno;
     PyObject *strerror;
+    PyObject *repr = NULL;
+    PyObject *fmt = NULL;
+    PyObject *tuple = NULL;
     PyObject *rtnval = NULL;
-
-    if (!PyArg_ParseTuple(args, "O:__str__", &self))
-	return NULL;

     filename = PyObject_GetAttrString(self, "filename");
     serrno = PyObject_GetAttrString(self, "winerror");
@@ -777,64 +768,46 @@
 	goto finally;

     if (filename != Py_None) {
-	PyObject *fmt = PyString_FromString("[Error %s] %s: %s");
-	PyObject *repr = PyObject_Repr(filename);
-	PyObject *tuple = PyTuple_New(3);
-
-	if (!fmt || !repr || !tuple) {
-	    Py_XDECREF(fmt);
-	    Py_XDECREF(repr);
-	    Py_XDECREF(tuple);
+	fmt = PyString_FromString("[Error %s] %s: %s");
+	repr = PyObject_Repr(filename);
+	if (!fmt || !repr)
 	    goto finally;
-	}
-
-	PyTuple_SET_ITEM(tuple, 0, serrno);
-	PyTuple_SET_ITEM(tuple, 1, strerror);
-	PyTuple_SET_ITEM(tuple, 2, repr);
+
+
+	tuple = PyTuple_Pack(3, serrno, strerror, repr);
+	if (!tuple)
+	    goto finally;

 	rtnval = PyString_Format(fmt, tuple);
-
-	Py_DECREF(fmt);
-	Py_DECREF(tuple);
-	/* already freed because tuple owned only reference */
-	serrno = NULL;
-	strerror = NULL;
     }
     else if (PyObject_IsTrue(serrno) && PyObject_IsTrue(strerror)) {
-	PyObject *fmt = PyString_FromString("[Error %s] %s");
-	PyObject *tuple = PyTuple_New(2);
-
-	if (!fmt || !tuple) {
-	    Py_XDECREF(fmt);
-	    Py_XDECREF(tuple);
+	fmt = PyString_FromString("[Error %s] %s");
+	if (!fmt)
 	    goto finally;
-	}
-
-	PyTuple_SET_ITEM(tuple, 0, serrno);
-	PyTuple_SET_ITEM(tuple, 1, strerror);
+
+	tuple = PyTuple_Pack(2, serrno, strerror);
+	if (!tuple)
+	    goto finally;

 	rtnval = PyString_Format(fmt, tuple);
-
-	Py_DECREF(fmt);
-	Py_DECREF(tuple);
-	/* already freed because tuple owned only reference */
-	serrno = NULL;
-	strerror = NULL;
     }
     else
-	rtnval = EnvironmentError__str__(originalself, args);
+	rtnval = EnvironmentError__str__(originalself, self);

   finally:
     Py_XDECREF(filename);
     Py_XDECREF(serrno);
     Py_XDECREF(strerror);
+    Py_XDECREF(repr);
+    Py_XDECREF(fmt);
+    Py_XDECREF(tuple);
     return rtnval;
 }

 static
 PyMethodDef WindowsError_methods[] = {
     {"__init__", WindowsError__init__, METH_VARARGS},
-    {"__str__", WindowsError__str__, METH_VARARGS},
+    {"__str__", WindowsError__str__, METH_O},
     {NULL, NULL}
 };
 #endif /* MS_WINDOWS */
@@ -980,14 +953,11 @@

 static PyObject *
-SyntaxError__str__(PyObject *self, PyObject *args)
+SyntaxError__str__(PyObject *_self, PyObject *self)
 {
     PyObject *msg;
     PyObject *str;
     PyObject *filename, *lineno, *result;
-
-    if (!PyArg_ParseTuple(args, "O:__str__", &self))
-	return NULL;

     if (!(msg = PyObject_GetAttrString(self, "msg")))
 	return NULL;
@@ -1053,19 +1023,16 @@

 static PyMethodDef SyntaxError_methods[] = {
     {"__init__", SyntaxError__init__, METH_VARARGS},
-    {"__str__",  SyntaxError__str__, METH_VARARGS},
+    {"__str__",  SyntaxError__str__, METH_O},
     {NULL, NULL}
 };

 static PyObject *
-KeyError__str__(PyObject *self, PyObject *args)
+KeyError__str__(PyObject *_self, PyObject *self)
 {
     PyObject *argsattr;
     PyObject *result;
-
-    if (!PyArg_ParseTuple(args, "O:__str__", &self))
-	return NULL;

     argsattr = PyObject_GetAttrString(self, "args");
     if (!argsattr)
@@ -1085,14 +1052,14 @@
 	result = PyObject_Repr(key);
     }
     else
-	result = BaseException__str__(self, args);
+	result = BaseException__str__(_self, self);

     Py_DECREF(argsattr);
     return result;
 }

 static PyMethodDef KeyError_methods[] = {
-    {"__str__",  KeyError__str__, METH_VARARGS},
+    {"__str__",  KeyError__str__, METH_O},
     {NULL, NULL}
 };


Limit the length of a produced tag to 64 bytes. Tags exceeding 64 bytes in length are truncated with an elipses (3 consecutive '.' characters).

--- engine/core_actions.c
+++ engine/core_actions.c
@@ -616,6 +616,12 @@
                 tx->mm,
                 tx->var_store
             );
+
+            /* If the expanded tag size is too long, truncate it with an elipses. */
+            if (expanded_tag_sz > 64) {
+                strcpy((char *)(expanded_tag + 61), "...");
+                expanded_tag_sz = 64;
+            }

             /* Null terminates the expanded string. */
             tag = ib_mm_memdup_to_str(tx->mm, expanded_tag, expanded_tag_sz);


[PATCH] powerpc/cell spidernet reduce DMA kicking

The current code attempts to start the TX dma every time a packet
is queued. This is too conservative, and wastes CPU time. This
patch changes behaviour to call the kick-dma function less often,
only when the tx queue is at risk of emptying.

This reduces cpu usage, improves performance.

Signed-off-by: Linas Vepstas <ba5b7161287ad232d67ab9ebf53b27130547a421@austin.ibm.com>
Cc: James K Lewis <7b5df93f3e1d4983159f9c25b509a5017a16a078@us.ibm.com>
Cc: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
Signed-off-by: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>

--- drivers/net/spider_net.c
+++ drivers/net/spider_net.c
@@ -698,7 +698,7 @@
 	return 0;
 }

-static void
+static int
 spider_net_set_low_watermark(struct spider_net_card *card)
 {
 	unsigned long flags;
@@ -719,7 +719,7 @@

 	/* If TX queue is short, don't even bother with interrupts */
 	if (cnt < card->tx_desc/4)
-		return;
+		return cnt;

 	/* Set low-watermark 3/4th's of the way into the queue. */
 	descr = card->tx_chain.tail;
@@ -735,6 +735,7 @@
 		     card->low_watermark->dmac_cmd_status & ~SPIDER_NET_DESCR_TXDESFLG;
 	card->low_watermark = descr;
 	spin_unlock_irqrestore(&card->tx_chain.lock, flags);
+	return cnt;
 }

 /**
@@ -819,8 +820,12 @@
  * @card: card structure
  * @descr: descriptor address to enable TX processing at
  *
- * spider_net_kick_tx_dma writes the current tx chain head as start address
- * of the tx descriptor chain and enables the transmission DMA engine
+ * This routine will start the transmit DMA running if
+ * it is not already running. This routine ned only be
+ * called when queueing a new packet to an empty tx queue.
+ * Writes the current tx chain head as start address
+ * of the tx descriptor chain and enables the transmission
+ * DMA engine.
  */
 static inline void
 spider_net_kick_tx_dma(struct spider_net_card *card)
@@ -860,6 +865,7 @@
 static int
 spider_net_xmit(struct sk_buff *skb, struct net_device *netdev)
 {
+	int cnt;
 	struct spider_net_card *card = netdev_priv(netdev);
 	struct spider_net_descr_chain *chain = &card->tx_chain;

@@ -873,8 +879,9 @@
 		return NETDEV_TX_BUSY;
 	}

-	spider_net_set_low_watermark(card);
-	spider_net_kick_tx_dma(card);
+	cnt = spider_net_set_low_watermark(card);
+	if (cnt < 5)
+		spider_net_kick_tx_dma(card);
 	return NETDEV_TX_OK;
 }


[tcp_transport] - Change log level on socket reading timeout

- Log level set to VERBOSE to reduce noise on debug.

--- components/tcp_transport/transport_ssl.c
+++ components/tcp_transport/transport_ssl.c
@@ -169,7 +169,7 @@
         ESP_LOGE(TAG, "poll_read select error %d, errno = %s, fd = %d", sock_errno, strerror(sock_errno), ssl->sockfd);
         ret = -1;
     } else if (ret == 0) {
-        ESP_LOGD(TAG, "poll_read: select - Timeout before any socket was ready!");
+        ESP_LOGV(TAG, "poll_read: select - Timeout before any socket was ready!");
     }
     return ret;
 }


zaurus: Add ID for C-750/C-760/C-860/SL-C3000 PDA in MDLM mode

In 16adf5d07987d93675945f3cecf0e33706566005 I removed an over-broad
alias that caused zaurus.ko to bind to unrelated devices.
I had a report that at least one valid case no longer auto-loads because of this.
This patch adds an ID for that case.

Reported-by: Raphael Wimmer <28753b04bcbadf3ae23022da0d8dd347bd9bf1ea@ur.de>
Signed-off-by: Dave Jones <d5ec0d24602845f6f4b6a35ef729998d1fba5507@redhat.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/usb/zaurus.c
+++ drivers/net/usb/zaurus.c
@@ -316,6 +316,11 @@
 	ZAURUS_MASTER_INTERFACE,
 	.driver_info = ZAURUS_PXA_INFO,
 }, {
+	/* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */
+	USB_DEVICE_AND_INTERFACE_INFO(0x04DD, 0x9031, USB_CLASS_COMM,
+			USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
+	.driver_info = (unsigned long) &bogus_mdlm_info,
+}, {
 	.match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
 		 | USB_DEVICE_ID_MATCH_DEVICE,
 	.idVendor               = 0x04DD,


parisc/PCI: Clip bridge windows to fit in upstream windows

Every PCI-PCI bridge window should fit inside an upstream bridge window
because orphaned address space is unreachable from the primary side of the
upstream bridge.  If we inherit invalid bridge windows that overlap an
upstream window from firmware, clip them to fit and update the bridge
accordingly.

[bhelgaas: changelog]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=85491
Reported-by: Marek Kordik <c212dccd388b077466ffbfcc02004523c25d400b@gmail.com>
Fixes: 5b28541552ef ("PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources")
Signed-off-by: Yinghai Lu <0674548f4d596393408a51d6287a76ebba2f42aa@kernel.org>
Signed-off-by: Bjorn Helgaas <f10ec01be0c6b54271af5c550cd257810bdf3268@google.com>
CC: "James E.J. Bottomley" <78abc16a0671a4bb8f94993f5c9afbb002942fb1@parisc-linux.org>
CC: Helge Deller <5b1e7895819cf7d6bc77091b09bbfd6d330a4e74@gmx.de>
CC: 4307ac9eeca0da415896cd586ac48f47a24d5ab9@vger.kernel.org


pcmcia: at91_cf: convert to dev_ print functions

Convert all pr_* functions to equivalent dev_* functions and
drop the driver_name variable.

Signed-off-by: Joachim Eastwood <6f54d78a4cd927eb19dd17c34117bfc80f7abcf7@gmail.com>
Signed-off-by: Nicolas Ferre <45b517be0e5ec6dc3a39715767c1d18e090d39b4@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <9fc55922e47e21cb004bb878f69efa10ab51cf02@jcrosoft.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


power: qpnp-bms: fix ocv conversions

power: qpnp-bms: fix ocv conversions

Currently the BMS driver is using reference voltage readings from the
ADC driver in order to convert the raw OCV from the BMS peripheral into
microvolts.

However, the ADC driver is reporting the reference voltage
precalibrated. BMS needs the uncalibrated values in order to calibrate
OCV. Fix this by reading the adc code and converting the results inside
BMS instead.

Change-Id: I9107ea233af563ab419dc4c291096b9669f7f8e3
Signed-off-by: Xiaozhe Shi <4c58d9c21c42c2a4cf34b559441bd01b9c143cf4@codeaurora.org>

--- drivers/power/qpnp-bms.c
+++ drivers/power/qpnp-bms.c
@@ -487,7 +487,7 @@

 static int calib_vadc(struct qpnp_bms_chip *chip)
 {
-	int rc;
+	int rc, raw_0625, raw_1250;
 	struct qpnp_vadc_result result;

 	rc = qpnp_vadc_read(REF_625MV, &result);
@@ -495,16 +495,19 @@
 		pr_debug("vadc read failed with rc = %d\n", rc);
 		return rc;
 	}
-	chip->vadc_v0625 = result.physical;
+	raw_0625 = result.adc_code;

 	rc = qpnp_vadc_read(REF_125V, &result);
 	if (rc) {
 		pr_debug("vadc read failed with rc = %d\n", rc);
 		return rc;
 	}
-	chip->vadc_v1250 = result.physical;
-	pr_debug("vadc calib: 0625 = %d, 1250 = %d\n",
-			chip->vadc_v0625, chip->vadc_v1250);
+	raw_1250 = result.adc_code;
+	chip->vadc_v0625 = vadc_reading_to_uv(raw_0625);
+	chip->vadc_v1250 = vadc_reading_to_uv(raw_1250);
+	pr_debug("vadc calib: 0625 = %d raw (%d uv), 1250 = %d raw (%d uv)\n",
+			raw_0625, chip->vadc_v0625,
+			raw_1250, chip->vadc_v1250);
 	return 0;
 }


Fix error type initialization in byte writers.

--- src/common/byte-writers.c
+++ src/common/byte-writers.c
@@ -110,7 +110,7 @@
         return -2;
     }

-    BAD_ALLOCATION = n_error_type("nuvm.Overflow", &error);
+    OVERFLOW = n_error_type("nuvm.Overflow", &error);
     if (!n_is_ok(&error)) {
         n_destroy_error(&error);
         return -3;


regulator: core: Try using the parent device for the default regmap

If the device doesn't have a regmap specified by the driver and we can't
find one on the device itself try its parent, providing a useful defualt
for many MFDs.

[Rewrite commit message -- broonie]

Signed-off-by: AnilKumar Ch <11d1de7b71ccfe0dc742cdf48cef5550211c9da9@ti.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- drivers/regulator/core.c
+++ drivers/regulator/core.c
@@ -3202,8 +3202,10 @@
 	rdev->desc = regulator_desc;
 	if (config->regmap)
 		rdev->regmap = config->regmap;
-	else
+	else if (dev_get_regmap(dev, NULL))
 		rdev->regmap = dev_get_regmap(dev, NULL);
+	else if (dev->parent)
+		rdev->regmap = dev_get_regmap(dev->parent, NULL);
 	INIT_LIST_HEAD(&rdev->consumer_list);
 	INIT_LIST_HEAD(&rdev->list);
 	BLOCKING_INIT_NOTIFIER_HEAD(&rdev->notifier);


Basic implementation of the bootstrap message. Added several comments.

--- src/common/protocol/msg.h
+++ src/common/protocol/msg.h
@@ -43,10 +43,21 @@
  * Bootstrap msg definition.
  */

-typedef struct HVN_msg_bootstrap_t {
+// A bootstrap message is a request to tell a remote idle follower that it
+// wishes to join a group of replicas which have yet to achieve 2f+1 :: f==1.
+// Fields in the struct coorespond to requestor identification so the remote
+// replica may add the new replica to its hook array.
+typedef struct HVN_msg_bootstrap_t
+    uuid_t uuid;
+    char* address;
+    int port;
 } HVN_msg_bootstrap_t;

+// A bootstrap response message contains the list of replicas that the remote
+// replica currently knows as existing in the current quorum group.
 typedef struct HVN_msg_resp_bootstrap_t {
+    bool success;
+    UT_array* known_replicas
 } HVN_msg_resp_bootstrap_t;

 int HVN_msg_bootstrap_send(int fd, HVN_msg_bootstrap_t* msg_in);
@@ -59,7 +70,12 @@
  * Consensus msg definitions.
  */

+// A consensus message is a consolidated RequestVote and AppendEntries message.
+// To construct a RequestVote message, simply exclude log entries and a commit
+// index and enable is_vote. To construct an AppendEntries, set is_vote to
+// false and include relevant log entries and a commit index.
 typedef struct HVN_msg_consensus_t {
+    bool is_vote;
     uint64_t term;
     uuid_t id;
     uint64_t log_index;
@@ -68,6 +84,10 @@
     UT_array* log_entries;
 } HVN_msg_consensus_t;

+// A consensus response message is a reply to consensus messages in all cases.
+// When the initial request is a vote, the success response determines if the
+// vote was granted or not. If the request was an append entries, then the
+// response cooresponds to the follower's log state.
 typedef struct HVN_msg_resp_consensus_t {
     uint64_t term;
     bool success;


all consts are in AliRICHParam now

all consts are in AliRICHParam now

--- RICH/AliRICHConst.h
+++ RICH/AliRICHConst.h
@@ -1,25 +0,0 @@
-#ifndef AliRICHConst_h
-#define AliRICHConst_h
-#include <TMath.h>
-
-static const Int_t kNpadsX = 144;
-static const Int_t kNpadsY = 160;
-static const Double_t kD2r=TMath::Pi()/180;
-static const Double_t kR2d=57.2957795130823229;
-static const Double_t kDeg=TMath::Pi()/180;
-static const Double_t kRad=1;
-static const Double_t kcm=1;
-static const Double_t kmm=0.1;
-static const Double_t km=100;
-static const Double_t knm=1e-7;
-static const Double_t kfm=1e-13;
-static const Double_t kfermi=1e-13;
-static const Int_t    kBad=-101;        //useful static const to mark initial (uninitalised) values
-
-
-static const int kNCH=7;                //number of RICH chambers
-static const Float_t kadc_satm  = 4096;  //dynamic range (10 bits)
-static const Int_t kMaxNeighbours = 24; //max number of neighbours
-static const Int_t kCerenkov=50000050;  //??? go to something more general like TPDGCode
-static const Int_t kFeedback=50000051;  //??? go to something more general like TPDGCode
-#endif


regulator: Fix checking return value of create_regulator

create_regulator() returns NULL on fail.

Signed-off-by: Axel Lin <b6ffd6973e972cb999e8e535ab74da7fee0c035f@gmail.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- drivers/regulator/core.c
+++ drivers/regulator/core.c
@@ -985,9 +985,8 @@
 	rdev_info(rdev, "supplied by %s\n", rdev_get_name(supply_rdev));

 	rdev->supply = create_regulator(supply_rdev, &rdev->dev, "SUPPLY");
-	if (IS_ERR(rdev->supply)) {
-		err = PTR_ERR(rdev->supply);
-		rdev->supply = NULL;
+	if (rdev->supply == NULL) {
+		err = -ENOMEM;
 		return err;
 	}


drivers/rtc/rtc-m41t94.c: remove empty function

After the switch to devm_* functions and the removal of
rtc_device_unregister(), the 'remove' function does not do anything.
Delete it.

Signed-off-by: Sachin Kamat <1c3b1584a6008857f36c03c58f657c0fc16fc09e@linaro.org>
Cc: Kim B. Heino <6fda87f044c289644961d3b2941a174764ee417a@bluegiga.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>


rtc: rx8025: remove useless initialization

irq_freq is already initialized to 1 in rtc_device_register()

Signed-off-by: Alexandre Belloni <a7228e626ecf0022ac91fc1cd8db88e71d0e5e0e@free-electrons.com>


[SCSI] fcoe: remove unnecessary list and lock initializations.

The hostlist and the hostlist_lock were initialized both in
the delcaration and in fcoe_init().  Remove the unneeded code.

Signed-off-by: Joe Eykholt <58ecd23b42b4d3dfa0c5ed4c55abaf4238ca786e@cisco.com>
Signed-off-by: Chris Leech <ee586ba3ad011fd0b33a5d2fe017df0df3995481@intel.com>
Signed-off-by: Robert Love <ae32029cc3b561e3768d1db8669e99f5bdf25e4b@intel.com>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>

--- drivers/scsi/fcoe/fcoe.c
+++ drivers/scsi/fcoe/fcoe.c
@@ -1881,9 +1881,6 @@
 	int rc = 0;
 	struct fcoe_percpu_s *p;

-	INIT_LIST_HEAD(&fcoe_hostlist);
-	rwlock_init(&fcoe_hostlist_lock);
-
 	for_each_possible_cpu(cpu) {
 		p = &per_cpu(fcoe_percpu, cpu);
 		skb_queue_head_init(&p->fcoe_rx_list);


[SCSI] libfc: fix NULL pointer dereference bug in fc_fcp_pkt_release

This happens when then tearing down the fcoe interface with active I/O.
The back trace shows dead000000200200 in RAX, i.e., LIST_POISON2, indicating
that the fsp is already being dequeued, which is probably why no complaining
was seen in fc_fcp_destroy() about outstanding fsp not freed, since we dequeue
it in the end of fc_io_compl() before releasing it. The bug is due to the
fact that we have already destroyed lport's scsi_pkt_pool while on-going i/o
is still accessing it through fc_fcp_pkt_release(), like this trace or the
similar code path from scsi-ml to fc_eh_abort, etc. This is fixed by moving
the fc_fcp_destroy() after lport is detached from scsi-ml since fc_fcp_destroy
is supposed to called only once where no lport lock is taken, otherwise the
fc_fcp_pkt_release() would have to grab the lport lock.

 BUG: unable to handle kernel NULL pointer dereference at (null)
 .......
 RIP: 0010:[<0000000000000000>]
 [<(null)>] (null)
 RSP: 0018:ffff8803270f7b88  EFLAGS: 00010282
 RAX: dead000000200200 RBX: ffff880197d2fbc0 RCX: 0000000000005908
 RDX: ffff880195ea6d08 RSI: 0000000000000282 RDI: ffff880180f4fec0
 RBP: ffff8803270f7bc0 R08: ffff880197d2fbe0 R09: 0000000000000000
 R10: ffff88032867f090 R11: 0000000000000000 R12: ffff880195ea6d08
 R13: 0000000000000282 R14: ffff880180f4fec0 R15: 0000000000000000
 FS:  0000000000000000(0000) GS:ffff8801b5820000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
 CR2: 0000000000000000 CR3: 00000001a6eae000 CR4: 00000000000006e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process fc_rport_eq (pid: 5278, threadinfo ffff8803270f6000, task ffff880326254ab0)
 Stack:
 ffffffffa02c39ca ffff8803270f7ba0 ffff88019331cbc0 ffff880197d2fbc0
 0000000000000000 ffff8801a8c895e0 ffff8801a8c895e0 ffff8803270f7c10
 ffffffffa02c4962 ffff8803270f7be0 ffffffff814c94ab ffff8803270f7c10
 Call Trace:
 [<ffffffffa02c39ca>] ? fc_io_compl+0x10a/0x530 [libfc]
 [<ffffffffa02c4962>] fc_fcp_complete_locked+0x72/0x150 [libfc]
 [<ffffffff814c94ab>] ? _spin_unlock_bh+0x1b/0x20
 [<ffffffffa02b98ff>] ? fc_exch_done+0x3f/0x60 [libfc]
 [<ffffffffa02c4a8f>] fc_fcp_retry_cmd+0x4f/0x60 [libfc]
 [<ffffffffa02c6150>] fc_fcp_recv+0x9b0/0xc30 [libfc]
 [<ffffffff8106ba7a>] ? _call_console_drivers+0x4a/0x80
 [<ffffffff8107d5ec>] ? lock_timer_base+0x3c/0x70
 [<ffffffff8107e06b>] ? try_to_del_timer_sync+0x7b/0xe0
 [<ffffffffa02b9dcf>] fc_exch_mgr_reset+0x1df/0x250 [libfc]
 [<ffffffffa02c57a0>] ? fc_fcp_recv+0x0/0xc30 [libfc]
 [<ffffffffa02c1042>] fc_rport_work+0xf2/0x4e0 [libfc]
 [<ffffffff8109203e>] ? prepare_to_wait+0x4e/0x80
 [<ffffffffa02c0f50>] ? fc_rport_work+0x0/0x4e0 [libfc]
 [<ffffffff8108c6c0>] worker_thread+0x170/0x2a0
 [<ffffffff81091d50>] ? autoremove_wake_function+0x0/0x40
 [<ffffffff8108c550>] ? worker_thread+0x0/0x2a0
 [<ffffffff810919e6>] kthread+0x96/0xa0
 [<ffffffff810141ca>] child_rip+0xa/0x20
 [<ffffffff81091950>] ? kthread+0x0/0xa0
 [<ffffffff810141c0>] ? child_rip+0x0/0x20
 Code:
 Bad RIP value.

 RIP
 [<(null)>] (null)
 RSP <ffff8803270f7b88>
 CR2: 0000000000000000

Signed-off-by: Yi Zou <5b3a821cf7a153d601945bbe257e1150110342e4@intel.com>
Signed-off-by: Robert Love <ae32029cc3b561e3768d1db8669e99f5bdf25e4b@intel.com>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>

--- drivers/scsi/fcoe/fcoe.c
+++ drivers/scsi/fcoe/fcoe.c
@@ -854,7 +854,6 @@

 	/* Cleanup the fc_lport */
 	fc_lport_destroy(lport);
-	fc_fcp_destroy(lport);

 	/* Stop the transmit retry timer */
 	del_timer_sync(&port->timer);
@@ -875,6 +874,9 @@
 	/* Detach from the scsi-ml */
 	fc_remove_host(lport->host);
 	scsi_remove_host(lport->host);
+
+	/* Destroy lport scsi_priv */
+	fc_fcp_destroy(lport);

 	/* There are no more rports or I/O, free the EM */
 	fc_exch_mgr_free(lport);


spi: altera: Remove the code to get unused platform_data

The definition of struct altera_spi_platform_data does not exist in current
tree. So remove the code to get platform_data which is never used.

Signed-off-by: Axel Lin <b6ffd6973e972cb999e8e535ab74da7fee0c035f@ingics.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>


spi/dw: use dmaengine_slave_config() API

The drivers should use dmaengine_slave_config() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <5cf69c63beb17bf38d63aa0e923ee8256af0e205@intel.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@kernel.org>


serial: mux: Align SUPPORT_SYSRQ behaviour with other drivers.

The mux driver is anomalous among all the serial drivers that can
define SUPPORT_SYSRQ because it can, with some configs, set
SUPPORT_SYSRQ when SERIAL_CORE_CONSOLE is not set.

Not only does this impose a pointless (but tiny) runtime overhead for
such configs but, more significantly, it adds needless complexity when
doing a code review to check for unexpected side effects of any
changes to the serial core.

This is (cross-)compile tested only because I do not have any PA-RISC
hardware.

Signed-off-by: Daniel Thompson <4421c302a8f2019ff02452a16ddbdd37770f814c@linaro.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


Added default constructor for SurfaceImport

Signed-off-by: Étienne Schmitt <25d5031dc1a1d443222aec9a4e916501ae23c255@inria.fr>

--- cgogn/io/surface_import.h
+++ cgogn/io/surface_import.h
@@ -55,6 +55,8 @@
 class SurfaceImport
 {
 public:
+	using Self = SurfaceImport<DATA_TRAITS>;
+	using UnsignedChunkArray = ChunkArrayContainer<DATA_TRAITS::CHUNK_SIZE, unsigned int>;

 	unsigned int nb_vertices_;
 	unsigned int nb_edges_;
@@ -63,13 +65,23 @@
 	std::vector<unsigned short> faces_nb_edges_;
 	std::vector<unsigned int> faces_vertex_indices_;

-	ChunkArrayContainer<DATA_TRAITS::CHUNK_SIZE, unsigned int> vertex_attributes_;
-
-	SurfaceImport()
+	UnsignedChunkArray vertex_attributes_;
+
+	SurfaceImport() :
+		nb_vertices_(0u)
+	  ,nb_edges_(0u)
+	  ,nb_faces_(0u)
+	  ,faces_nb_edges_()
+	  ,faces_vertex_indices_()
 	{}

 	~SurfaceImport()
 	{}
+
+	SurfaceImport(const Self&) = delete;
+	SurfaceImport(Self&&) = delete;
+	Self& operator=(const Self&) = delete;
+	Self& operator=(Self&&) = delete;

 	void clear()
 	{


Allow the end of the cut region to be corrected. (dm)

git-svn-id: 30a5f035a20f1bc647618dbad7eea2a951b61b7c@1919 91a5dbb7-01b9-0310-9b5f-b28072856b6e

--- Programs/cut.c
+++ Programs/cut.c
@@ -32,6 +32,7 @@

 static int beginColumn = 0;
 static int beginRow = 0;
+static int beginOffset = -1;

 static unsigned char *
 cut (size_t *length, int fromColumn, int fromRow, int toColumn, int toRow) {
@@ -39,7 +40,7 @@
   int columns = toColumn - fromColumn + 1;
   int rows = toRow - fromRow + 1;

-  if ((columns >= 1) && (rows >= 1)) {
+  if ((columns >= 1) && (rows >= 1) && (beginOffset >= 0)) {
     unsigned char *fromBuffer = malloc(rows * columns);
     if (fromBuffer) {
       unsigned char *toBuffer = malloc(rows * (columns + 1));
@@ -94,12 +95,12 @@
 static int
 append (unsigned char *buffer, size_t length) {
   if (cutBuffer) {
-    size_t newLength = cutLength + length;
+    size_t newLength = beginOffset + length;
     unsigned char *newBuffer = malloc(newLength);
     if (!newBuffer) return 0;

-    memcpy(newBuffer, cutBuffer, cutLength);
-    memcpy(newBuffer+cutLength, buffer, length);
+    memcpy(newBuffer, cutBuffer, beginOffset);
+    memcpy(newBuffer+beginOffset, buffer, length);

     free(buffer);
     free(cutBuffer);
@@ -130,6 +131,7 @@
 cutAppend (int column, int row) {
   beginColumn = column;
   beginRow = row;
+  beginOffset = cutLength;
   playTune(&tune_cut_begin);
 }


structural changes, not user-visible

structural changes, not user-visible

--- src/Balcony.h
+++ src/Balcony.h
@@ -36,9 +36,9 @@
 	{
 	public:
 		inline Balcony();
-		inline void leaveItem(const Item& Item, Table* table);
-		inline void leaveItem(const htl::list<Item>& ords, Table* table);
-		inline std::pair<Item, Table*> nextItem();
+		inline void leaveOrder(const Item& Item, Table* table);
+		inline void leaveOrder(const htl::list<Item>& ords, Table* table);
+		inline std::pair<Item, Table*> nextOrder();
 		inline bool hasNext() const;
 	private:
 		htl::queue<std::pair<Item, Table*>> orders;
@@ -48,18 +48,18 @@
 		: orders()
 	{}

-	void Balcony::leaveItem(const Item& order, Table* table)
+	void Balcony::leaveOrder(const Item& order, Table* table)
 	{
 		orders.push(std::pair<Item, Table*>(order,table));
 	}

-	void Balcony::leaveItem(const htl::list<Item>& ords, Table* table)
+	void Balcony::leaveOrder(const htl::list<Item>& ords, Table* table)
 	{
 		for(htl::list<Item>::const_iterator it = ords.begin(); it != ords.end(); it++)
 			orders.push(std::pair<Item, Table*>(*it, table));
 	}

-	std::pair<Item, Table*> Balcony::nextItem()
+	std::pair<Item, Table*> Balcony::nextOrder()
 	{
 		std::pair<Item, Table*> ord = orders.front();
 		orders.pop();


With a trivial change in the definition of two CINT parameters,
the memory requirements from the CINT data structures is going down from
25 MBytes to about 5 Mbytes.
The change is the following. Instead of
#define G__MAXIFUNC 10
#define G__MEMDEPTH 10
use
#define G__MAXIFUNC 1
#define G__MEMDEPTH 2
The change has no noticeable impact on the run time performance

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@16016 27541ba8-7e3a-0410-8455-c3a389f83636

--- cint/inc/G__ci.h
+++ cint/inc/G__ci.h
@@ -814,8 +814,8 @@
 /* G__MAXIFUNC and G__MEMDEPTH are not real limit
  * They are depth of one page of function or variable list
  * If the page gets full, more table is allocated. */
-#define G__MAXIFUNC 10
-#define G__MEMDEPTH 10
+#define G__MAXIFUNC 1
+#define G__MEMDEPTH 2

 /* #define G__HIST     1 */


Patch applied AXIS2C-1221. Thanks Federic and Rajika for the effort.

git-svn-id: fbb392d5347ebc45c06187f72dfd8bab02595dbf@673382 13f79535-47bb-0310-9956-ffa450edef68

--- src/core/transport/http/util/http_transport_utils.c
+++ src/core/transport/http/util/http_transport_utils.c
@@ -639,7 +639,7 @@

     axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);

-    engine = axis2_engine_create(env, conf_ctx);
+    engine = axis2_engine_create(env, conf_ctx);g

     if (!soap_envelope)
         return AXIS2_FAILURE;


OptDiag: Use DiagnosticLocation in MachineOptimizationRemarks

DiagnosticInfo switched from DebugLoc to DiagnosticLocation in
r295519, update these subclasses to match.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@296052 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
+++ include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
@@ -29,10 +29,11 @@
 class DiagnosticInfoMIROptimization : public DiagnosticInfoOptimizationBase {
 public:
   DiagnosticInfoMIROptimization(enum DiagnosticKind Kind, const char *PassName,
-                                StringRef RemarkName, const DebugLoc &DLoc,
+                                StringRef RemarkName,
+                                const DiagnosticLocation &Loc,
                                 const MachineBasicBlock *MBB)
       : DiagnosticInfoOptimizationBase(Kind, DS_Remark, PassName, RemarkName,
-                                       *MBB->getParent()->getFunction(), DLoc),
+                                       *MBB->getParent()->getFunction(), Loc),
         MBB(MBB) {}

   /// MI-specific kinds of diagnostic Arguments.
@@ -58,12 +59,13 @@
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass=, then the diagnostic will
   /// be emitted.  \p RemarkName is a textual identifier for the remark.  \p
-  /// DLoc is the debug location and \p MBB is the block that the optimization
+  /// Loc is the debug location and \p MBB is the block that the optimization
   /// operates in.
   MachineOptimizationRemark(const char *PassName, StringRef RemarkName,
-                            const DebugLoc &DLoc, const MachineBasicBlock *MBB)
+                            const DiagnosticLocation &Loc,
+                            const MachineBasicBlock *MBB)
       : DiagnosticInfoMIROptimization(DK_MachineOptimizationRemark, PassName,
-                                      RemarkName, DLoc, MBB) {}
+                                      RemarkName, Loc, MBB) {}

   static bool classof(const DiagnosticInfo *DI) {
     return DI->getKind() == DK_MachineOptimizationRemark;
@@ -81,13 +83,13 @@
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass-missed=, then the
   /// diagnostic will be emitted.  \p RemarkName is a textual identifier for the
-  /// remark.  \p DLoc is the debug location and \p MBB is the block that the
+  /// remark.  \p Loc is the debug location and \p MBB is the block that the
   /// optimization operates in.
   MachineOptimizationRemarkMissed(const char *PassName, StringRef RemarkName,
-                                  const DebugLoc &DLoc,
+                                  const DiagnosticLocation &Loc,
                                   const MachineBasicBlock *MBB)
       : DiagnosticInfoMIROptimization(DK_MachineOptimizationRemarkMissed,
-                                      PassName, RemarkName, DLoc, MBB) {}
+                                      PassName, RemarkName, Loc, MBB) {}

   static bool classof(const DiagnosticInfo *DI) {
     return DI->getKind() == DK_MachineOptimizationRemarkMissed;
@@ -105,13 +107,13 @@
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass-analysis=, then the
   /// diagnostic will be emitted.  \p RemarkName is a textual identifier for the
-  /// remark.  \p DLoc is the debug location and \p MBB is the block that the
+  /// remark.  \p Loc is the debug location and \p MBB is the block that the
   /// optimization operates in.
   MachineOptimizationRemarkAnalysis(const char *PassName, StringRef RemarkName,
-                                    const DebugLoc &DLoc,
+                                    const DiagnosticLocation &Loc,
                                     const MachineBasicBlock *MBB)
       : DiagnosticInfoMIROptimization(DK_MachineOptimizationRemarkAnalysis,
-                                      PassName, RemarkName, DLoc, MBB) {}
+                                      PassName, RemarkName, Loc, MBB) {}

   static bool classof(const DiagnosticInfo *DI) {
     return DI->getKind() == DK_MachineOptimizationRemarkAnalysis;


fix compile bug in example/log

fix compile bug in example/log

--- example/log/example_log.c
+++ example/log/example_log.c
@@ -205,7 +205,7 @@
 	init_log();

 	// version and compile time informations
-	const char *ver = mugglec_version(ver, sizeof(ver));
+	const char *ver = mugglec_version();
 	MUGGLE_LOG_INFO("mugglec version: %s", ver);

 	const char *compile_ts = mugglec_compile_time();


remove warnings

remove warnings

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

--- config/gen/platform/platform_interface.h
+++ config/gen/platform/platform_interface.h
@@ -121,7 +121,6 @@

 struct parrot_string_t;
-Interp;
 INTVAL Parrot_Run_OS_Command(Interp*, struct parrot_string_t *);
 void Parrot_Exec_OS_Command(Interp*, struct parrot_string_t *);


USB: atm/cxacru, fix lock imbalance

USB: atm/cxacru, fix lock imbalance

We do not hold mutex in one place in cxacru_cm, but unlock it on fail path.
Fix this.

Signed-off-by: Jiri Slaby <aeaaaa09d9a5fac7c38743ea79aa4bb8ffb08290@gmail.com>
Cc: Simon Arlott <93bc4e9aaed0a6878ddd30be50414e1a0bfab610@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/atm/cxacru.c
+++ drivers/usb/atm/cxacru.c
@@ -485,7 +485,7 @@
 			usb_err(instance->usbatm, "requested transfer size too large (%d, %d)\n",
 				wbuflen, rbuflen);
 		ret = -ENOMEM;
-		goto fail;
+		goto err;
 	}

 	mutex_lock(&instance->cm_serialize);
@@ -565,6 +565,7 @@
 	dbg("cm %#x", cm);
 fail:
 	mutex_unlock(&instance->cm_serialize);
+err:
 	return ret;
 }


video: au1100fb: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <fc379137a64feb86ce38ec5811a14280acc1ccfc@samsung.com>
Signed-off-by: Tomi Valkeinen <e1ca4dbb8be1acaf20734fecd2da10ed1d46a9bb@ti.com>


cirrusfb: remove fields from cirrusfb_info

This patch removes unused or redundant fields from cirrusfb_info structure.

Signed-off-by: Krzysztof Helt <e36322531041744f35a39a40f0faffcfb5b388ff@wp.pl>
Signed-off-by: Antonino Daplas <be03a811842969f6b435f66cb85a30eb479a8702@gmail.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- drivers/video/cirrusfb.c
+++ drivers/video/cirrusfb.c
@@ -369,23 +369,14 @@

 /* info about board */
 struct cirrusfb_info {
-	struct fb_info *info;
-
-	u8 __iomem *fbmem;
 	u8 __iomem *regbase;
-	u8 __iomem *mem;
-	unsigned long size;
 	enum cirrus_board btype;
 	unsigned char SFR;	/* Shadow of special function register */

-	unsigned long fbmem_phys;
-	unsigned long fbregs_phys;
-
 	struct cirrusfb_regs currentmode;
 	int blank_mode;

 	u32	pseudo_palette[16];
-	struct { u8 red, green, blue, pad; } palette[256];

 #ifdef CONFIG_ZORRO
 	struct zorro_dev *zdev;
@@ -393,7 +384,7 @@
 #ifdef CONFIG_PCI
 	struct pci_dev *pdev;
 #endif
-	void (*unmap)(struct cirrusfb_info *cinfo);
+	void (*unmap)(struct fb_info *info);
 };

 static unsigned cirrusfb_def_mode = 1;
@@ -536,7 +527,7 @@
 				struct cirrusfb_regs *regs,
 				const struct fb_info *info);
 /*--- Internal routines ----------------------------------------------------*/
-static void init_vgachip(struct cirrusfb_info *cinfo);
+static void init_vgachip(struct fb_info *info);
 static void switch_monitor(struct cirrusfb_info *cinfo, int on);
 static void WGen(const struct cirrusfb_info *cinfo,
 		 int regnum, unsigned char val);
@@ -645,7 +636,6 @@
 static int cirrusfb_check_var(struct fb_var_screeninfo *var,
 			      struct fb_info *info)
 {
-	struct cirrusfb_info *cinfo = info->par;
 	int nom, den;		/* translyting from pixels->bytes */
 	int yres, i;
 	static struct { int xres, yres; } modes[] =
@@ -690,7 +680,7 @@
 		return -EINVAL;
 	}

-	if (var->xres * nom / den * var->yres > cinfo->size) {
+	if (var->xres * nom / den * var->yres > info->screen_size) {
 		printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..."
 			"resolution too high to fit into video memory!\n",
 			var->xres, var->yres, var->bits_per_pixel);
@@ -704,7 +694,8 @@
 		printk(KERN_INFO
 		     "cirrusfb: using maximum available virtual resolution\n");
 		for (i = 0; modes[i].xres != -1; i++) {
-			if (modes[i].xres * nom / den * modes[i].yres < cinfo->size / 2)
+			int size = modes[i].xres * nom / den * modes[i].yres;
+			if (size < info->screen_size / 2)
 				break;
 		}
 		if (modes[i].xres == -1) {
@@ -1018,7 +1009,7 @@
 	       var->xres, var->yres, var->bits_per_pixel);
 	DPRINTK("pixclock: %d\n", var->pixclock);

-	init_vgachip(cinfo);
+	init_vgachip(info);

 	err = cirrusfb_decode_var(var, &regs, info);
 	if (err) {
@@ -1686,10 +1677,6 @@
 		return 0;
 	}

-	cinfo->palette[regno].red = red;
-	cinfo->palette[regno].green = green;
-	cinfo->palette[regno].blue = blue;
-
 	if (info->var.bits_per_pixel == 8)
 		WClut(cinfo, regno, red >> 10, green >> 10, blue >> 10);

@@ -1848,8 +1835,9 @@
 /****************************************************************************/
 /**** BEGIN Internal Routines ***********************************************/

-static void init_vgachip(struct cirrusfb_info *cinfo)
-{
+static void init_vgachip(struct fb_info *info)
+{
+	struct cirrusfb_info *cinfo = info->par;
 	const struct cirrusfb_board_info_rec *bi;

 	DPRINTK("ENTER\n");
@@ -1903,7 +1891,8 @@
 		break;
 	}

-	assert(cinfo->size > 0); /* make sure RAM size set by this point */
+	/* make sure RAM size set by this point */
+	assert(info->screen_size > 0);

 	/* the P4 is not fully initialized here; I rely on it having been */
 	/* inited under AmigaOS already, which seems to work just fine    */
@@ -2089,7 +2078,7 @@
 	WHDR(cinfo, 0);	/* Hidden DAC register: - */

 	printk(KERN_DEBUG "cirrusfb: This board has %ld bytes of DRAM memory\n",
-		cinfo->size);
+		info->screen_size);
 	DPRINTK("EXIT\n");
 	return;
 }
@@ -2150,24 +2139,25 @@
 /* Linux 2.6-style  accelerated functions */
 /******************************************/

-static void cirrusfb_prim_fillrect(struct cirrusfb_info *cinfo,
+static void cirrusfb_prim_fillrect(struct fb_info *info,
 				   const struct fb_fillrect *region)
 {
+	struct cirrusfb_info *cinfo = info->par;
 	int m; /* bytes per pixel */
-	u32 color = (cinfo->info->fix.visual == FB_VISUAL_TRUECOLOR) ?
+	u32 color = (info->fix.visual == FB_VISUAL_TRUECOLOR) ?
 		cinfo->pseudo_palette[region->color] : region->color;

-	if (cinfo->info->var.bits_per_pixel == 1) {
+	if (info->var.bits_per_pixel == 1) {
 		cirrusfb_RectFill(cinfo->regbase,
-				  cinfo->info->var.bits_per_pixel,
+				  info->var.bits_per_pixel,
 				  region->dx / 8, region->dy,
 				  region->width / 8, region->height,
 				  color,
 				  cinfo->currentmode.line_length);
 	} else {
-		m = (cinfo->info->var.bits_per_pixel + 7) / 8;
+		m = (info->var.bits_per_pixel + 7) / 8;
 		cirrusfb_RectFill(cinfo->regbase,
-				  cinfo->info->var.bits_per_pixel,
+				  info->var.bits_per_pixel,
 				  region->dx * m, region->dy,
 				  region->width * m, region->height,
 				  color,
@@ -2179,7 +2169,6 @@
 static void cirrusfb_fillrect(struct fb_info *info,
 			      const struct fb_fillrect *region)
 {
-	struct cirrusfb_info *cinfo = info->par;
 	struct fb_fillrect modded;
 	int vxres, vyres;

@@ -2204,22 +2193,24 @@
 	if (modded.dy + modded.height > vyres)
 		modded.height = vyres - modded.dy;

-	cirrusfb_prim_fillrect(cinfo, &modded);
-}
-
-static void cirrusfb_prim_copyarea(struct cirrusfb_info *cinfo,
+	cirrusfb_prim_fillrect(info, &modded);
+}
+
+static void cirrusfb_prim_copyarea(struct fb_info *info,
 				   const struct fb_copyarea *area)
 {
+	struct cirrusfb_info *cinfo = info->par;
 	int m; /* bytes per pixel */
-	if (cinfo->info->var.bits_per_pixel == 1) {
-		cirrusfb_BitBLT(cinfo->regbase, cinfo->info->var.bits_per_pixel,
+
+	if (info->var.bits_per_pixel == 1) {
+		cirrusfb_BitBLT(cinfo->regbase, info->var.bits_per_pixel,
 				area->sx / 8, area->sy,
 				area->dx / 8, area->dy,
 				area->width / 8, area->height,
 				cinfo->currentmode.line_length);
 	} else {
-		m = (cinfo->info->var.bits_per_pixel + 7) / 8;
-		cirrusfb_BitBLT(cinfo->regbase, cinfo->info->var.bits_per_pixel,
+		m = (info->var.bits_per_pixel + 7) / 8;
+		cirrusfb_BitBLT(cinfo->regbase, info->var.bits_per_pixel,
 				area->sx * m, area->sy,
 				area->dx * m, area->dy,
 				area->width * m, area->height,
@@ -2231,9 +2222,9 @@
 static void cirrusfb_copyarea(struct fb_info *info,
 			      const struct fb_copyarea *area)
 {
-	struct cirrusfb_info *cinfo = info->par;
 	struct fb_copyarea modded;
 	u32 vxres, vyres;
+
 	modded.sx = area->sx;
 	modded.sy = area->sy;
 	modded.dx = area->dx;
@@ -2265,7 +2256,7 @@
 	if (modded.dy + modded.height > vyres)
 		modded.height = vyres - modded.dy;

-	cirrusfb_prim_copyarea(cinfo, &modded);
+	cirrusfb_prim_copyarea(info, &modded);
 }

 static void cirrusfb_imageblit(struct fb_info *info,
@@ -2363,18 +2354,19 @@
 	DPRINTK("EXIT\n");
 }

-static void cirrusfb_pci_unmap(struct cirrusfb_info *cinfo)
-{
+static void cirrusfb_pci_unmap(struct fb_info *info)
+{
+	struct cirrusfb_info *cinfo = info->par;
 	struct pci_dev *pdev = cinfo->pdev;

-	iounmap(cinfo->fbmem);
+	iounmap(info->screen_base);
 #if 0 /* if system didn't claim this region, we would... */
 	release_mem_region(0xA0000, 65535);
 #endif
 	if (release_io_ports)
 		release_region(0x3C0, 32);
 	pci_release_regions(pdev);
-	framebuffer_release(cinfo->info);
+	framebuffer_release(info);
 }
 #endif /* CONFIG_PCI */

@@ -2386,21 +2378,20 @@
 	if (cinfo->btype == BT_PICASSO4) {
 		cinfo->regbase -= 0x600000;
 		iounmap((void *)cinfo->regbase);
-		iounmap((void *)cinfo->fbmem);
+		iounmap(info->screen_base);
 	} else {
 		if (zorro_resource_start(cinfo->zdev) > 0x01000000)
-			iounmap((void *)cinfo->fbmem);
+			iounmap(info->screen_base);
 	}
 	framebuffer_release(cinfo->info);
 }
 #endif /* CONFIG_ZORRO */

-static int cirrusfb_set_fbinfo(struct cirrusfb_info *cinfo)
-{
-	struct fb_info *info = cinfo->info;
+static int cirrusfb_set_fbinfo(struct fb_info *info)
+{
+	struct cirrusfb_info *cinfo = info->par;
 	struct fb_var_screeninfo *var = &info->var;

-	info->par = cinfo;
 	info->pseudo_palette = cinfo->pseudo_palette;
 	info->flags = FBINFO_DEFAULT
 		    | FBINFO_HWACCEL_XPAN
@@ -2410,7 +2401,6 @@
 	if (noaccel)
 		info->flags |= FBINFO_HWACCEL_DISABLED;
 	info->fbops = &cirrusfb_ops;
-	info->screen_base = cinfo->fbmem;
 	if (cinfo->btype == BT_GD5480) {
 		if (var->bits_per_pixel == 16)
 			info->screen_base += 1 * MB_;
@@ -2424,9 +2414,9 @@

 	/* monochrome: only 1 memory plane */
 	/* 8 bit and above: Use whole memory area */
-	info->fix.smem_start = cinfo->fbmem_phys;
-	info->fix.smem_len   =
-		(var->bits_per_pixel == 1) ? cinfo->size / 4 : cinfo->size;
+	info->fix.smem_len   = info->screen_size;
+	if (var->bits_per_pixel == 1)
+		info->fix.smem_len /= 4;
 	info->fix.type       = cinfo->currentmode.type;
 	info->fix.type_aux   = 0;
 	info->fix.visual     = cinfo->currentmode.visual;
@@ -2436,7 +2426,6 @@
 	info->fix.line_length = cinfo->currentmode.line_length;

 	/* FIXME: map region at 0xB8000 if available, fill in here */
-	info->fix.mmio_start = cinfo->fbregs_phys;
 	info->fix.mmio_len   = 0;
 	info->fix.accel = FB_ACCEL_NONE;

@@ -2445,9 +2434,9 @@
 	return 0;
 }

-static int cirrusfb_register(struct cirrusfb_info *cinfo)
-{
-	struct fb_info *info;
+static int cirrusfb_register(struct fb_info *info)
+{
+	struct cirrusfb_info *cinfo = info->par;
 	int err;
 	enum cirrus_board btype;

@@ -2456,13 +2445,12 @@
 	printk(KERN_INFO "cirrusfb: Driver for Cirrus Logic based "
 		"graphic boards, v" CIRRUSFB_VERSION "\n");

-	info = cinfo->info;
 	btype = cinfo->btype;

 	/* sanity checks */
 	assert(btype != BT_NONE);

-	DPRINTK("cirrusfb: (RAM start set to: 0x%p)\n", cinfo->fbmem);
+	DPRINTK("cirrusfb: (RAM start set to: 0x%p)\n", info->screen_base);

 	/* Make pretend we've set the var so our structures are in a "good" */
 	/* state, even though we haven't written the mode to the hw yet...  */
@@ -2477,7 +2465,7 @@
 	}

 	/* set all the vital stuff */
-	cirrusfb_set_fbinfo(cinfo);
+	cirrusfb_set_fbinfo(info);

 	err = register_framebuffer(info);
 	if (err < 0) {
@@ -2492,7 +2480,7 @@
 err_dealloc_cmap:
 	fb_dealloc_cmap(&info->cmap);
 err_unmap_cirrusfb:
-	cinfo->unmap(cinfo);
+	cinfo->unmap(info);
 	return err;
 }

@@ -2506,7 +2494,7 @@
 	unregister_framebuffer(info);
 	fb_dealloc_cmap(&info->cmap);
 	printk("Framebuffer unregistered\n");
-	cinfo->unmap(cinfo);
+	cinfo->unmap(info);

 	DPRINTK("EXIT\n");
 }
@@ -2535,7 +2523,6 @@
 	}

 	cinfo = info->par;
-	cinfo->info = info;
 	cinfo->pdev = pdev;
 	cinfo->btype = btype = (enum cirrus_board) ent->driver_data;

@@ -2546,19 +2533,19 @@
 	if (isPReP) {
 		pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, 0x00000000);
 #ifdef CONFIG_PPC_PREP
-		get_prep_addrs(&board_addr, &cinfo->fbregs_phys);
+		get_prep_addrs(&board_addr, &info->fix.mmio_start);
 #endif
 	/* PReP dies if we ioremap the IO registers, but it works w/out... */
-		cinfo->regbase = (char __iomem *) cinfo->fbregs_phys;
+		cinfo->regbase = (char __iomem *) info->fix.mmio_start;
 	} else {
 		DPRINTK("Attempt to get PCI info for Cirrus Graphics Card\n");
-		get_pci_addrs(pdev, &board_addr, &cinfo->fbregs_phys);
+		get_pci_addrs(pdev, &board_addr, &info->fix.mmio_start);
 		/* FIXME: this forces VGA.  alternatives? */
 		cinfo->regbase = NULL;
 	}

 	DPRINTK("Board address: 0x%lx, register address: 0x%lx\n",
-		board_addr, cinfo->fbregs_phys);
+		board_addr, info->fix.mmio_start);

 	board_size = (btype == BT_GD5480) ?
 		32 * MB_ : cirrusfb_get_memsize(cinfo->regbase);
@@ -2582,24 +2569,24 @@
 	if (request_region(0x3C0, 32, "cirrusfb"))
 		release_io_ports = 1;

-	cinfo->fbmem = ioremap(board_addr, board_size);
-	if (!cinfo->fbmem) {
+	info->screen_base = ioremap(board_addr, board_size);
+	if (!info->screen_base) {
 		ret = -EIO;
 		goto err_release_legacy;
 	}

-	cinfo->fbmem_phys = board_addr;
-	cinfo->size = board_size;
+	info->fix.smem_start = board_addr;
+	info->screen_size = board_size;
 	cinfo->unmap = cirrusfb_pci_unmap;

 	printk(KERN_INFO " RAM (%lu kB) at 0xx%lx, ",
-		cinfo->size / KB_, board_addr);
+		info->screen_size / KB_, board_addr);
 	printk(KERN_INFO "Cirrus Logic chipset on PCI bus\n");
 	pci_set_drvdata(pdev, info);

-	ret = cirrusfb_register(cinfo);
+	ret = cirrusfb_register(info);
 	if (ret)
-		iounmap(cinfo->fbmem);
+		iounmap(info->screen_base);
 	return ret;

 err_release_legacy:
@@ -2677,7 +2664,7 @@
 	cinfo->zdev = z;
 	board_addr = zorro_resource_start(z);
 	board_size = zorro_resource_len(z);
-	cinfo->size = size;
+	info->screen_size = size;

 	if (!zorro_request_device(z, "cirrusfb")) {
 		printk(KERN_ERR "cirrusfb: cannot reserve region 0x%lx, "
@@ -2705,27 +2692,27 @@
 		DPRINTK("cirrusfb: Virtual address for board set to: $%p\n",
 			cinfo->regbase);
 		cinfo->regbase += 0x600000;
-		cinfo->fbregs_phys = board_addr + 0x600000;
-
-		cinfo->fbmem_phys = board_addr + 16777216;
-		cinfo->fbmem = ioremap(cinfo->fbmem_phys, 16777216);
-		if (!cinfo->fbmem)
+		info->fix.mmio_start = board_addr + 0x600000;
+
+		info->fix.smem_start = board_addr + 16777216;
+		info->screen_base = ioremap(info->fix.smem_start, 16777216);
+		if (!info->screen_base)
 			goto err_unmap_regbase;
 	} else {
 		printk(KERN_INFO " REG at $%lx\n",
 			(unsigned long) z2->resource.start);

-		cinfo->fbmem_phys = board_addr;
+		info->fix.smem_start = board_addr;
 		if (board_addr > 0x01000000)
-			cinfo->fbmem = ioremap(board_addr, board_size);
+			info->screen_base = ioremap(board_addr, board_size);
 		else
-			cinfo->fbmem = (caddr_t) ZTWO_VADDR(board_addr);
-		if (!cinfo->fbmem)
+			info->screen_base = (caddr_t) ZTWO_VADDR(board_addr);
+		if (!info->screen_base)
 			goto err_release_region;

 		/* set address for REG area of board */
 		cinfo->regbase = (caddr_t) ZTWO_VADDR(z2->resource.start);
-		cinfo->fbregs_phys = z2->resource.start;
+		info->fix.mmio_start = z2->resource.start;

 		DPRINTK("cirrusfb: Virtual address for board set to: $%p\n",
 			cinfo->regbase);
@@ -2738,10 +2725,10 @@
 	ret = cirrusfb_register(cinfo);
 	if (ret) {
 		if (btype == BT_PICASSO4) {
-			iounmap(cinfo->fbmem);
+			iounmap(info->screen_base);
 			iounmap(cinfo->regbase - 0x600000);
 		} else if (board_addr > 0x01000000)
-			iounmap(cinfo->fbmem);
+			iounmap(info->screen_base);
 	}
 	return ret;


Video / da8xx-fb: Use module_platform_driver() to simplify code

Convert to module_platform_driver() to simplify code.

Signed-off-by: Hanjun Guo <95c4dbadfa6003adc188d9bdfe4b6c123adc8dc4@linaro.org>
Signed-off-by: Tomi Valkeinen <e1ca4dbb8be1acaf20734fecd2da10ed1d46a9bb@ti.com>


vt8623fb: Compute VGA base iomem pointer explicitly.

This allows the driver to work in multi-domain PCI
configurations.

Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>

--- drivers/video/vt8623fb.c
+++ drivers/video/vt8623fb.c
@@ -661,6 +661,8 @@

 static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
+	struct pci_bus_region bus_reg;
+	struct resource vga_res;
 	struct fb_info *info;
 	struct vt8623fb_info *par;
 	unsigned int memsize1, memsize2;
@@ -718,6 +720,15 @@
 		dev_err(info->device, "iomap for MMIO failed\n");
 		goto err_iomap_2;
 	}
+
+	bus_reg.start = 0;
+	bus_reg.end = 64 * 1024;
+
+	vga_res.flags = IORESOURCE_IO;
+
+	pcibios_bus_to_resource(dev, &vga_res, &bus_reg);
+
+	par->state.vgabase = (void __iomem *) vga_res.start;

 	/* Find how many physical memory there is on card */
 	memsize1 = (vga_rseq(par->state.vgabase, 0x34) + 1) >> 1;


watchdog: shwdt: use devm_clk_get()

watchdog: shwdt: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <fc379137a64feb86ce38ec5811a14280acc1ccfc@samsung.com>
Reviewed-by: Guenter Roeck <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <5f65f6985de1ebf15dde04e0dc4668211868bafa@iguana.be>


Overload operator<< for Arm and XDiretion enums

--- tests/PrintEventsFeature.h
+++ tests/PrintEventsFeature.h
@@ -27,6 +27,42 @@
   out << "(" << quat.x();
   out << ", " << quat.y();
   out << ", " << quat.z() << ")";
+  return out;
+}
+
+std::ostream& operator<<(std::ostream& out, myo::Arm arm) {
+  switch (arm) {
+    case myo::armLeft:
+      out << "armLeft";
+      break;
+    case myo::armRight:
+      out << "armRight";
+      break;
+    case myo::armUnknown:
+      out << "armUnknown";
+      break;
+    default:
+      out << "unknown";
+      break;
+  }
+  return out;
+}
+
+std::ostream& operator<<(std::ostream& out, myo::XDirection x_direction) {
+  switch (x_direction) {
+    case myo::xDirectionTowardWrist:
+      out << "xDirectionTowardWrist";
+      break;
+    case myo::xDirectionTowardElbow:
+      out << "xDirectionTowardElbow";
+      break;
+    case myo::xDirectionUnknown:
+      out << "xDirectionUnknown";
+      break;
+    default:
+      out << "unknown";
+      break;
+  }
   return out;
 }
 }


regen

regen

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@16524 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- utils/typedump/typedump.c
+++ utils/typedump/typedump.c
@@ -260,6 +260,7 @@
 	PRTYPE(struct srm_create_rep);
 	PRTYPE(struct srm_create_req);
 	PRTYPE(struct srm_destroy_req);
+	PRTYPE(struct srm_forward_rep);
 	PRTYPE(struct srm_forward_req);
 	PRTYPE(struct srm_generic_rep);
 	PRTYPE(struct srm_getattr2_rep);
@@ -585,6 +586,7 @@
 	PRVAL(SLITHRT_RII);
 	PRVAL(SLITHRT_RIM);
 	PRVAL(SLITHRT_SLVR_CRC);
+	PRVAL(SLITHRT_STATFS);
 	PRVAL(SLITHRT_TIOS);
 	PRVAL(SLITHRT_USKLNDPL);
 	PRVAL(SLMTHRT_BMAPTIMEO);


regen

regen

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@23252 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- utils/typedump/typedump.c
+++ utils/typedump/typedump.c
@@ -652,6 +652,9 @@
 	PRVAL(SLC_OPST_BMAP_ALLOC_STALL);
 	PRVAL(SLC_OPST_BMAP_DIO);
 	PRVAL(SLC_OPST_BMAP_FLUSH);
+	PRVAL(SLC_OPST_BMAP_FLUSH_COALESCE_CONTIG);
+	PRVAL(SLC_OPST_BMAP_FLUSH_COALESCE_EXPIRE);
+	PRVAL(SLC_OPST_BMAP_FLUSH_COALESCE_RESTART);
 	PRVAL(SLC_OPST_BMAP_FLUSH_RESCHED);
 	PRVAL(SLC_OPST_BMAP_FLUSH_RPCWAIT);
 	PRVAL(SLC_OPST_BMAP_LEASE_EXT_ABRT);


regen

regen

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@19911 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- utils/typedump/typedump.c
+++ utils/typedump/typedump.c
@@ -642,6 +642,7 @@
 	PRVAL(SLC_OPST_CREAT);
 	PRVAL(SLC_OPST_DEBUG);
 	PRVAL(SLC_OPST_DIO_CB);
+	PRVAL(SLC_OPST_DIO_CB0);
 	PRVAL(SLC_OPST_DIO_CB_ADD);
 	PRVAL(SLC_OPST_FLUSH_ATTR);
 	PRVAL(SLC_OPST_FSRQ_READ);
@@ -666,6 +667,7 @@
 	PRVAL(SLC_OPST_READ_AHEAD_CB_ADD);
 	PRVAL(SLC_OPST_READ_AIO_NOT_FOUND);
 	PRVAL(SLC_OPST_READ_AIO_WAIT);
+	PRVAL(SLC_OPST_READ_AIO_WAIT_MAX);
 	PRVAL(SLC_OPST_READ_CB);
 	PRVAL(SLC_OPST_READ_CB_ADD);
 	PRVAL(SLC_OPST_READ_RPC_LAUNCH);


Fixed uninitialized value.

Fixed uninitialized value.

--- uwac/libuwac/uwac-input.c
+++ uwac/libuwac/uwac-input.c
@@ -82,7 +82,7 @@
 static UwacReturnCode
 set_cursor_image(UwacSeat* seat, uint32_t serial)
 {
-	struct wl_buffer* buffer;
+	struct wl_buffer* buffer = NULL;
 	struct wl_cursor* cursor;
 	struct wl_cursor_image* image;
 	struct wl_surface* surface = NULL;