More reformatting.

More reformatting.

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

--- include/parrot/packfile.h
+++ include/parrot/packfile.h
@@ -84,8 +84,7 @@

 struct PackFile *PackFile_new(void);

-void
-PackFile_destroy(struct PackFile * self);
+void PackFile_destroy(struct PackFile * self);

 opcode_t PackFile_pack_size(struct PackFile *self);

@@ -99,11 +98,9 @@
 ** PackFile_FixupTable Functions:
 */

-void
-PackFile_FixupTable_clear(struct PackFile_FixupTable * self);
+void PackFile_FixupTable_clear(struct PackFile_FixupTable * self);

-BOOLVAL
-PackFile_FixupTable_unpack(struct PackFile_FixupTable * self, opcode_t * packed, opcode_t packed_size);
+BOOLVAL PackFile_FixupTable_unpack(struct PackFile_FixupTable * self, opcode_t * packed, opcode_t packed_size);

 opcode_t PackFile_FixupTable_pack_size(struct PackFile_FixupTable * self);

@@ -113,21 +110,18 @@
 ** PackFile_ConstTable Functions:
 */

-void
-PackFile_ConstTable_clear(struct PackFile_ConstTable * self);
+void PackFile_ConstTable_clear(struct PackFile_ConstTable * self);

 opcode_t PackFile_ConstTable_pack_size(struct PackFile_ConstTable * self);

-void
-PackFile_ConstTable_pack(struct PackFile * pf,
-                            struct PackFile_ConstTable * self,
-                            opcode_t * packed);
+void PackFile_ConstTable_pack(struct PackFile * pf,
+                              struct PackFile_ConstTable * self,
+                              opcode_t * packed);

-BOOLVAL
-PackFile_ConstTable_unpack(struct Parrot_Interp *interpreter,
-                        struct PackFile * pf,
-                        struct PackFile_ConstTable * self,
-                        opcode_t * packed, opcode_t packed_size);
+BOOLVAL PackFile_ConstTable_unpack(struct Parrot_Interp *interpreter,
+                                   struct PackFile * pf,
+                                   struct PackFile_ConstTable * self,
+                                   opcode_t * packed, opcode_t packed_size);

 /*
 ** PackFile_Constant Functions:
@@ -135,41 +129,34 @@

 struct PackFile_Constant *PackFile_Constant_new(void);

-opcode_t
-PackFile_Constant_pack_size(struct PackFile_Constant * self);
+opcode_t PackFile_Constant_pack_size(struct PackFile_Constant * self);

-void
-PackFile_Constant_pack(struct PackFile_Constant * self, opcode_t * packed);
+void PackFile_Constant_pack(struct PackFile_Constant * self, opcode_t * packed);

-void
-PackFile_Constant_destroy(struct PackFile_Constant * self);
+void PackFile_Constant_destroy(struct PackFile_Constant * self);

 BOOLVAL PackFile_Constant_unpack(struct Parrot_Interp *interpreter,
-                                  struct PackFile *packfile,
-                                  struct PackFile_Constant *self,
-                                  opcode_t *packed, opcode_t packed_size);
+                                 struct PackFile *packfile,
+                                 struct PackFile_Constant *self,
+                                 opcode_t *packed, opcode_t packed_size);

-BOOLVAL
-PackFile_Constant_unpack_number(struct PackFile * pf,
-                                struct PackFile_Constant * self,
-                                opcode_t * packed, opcode_t packed_size);
+BOOLVAL PackFile_Constant_unpack_number(struct PackFile * pf,
+                                        struct PackFile_Constant * self,
+                                        opcode_t * packed, opcode_t packed_size);

 BOOLVAL PackFile_Constant_unpack_string(struct Parrot_Interp *interpreter,
-                                         struct PackFile * pf,
-                                         struct PackFile_Constant *self,
-                                         opcode_t *packed,
-                                         opcode_t packed_size);
+                                        struct PackFile * pf,
+                                        struct PackFile_Constant *self,
+                                        opcode_t *packed,
+                                        opcode_t packed_size);

 opcode_t PackFile_fetch_op(struct PackFile *pf, opcode_t *stream);

-INTVAL
-PackFile_fetch_iv(struct PackFile *pf, opcode_t *stream);
+INTVAL PackFile_fetch_iv(struct PackFile *pf, opcode_t *stream);

-FLOATVAL
-PackFile_fetch_nv(struct PackFile *pf, opcode_t *stream);
+FLOATVAL PackFile_fetch_nv(struct PackFile *pf, opcode_t *stream);

-void
-PackFile_assign_transforms(struct PackFile *pf);
+void PackFile_assign_transforms(struct PackFile *pf);

 /*
 ** Byte Ordering Functions (byteorder.c)


drivers: serial: altera_jtag: remove unused config

The driver configuration was not used, so just remove it.

Signed-off-by: Gerard Marull-Paretas <bedb45f43a286e49f4dcda039a436b216ae61ef3@nordicsemi.no>

--- drivers/serial/uart_altera_jtag_hal.c
+++ drivers/serial/uart_altera_jtag_hal.c
@@ -26,10 +26,7 @@
 static void uart_altera_jtag_poll_out(const struct device *dev,
 					       unsigned char c)
 {
-	const struct uart_device_config *config;
 	altera_avalon_jtag_uart_state ustate;
-
-	config = dev->config;

 	ustate.base = JTAG_UART_0_BASE;
 	altera_avalon_jtag_uart_write(&ustate, &c, 1, 0);
@@ -51,12 +48,6 @@
 	.err_check = NULL,
 };

-static const struct uart_device_config uart_altera_jtag_dev_cfg_0 = {
-	.base = (void *)JTAG_UART_0_BASE,
-	.sys_clk_freq = 0, /* Unused */
-};
-
-DEVICE_DT_INST_DEFINE(0, uart_altera_jtag_init, NULL,
-		      NULL, &uart_altera_jtag_dev_cfg_0,
-		      PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY,
+DEVICE_DT_INST_DEFINE(0, uart_altera_jtag_init, NULL, NULL, NULL, PRE_KERNEL_1,
+		      CONFIG_SERIAL_INIT_PRIORITY,
 		      &uart_altera_jtag_driver_api);


drm/irq: Coding style fix

drm/irq: Coding style fix

Noticed by Thierry Reding in his review, but I've merged the drm
vblank rework topic branch a bit too quickly. So separate fixup.

Cc: Thierry Reding <b75a4d02013b0e68ae2c6bb0dcfd4b7bec282dc9@gmail.com>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>


flashrom: Do not attempt to change the physical ID after setup()

--- plugins/flashrom/fu-flashrom-device.c
+++ plugins/flashrom/fu-flashrom-device.c
@@ -109,15 +109,18 @@
 fu_flashrom_device_probe (FuDevice *device, GError **error)
 {
 	const gchar *dev_name = NULL;
-	g_autofree gchar *path = NULL;
+	const gchar *sysfs_path = NULL;

 	/* FuUdevDevice->probe */
 	if (!FU_DEVICE_CLASS (fu_flashrom_device_parent_class)->probe (device, error))
 		return FALSE;

-	path = g_strdup_printf ("DEVNAME=%s",
-				fu_udev_device_get_sysfs_path (FU_UDEV_DEVICE (device)));
-	fu_device_set_physical_id (device, path);
+	sysfs_path = fu_udev_device_get_sysfs_path (FU_UDEV_DEVICE (device));
+	if (sysfs_path != NULL) {
+		g_autofree gchar *physical_id = NULL;
+		physical_id = g_strdup_printf ("DEVNAME=%s", sysfs_path);
+		fu_device_set_physical_id (device, physical_id);
+	}
 	dev_name = fu_udev_device_get_sysfs_attr (FU_UDEV_DEVICE (device), "name", NULL);
 	if (dev_name != NULL) {
 		fu_device_add_instance_id_full (device, dev_name,


fixed hastable histograms assertion failure when the table is empty + added some more debug info.

--- include/pinba/histogram.h
+++ include/pinba/histogram.h
@@ -214,6 +214,9 @@
 	if (percentile == 0.) // 0'th percentile is always 0
 		return {0};

+	if (hv.items_total() == 0) // no values in histogram, nothing to do
+		return {0};
+
 	uint32_t const required_sum = [&]()
 	{
 		uint32_t const res = std::ceil(hv.items_total() * percentile / 100.0);
@@ -238,13 +241,9 @@
 	auto const map_end = map.end();

 	uint32_t current_sum = 0;
-	uint32_t bucket_id   = 0;
-
-	for (; current_sum < required_sum; bucket_id++)
-	{
-		// infinity checked before the loop
-		assert(bucket_id < conf.bucket_count);
-
+
+	for (uint32_t bucket_id = 0; bucket_id < conf.bucket_count; bucket_id++)
+	{
 		auto const it = map.find(bucket_id);
 		if (it == map_end)
 		{
@@ -276,6 +275,11 @@
 			return conf.bucket_d * bucket_id + d;
 		}
 	}
+
+	// dump map contents to stderr, as we're going to die anyway
+	ff::fmt(stderr, "{0} internal failure, dumping histogram: {1} values\n", __func__, map.size());
+	for (auto const& pair : map)
+		ff::fmt(stderr, "[{0}] -> {1}\n", pair.first, pair.second);

 	assert(!"must not be reached");
 	// return conf.bucket_d * conf.bucket_count;
@@ -351,6 +355,11 @@
 		}
 	}

+	// dump hv contents to stderr, as we're going to die anyway
+	ff::fmt(stderr, "{0} internal failure, dumping histogram: {1} values\n", __func__, hv.values.size());
+	for (auto const& item : hv.values)
+		ff::fmt(stderr, "[{0}] -> {1}\n", item.bucket_id, item.value);
+
 	assert(!"must not be reached");
 	// return conf.bucket_d * conf.bucket_count;
 }


drm/irq: BUG_ON() -> WARN_ON()

drm/irq: BUG_ON() -> WARN_ON()

Let's make things a bit easier to debug when things go bad (potentially
under console_lock).

Signed-off-by: Rob Clark <915c10c999604870200b6defbe633d857c856ca0@gmail.com>
Reviewed-by: Michel Dänzer <242b79f0804cf52679d58f27ed754158c1323c75@amd.com>
Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>


Staging: echo: remove bit_operations.h

Staging: echo: remove bit_operations.h

This file is no longer needed, thanks to the work done by David.

Cc: David Rowe <aa743a0aaec8f7d7a1f01442503957f4d7a2d634@rowetel.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/echo/bit_operations.h
+++ drivers/staging/echo/bit_operations.h
@@ -1,226 +0,0 @@
-/*
- * SpanDSP - a series of DSP components for telephony
- *
- * bit_operations.h - Various bit level operations, such as bit reversal
- *
- * Written by Steve Underwood <steveu@coppice.org>
- *
- * Copyright (C) 2006 Steve Underwood
- *
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2, as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/*! \file */
-
-#if !defined(_BIT_OPERATIONS_H_)
-#define _BIT_OPERATIONS_H_
-
-#if defined(__i386__)  ||  defined(__x86_64__)
-/*! \brief Find the bit position of the highest set bit in a word
-    \param bits The word to be searched
-    \return The bit number of the highest set bit, or -1 if the word is zero. */
-static inline int top_bit(unsigned int bits)
-{
-	int res;
-
-	__asm__(" xorl %[res],%[res];\n"
-		" decl %[res];\n"
-		" bsrl %[bits],%[res]\n"
-		:[res] "=&r" (res)
-		:[bits] "rm"(bits)
-	);
-	return res;
-}
-
-/*! \brief Find the bit position of the lowest set bit in a word
-    \param bits The word to be searched
-    \return The bit number of the lowest set bit, or -1 if the word is zero. */
-static inline int bottom_bit(unsigned int bits)
-{
-	int res;
-
-	__asm__(" xorl %[res],%[res];\n"
-		" decl %[res];\n"
-		" bsfl %[bits],%[res]\n"
-		:[res] "=&r" (res)
-		:[bits] "rm"(bits)
-	);
-	return res;
-}
-#else
-static inline int top_bit(unsigned int bits)
-{
-	int i;
-
-	if (bits == 0)
-		return -1;
-	i = 0;
-	if (bits & 0xFFFF0000) {
-		bits &= 0xFFFF0000;
-		i += 16;
-	}
-	if (bits & 0xFF00FF00) {
-		bits &= 0xFF00FF00;
-		i += 8;
-	}
-	if (bits & 0xF0F0F0F0) {
-		bits &= 0xF0F0F0F0;
-		i += 4;
-	}
-	if (bits & 0xCCCCCCCC) {
-		bits &= 0xCCCCCCCC;
-		i += 2;
-	}
-	if (bits & 0xAAAAAAAA) {
-		bits &= 0xAAAAAAAA;
-		i += 1;
-	}
-	return i;
-}
-
-static inline int bottom_bit(unsigned int bits)
-{
-	int i;
-
-	if (bits == 0)
-		return -1;
-	i = 32;
-	if (bits & 0x0000FFFF) {
-		bits &= 0x0000FFFF;
-		i -= 16;
-	}
-	if (bits & 0x00FF00FF) {
-		bits &= 0x00FF00FF;
-		i -= 8;
-	}
-	if (bits & 0x0F0F0F0F) {
-		bits &= 0x0F0F0F0F;
-		i -= 4;
-	}
-	if (bits & 0x33333333) {
-		bits &= 0x33333333;
-		i -= 2;
-	}
-	if (bits & 0x55555555) {
-		bits &= 0x55555555;
-		i -= 1;
-	}
-	return i;
-}
-#endif
-
-/*! \brief Bit reverse a byte.
-    \param data The byte to be reversed.
-    \return The bit reversed version of data. */
-static inline uint8_t bit_reverse8(uint8_t x)
-{
-#if defined(__i386__)  ||  defined(__x86_64__)
-	/* If multiply is fast */
-	return ((x * 0x0802U & 0x22110U) | (x * 0x8020U & 0x88440U)) *
-	    0x10101U >> 16;
-#else
-	/* If multiply is slow, but we have a barrel shifter */
-	x = (x >> 4) | (x << 4);
-	x = ((x & 0xCC) >> 2) | ((x & 0x33) << 2);
-	return ((x & 0xAA) >> 1) | ((x & 0x55) << 1);
-#endif
-}
-
-/*! \brief Bit reverse a 16 bit word.
-    \param data The word to be reversed.
-    \return The bit reversed version of data. */
-uint16_t bit_reverse16(uint16_t data);
-
-/*! \brief Bit reverse a 32 bit word.
-    \param data The word to be reversed.
-    \return The bit reversed version of data. */
-uint32_t bit_reverse32(uint32_t data);
-
-/*! \brief Bit reverse each of the four bytes in a 32 bit word.
-    \param data The word to be reversed.
-    \return The bit reversed version of data. */
-uint32_t bit_reverse_4bytes(uint32_t data);
-
-/*! \brief Find the number of set bits in a 32 bit word.
-    \param x The word to be searched.
-    \return The number of set bits. */
-int one_bits32(uint32_t x);
-
-/*! \brief Create a mask as wide as the number in a 32 bit word.
-    \param x The word to be searched.
-    \return The mask. */
-uint32_t make_mask32(uint32_t x);
-
-/*! \brief Create a mask as wide as the number in a 16 bit word.
-    \param x The word to be searched.
-    \return The mask. */
-uint16_t make_mask16(uint16_t x);
-
-/*! \brief Find the least significant one in a word, and return a word
-	    with just that bit set.
-    \param x The word to be searched.
-    \return The word with the single set bit. */
-static inline uint32_t least_significant_one32(uint32_t x)
-{
-	return x & (-(int32_t) x);
-}
-
-/*! \brief Find the most significant one in a word, and return a word
-	    with just that bit set.
-    \param x The word to be searched.
-    \return The word with the single set bit. */
-static inline uint32_t most_significant_one32(uint32_t x)
-{
-#if defined(__i386__)  ||  defined(__x86_64__)
-	return 1 << top_bit(x);
-#else
-	x = make_mask32(x);
-	return x ^ (x >> 1);
-#endif
-}
-
-/*! \brief Find the parity of a byte.
-    \param x The byte to be checked.
-    \return 1 for odd, or 0 for even. */
-static inline int parity8(uint8_t x)
-{
-	x = (x ^ (x >> 4)) & 0x0F;
-	return (0x6996 >> x) & 1;
-}
-
-/*! \brief Find the parity of a 16 bit word.
-    \param x The word to be checked.
-    \return 1 for odd, or 0 for even. */
-static inline int parity16(uint16_t x)
-{
-	x ^= (x >> 8);
-	x = (x ^ (x >> 4)) & 0x0F;
-	return (0x6996 >> x) & 1;
-}
-
-/*! \brief Find the parity of a 32 bit word.
-    \param x The word to be checked.
-    \return 1 for odd, or 0 for even. */
-static inline int parity32(uint32_t x)
-{
-	x ^= (x >> 16);
-	x ^= (x >> 8);
-	x = (x ^ (x >> 4)) & 0x0F;
-	return (0x6996 >> x) & 1;
-}
-
-#endif
-/*- End of file ------------------------------------------------------------*/


Ненужный virtual убран

Ненужный virtual убран

--- unreal/trunk/qrgui/umllib/contextMenuAction.h
+++ unreal/trunk/qrgui/umllib/contextMenuAction.h
@@ -17,7 +17,7 @@
 	private slots:
 		void trigger();
 	signals:
-		virtual void triggered(QPointF const &pos);
+		void triggered(QPointF const &pos);
 	private:
 		QPointF mEventPos;
 	};


Added config check for POLARSSL_SSL_SESSION_TICKETS

--- include/polarssl/config.h
+++ include/polarssl/config.h
@@ -1451,6 +1451,11 @@
 #error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
 #endif

+#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
+    ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) )
+#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
+#endif
+
 #if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) ||  \
     !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) ||      \
     !defined(POLARSSL_RSA_C) )


Fredrik Lundh: get rid of warning in pythonrun.c

--- Include/pythonrun.h
+++ Include/pythonrun.h
@@ -94,6 +94,7 @@

 /* Various internal finalizers */
 DL_IMPORT(void) fini_exceptions Py_PROTO((void));
+DL_IMPORT(void) _PyImport_Fini Py_PROTO((void));
 DL_IMPORT(void) PyMethod_Fini Py_PROTO((void));
 DL_IMPORT(void) PyFrame_Fini Py_PROTO((void));
 DL_IMPORT(void) PyCFunction_Fini Py_PROTO((void));


HID: appleir: force input to be set

HID: appleir: force input to be set

Some weird remotes are not correctly creating the input device. Their
report descriptor starts with:
0x06, 0x00, 0xff,              // Usage Page (Vendor Defined Page 1)  0
0xa1, 0x01,                    // Collection (Application)            3

whereas others (which are correctly handled) start with:
0x05, 0x0c,                    // Usage Page (Consumer Devices)       0
0x09, 0x01,                    // Usage (Consumer Control)            2
0xa1, 0x01,                    // Collection (Application)            4

The rest of the report descriptor is the same.

Adding the quirk HID_QUIRK_HIDINPUT_FORCE forces hid-input to allocate
the inputs, and everything should be ok.

Signed-off-by: Benjamin Tissoires <7a0e50e3f6a0939db82b6a8a423c08a163896f41@redhat.com>
Tested-by: James Henstridge <ec6702024a464385b89e3a81c797703e96f63b1a@canonical.com>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>


staging:iio:adc:ad7298 unwind use of IIO_CHAN macro.

This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

Signed-off-by: Jonathan Cameron <09f65b71b7655725897b2fd41a09a0cefe2e1ace@kernel.org>
Acked-by: Lars-Peter Clausen <3318dc5ce3e4fb7c28a0b841b6801c884e1d0896@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/iio/adc/ad7298_core.c
+++ drivers/staging/iio/adc/ad7298_core.c
@@ -22,34 +22,43 @@

 #include "ad7298.h"

+#define AD7298_V_CHAN(index)						\
+	{								\
+		.type = IIO_VOLTAGE,					\
+		.indexed = 1,						\
+		.channel = index,					\
+		.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,		\
+		.address = index,					\
+		.scan_index = index,					\
+		.scan_type = {						\
+			.sign = 'u',					\
+			.realbits = 12,					\
+			.storagebits = 16,				\
+		},							\
+	}
+
 static struct iio_chan_spec ad7298_channels[] = {
-	IIO_CHAN(IIO_TEMP, 0, 1, 0, NULL, 0, 0,
-		 IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
-		 9, AD7298_CH_TEMP, IIO_ST('s', 32, 32, 0), 0),
-	IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 0, 0,
-		 IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		 0, 0, IIO_ST('u', 12, 16, 0), 0),
-	IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 1, 0,
-		 IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		 1, 1, IIO_ST('u', 12, 16, 0), 0),
-	IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 2, 0,
-		 IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		 2, 2, IIO_ST('u', 12, 16, 0), 0),
-	IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 3, 0,
-		 IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		 3, 3, IIO_ST('u', 12, 16, 0), 0),
-	IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 4, 0,
-		 IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		 4, 4, IIO_ST('u', 12, 16, 0), 0),
-	IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 5, 0,
-		 IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		 5, 5, IIO_ST('u', 12, 16, 0), 0),
-	IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 6, 0,
-		 IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		 6, 6, IIO_ST('u', 12, 16, 0), 0),
-	IIO_CHAN(IIO_VOLTAGE, 0, 1, 0, NULL, 7, 0,
-		 IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		 7, 7, IIO_ST('u', 12, 16, 0), 0),
+	{
+		.type = IIO_TEMP,
+		.indexed = 1,
+		.channel = 0,
+		.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
+		.address = 9,
+		.scan_index = AD7298_CH_TEMP,
+		.scan_type = {
+			.sign = 's',
+			.realbits = 32,
+			.storagebits = 32,
+		},
+	},
+	AD7298_V_CHAN(0),
+	AD7298_V_CHAN(1),
+	AD7298_V_CHAN(2),
+	AD7298_V_CHAN(3),
+	AD7298_V_CHAN(4),
+	AD7298_V_CHAN(5),
+	AD7298_V_CHAN(6),
+	AD7298_V_CHAN(7),
 	IIO_CHAN_SOFT_TIMESTAMP(8),
 };


export midi

export midi

--- src/Firmware/interface/Export.h
+++ src/Firmware/interface/Export.h
@@ -21,3 +21,4 @@
 #include "leds/Variables.h"
 #include "leds/DataTypes.h"
 #include "leds/Constants.h"
+#include "../midi/MIDI.h"


Squashed 'subtree/rabit/' changes from 85b7463..4ebe657

4ebe657 fix in cxx11

git-subtree-dir: subtree/rabit
git-subtree-split: 4ebe657dd75999c1556c5f77625bdef2cd29917e

--- include/rabit/rabit-inl.h
+++ include/rabit/rabit-inl.h
@@ -294,9 +294,9 @@
 }

 #if __cplusplus >= 201103L
-template<typename DType>
-inline void Reducer<DType>::Allreduce(DType *sendrecvbuf, size_t count,
-                                      std::function<void()> prepare_fun) {
+template<typename DType, void (*freduce)(DType &dst, const DType &src)>
+inline void Reducer<DType, freduce>::Allreduce(DType *sendrecvbuf, size_t count,
+                                               std::function<void()> prepare_fun) {
   this->Allreduce(sendrecvbuf, count, InvokeLambda_, &prepare_fun);
 }
 template<typename DType>


hwmon: (abituguru) Use pr_fmt and pr_<level>

Added #define pr_fmt KBUILD_MODNAME ": " fmt
Converted printks to pr_<level>
Coalesced any long formats
Removed prefixes from formats
Added a few static strings to standardize logging messages.

Signed-off-by: Joe Perches <16a9a54ddf4259952e3c118c763138e83693d7fd@perches.com>
Signed-off-by: Guenter Roeck <32ce62c5480002985aec58d7044038218061ef55@ericsson.com>

--- drivers/hwmon/abituguru.c
+++ drivers/hwmon/abituguru.c
@@ -20,6 +20,9 @@
     the custom Abit uGuru chip found on Abit uGuru motherboards. Note: because
     of lack of specs the CPU/RAM voltage & frequency control is not supported!
 */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
@@ -220,6 +223,10 @@
 	u8 pwm_settings[ABIT_UGURU_MAX_PWMS][5];
 };

+static const char *never_happen = "This should never happen.";
+static const char *report_this =
+	"Please report this to the abituguru maintainer (see MAINTAINERS)";
+
 /* wait till the uguru is in the specified state */
 static int abituguru_wait(struct abituguru_data *data, u8 state)
 {
@@ -438,8 +445,7 @@

 	/* Test val is sane / usable for sensor type detection. */
 	if ((val < 10u) || (val > 250u)) {
-		printk(KERN_WARNING ABIT_UGURU_NAME
-			": bank1-sensor: %d reading (%d) too close to limits, "
+		pr_warn("bank1-sensor: %d reading (%d) too close to limits, "
 			"unable to determine sensor type, skipping sensor\n",
 			(int)sensor_addr, (int)val);
 		/* assume no sensor is there for sensors for which we can't
@@ -535,10 +541,8 @@
 				3) == 3)
 			break;
 	if (i == 3) {
-		printk(KERN_ERR ABIT_UGURU_NAME
-			": Fatal error could not restore original settings. "
-			"This should never happen please report this to the "
-			"abituguru maintainer (see MAINTAINERS)\n");
+		pr_err("Fatal error could not restore original settings. %s %s\n",
+		       never_happen, report_this);
 		return -ENODEV;
 	}
 	return ret;
@@ -1268,14 +1272,12 @@
 	}
 	/* Fail safe check, this should never happen! */
 	if (sysfs_names_free < 0) {
-		printk(KERN_ERR ABIT_UGURU_NAME ": Fatal error ran out of "
-		       "space for sysfs attr names. This should never "
-		       "happen please report to the abituguru maintainer "
-		       "(see MAINTAINERS)\n");
+		pr_err("Fatal error ran out of space for sysfs attr names. %s %s",
+		       never_happen, report_this);
 		res = -ENAMETOOLONG;
 		goto abituguru_probe_error;
 	}
-	printk(KERN_INFO ABIT_UGURU_NAME ": found Abit uGuru\n");
+	pr_info("found Abit uGuru\n");

 	/* Register sysfs hooks */
 	for (i = 0; i < sysfs_attr_i; i++)
@@ -1432,8 +1434,7 @@
 		"0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val);

 	if (force) {
-		printk(KERN_INFO ABIT_UGURU_NAME ": Assuming Abit uGuru is "
-				"present because of \"force\" parameter\n");
+		pr_info("Assuming Abit uGuru is present because of \"force\" parameter\n");
 		return ABIT_UGURU_BASE;
 	}

@@ -1467,8 +1468,7 @@

 	abituguru_pdev = platform_device_alloc(ABIT_UGURU_NAME, address);
 	if (!abituguru_pdev) {
-		printk(KERN_ERR ABIT_UGURU_NAME
-			": Device allocation failed\n");
+		pr_err("Device allocation failed\n");
 		err = -ENOMEM;
 		goto exit_driver_unregister;
 	}
@@ -1479,15 +1479,13 @@

 	err = platform_device_add_resources(abituguru_pdev, &res, 1);
 	if (err) {
-		printk(KERN_ERR ABIT_UGURU_NAME
-			": Device resource addition failed (%d)\n", err);
+		pr_err("Device resource addition failed (%d)\n", err);
 		goto exit_device_put;
 	}

 	err = platform_device_add(abituguru_pdev);
 	if (err) {
-		printk(KERN_ERR ABIT_UGURU_NAME
-			": Device addition failed (%d)\n", err);
+		pr_err("Device addition failed (%d)\n", err);
 		goto exit_device_put;
 	}


Clarified comment

Clarified comment

--- Input/InputSource.h
+++ Input/InputSource.h
@@ -190,7 +190,7 @@
 	/*! The location of the bytes to be read */
 	CFURLRef mURL;

-	/*! Subclasses should set this to true if Open() is successful */
+	/*! Subclasses should set this to \c true if Open() is successful and \c false if Close() is successful */
 	bool mIsOpen;


staging: iio: dac: Use spi_write() and handle return value

Signed-off-by: Michael Hennerich <38f18d03059a1bc88082b55d7ca2d9b1ebfaffe0@analog.com>
Acked-by: Jonathan Cameron <09f65b71b7655725897b2fd41a09a0cefe2e1ace@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/iio/dac/ad5624r_spi.c
+++ drivers/staging/iio/dac/ad5624r_spi.c
@@ -35,10 +35,9 @@
 	int internal_ref;
 };

-static int ad5624r_spi_write(struct spi_device *spi, u8 cmd, u8 addr, u16 val, u8 len)
-{
-	struct spi_transfer t;
-	struct spi_message m;
+static int ad5624r_spi_write(struct spi_device *spi,
+			     u8 cmd, u8 addr, u16 val, u8 len)
+{
 	u32 data;
 	u8 msg[3];

@@ -54,15 +53,7 @@
 	msg[1] = data >> 8;
 	msg[2] = data;

-	spi_message_init(&m);
-	memset(&t, 0, (sizeof t));
-	t.tx_buf = &msg[0];
-	t.len = 3;
-
-	spi_message_add_tail(&t, &m);
-	spi_sync(spi, &m);
-
-	return len;
+	return spi_write(spi, msg, 3);
 }

 static ssize_t ad5624r_write_dac(struct device *dev,
@@ -80,7 +71,7 @@
 	if (ret)
 		return ret;

-	ad5624r_spi_write(st->us, AD5624R_CMD_WRITE_INPUT_N_UPDATE_N,
+	ret = ad5624r_spi_write(st->us, AD5624R_CMD_WRITE_INPUT_N_UPDATE_N,
 			this_attr->address, readin, st->data_len);
 	return ret ? ret : len;
 }
@@ -109,7 +100,7 @@
 	if (ret)
 		return ret;

-	ad5624r_spi_write(st->us, AD5624R_CMD_LDAC_SETUP, 0, readin & 0xF, 16);
+	ret = ad5624r_spi_write(st->us, AD5624R_CMD_LDAC_SETUP, 0, readin & 0xF, 16);
 	st->ldac_mode = readin & 0xF;

 	return ret ? ret : len;
@@ -141,7 +132,7 @@
 	if (ret)
 		return ret;

-	ad5624r_spi_write(st->us, AD5624R_CMD_POWERDOWN_DAC, 0,
+	ret = ad5624r_spi_write(st->us, AD5624R_CMD_POWERDOWN_DAC, 0,
 			((readin & 0x3) << 4) | (1 << this_attr->address), 16);

 	st->dac_power_mode[this_attr->address] = readin & 0x3;
@@ -173,7 +164,7 @@
 	if (ret)
 		return ret;

-	ad5624r_spi_write(st->us, AD5624R_CMD_INTERNAL_REFER_SETUP, 0, !!readin, 16);
+	ret = ad5624r_spi_write(st->us, AD5624R_CMD_INTERNAL_REFER_SETUP, 0, !!readin, 16);

 	st->internal_ref = !!readin;


fixed typos

fixed typos

--- include/rocksdb/options.h
+++ include/rocksdb/options.h
@@ -88,7 +88,7 @@
   // Recover from clean shutdown
   // We don't expect to find any corruption in the WAL
   // Use case : This is ideal for unit tests and rare applications that
-  // can require high consistency gaurantee
+  // can require high consistency guarantee
   kAbsoluteConsistency = 0x01,
   // Recover to point-in-time consistency
   // We stop the WAL playback on discovering WAL inconsistency
@@ -96,7 +96,7 @@
   // hard disk, SSD without super capacitor that store related data
   kPointInTimeRecovery = 0x02,
   // Recovery after a disaster
-  // We ignore any corruption in the  WAL and try to salvage as much data as
+  // We ignore any corruption in the WAL and try to salvage as much data as
   // possible
   // Use case : Ideal for last ditch effort to recover data or systems that
   // operate with low grade unrelated data
@@ -1097,7 +1097,7 @@
   bool enable_thread_tracking;

   // The limited write rate to DB if soft_rate_limit or
-  // level0_slowdown_writes_trigger is triggered. It is calcualted using
+  // level0_slowdown_writes_trigger is triggered. It is calculated using
   // size of user write requests before compression.
   // Unit: byte per second.
   //
@@ -1106,7 +1106,7 @@

   // If true, then DB::Open() will not update the statistics used to optimize
   // compaction decision by loading table properties from many files.
-  // Turning off this feature will improve DBOpen time espcially in
+  // Turning off this feature will improve DBOpen time especially in
   // disk environment.
   //
   // Default: false


hwmon: (w83l786ng) Fix fan speed control mode setting and reporting

The wrong mask is used, which causes some fan speed control modes
(pwmX_enable) to be incorrectly reported, and some modes to be
impossible to set.

[JD: add subject and description.]

Signed-off-by: Brian Carnes <c7d4d169951f4d42927b6a240b3361780409ffef@gmail.com>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Signed-off-by: Jean Delvare <49ad6a9f5aa17024c23048df346d55bda6837e01@linux-fr.org>


Correct the CBOR tags for the dumping function

--- dumper/dumper.c
+++ dumper/dumper.c
@@ -600,12 +600,12 @@
 	if (root == NULL) {
 		if (cbor->type == CN_CBOR_TAG) {
 			switch (cbor->v.sint) {
-			case 991: root = &SignedMessageWithTag; break;
-			case 992: root = &EnvelopedMessageWithTag; break;
-			case 993: root = &EncryptedMessageWithTag; break;
-			case 994: root = &MacMessageWithTag; break;
-			case 996: root = &Mac0MessageWithTag; break;
-			case 997: root = &Sign0MessageWithTag; break;
+			case 98: root = &SignedMessageWithTag; break;
+			case 96: root = &EnvelopedMessageWithTag; break;
+			case 16: root = &EncryptedMessageWithTag; break;
+			case 97: root = &MacMessageWithTag; break;
+			case 17: root = &Mac0MessageWithTag; break;
+			case 18: root = &Sign0MessageWithTag; break;
 			}
 		}
 	}


Staging: olpc_dcon.c: obsolete use of strict_stroul

As Dan mentioned, dcon_write() will only write u16 values. The
appropriate parts have been changed. As a result of module_param()
not accepting u16 as a valid data type, ushort is used.

Signed-off-by: Valentin Rothberg <d484ff0dce8fd014bfe319bab334c357ca5afaee@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/olpc_dcon/olpc_dcon.c
+++ drivers/staging/olpc_dcon/olpc_dcon.c
@@ -34,8 +34,8 @@

 /* Module definitions */

-static int resumeline = 898;
-module_param(resumeline, int, 0444);
+static ushort resumeline = 898;
+module_param(resumeline, ushort, 0444);

 /* Default off since it doesn't work on DCON ASIC in B-test OLPC board */
 static int useaa = 1;
@@ -498,10 +498,10 @@
 static ssize_t dcon_resumeline_store(struct device *dev,
 	struct device_attribute *attr, const char *buf, size_t count)
 {
-	unsigned long rl;
+	unsigned short rl;
 	int rc;

-	rc = strict_strtoul(buf, 10, &rl);
+	rc = kstrtou16(buf, 10, &rl);
 	if (rc)
 		return rc;


Implicit conversion to boolean of smart Sqrat pointers so they can be used in conditional expressions.


hwmon: (w83l768ng) Fix fan speed control range

The W83L786NG stores the fan speed on 4 bits while the sysfs interface
uses a 0-255 range. Thus the driver should scale the user input down
to map it to the device range, and scale up the value read from the
device before presenting it to the user. The reserved register nibble
should be left unchanged.

Signed-off-by: Jean Delvare <49ad6a9f5aa17024c23048df346d55bda6837e01@linux-fr.org>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Reviewed-by: Guenter Roeck <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@roeck-us.net>


staging: olpc_dcon: move fb stuff info dcon_priv, and clean up fb handling

 - move fbinfo and ignore_fb_events into dcon_priv
 - add calls to {un,}lock_fb_info before calling fb_blank
 - fail to load the driver if there are no registered framebuffers

That last one fixes a potential oops, where if the dcon driver loads
without a framebuffer registered, fb_blank will end up being passed a
NULL (and will attempt to dereference it).

Signed-off-by: Andres Salomon <3945bcf5fa0c9ecb9066fe0f9d287073618c06cc@queued.net>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/olpc_dcon/olpc_dcon.c
+++ drivers/staging/olpc_dcon/olpc_dcon.c
@@ -55,6 +55,7 @@

 struct dcon_priv {
 	struct i2c_client *client;
+	struct fb_info *fbinfo;

 	struct work_struct switch_source;
 	struct notifier_block reboot_nb;
@@ -66,6 +67,8 @@
 	/* Current output type; true == mono, false == color */
 	bool mono;
 	bool asleep;
+	/* This get set while controlling fb blank state from the driver */
+	bool ignore_fb_events;
 };

 /* I2C structures */
@@ -77,11 +80,6 @@

 /* Backlight device */
 static struct backlight_device *dcon_bl_dev;
-
-static struct fb_info *fbinfo;
-
-/* set this to 1 while controlling fb blank state from this driver */
-static int ignore_fb_events = 0;

 /* Current source, initialized at probe time */
 static int dcon_source;
@@ -346,8 +344,32 @@
 		mdelay(4);
 	}
 }
+
+static bool dcon_blank_fb(struct dcon_priv *dcon, bool blank)
+{
+	int err;
+
+	if (!lock_fb_info(dcon->fbinfo)) {
+		dev_err(&dcon->client->dev, "unable to lock framebuffer\n");
+		return false;
+	}
+	console_lock();
+	dcon->ignore_fb_events = true;
+	err = fb_blank(dcon->fbinfo,
+			blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK);
+	dcon->ignore_fb_events = false;
+	console_unlock();
+	unlock_fb_info(dcon->fbinfo);
+
+	if (err) {
+		dev_err(&dcon->client->dev, "couldn't %sblank framebuffer\n",
+				blank ? "" : "un");
+		return false;
+	}
+	return true;
+}
+
 /* Set the source of the display (CPU or DCON) */
-
 static void dcon_source_switch(struct work_struct *work)
 {
 	struct dcon_priv *dcon = container_of(work, struct dcon_priv,
@@ -391,17 +413,11 @@
 		 *
 		 * For now, we just hope..
 		 */
-		console_lock();
-		ignore_fb_events = 1;
-		if (fb_blank(fbinfo, FB_BLANK_UNBLANK)) {
-			ignore_fb_events = 0;
-			console_unlock();
+		if (!dcon_blank_fb(dcon, false)) {
 			printk(KERN_ERR "olpc-dcon:  Failed to enter CPU mode\n");
 			dcon_pending = DCON_SOURCE_DCON;
 			return;
 		}
-		ignore_fb_events = 0;
-		console_unlock();

 		/* And turn off the DCON */
 		pdata->set_dconload(1);
@@ -453,13 +469,7 @@
 			}
 		}

-		console_lock();
-		ignore_fb_events = 1;
-		if (fb_blank(fbinfo, FB_BLANK_POWERDOWN))
-			printk(KERN_ERR "olpc-dcon:  couldn't blank fb!\n");
-		ignore_fb_events = 0;
-		console_unlock();
-
+		dcon_blank_fb(dcon, true);
 		printk(KERN_INFO "olpc-dcon: The DCON has control\n");
 		break;
 	}
@@ -678,7 +688,7 @@
 			fbevent_nb);
 	int *blank = (int *) evdata->data;
 	if (((event != FB_EVENT_BLANK) && (event != FB_EVENT_CONBLANK)) ||
-			ignore_fb_events)
+			dcon->ignore_fb_events)
 		return 0;
 	dcon_sleep(dcon, *blank ? true : false);
 	return 0;
@@ -708,8 +718,12 @@

 	i2c_set_clientdata(client, dcon);

-	if (num_registered_fb >= 1)
-		fbinfo = registered_fb[0];
+	if (num_registered_fb < 1) {
+		dev_err(&client->dev, "DCON driver requires a registered fb\n");
+		rc = -EIO;
+		goto einit;
+	}
+	dcon->fbinfo = registered_fb[0];

 	rc = dcon_hw_init(dcon, 1);
 	if (rc)


Simplified some redundant pointer logic, and also trim symbols properly when they are set via equal signs

git-svn-id: f34796b572e3bc51798c098e642777ba0b714449@775 96dfbd92-d197-e211-9ca9-00110a534b34

--- as6502/symbols.c
+++ as6502/symbols.c
@@ -241,9 +241,8 @@

 	as6502_symbol_type type;
 	size_t len = strlen(line) + 1;
-	char *symbol_true = malloc(len);
-	strncpy(symbol_true, line, len);
-	char *symbol = symbol_true;
+	char *symbol = malloc(len);
+	strncpy(symbol, line, len);
 	int isByte = NO;

 	if (!strncasecmp(".byte", symbol, 5)) {
@@ -257,8 +256,9 @@
 		trimgreedytaild(symbol);
 	}

+	trimtailchard(symbol, ':'); // If there is a colon, truncate there
+	trimtailchard(symbol, '=');
 	trimtaild(symbol);
-	trimtailchard(symbol, ':'); // If there is a colon, truncate there

 	// TODO: implement variable declaration without equals signs
 	if (strchr(line, '=')  || isByte) { // Variable
@@ -272,7 +272,7 @@

 	as6502_addSymbolToTable(table, lineNumber, symbol, offset, type);

-	free(symbol_true);
+	free(symbol);

 	return type;
 }


  * Allow to resize canvases back to (0,0).

git-svn-id: 3f9eced0add15b5a9fa491ea3f7f263c10f60fd6@1336 92316355-f0b4-4df1-b90c-862c8a59935f

--- cucul/cucul.c
+++ cucul/cucul.c
@@ -259,8 +259,8 @@
             cv->allchars[f] = realloc(cv->allchars[f],
                                       new_size * sizeof(uint32_t));
             cv->allattrs[f] = realloc(cv->allattrs[f],
-                                     new_size * sizeof(uint32_t));
-            if(!cv->allchars[f] || !cv->allattrs[f])
+                                      new_size * sizeof(uint32_t));
+            if(new_size && (!cv->allchars[f] || !cv->allattrs[f]))
             {
 #if defined(HAVE_ERRNO_H)
                 errno = ENOMEM;
@@ -353,8 +353,8 @@
             cv->allchars[f] = realloc(cv->allchars[f],
                                       new_size * sizeof(uint32_t));
             cv->allattrs[f] = realloc(cv->allattrs[f],
-                                     new_size * sizeof(uint32_t));
-            if(!cv->allchars[f] || !cv->allattrs[f])
+                                      new_size * sizeof(uint32_t));
+            if(new_size && (!cv->allchars[f] || !cv->allattrs[f]))
             {
 #if defined(HAVE_ERRNO_H)
                 errno = ENOMEM;


Fix ParameterTypeFlags::withCompileTimeConst() bit manipulation

--- include/swift/AST/Types.h
+++ include/swift/AST/Types.h
@@ -2020,7 +2020,7 @@

   ParameterTypeFlags withCompileTimeConst(bool isConst) const {
     return ParameterTypeFlags(isConst ? value | ParameterTypeFlags::CompileTimeConst
-                                      : value | ParameterTypeFlags::CompileTimeConst);
+                                      : value - ParameterTypeFlags::CompileTimeConst);
   }

   ParameterTypeFlags withShared(bool isShared) const {


triflex: add ->remove method and module_exit()

Signed-off-by: Bartlomiej Zolnierkiewicz <248de9df611a028e5eceb9d893a2ed6c24c89ef4@gmail.com>

--- drivers/ide/pci/triflex.c
+++ drivers/ide/pci/triflex.c
@@ -117,6 +117,7 @@
 	.name		= "TRIFLEX_IDE",
 	.id_table	= triflex_pci_tbl,
 	.probe		= triflex_init_one,
+	.remove		= ide_pci_remove,
 };

 static int __init triflex_ide_init(void)
@@ -124,7 +125,13 @@
 	return ide_pci_register_driver(&driver);
 }

+static void __exit triflex_ide_exit(void)
+{
+	pci_unregister_driver(&driver);
+}
+
 module_init(triflex_ide_init);
+module_exit(triflex_ide_exit);

 MODULE_AUTHOR("Torben Mathiasen");
 MODULE_DESCRIPTION("PCI driver module for Compaq Triflex IDE");


staging: rtl8192e: Convert typedef INTERFACE_SELECT_8190PCI to enum interface_select_8190pci

Remove typedef from enum.
Rename enum.
Rename uses.

Signed-off-by: Larry Finger <ed0f1d78b8c21b2970494a178da4bdfa8beba2a7@lwfinger.net>

--- drivers/staging/rtl8192e/r8190P_def.h
+++ drivers/staging/rtl8192e/r8190P_def.h
@@ -150,12 +150,12 @@
 	POWER_SAVE_MODE_SAVE,
 };

-typedef	enum _INTERFACE_SELECT_8190PCI{
+enum interface_select_8190pci {
 	INTF_SEL1_MINICARD		= 0,
 	INTF_SEL0_PCIE			= 1,
 	INTF_SEL2_RSV			= 2,
 	INTF_SEL3_RSV			= 3,
-} INTERFACE_SELECT_8190PCI, *PINTERFACE_SELECT_8190PCI;
+};

 struct bb_reg_definition {
 	u32 rfintfs;


crypto/dpaa_sec: reorganize structure members

This patch reorganize the members of a structure
used by driver in its data-path to improve
performance.

Signed-off-by: Gagandeep Singh <e6d306c72b92f139a7e7973ee8ee79cc78f81691@nxp.com>
Acked-by: Akhil Goyal <74d7c4c993a22c1d4f60c46ff3d95c969a24a25c@nxp.com>

--- drivers/crypto/dpaa_sec/dpaa_sec.h
+++ drivers/crypto/dpaa_sec/dpaa_sec.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- *   Copyright 2016 NXP
+ *   Copyright 2016-2020 NXP
  *
  */

@@ -117,6 +117,9 @@
 };
 #endif
 typedef struct dpaa_sec_session_entry {
+	struct sec_cdb cdb;	/**< cmd block associated with qp */
+	struct dpaa_sec_qp *qp[MAX_DPAA_CORES];
+	struct qman_fq *inq[MAX_DPAA_CORES];
 	uint8_t dir;         /*!< Operation Direction */
 	uint8_t ctxt;	/*!< Session Context Type */
 	enum rte_crypto_cipher_algorithm cipher_alg; /*!< Cipher Algorithm*/
@@ -169,9 +172,6 @@
 		struct sec_pdcp_ctxt pdcp;
 #endif
 	};
-	struct dpaa_sec_qp *qp[MAX_DPAA_CORES];
-	struct qman_fq *inq[MAX_DPAA_CORES];
-	struct sec_cdb cdb;	/**< cmd block associated with qp */
 } dpaa_sec_session;

 struct dpaa_sec_qp {


trivial: Fix a compile warning when doing a unifying control transfer

--- plugins/unifying/fu-device-unifying.c
+++ plugins/unifying/fu-device-unifying.c
@@ -227,20 +227,22 @@

 	/* send request */
 	fu_unifying_dump_raw ("host->device", data_in, data_in_length);
-	if (priv->usb_device != NULL &&
-	    !g_usb_device_control_transfer (priv->usb_device,
-					    G_USB_DEVICE_DIRECTION_HOST_TO_DEVICE,
-					    G_USB_DEVICE_REQUEST_TYPE_CLASS,
-					    G_USB_DEVICE_RECIPIENT_INTERFACE,
-					    UNIFYING_REQUEST_SET_REPORT,
-					    value, idx,
-					    data_in, data_in_length,
-					    &actual_length,
-					    FU_DEVICE_UNIFYING_TIMEOUT_MS,
-					    NULL,
-					    error)) {
-		g_prefix_error (error, "failed to send data: ");
-		return FALSE;
+	if (priv->usb_device != NULL) {
+		g_autofree guint8 *data_in_buf = g_memdup (data_in, data_in_length);
+		if (!g_usb_device_control_transfer (priv->usb_device,
+						    G_USB_DEVICE_DIRECTION_HOST_TO_DEVICE,
+						    G_USB_DEVICE_REQUEST_TYPE_CLASS,
+						    G_USB_DEVICE_RECIPIENT_INTERFACE,
+						    UNIFYING_REQUEST_SET_REPORT,
+						    value, idx,
+						    data_in_buf, data_in_length,
+						    &actual_length,
+						    FU_DEVICE_UNIFYING_TIMEOUT_MS,
+						    NULL,
+						    error)) {
+			g_prefix_error (error, "failed to send data: ");
+			return FALSE;
+		}
 	}

 	/* get response */


memif: try harder to transmit packets

memif: try harder to transmit packets

Change-Id: I1e57a86b8872798a888e7d6128d9c4537a8090e6
Signed-off-by: Damjan Marion <9141bba8b2efed526e55cf796d48631af330ad98@cisco.com>

--- src/plugins/memif/device.c
+++ src/plugins/memif/device.c
@@ -31,8 +31,7 @@
 #define foreach_memif_tx_func_error	       \
 _(NO_FREE_SLOTS, "no free tx slots")           \
 _(TRUNC_PACKET, "packet > buffer size -- truncated in tx ring") \
-_(PENDING_MSGS, "pending msgs in tx ring") \
-_(NO_TX_QUEUES, "no tx queues")
+_(PENDING_MSGS, "pending msgs in tx ring")

 typedef enum
 {
@@ -173,13 +172,7 @@
   u32 thread_index = vlib_get_thread_index ();
   u8 tx_queues = vec_len (mif->tx_queues);
   memif_queue_t *mq;
-
-  if (PREDICT_FALSE (tx_queues == 0))
-    {
-      vlib_error_count (vm, node->node_index, MEMIF_TX_ERROR_NO_TX_QUEUES,
-			n_left);
-      goto error;
-    }
+  int n_retries = 5;

   if (tx_queues < vec_len (vlib_mains))
     {
@@ -187,13 +180,13 @@
       clib_spinlock_lock_if_init (&mif->lockp);
     }
   else
-    {
-      qid = thread_index;
-    }
+    qid = thread_index;
+
   mq = vec_elt_at_index (mif->tx_queues, qid);
   ring = mq->ring;
   ring_size = 1 << mq->log2_ring_size;
   mask = ring_size - 1;
+retry:

   /* free consumed buffers */

@@ -237,6 +230,9 @@
   CLIB_MEMORY_STORE_BARRIER ();
   ring->head = head;

+  if (n_left && n_retries--)
+    goto retry;
+
   clib_spinlock_unlock_if_init (&mif->lockp);

   if (n_left)
@@ -252,7 +248,6 @@
       mq->int_count++;
     }

-error:
   vlib_buffer_free (vm, vlib_frame_args (frame), frame->n_vectors);

   return frame->n_vectors;


add shared_ptr

add shared_ptr

error: pathspec 'eventrpc/src/shared_ptr.h' did not match any file(s) known to git

--- eventrpc/src/shared_ptr.h
+++ eventrpc/src/shared_ptr.h
@@ -0,0 +1,143 @@
+#ifndef __EVENTRPC_SHARED_PTR_H__
+#define __EVENTRPC_SHARED_PTR_H__
+
+#include "atomic.h"
+
+template<class T>
+class shared_ptr
+{
+  template<typename Y> friend class shared_ptr;
+ public:
+  typedef T value_type;
+  typedef T * pointer;
+  typedef T& reference;
+
+  explicit shared_ptr(T* p = NULL)
+    : ptr_(p) {
+    counter_ = new atomic_t;
+    *counter_ = ATOMIC_INIT(1);
+  }
+
+  shared_ptr& operator= (T* p) {
+    if(this->ptr_ == p) {
+      return *this;
+    }
+    dispose();
+    counter_ = new atomic_t;
+    *counter_ = ATOMIC_INIT(1);
+
+    return *this;
+  }
+
+  shared_ptr(const shared_ptr& r)
+    : ptr_(r.ptr_) {
+    atomic_add(r.counter_);
+    counter_ = r.counter_;
+  }
+
+  shared_ptr& operator= (const shared_ptr& r)  {
+    if(this == &r) {
+      return *this;
+    }
+    dispose();
+    ptr_ = r.ptr_;
+    atomic_add(r.counter_);
+    counter_ = r.counter_;
+    return *this;
+  }
+
+  template<typename Y>
+  shared_ptr(const shared_ptr<Y>& r) {
+    ptr_ = r.ptr_;
+    atomic_add(r.counter_);
+    counter_ = r.counter_;
+  }
+
+  template<typename Y>
+  shared_ptr& operator= (const shared_ptr<Y>& r) {
+    dispose();
+    ptr_ = r.ptr_;
+    atomic_add(r.counter_);
+    counter_ = r.counter_;
+    return *this;
+  }
+
+  template<typename Y>
+  shared_ptr(Y* py) {
+    counter_ = new atomic_t;
+    *counter_ = ATOMIC_INIT(1);
+    ptr_ = py;
+  }
+
+  template<typename Y>
+  shared_ptr& operator= (Y* py) {
+    if(this->ptr_ == py) {
+      return *this;
+    }
+    dispose();
+    counter_ = new atomic_t;
+    *counter_ = ATOMIC_INIT(1);
+    ptr_=py;
+    return *this;
+  }
+
+  ~shared_ptr() {
+    dispose();
+  }
+
+  void reset(T* p= NULL) {
+    if ( ptr_ == p ) return;
+    if (atomic_dec_and_test(counter_) == 0) {
+      delete(ptr_);
+    } else {
+      counter_ = new atomic_t;
+    }
+    *counter_ = ATOMIC_INIT(1);
+    ptr_ = p;
+  }
+
+  reference operator*() const {
+    return *ptr_;
+  }
+
+  pointer operator->() const {
+    return ptr_;
+  }
+
+  pointer get() const {
+    return ptr_;
+  }
+
+  int32 use_count() const {
+    return atomic_read(counter_);
+  }
+
+  bool unique() const  {
+    return atomic_read(counter_) == 1;
+  }
+
+ private:
+  void dispose() {
+    if (atomic_dec_and_test(counter_) == 0) {
+      delete ptr_;
+      delete counter_;
+    }
+  }
+
+  T *ptr_;
+  atomic_t* counter_;
+};
+
+template<typename A,typename B>
+inline bool operator==(shared_ptr<A> const & l, shared_ptr<B> const & r)
+{
+  return l.get() == r.get();
+}
+
+template<typename A,typename B>
+inline bool operator!=(shared_ptr<A> const & l, shared_ptr<B> const & r)
+{
+  return l.get() != r.get();
+}
+
+#endif  // __EVENTRPC_SHARED_PTR_H__


brcmsmac: fix uninitialized variable warning on arm architecture

Using gcc v4.7.2 gave following warning:

  CC [M]  drivers/net/wireless/brcm80211/brcmsmac/aiutils.o
brcmsmac/aiutils.c: In function 'ai_deviceremoved':
brcmsmac/aiutils.c:733:9: error: 'w' may be used uninitialized
in this function [-Werror=uninitialized]

Inspection of the pci_read_config_dword() function showed it can
return without modifying the output variable 'w' so this patch
initializes it to 0.

Reviewed-by: Pieter-Paul Giesberts <d101f7ec36e185d305862a92a05a9a0c1b62aa38@broadcom.com>
Reviewed-by: Piotr Haber <3e5ea2cf134814100e7360882d38b1d086e2de6b@broadcom.com>
Reviewed-by: Hante Meuleman <31ca5aa57e9f47a38c33f2797b138069dfa82656@broadcom.com>
Signed-off-by: Arend van Spriel <06447fbe43693466d3293d0b5eaeeb2efd3d7d3a@broadcom.com>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>


Fix segfault when attempting to take ref of invalid property

* Fix attempted access of uninitialized memory in read_property

--- php_request.c
+++ php_request.c
@@ -548,6 +548,7 @@
         zend_string *member_str = zval_get_string(member);
         zend_throw_exception_ex(spl_ce_RuntimeException, 0, "%.*s::$%.*s does not exist.", (int)ZSTR_LEN(ce_name), ZSTR_VAL(ce_name), (int)ZSTR_LEN(member_str), ZSTR_VAL(member_str));
         zend_string_release(member_str);
+        ZVAL_NULL(rv);
         return rv;
     }
     struct prop_handlers *hnd = zend_hash_str_find_ptr(&ServerRequest_prop_handlers, Z_STRVAL_P(member), Z_STRLEN_P(member));
@@ -580,6 +581,13 @@
 {
     struct prop_handlers *hnd = zend_hash_str_find_ptr(&ServerRequest_prop_handlers, Z_STRVAL_P(member), Z_STRLEN_P(member));
     return (hnd ? hnd->unset_property : std_object_handlers.unset_property)(object, member, cache_slot);
+}
+/* }}} */
+
+/* {{{ server_request_object_get_property_ptr_ptr */
+static zval *server_request_object_get_property_ptr_ptr(zend_object *object, zend_string *name, int type, void **cache_slot)
+{
+    return NULL;
 }
 /* }}} */

@@ -1000,7 +1008,7 @@
     ServerRequest_obj_handlers.read_property = server_request_object_read_property;
     ServerRequest_obj_handlers.write_property = server_request_object_write_property;
     ServerRequest_obj_handlers.unset_property = server_request_object_unset_property;
-    ServerRequest_obj_handlers.get_property_ptr_ptr = NULL;
+    ServerRequest_obj_handlers.get_property_ptr_ptr = server_request_object_get_property_ptr_ptr;
     ServerRequest_obj_handlers.clone_obj = server_request_clone_obj;

     INIT_CLASS_ENTRY(ce, "ServerRequest", ServerRequest_methods);


remove some defs from GUIslice_config_esp.h with not valid characters

--- src/GUIslice_config_esp.h
+++ src/GUIslice_config_esp.h
@@ -48,24 +48,16 @@

 // Specify the graphics driver library
 // - Uncomment one of the following graphics drivers
-#ifdef ARDUINO_M5Stack-Core-ESP32
-#define DRV_DISP_M5STACK           // M5Stack: m5stack/M5Stack library
-#else
 #define DRV_DISP_TFT_ESPI          // Arduino: Bodmer/TFT_eSPI library
-#endif
-
+//#define DRV_DISP_M5STACK           // M5Stack: m5stack/M5Stack library

 // Specify the touchscreen driver
 // - Uncomment one of the following touchscreen drivers
-#ifdef ARDUINO_M5Stack-Core-ESP32
-#define DRV_TOUCH_NONE            // No touchscreen support
-#else
 //#define DRV_TOUCH_NONE          // No touchscreen support
-#define DRV_TOUCH_ADA_STMPE610  // Arduino: Use Adafruit STMPE610 touch driver
+//#define DRV_TOUCH_ADA_STMPE610  // Arduino: Use Adafruit STMPE610 touch driver
 //#define DRV_TOUCH_ADA_FT6206    // Arduino: Use Adafruit FT6206 touch driver
-//#define DRV_TOUCH_TFT_ESPI      // Arduino: Use TFT_eSPI XPT2046 touch driver
+#define DRV_TOUCH_TFT_ESPI      // Arduino: Use TFT_eSPI XPT2046 touch driver
 //#define DRV_TOUCH_ADA_SIMPLE    // Arduino: Use Adafruit Touchscreen
-#endif

 // -----------------------------------------------------------------------------------------
 // Enable of optional features


sanity-check file offsets

sanity-check file offsets

--- daemon/dump.c
+++ daemon/dump.c
@@ -9,13 +9,27 @@

 #include "regdb.h"

-static void print_reg_rule(__u8 *db, struct regdb_file_reg_rule *rule)
+static void *get_file_ptr(__u8 *db, int dblen, int structlen, __be32 ptr)
 {
+	__u32 p = ntohl(ptr);
+
+	if (p > dblen - structlen) {
+		fprintf(stderr, "Invalid database file, bad pointer!\n");
+		exit(3);
+	}
+
+	return (void *)(db + p);
+}
+
+static void print_reg_rule(__u8 *db, int dblen, __be32 ruleptr)
+{
+	struct regdb_file_reg_rule *rule;
 	struct regdb_file_freq_range *freq;
 	struct regdb_file_power_rule *power;

-	freq = (void *)(db + ntohl(rule->freq_range_ptr));
-	power = (void *)(db + ntohl(rule->power_rule_ptr));
+	rule = get_file_ptr(db, dblen, sizeof(*rule), ruleptr);
+	freq = get_file_ptr(db, dblen, sizeof(*freq), rule->freq_range_ptr);
+	power = get_file_ptr(db, dblen, sizeof(*power), rule->power_rule_ptr);

 	printf("\t%d..%d kHz (maxbw: %d kHz, mod: 0x%x, restrict: 0x%x)\n",
 	       ntohl(freq->start_freq),
@@ -40,7 +54,7 @@
 	__u8 *db;
 	struct regdb_file_header *header;
 	struct regdb_file_reg_country *countries;
-	int num_countries, i, j;
+	int dblen, num_countries, i, j;

 	if (argc != 2) {
 		fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
@@ -58,15 +72,15 @@
 		return 2;
 	}

-	/* XXX: check file length to be at least >= sizeof(struct regdb_file_header) */
+	dblen = stat.st_size;

-	db = mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
+	db = mmap(NULL, dblen, PROT_READ, MAP_SHARED, fd, 0);
 	if (db == MAP_FAILED) {
 		perror("failed to mmap db file");
 		return 2;
 	}

-	header = (void *)db;
+	header = get_file_ptr(db, dblen, sizeof(*header), 0);

 	if (ntohl(header->magic) != REGDB_MAGIC) {
 		fprintf(stderr, "Invalid database magic\n");
@@ -79,18 +93,24 @@
 	}

 	num_countries = ntohl(header->reg_country_num);
-	countries = (void *)(db + ntohl(header->reg_country_ptr));
-
-	/* XXX: check countries pointer to be in file */
+	countries = get_file_ptr(db, dblen,
+				 sizeof(struct regdb_file_reg_country) * num_countries,
+				 header->reg_country_ptr);

 	for (i = 0; i < num_countries; i++) {
 		struct regdb_file_reg_rules_collection *rcoll;
 		struct regdb_file_reg_country *country = countries + i;
+		int num_rules;

 		printf("Country %.2s\n", country->alpha2);
-		rcoll = (void *)db + ntohl(country->reg_collection_ptr);
-		for (j = 0; j < ntohl(rcoll->reg_rule_num); j++)
-			print_reg_rule(db, (void *)(db + ntohl(rcoll->reg_rule_ptrs[j])));
+		rcoll = get_file_ptr(db, dblen, sizeof(*rcoll), country->reg_collection_ptr);
+		num_rules = ntohl(rcoll->reg_rule_num);
+		/* re-get pointer with sanity checking for num_rules */
+		rcoll = get_file_ptr(db, dblen,
+				     sizeof(*rcoll) + num_rules * sizeof(__be32),
+				     country->reg_collection_ptr);
+		for (j = 0; j < num_rules; j++)
+			print_reg_rule(db, dblen, rcoll->reg_rule_ptrs[j]);
 	}

 	return 0;


add comment for intervaltree repo

add comment for intervaltree repo

--- IntervalTree.h
+++ IntervalTree.h
@@ -1,3 +1,4 @@
+// Taken from: https://github.com/ekg/intervaltree
 #ifndef __INTERVAL_TREE_H
 #define __INTERVAL_TREE_H


Improve HAL_RingBuffer to handle different type sizes (#1083)

--- src/HAL/Include/nanoHAL.h
+++ src/HAL/Include/nanoHAL.h
@@ -1143,6 +1143,7 @@

 template<typename T> class HAL_RingBuffer
 {
+    size_t _dataSize;
     size_t _size;
     size_t _capacity;
     size_t _write_index;
@@ -1153,7 +1154,9 @@

     void Initialize(T* data, size_t size)
     {
-        _capacity = size;
+        _dataSize = sizeof(T);
+
+        _capacity = (size * _dataSize);
         _write_index = 0;
         _read_index = 0;
         _size = 0;
@@ -1161,9 +1164,9 @@
         _buffer = data;
     }

-    size_t Capacity() { return _capacity; }
-
-    size_t Length() { return _size; }
+    size_t Capacity() { return (_capacity / _dataSize); }
+
+    size_t Length() { return (_size / _dataSize); }

     // Push a single element to the buffer.
     size_t Push(const T data)
@@ -1172,13 +1175,13 @@
         destination += _write_index;

         *destination = data;
-        _write_index += 1;
+        _write_index += _dataSize;

         // check if we are the end of the capacity
         if (_write_index == _capacity) _write_index = 0;

         // update ring buffer size
-        _size += 1;
+        _size += _dataSize;

         return 1;
     }
@@ -1191,13 +1194,13 @@
         // sanity check for 0 length
         if (length == 0) return 0;

-        if(length < _capacity - _size)
+        if( (length * _dataSize) < (_capacity - _size))
         {
-            lengthToWrite = length;
+            lengthToWrite = (length * _dataSize);
         }
         else
         {
-            lengthToWrite = _capacity - _size;
+            lengthToWrite = (_capacity - _size);
         }

         // single memcpy
@@ -1224,7 +1227,7 @@
         // update ring buffer size
         _size += lengthToWrite;

-        return lengthToWrite;
+        return (lengthToWrite / _dataSize);
     }

     // Pop N elements from ring buffer returning them in the data argument.
@@ -1235,14 +1238,7 @@
         // sanity check for 0 length
         if (length == 0) return 0;

-        if(length < _size)
-        {
-            lengthToRead = length;
-        }
-        else
-        {
-            lengthToRead = _size;
-        }
+        lengthToRead = (length * _dataSize);

         // can read in a single memcpy
         if (lengthToRead <= _capacity - _read_index)
@@ -1277,7 +1273,7 @@
             _read_index = 0;
         }

-        return lengthToRead;
+        return (lengthToRead / _dataSize);
     }

     // Pop N elements from ring buffer. The elements are not actually returned, just popped from the buffer.
@@ -1288,14 +1284,7 @@
         // sanity check for 0 length
         if (length == 0) return 0;

-        if(length < _size)
-        {
-            lengthToRead = length;
-        }
-        else
-        {
-            lengthToRead = _size;
-        }
+        lengthToRead = (length * _dataSize);

         // can read in a single memcpy
         if (lengthToRead <= _capacity - _read_index)
@@ -1325,7 +1314,7 @@
             _read_index = 0;
         }

-        return lengthToRead;
+        return (lengthToRead / _dataSize);
     }

     void OptimizeSequence()
@@ -1350,7 +1339,7 @@
             // |xxxx......xxxxxx|

             // store size of tail
-            size_t tailSize = _write_index - 1;
+            size_t tailSize = _write_index - (1 * _dataSize);

             // 1st move tail to temp buffer (need to malloc first)
             T* tempBuffer = (T*)platform_malloc(tailSize);


intel_idle: Skylake Client Support - updated

Addition of PC9 state, and minor tweaks to existing PC6 and PC8 states.

Signed-off-by: Len Brown <b060cfa1096cc6e8be83699ddb4ed8a77dd63af5@intel.com>


driver: staging: wlan-ng: switched to pr_warn

changed printk(KERN_WARNING .. to pr_warn

Signed-off-by: Sherif Shehab Aldin <c9bf5ba5e076956e64b9f26c347cde0226270871@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/wlan-ng/hfa384x_usb.c
+++ drivers/staging/wlan-ng/hfa384x_usb.c
@@ -714,10 +714,9 @@

 	/* Validate the length, note body len calculation in bytes */
 	if (rridresult.riddata_len != complete->riddatalen) {
-		printk(KERN_WARNING
-		       "RID len mismatch, rid=0x%04x hlen=%d fwlen=%d\n",
-		       rridresult.rid,
-		       complete->riddatalen, rridresult.riddata_len);
+		pr_warn("RID len mismatch, rid=0x%04x hlen=%d fwlen=%d\n",
+			rridresult.rid,
+			complete->riddatalen, rridresult.riddata_len);
 		return -ENODATA;
 	}


event/dpaa: remove dead code

event/dpaa: remove dead code

Fix logical dead code.

Coverity issue: 323495
Fixes: 77b5311d0ece ("event/dpaa: support select based event")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <9985a735d5d5f80ef648228b285228d6eb6eaf45@huawei.com>
Acked-by: Hemant Agrawal <90d96ef1ecd8ed49b97c7897be950e80824a9c5c@nxp.com>

--- drivers/event/dpaa/dpaa_eventdev.c
+++ drivers/event/dpaa/dpaa_eventdev.c
@@ -174,7 +174,7 @@
 	int ret;
 	u16 ch_id;
 	void *buffers[8];
-	u32 num_frames, i, irq = 0;
+	u32 num_frames, i;
 	uint64_t cur_ticks = 0, wait_time_ticks = 0;
 	struct dpaa_port *portal = (struct dpaa_port *)port;
 	struct rte_mbuf *mbuf;
@@ -223,8 +223,6 @@
 	do {
 		/* Lets dequeue the frames */
 		num_frames = qman_portal_dequeue(ev, nb_events, buffers);
-		if (irq)
-			irq = 0;
 		if (num_frames)
 			break;
 		cur_ticks = rte_get_timer_cycles();


plugins ext compile BUGFIX missing API func decl macro

--- src/plugins_exts_compile.h
+++ src/plugins_exts_compile.h
@@ -95,14 +95,14 @@
  * @param[in] ctx YANG schema compilation context.
  * @return current module.
  */
-const struct lys_module *lysc_ctx_get_cur_mod(const struct lysc_ctx *ctx);
+LIBYANG_API_DECL const struct lys_module *lysc_ctx_get_cur_mod(const struct lysc_ctx *ctx);

 /**
  * @brief YANG schema compilation context getter for currently processed module.
  * @param[in] ctx YANG schema compilation context.
  * @return Currently processed module.
  */
-struct lysp_module *lysc_ctx_get_pmod(const struct lysc_ctx *ctx);
+LIBYANG_API_DECL struct lysp_module *lysc_ctx_get_pmod(const struct lysc_ctx *ctx);

 /**
  * @brief Compile substatements of an extension instance.
@@ -119,7 +119,8 @@
  * @return LY_EVALID if compilation of the substatements fails.
  * @return LY_ENOT if the extension is disabled (by if-feature) and should be ignored.
  */
-LIBYANG_API_DECL LY_ERR lys_compile_extension_instance(struct lysc_ctx *ctx, const struct lysp_ext_instance *ext_p, struct lysc_ext_instance *ext);
+LIBYANG_API_DECL LY_ERR lys_compile_extension_instance(struct lysc_ctx *ctx, const struct lysp_ext_instance *ext_p,
+        struct lysc_ext_instance *ext);

 /**
  * @brief Update path in the compile context, which is used for logging where the compilation failed.


staging: wilc1000: del_key: use netdev private wilc instead of g_linux_wlan

Use netdev private data member wilc instead of global variable g_linux_wlan.

Signed-off-by: Glen Lee <b273a5e0a15e6f6e6656fc1a8e14c039ac523a98@atmel.com>
Signed-off-by: Tony Cho <545cb41ca22b217ad08520fed1285c6bec9a869f@atmel.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


lib: os: ring_buffer: Clarify macro description

Description was falsely static that macros statically creates
the ring buffer objects. Clarify description since variables
are not static.

Signed-off-by: Krzysztof Chruscinski <9b6dc988558c51b0405b49b55c8e66862969844b@nordicsemi.no>

--- include/sys/ring_buffer.h
+++ include/sys/ring_buffer.h
@@ -64,7 +64,7 @@
  */

 /**
- * @brief Statically define and initialize a high performance ring buffer.
+ * @brief Define and initialize a high performance ring buffer.
  *
  * This macro establishes a ring buffer whose size must be a power of 2;
  * that is, the ring buffer contains 2^pow 32-bit words, where @a pow is
@@ -90,7 +90,7 @@
 	}

 /**
- * @brief Statically define and initialize a standard ring buffer.
+ * @brief Define and initialize a standard ring buffer.
  *
  * This macro establishes a ring buffer of an arbitrary size. A standard
  * ring buffer uses modulo arithmetic operations to maintain itself.
@@ -113,7 +113,7 @@
 	}

 /**
- * @brief Statically define and initialize a ring buffer for byte data.
+ * @brief Define and initialize a ring buffer for byte data.
  *
  * This macro establishes a ring buffer of an arbitrary size.
  *


Working on IntervalTree

Working on IntervalTree

--- IntervalTree.h
+++ IntervalTree.h
@@ -19,12 +19,13 @@
 		struct Node
 		{
 			PointType	Point;
+			Node*		Parent;
 			Node*		Left;
 			Node*		Right;
 			Intervals	Intervals;

-			Node(const PointType& point)
-				: Point(point)
+			Node(const PointType& point, Node* parent)
+				: Point(point), Parent(parent)
 			{ }
 		};

@@ -107,8 +108,9 @@
 							while (_node && prev == _node->Left);
 						}
 					} while (_node && _node->Intervals.empty());
-					if (_node) // TODO: fix begin!
-						_intervalsIt = --_node->Intervals.end();
+					if (!_node)
+						throw std::runtime_error("Invalid iterator!");
+					_intervalsIt = --_node->Intervals.end();
 				}
 			}
 		}
@@ -147,15 +149,14 @@

 		size_t size() const			{ return _size; }

-		void insert(const T& val)	{ InsertValue(_root, val); }
+		void insert(const T& val)	{ InsertValue(_root, NULL, val); }

 		void erase(const iterator& it)
 		{
 			if (!it._node)
 				throw std::runtime_error("Invalid iterator!");
 			it._node->Intervals.erase(it._intervalsIt); // the iterator is invalidated
-			if (it._node->Intervals.empty())
-				; // TODO: ...
+			RemoveNodes(it._node);
 		}

 	private:
@@ -171,20 +172,32 @@
 		static bool Intersects(const T& val, const PointType& point)
 		{ return !IntervalIsAtLeft(val, point) && !IntervalIsAtRight(val, point); }

-		void InsertValue(Node*& where, const T& val)
+		void RemoveNodes(Node* where)
+		{
+			if (!where || where->Left || where->Right || !where->Intervals.empty())
+				return;
+
+			Node* parent = where->Parent;
+			if (where == _root)
+				_root = NULL;
+			delete where;
+			RemoveNodes(parent);
+		}
+
+		static void InsertValue(Node*& where, Node* parent, const T& val)
 		{
 			if (!where)
-				where = new Node((val.GetLeft() + val.GetRight()) / 2);
+				where = new Node((val.GetLeft() + val.GetRight()) / 2, parent);

 			if (Intersects(val, where->Point))
 				where->Intervals.push_back(val);
 			else if (IntervalIsAtLeft(val, where->Point))
-				InsertNode(where->Left, val);
+				InsertNode(where->Left, where, val);
 			else if (IntervalIsAtRight(val, where->Point))
-				InsertNode(where->Right, val);
-		}
-
-		void DeleteNode(const Node* node)
+				InsertNode(where->Right, where, val);
+		}
+
+		static void DeleteNode(const Node* node)
 		{
 			if (!node)
 				return;


nrf/drivers/bluetooth: Reset evt_len to size of static buffer each iter.

For each iteration of polling BLE events from the Bluetooth LE stack.

--- ports/nrf/drivers/bluetooth/ble_drv.c
+++ ports/nrf/drivers/bluetooth/ble_drv.c
@@ -1071,8 +1071,8 @@
         sd_evt_handler(evt_id);
     }

-    uint16_t evt_len = sizeof(m_ble_evt_buf);
     while (1) {
+        uint16_t evt_len  = sizeof(m_ble_evt_buf);
         uint32_t err_code = sd_ble_evt_get(m_ble_evt_buf, &evt_len);
         if (err_code != NRF_SUCCESS) {
             // Possible error conditions:


drivers: mma8652: add mma8652_params_t for initialization

--- drivers/include/mma8652.h
+++ drivers/include/mma8652.h
@@ -66,6 +66,16 @@
     bool initialized;       /**< accelerometer status, true if accelerometer is initialized */
     int16_t scale;          /**< each count corresponds to (1/scale) g */
 } mma8652_t;
+
+/**
+ * @brief Data structure holding all the information needed for initialization
+ */
+typedef struct {
+    i2c_t i2c;              /**< I2C bus used */
+    uint8_t addr;           /**< accelerometer's I2C address */
+    uint8_t rate;           /**< accelerometer's sampling rate */
+    uint8_t scale;          /**< accelerometer's scale factor */
+} mma8652_params_t;

 /**
  * @brief MMA8652 accelerometer test.


msm: vidc: Add free buffer api to flush state

This change adds free buffer api to video
client's flushing state to allow buffer
freeing in flush state.

CRs-fixed: 430214
Change-Id: I970efbbd8cc503eab4b944e12630f1b1faa9069c
Signed-off-by: Maheshwar Ajja <d2d05c150d4a5b546ab169433b8261efde71359a@codeaurora.org>

--- drivers/video/msm/vidc/common/vcd/vcd_client_sm.c
+++ drivers/video/msm/vidc/common/vcd/vcd_client_sm.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2013, Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -1750,7 +1750,7 @@
 	 vcd_get_buffer_requirements_cmn,
 	 NULL,
 	 NULL,
-	 NULL,
+	 vcd_free_buffer_cmn,
 	 vcd_fill_output_buffer_cmn,
 	 vcd_clnt_cb_in_flushing,
 	 },


update

update

--- include/threads/rw_lock.h
+++ include/threads/rw_lock.h
@@ -116,7 +116,7 @@
     Impl& impl() noexcept { return reinterpret_cast<Impl&>(_storage); }
     const Impl& impl() const noexcept { return reinterpret_cast<Impl const&>(_storage); }

-    static const size_t StorageSize = 96;
+    static const size_t StorageSize = 128;
     static const size_t StorageAlign = 8;
     std::aligned_storage<StorageSize, StorageAlign>::type _storage;
 };


ArmPlatformPkg/ArmVExpressDxe: Fixed build after changing ARM_VEXPRESS_PLATFORM struct

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>

git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@17409 6f19259b-4bc3-4df7-8a09-765794883524

--- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.c
+++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.c
@@ -15,6 +15,12 @@
 #include "ArmVExpressInternal.h"
 #include <Library/ArmShellCmdLib.h>

+CONST EFI_GUID ArmHwA9x4Guid = { 0x2fd21cf6, 0xe6e8, 0x4ff2, { 0xa9, 0xca, 0x3b, 0x9f, 0x00, 0xe9, 0x28, 0x89 } };
+CONST EFI_GUID ArmHwA15x2A7x3Guid = { 0xd5e606eb, 0x83df, 0x4e90, { 0x81, 0xe8, 0xc3, 0xdb, 0x2f, 0x77, 0x17, 0x9a } };
+CONST EFI_GUID ArmHwA15Guid = { 0x6b8947c2, 0x4287, 0x4d91, { 0x8f, 0xe0, 0xa3, 0x81, 0xea, 0x5b, 0x56, 0x8f } };
+CONST EFI_GUID ArmHwA5Guid = { 0xa2cc7663, 0x4d7c, 0x448a, { 0xaa, 0xb5, 0x4c, 0x03, 0x4b, 0x6f, 0xda, 0xb7 } };
+CONST EFI_GUID NullGuid = { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } };
+
 //
 // Description of the four hardware platforms :
 // just the platform id for the time being.
@@ -23,11 +29,11 @@
 // model or hardware platforms).
 //
 CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = {
-  { ARM_HW_A9x4, { 0x2fd21cf6, 0xe6e8, 0x4ff2, { 0xa9, 0xca, 0x3b, 0x9f, 0x00, 0xe9, 0x28, 0x89 } }, L"vexpress-v2p-ca9.dtb" },
-  { ARM_HW_A15x2_A7x3, { 0xd5e606eb, 0x83df, 0x4e90, { 0x81, 0xe8, 0xc3, 0xdb, 0x2f, 0x77, 0x17, 0x9a } }, L"vexpress-v2p-ca15_a7.dtb" },
-  { ARM_HW_A15, { 0x6b8947c2, 0x4287, 0x4d91, { 0x8f, 0xe0, 0xa3, 0x81, 0xea, 0x5b, 0x56, 0x8f } }, L"vexpress-v2p-ca15-tc1.dtb" },
-  { ARM_HW_A5, { 0xa2cc7663, 0x4d7c, 0x448a, { 0xaa, 0xb5, 0x4c, 0x03, 0x4b, 0x6f, 0xda, 0xb7 } }, L"vexpress-v2p-ca5s.dtb" },
-  { ARM_FVP_VEXPRESS_UNKNOWN, { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } }
+  { ARM_HW_A9x4, &ArmHwA9x4Guid, L"vexpress-v2p-ca9.dtb" },
+  { ARM_HW_A15x2_A7x3, &ArmHwA15x2A7x3Guid, L"vexpress-v2p-ca15_a7.dtb" },
+  { ARM_HW_A15, &ArmHwA15Guid, L"vexpress-v2p-ca15-tc1.dtb" },
+  { ARM_HW_A5, &ArmHwA5Guid, L"vexpress-v2p-ca5s.dtb" },
+  { ARM_FVP_VEXPRESS_UNKNOWN, &NullGuid, NULL }
 };

 /**


[popsift] removed unimplemented function

--- src/popsift/sift_pyramid.h
+++ src/popsift/sift_pyramid.h
@@ -160,11 +160,6 @@

     void clone_device_descriptors_sub( const Config& conf, FeaturesDev* features );

-private:
-    // debug
-//    void print_tables_host( );
-
-public:
 };

 } // namespace popsift


iommu/amd: Correctly encode huge pages in iommu page tables

When a default page-size for given level should be mapped,
the level encoding must be 0 rather than 7. This fixes an
issue seen on IOMMUv2 hardware, where this encoding is
enforced.

Tested-by: Suravee Suthikulpanit <ed04488ebbbd0c8ebb072b7ab25add9fa816eb84@amd.com>
Signed-off-by: Joerg Roedel <61aff96566804ea1da8a65de5bcc892ce07caceb@suse.de>


bonding: remove the redundant judgements for bond_option_queue_id_set()

The dev_valid_name() will check the buffer length for input name, no need to
check it twice.

Cc: Jay Vosburgh <9ab50f27d4201db9b28483ba83c48ebafbb2aa17@us.ibm.com>
Cc: Veaceslav Falico <13e4c2c2c15eff98ad47d02f3ccee2d83dc7015d@redhat.com>
Cc: Andy Gospodarek <e3579b1e47f273529f0f929453e939a68ede9fd1@greyhouse.net>
Signed-off-by: Ding Tianhong <6319509b12a56ad4c8f781f7750eb8df2374d4fd@huawei.com>
Reviewed-by: Jiri Pirko <1b548d10035ae428195c41f5d55eedb1437ccd8a@resnulli.us>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/bonding/bond_options.c
+++ drivers/net/bonding/bond_options.c
@@ -1199,8 +1199,7 @@
 		goto err_no_cmd;

 	/* Check buffer length, valid ifname and queue id */
-	if (strlen(newval->string) > IFNAMSIZ ||
-	    !dev_valid_name(newval->string) ||
+	if (!dev_valid_name(newval->string) ||
 	    qid > bond->dev->real_num_tx_queues)
 		goto err_no_cmd;


Note that cpusets are OS-indexed

Note that cpusets are OS-indexed

This commit was SVN r612.

--- include/topology/cpuset.h
+++ include/topology/cpuset.h
@@ -45,6 +45,8 @@
 /** \defgroup topology_cpuset The Cpuset API
  *
  * for use in libtopology itself.
+ *
+ * \note cpusets are indexed by OS logical processor number.
  * @{
  */


irqchip: mmp: avoid to include irqs head file

Since <mach/irqs.h> in irq-mmp.c blocks the multiplatform build,
remove it instead.

Signed-off-by: Haojian Zhuang <979139d45d262f0480136b0da512e0afa0fe79d3@gmail.com>


Formatting.

Formatting.

--- include/unique_resource.h
+++ include/unique_resource.h
@@ -153,7 +153,7 @@
                 std::enable_if_t<std::is_pointer<RR>::value && std::is_nothrow_copy_constructible<RR>::value
                                 && ( std::is_class<std::remove_pointer_t<RR>>::value
                                         || std::is_union<std::remove_pointer_t<RR>>::value ), int> = 0
-                                >
+                >
         RR operator->() const noexcept
         {
             return m_resource;
@@ -175,7 +175,7 @@
         template<class RR = R, class DD = D,
             std::enable_if_t<(std::is_nothrow_move_assignable<RR>::value || std::is_nothrow_copy_assignable<RR>::value)
                             && (std::is_nothrow_copy_assignable<DD>::value || std::is_nothrow_copy_assignable<DD>::value), int> = 0
-                            >
+            >
         unique_resource& operator=(unique_resource&& other)
         {
             if( this != &other )


drivers/mcp2515: support no rst_pin

drivers/mcp2515: support no rst_pin

--- drivers/mcp2515/mcp2515.c
+++ drivers/mcp2515/mcp2515.c
@@ -99,7 +99,9 @@
         DEBUG("Error setting interrupt pin!\n");
         return -1;
     }
-    gpio_init(dev->conf->rst_pin, GPIO_OUT);
+    if (gpio_is_valid(dev->conf->rst_pin)) {
+        gpio_init(dev->conf->rst_pin, GPIO_OUT);
+    }

     res = mcp2515_spi_init(dev);
     if (res < 0) {
@@ -118,9 +120,14 @@

 void mcp2515_reset(candev_mcp2515_t *dev)
 {
-    gpio_clear(dev->conf->rst_pin);
-    xtimer_usleep(RESET_DELAY_US);
-    gpio_set(dev->conf->rst_pin);
+    if (gpio_is_valid(dev->conf->rst_pin)) {
+        gpio_clear(dev->conf->rst_pin);
+        xtimer_usleep(RESET_DELAY_US);
+        gpio_set(dev->conf->rst_pin);
+    }
+    else {
+        mcp2515_spi_reset(dev);
+    }
     xtimer_usleep(_osc_startup(dev));
 }


net/ixgbe/base: extract PHY probing function

Move the PHY probe code into a separate function so that it can be
reused. A subsequent patch will use it for configurations that
provide the PHY address explicitly.

Signed-off-by: Xiao Wang <28aecb4e45c1566b6185c24680691da84bd4fcf8@intel.com>
Acked-by: Wenzhuo Lu <58cb9036bdff9a5412edc3b9f70e105ccf59954f@intel.com>

--- drivers/net/ixgbe/base/ixgbe_phy.c
+++ drivers/net/ixgbe/base/ixgbe_phy.c
@@ -283,6 +283,39 @@
 }

 /**
+ * ixgbe_probe_phy - Probe a single address for a PHY
+ * @hw: pointer to hardware structure
+ * @phy_addr: PHY address to probe
+ *
+ * Returns true if PHY found
+ */
+static bool ixgbe_probe_phy(struct ixgbe_hw *hw, u16 phy_addr)
+{
+	u16 ext_ability = 0;
+
+	if (!ixgbe_validate_phy_addr(hw, phy_addr))
+		return false;
+
+	if (ixgbe_get_phy_id(hw))
+		return false;
+
+	hw->phy.type = ixgbe_get_phy_type_from_id(hw->phy.id);
+
+	if (hw->phy.type == ixgbe_phy_unknown) {
+		hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY,
+				     IXGBE_MDIO_PMA_PMD_DEV_TYPE, &ext_ability);
+		if (ext_ability &
+		    (IXGBE_MDIO_PHY_10GBASET_ABILITY |
+		     IXGBE_MDIO_PHY_1000BASET_ABILITY))
+			hw->phy.type = ixgbe_phy_cu_unknown;
+		else
+			hw->phy.type = ixgbe_phy_generic;
+	}
+
+	return true;
+}
+
+/**
  *  ixgbe_identify_phy_generic - Get physical layer module
  *  @hw: pointer to hardware structure
  *
@@ -291,8 +324,7 @@
 s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
 {
 	s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
-	u32 phy_addr;
-	u16 ext_ability = 0;
+	u16 phy_addr;

 	DEBUGFUNC("ixgbe_identify_phy_generic");

@@ -305,27 +337,7 @@

 	if (hw->phy.type == ixgbe_phy_unknown) {
 		for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) {
-			if (ixgbe_validate_phy_addr(hw, phy_addr)) {
-				hw->phy.addr = phy_addr;
-				ixgbe_get_phy_id(hw);
-				hw->phy.type =
-					ixgbe_get_phy_type_from_id(hw->phy.id);
-
-				if (hw->phy.type == ixgbe_phy_unknown) {
-					hw->phy.ops.read_reg(hw,
-						  IXGBE_MDIO_PHY_EXT_ABILITY,
-						  IXGBE_MDIO_PMA_PMD_DEV_TYPE,
-						  &ext_ability);
-					if (ext_ability &
-					    (IXGBE_MDIO_PHY_10GBASET_ABILITY |
-					     IXGBE_MDIO_PHY_1000BASET_ABILITY))
-						hw->phy.type =
-							 ixgbe_phy_cu_unknown;
-					else
-						hw->phy.type =
-							 ixgbe_phy_generic;
-				}
-
+		if (ixgbe_probe_phy(hw, phy_addr)) {
 				status = IXGBE_SUCCESS;
 				break;
 			}


mfd: arizona: Disable control interface reporting for WM5102 and WM5110

Rather than disabling the error reporting only for earlier revisions
unconditionally disable it.

Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>

--- drivers/mfd/arizona-irq.c
+++ drivers/mfd/arizona-irq.c
@@ -176,14 +176,7 @@
 		aod = &wm5102_aod;
 		irq = &wm5102_irq;

-		switch (arizona->rev) {
-		case 0:
-		case 1:
-			ctrlif_error = false;
-			break;
-		default:
-			break;
-		}
+		ctrlif_error = false;
 		break;
 #endif
 #ifdef CONFIG_MFD_WM5110
@@ -191,14 +184,7 @@
 		aod = &wm5110_aod;
 		irq = &wm5110_irq;

-		switch (arizona->rev) {
-		case 0:
-		case 1:
-			ctrlif_error = false;
-			break;
-		default:
-			break;
-		}
+		ctrlif_error = false;
 		break;
 #endif
 	default:


virtio: remove blank lines

virtio: remove blank lines

Putting blank line between function and following conditional
just wastes screen space, and makes code less obvious.

Signed-off-by: Stephen Hemminger <06fa905d7f2aaced6dc72e9511c71a2a51e8aead@networkplumber.org>
Acked-by: Changchun Ouyang <593bf1f161e79772915ea885e47cf0e95f4498c0@intel.com>

--- drivers/net/virtio/virtio_ethdev.c
+++ drivers/net/virtio/virtio_ethdev.c
@@ -228,7 +228,6 @@
 	dlen[0] = sizeof(uint16_t);

 	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
-
 	if (ret) {
 		PMD_INIT_LOG(ERR, "Multiqueue configured but send command "
 			  "failed, this is too late now...");
@@ -394,7 +393,6 @@
 	PMD_INIT_FUNC_TRACE();
 	ret = virtio_dev_queue_setup(dev, VTNET_CQ, VTNET_SQ_CQ_QUEUE_IDX,
 			vtpci_queue_idx, nb_desc, socket_id, &vq);
-
 	if (ret < 0) {
 		PMD_INIT_LOG(ERR, "control vq initialization failed");
 		return ret;
@@ -434,7 +432,6 @@
 	dlen[0] = 1;

 	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
-
 	if (ret)
 		PMD_INIT_LOG(ERR, "Failed to enable promisc");
 }
@@ -453,7 +450,6 @@
 	dlen[0] = 1;

 	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
-
 	if (ret)
 		PMD_INIT_LOG(ERR, "Failed to disable promisc");
 }
@@ -472,7 +468,6 @@
 	dlen[0] = 1;

 	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
-
 	if (ret)
 		PMD_INIT_LOG(ERR, "Failed to enable allmulticast");
 }
@@ -491,7 +486,6 @@
 	dlen[0] = 1;

 	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
-
 	if (ret)
 		PMD_INIT_LOG(ERR, "Failed to disable allmulticast");
 }


drivers/mma7660: do normal assignment instead of memcpy

--- drivers/mma7660/mma7660.c
+++ drivers/mma7660/mma7660.c
@@ -48,7 +48,7 @@
 int mma7660_init(mma7660_t *dev, const mma7660_params_t *params)
 {
     /* write device descriptor */
-    memcpy(&dev->params, params, sizeof(mma7660_params_t));
+    dev->params = *params;

     if (mma7660_set_mode(dev, 0, 0, 0, 0) != MMA7660_OK) {
         DEBUG("mma7660_set_mode failed!\n");


wl12xx: set max_sched_scan_ie_len correctly

The wiphy max_sched_scan_ie_len attribute was not set correctly and
remained as 0, so when IEs were being passed in a scheduled scan, we
were returning -EINVAL.

Fix this by setting the attribute properly.

Signed-off-by: Luciano Coelho <d1ef580865f8eb2e1d1c65bc406aba322cc98f3e@ti.com>

--- drivers/net/wireless/wl12xx/main.c
+++ drivers/net/wireless/wl12xx/main.c
@@ -4679,6 +4679,9 @@
 	wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE -
 			sizeof(struct ieee80211_header);

+	wl->hw->wiphy->max_sched_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE -
+		sizeof(struct ieee80211_header);
+
 	wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;

 	/* make sure all our channels fit in the scanned_ch bitmask */


drivers: modem: wncm14a2a: fix void ptr math warning

I have no idea what I was thinking when I wrote this.
But, it's an easy fix to remove the void * entirely.

Signed-off-by: Michael Scott <a17fed27eaa842282862ff7c1b9c8395a26ac320@foundries.io>

--- drivers/modem/wncm14a2a.c
+++ drivers/modem/wncm14a2a.c
@@ -1810,7 +1810,7 @@
 	ctx->mac_addr[1] = 0x10;

 	UNALIGNED_PUT(sys_cpu_to_be32(sys_rand32_get()),
-		      (u32_t *) ((void *)ctx->mac_addr+2));
+		      (u32_t *)(ctx->mac_addr + 2));

 	return ctx->mac_addr;
 }


asus-laptop: code movement

asus-laptop: code movement

The asus-laptop driver implements a number of interfaces like the
backlight class driver.  This change makes it easier to examine the
implementation of one interface at at a time, without having to search
through the file to find init() and exit() functions etc.

Signed-off-by: Corentin Chary <298d22bb5b8e08c296f77ec9e7162462cf47b8a1@iksaif.net>

--- drivers/platform/x86/asus-laptop.c
+++ drivers/platform/x86/asus-laptop.c
@@ -58,6 +58,36 @@
 #define ASUS_LAPTOP_FILE	KBUILD_MODNAME
 #define ASUS_LAPTOP_PREFIX	"\\_SB.ATKD."

+MODULE_AUTHOR("Julien Lerouge, Karol Kozimor, Corentin Chary");
+MODULE_DESCRIPTION(ASUS_LAPTOP_NAME);
+MODULE_LICENSE("GPL");
+
+/*
+ * WAPF defines the behavior of the Fn+Fx wlan key
+ * The significance of values is yet to be found, but
+ * most of the time:
+ * 0x0 will do nothing
+ * 0x1 will allow to control the device with Fn+Fx key.
+ * 0x4 will send an ACPI event (0x88) while pressing the Fn+Fx key
+ * 0x5 like 0x1 or 0x4
+ * So, if something doesn't work as you want, just try other values =)
+ */
+static uint wapf = 1;
+module_param(wapf, uint, 0644);
+MODULE_PARM_DESC(wapf, "WAPF value");
+
+static uint wireless_status = 1;
+static uint bluetooth_status = 1;
+
+module_param(wireless_status, uint, 0644);
+MODULE_PARM_DESC(wireless_status, "Set the wireless status on boot "
+		 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
+		 "default is 1");
+
+module_param(bluetooth_status, uint, 0644);
+MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot "
+		 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
+		 "default is 1");

 /*
  * Some events we use, same for all Asus
@@ -87,37 +117,6 @@
 #define LCD_ON		0x80	/* LCD backlight */
 #define GPS_ON		0x100	/* GPS */
 #define KEY_ON		0x200	/* Keyboard backlight */
-
-MODULE_AUTHOR("Julien Lerouge, Karol Kozimor, Corentin Chary");
-MODULE_DESCRIPTION(ASUS_LAPTOP_NAME);
-MODULE_LICENSE("GPL");
-
-/*
- * WAPF defines the behavior of the Fn+Fx wlan key
- * The significance of values is yet to be found, but
- * most of the time:
- * 0x0 will do nothing
- * 0x1 will allow to control the device with Fn+Fx key.
- * 0x4 will send an ACPI event (0x88) while pressing the Fn+Fx key
- * 0x5 like 0x1 or 0x4
- * So, if something doesn't work as you want, just try other values =)
- */
-static uint wapf = 1;
-module_param(wapf, uint, 0644);
-MODULE_PARM_DESC(wapf, "WAPF value");
-
-static uint wireless_status = 1;
-static uint bluetooth_status = 1;
-
-module_param(wireless_status, uint, 0644);
-MODULE_PARM_DESC(wireless_status, "Set the wireless status on boot "
-		 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
-		 "default is 1");
-
-module_param(bluetooth_status, uint, 0644);
-MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot "
-		 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
-		 "default is 1");

 #define ASUS_HANDLE(object, paths...)					\
 	static acpi_handle  object##_handle = NULL;			\
@@ -248,36 +247,6 @@
 	u16 event_count[128];	/* count for each event TODO make this better */
 	u16 *keycode_map;
 };
-
-/*
- * The backlight class declaration
- */
-static int read_brightness(struct backlight_device *bd);
-static int update_bl_status(struct backlight_device *bd);
-static struct backlight_ops asusbl_ops = {
-	.get_brightness = read_brightness,
-	.update_status = update_bl_status,
-};
-
-#define ASUS_LED(object, ledname, max)					\
-	static void object##_led_set(struct led_classdev *led_cdev,	\
-				     enum led_brightness value);	\
-	static enum led_brightness object##_led_get(			\
-		struct led_classdev *led_cdev);				\
-	static void object##_led_update(struct work_struct *ignored);	\
-	static struct led_classdev object##_led = {			\
-		.name           = "asus::" ledname,			\
-		.brightness_set = object##_led_set,			\
-		.brightness_get = object##_led_get,			\
-		.max_brightness = max					\
-	}
-
-ASUS_LED(mled, "mail", 1);
-ASUS_LED(tled, "touchpad", 1);
-ASUS_LED(rled, "record", 1);
-ASUS_LED(pled, "phone", 1);
-ASUS_LED(gled, "gaming", 1);
-ASUS_LED(kled, "kbd_backlight", 3);

 struct key_entry {
 	char type;
@@ -427,6 +396,29 @@
 		pr_warning(" write failed %x\n", mask);
 }

+/*
+ * LEDs
+ */
+#define ASUS_LED(object, ledname, max)					\
+	static void object##_led_set(struct led_classdev *led_cdev,	\
+				     enum led_brightness value);	\
+	static enum led_brightness object##_led_get(			\
+		struct led_classdev *led_cdev);				\
+	static void object##_led_update(struct work_struct *ignored);	\
+	static struct led_classdev object##_led = {			\
+		.name           = "asus::" ledname,			\
+		.brightness_set = object##_led_set,			\
+		.brightness_get = object##_led_get,			\
+		.max_brightness = max					\
+	}
+
+ASUS_LED(mled, "mail", 1);
+ASUS_LED(tled, "touchpad", 1);
+ASUS_LED(rled, "record", 1);
+ASUS_LED(pled, "phone", 1);
+ASUS_LED(gled, "gaming", 1);
+ASUS_LED(kled, "kbd_backlight", 3);
+
 /* /sys/class/led handlers */
 #define ASUS_LED_HANDLER(object, mask)					\
 	static void object##_led_set(struct led_classdev *led_cdev,	\
@@ -459,7 +451,7 @@
 ASUS_LED_HANDLER(gled, GLED_ON);

 /*
- * Keyboard backlight
+ * Keyboard backlight (also a LED)
  */
 static int get_kled_lvl(void)
 {
@@ -516,6 +508,70 @@
 	return get_kled_lvl();
 }

+#define ASUS_LED_UNREGISTER(object)				\
+	if (object##_led.dev)					\
+		led_classdev_unregister(&object##_led)
+
+static void asus_led_exit(struct asus_laptop *asus)
+{
+	ASUS_LED_UNREGISTER(mled);
+	ASUS_LED_UNREGISTER(tled);
+	ASUS_LED_UNREGISTER(pled);
+	ASUS_LED_UNREGISTER(rled);
+	ASUS_LED_UNREGISTER(gled);
+	ASUS_LED_UNREGISTER(kled);
+	if (asus->leds.workqueue) {
+		destroy_workqueue(asus->leds.workqueue);
+		asus->leds.workqueue = NULL;
+	}
+}
+
+/*  Ugly macro, need to fix that later */
+#define ASUS_LED_REGISTER(asus, object, _name, max)			\
+	do {								\
+		struct led_classdev *ldev = &asus->leds.object;		\
+		if (!object##_set_handle)				\
+			break ;						\
+									\
+		INIT_WORK(&asus->leds.object##_work, object##_led_update); \
+		ldev->name = "asus::" _name;				\
+		ldev->brightness_set = object##_led_set;		\
+		ldev->max_brightness = max;				\
+		rv = led_classdev_register(&asus->platform_device->dev, ldev); \
+		if (rv)							\
+			goto error;					\
+	} while (0)
+
+static int asus_led_init(struct asus_laptop *asus)
+{
+	int rv;
+
+	/*
+	 * Functions that actually update the LED's are called from a
+	 * workqueue. By doing this as separate work rather than when the LED
+	 * subsystem asks, we avoid messing with the Asus ACPI stuff during a
+	 * potentially bad time, such as a timer interrupt.
+	 */
+	asus->leds.workqueue = create_singlethread_workqueue("led_workqueue");
+	if (!asus->leds.workqueue)
+		return -ENOMEM;
+
+	ASUS_LED_REGISTER(asus, mled, "mail", 1);
+	ASUS_LED_REGISTER(asus, tled, "touchpad", 1);
+	ASUS_LED_REGISTER(asus, rled, "record", 1);
+	ASUS_LED_REGISTER(asus, pled, "phone", 1);
+	ASUS_LED_REGISTER(asus, gled, "gaming", 1);
+	if (kled_set_handle && kled_get_handle)
+		ASUS_LED_REGISTER(asus, kled, "kbd_backlight", 3);
+error:
+	if (rv)
+		asus_led_exit(asus);
+	return rv;
+}
+
+/*
+ * Backlight device
+ */
 static int get_lcd_state(struct asus_laptop *asus)
 {
 	return read_status(asus, LCD_ON);
@@ -586,6 +642,41 @@

 	value = (bd->props.power == FB_BLANK_UNBLANK) ? 1 : 0;
 	return set_lcd_state(asus, value);
+}
+
+static struct backlight_ops asusbl_ops = {
+	.get_brightness = read_brightness,
+	.update_status = update_bl_status,
+};
+
+static int asus_backlight_init(struct asus_laptop *asus)
+{
+	struct backlight_device *bd;
+	struct device *dev = &asus->platform_device->dev;
+
+	if (brightness_set_handle && lcd_switch_handle) {
+		bd = backlight_device_register(ASUS_LAPTOP_FILE, dev,
+					       asus, &asusbl_ops);
+		if (IS_ERR(bd)) {
+			pr_err("Could not register asus backlight device\n");
+			asus->backlight_device = NULL;
+			return PTR_ERR(bd);
+		}
+
+		asus->backlight_device = bd;
+
+		bd->props.max_brightness = 15;
+		bd->props.brightness = read_brightness(NULL);
+		bd->props.power = FB_BLANK_UNBLANK;
+		backlight_update_status(bd);
+	}
+	return 0;
+}
+
+static void asus_backlight_exit(struct asus_laptop *asus)
+{
+	if (asus->backlight_device)
+		backlight_device_unregister(asus->backlight_device);
 }

 /*
@@ -904,7 +995,7 @@
 }

 /*
- * Hotkey functions
+ * Input device (i.e. hotkeys)
  */
 static struct key_entry *asus_get_entry_by_scancode(struct asus_laptop *asus,
 						    int code)
@@ -965,10 +1056,72 @@
 	return -EINVAL;
 }

+static void asus_input_notify(struct asus_laptop *asus, int event)
+{
+	struct key_entry *key;
+
+	key = asus_get_entry_by_scancode(asus, event);
+	if (!key)
+		return ;
+
+	switch (key->type) {
+	case KE_KEY:
+		input_report_key(asus->inputdev, key->keycode, 1);
+		input_sync(asus->inputdev);
+		input_report_key(asus->inputdev, key->keycode, 0);
+		input_sync(asus->inputdev);
+		break;
+	}
+}
+
+static int asus_input_init(struct asus_laptop *asus)
+{
+	const struct key_entry *key;
+	int result;
+
+	asus->inputdev = input_allocate_device();
+	if (!asus->inputdev) {
+		pr_info("Unable to allocate input device\n");
+		return 0;
+	}
+	asus->inputdev->name = "Asus Laptop extra buttons";
+	asus->inputdev->dev.parent = &asus->platform_device->dev;
+	asus->inputdev->phys = ASUS_LAPTOP_FILE "/input0";
+	asus->inputdev->id.bustype = BUS_HOST;
+	asus->inputdev->getkeycode = asus_getkeycode;
+	asus->inputdev->setkeycode = asus_setkeycode;
+	input_set_drvdata(asus->inputdev, asus);
+
+	asus->keymap = kmemdup(asus_keymap, sizeof(asus_keymap),
+				GFP_KERNEL);
+	for (key = asus->keymap; key->type != KE_END; key++) {
+		switch (key->type) {
+		case KE_KEY:
+			set_bit(EV_KEY, asus->inputdev->evbit);
+			set_bit(key->keycode, asus->inputdev->keybit);
+			break;
+		}
+	}
+	result = input_register_device(asus->inputdev);
+	if (result) {
+		pr_info("Unable to register input device\n");
+		input_free_device(asus->inputdev);
+	}
+	return result;
+}
+
+static void asus_input_exit(struct asus_laptop *asus)
+{
+	if (asus->inputdev)
+		input_unregister_device(asus->inputdev);
+}
+
+/*
+ * ACPI driver
+ */
 static void asus_acpi_notify(struct acpi_device *device, u32 event)
 {
 	struct asus_laptop *asus = acpi_driver_data(device);
-	static struct key_entry *key;
 	u16 count;

 	/*
@@ -990,20 +1143,7 @@
 					dev_name(&asus->device->dev), event,
 					count);

-	if (asus->inputdev) {
-		key = asus_get_entry_by_scancode(asus, event);
-		if (!key)
-			return ;
-
-		switch (key->type) {
-		case KE_KEY:
-			input_report_key(asus->inputdev, key->keycode, 1);
-			input_sync(asus->inputdev);
-			input_report_key(asus->inputdev, key->keycode, 0);
-			input_sync(asus->inputdev);
-			break;
-		}
-	}
+	asus_input_notify(asus, event);
 }

 #define ASUS_CREATE_DEVICE_ATTR(_name)					\
@@ -1257,142 +1397,6 @@
 	return AE_OK;
 }

-static int asus_input_init(struct asus_laptop *asus)
-{
-	const struct key_entry *key;
-	int result;
-
-	asus->inputdev = input_allocate_device();
-	if (!asus->inputdev) {
-		pr_info("Unable to allocate input device\n");
-		return 0;
-	}
-	asus->inputdev->name = "Asus Laptop extra buttons";
-	asus->inputdev->dev.parent = &asus->platform_device->dev;
-	asus->inputdev->phys = ASUS_LAPTOP_FILE "/input0";
-	asus->inputdev->id.bustype = BUS_HOST;
-	asus->inputdev->getkeycode = asus_getkeycode;
-	asus->inputdev->setkeycode = asus_setkeycode;
-	input_set_drvdata(asus->inputdev, asus);
-
-	asus->keymap = kmemdup(asus_keymap, sizeof(asus_keymap),
-				GFP_KERNEL);
-	for (key = asus->keymap; key->type != KE_END; key++) {
-		switch (key->type) {
-		case KE_KEY:
-			set_bit(EV_KEY, asus->inputdev->evbit);
-			set_bit(key->keycode, asus->inputdev->keybit);
-			break;
-		}
-	}
-	result = input_register_device(asus->inputdev);
-	if (result) {
-		pr_info("Unable to register input device\n");
-		input_free_device(asus->inputdev);
-	}
-	return result;
-}
-
-static void asus_backlight_exit(struct asus_laptop *asus)
-{
-	if (asus->backlight_device)
-		backlight_device_unregister(asus->backlight_device);
-}
-
-#define ASUS_LED_UNREGISTER(object)				\
-	if (object##_led.dev)					\
-		led_classdev_unregister(&object##_led)
-
-static void asus_led_exit(struct asus_laptop *asus)
-{
-	ASUS_LED_UNREGISTER(mled);
-	ASUS_LED_UNREGISTER(tled);
-	ASUS_LED_UNREGISTER(pled);
-	ASUS_LED_UNREGISTER(rled);
-	ASUS_LED_UNREGISTER(gled);
-	ASUS_LED_UNREGISTER(kled);
-	if (asus->leds.workqueue) {
-		destroy_workqueue(asus->leds.workqueue);
-		asus->leds.workqueue = NULL;
-	}
-}
-
-static void asus_input_exit(struct asus_laptop *asus)
-{
-	if (asus->inputdev)
-		input_unregister_device(asus->inputdev);
-}
-
-static int asus_backlight_init(struct asus_laptop *asus)
-{
-	struct backlight_device *bd;
-	struct device *dev = &asus->platform_device->dev;
-
-	if (brightness_set_handle && lcd_switch_handle) {
-		bd = backlight_device_register(ASUS_LAPTOP_FILE, dev,
-					       asus, &asusbl_ops);
-		if (IS_ERR(bd)) {
-			pr_err("Could not register asus backlight device\n");
-			asus->backlight_device = NULL;
-			return PTR_ERR(bd);
-		}
-
-		asus->backlight_device = bd;
-
-		bd->props.max_brightness = 15;
-		bd->props.brightness = read_brightness(NULL);
-		bd->props.power = FB_BLANK_UNBLANK;
-		backlight_update_status(bd);
-	}
-	return 0;
-}
-
-/*
- * Ugly macro, need to fix that later
- */
-#define ASUS_LED_REGISTER(asus, object, _name, max)			\
-	do {								\
-		struct led_classdev *ldev = &asus->leds.object;		\
-		if (!object##_set_handle)				\
-			break ;						\
-									\
-		INIT_WORK(&asus->leds.object##_work, object##_led_update); \
-		ldev->name = "asus::" _name;				\
-		ldev->brightness_set = object##_led_set;		\
-		ldev->max_brightness = max;				\
-		rv = led_classdev_register(&asus->platform_device->dev, ldev); \
-		if (rv)							\
-			goto error;					\
-	} while (0)
-
-static int asus_led_init(struct asus_laptop *asus)
-{
-	int rv;
-
-	/*
-	 * Functions that actually update the LED's are called from a
-	 * workqueue. By doing this as separate work rather than when the LED
-	 * subsystem asks, we avoid messing with the Asus ACPI stuff during a
-	 * potentially bad time, such as a timer interrupt.
-	 */
-	asus->leds.workqueue = create_singlethread_workqueue("led_workqueue");
-	if (!asus->leds.workqueue)
-		return -ENOMEM;
-
-	ASUS_LED_REGISTER(asus, mled, "mail", 1);
-	ASUS_LED_REGISTER(asus, tled, "touchpad", 1);
-	ASUS_LED_REGISTER(asus, rled, "record", 1);
-	ASUS_LED_REGISTER(asus, pled, "phone", 1);
-	ASUS_LED_REGISTER(asus, gled, "gaming", 1);
-	if (kled_set_handle && kled_get_handle)
-		ASUS_LED_REGISTER(asus, kled, "kbd_backlight", 3);
-error:
-	if (rv)
-		asus_led_exit(asus);
-	return rv;
-}
-
-
 static bool asus_device_present;

 static int __devinit asus_acpi_init(struct asus_laptop *asus)
@@ -1414,8 +1418,10 @@
 	asus_laptop_add_fs(asus);

 	/* WLED and BLED are on by default */
-	write_status(asus, bt_switch_handle, 1, BT_ON);
-	write_status(asus, wl_switch_handle, 1, WL_ON);
+	if (bluetooth_status >= 0)
+		write_status(asus, bt_switch_handle, !!bluetooth_status, BT_ON);
+	if (wireless_status >= 0)
+		write_status(asus, wl_switch_handle, !!wireless_status, WL_ON);

 	/* If the h/w switch is off, we need to check the real status */
 	write_status(asus, NULL, read_status(asus, BT_ON), BT_ON);
@@ -1432,8 +1438,8 @@
 	asus->ledd_status = 0xFFF;

 	/* Set initial values of light sensor and level */
-	hotk->light_switch = 0;	/* Default to light sensor disabled */
-	hotk->light_level = 5;	/* level 5 for sensor sensitivity */
+	asus->light_switch = 0;	/* Default to light sensor disabled */
+	asus->light_level = 5;	/* level 5 for sensor sensitivity */

 	if (ls_switch_handle)
 		set_light_sens_switch(asus, asus->light_switch);


_translate_mysql_type(): never treat STRING or VAR_STRING as binary

--- drivers/mysql/dbd_mysql.c
+++ drivers/mysql/dbd_mysql.c
@@ -21,7 +21,7 @@
  * Copyright (C) 2001-2002, Mark Tobenkin <mark@brentwoodradio.com>
  * http://libdbi.sourceforge.net
  *
- * $Id: dbd_mysql.c,v 1.101 2009/10/13 21:56:18 mhoenicka Exp $
+ * $Id: dbd_mysql.c,v 1.102 2010/01/19 23:35:08 mhoenicka Exp $
  */

 #ifdef HAVE_CONFIG_H
@@ -675,8 +675,6 @@
 			_attribs |= DBI_DATETIME_DATE | DBI_DATETIME_TIME;
 			break;

-		case FIELD_TYPE_VAR_STRING:
-		case FIELD_TYPE_STRING:
 		case FIELD_TYPE_TINY_BLOB:
 		case FIELD_TYPE_MEDIUM_BLOB:
 		case FIELD_TYPE_LONG_BLOB:
@@ -688,6 +686,8 @@
 				_type = DBI_TYPE_BINARY;
 				break;
 			}
+		case FIELD_TYPE_VAR_STRING:
+		case FIELD_TYPE_STRING:
 #ifdef FIELD_TYPE_NEWDECIMAL
 		case FIELD_TYPE_NEWDECIMAL: // Precision math DECIMAL or NUMERIC field (MySQL 5.0.3 and up)
 #endif


scsi: mpt2sas: fix ioctl in comment

scsi: mpt2sas: fix ioctl in comment

Fix 'ioctl' spelling.

Signed-off-by: Alex Pilon <b2b4eeae0f8e66abb152efc3a9f3b762a781c5d6@alexpilon.ca>
Acked-by: Sreekanth Reddy <f8c6577e65f24cd0f070fd4ab3f4eacf376d5922@avagotech.com>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>

--- drivers/scsi/mpt2sas/mpt2sas_ctl.h
+++ drivers/scsi/mpt2sas/mpt2sas_ctl.h
@@ -224,7 +224,7 @@
 };

 /**
- * struct mpt2_ioctl_command - generic mpt firmware passthru ioclt
+ * struct mpt2_ioctl_command - generic mpt firmware passthru ioctl
  * @hdr - generic header
  * @timeout - command timeout in seconds. (if zero then use driver default
  *  value).


add const to test sample

add const to test sample

--- CinyTest-Sample/CinyTest-SampleTests/binarytree_tests.c
+++ CinyTest-Sample/CinyTest-SampleTests/binarytree_tests.c
@@ -315,7 +315,7 @@

 size_t binarytree_tests(void)
 {
-    struct ct_testcase tests[] = {
+    const struct ct_testcase tests[] = {
         ct_maketest(btcreate_creates_emptytree),
         ct_maketest(btsize_returnszero_ifemptytree),
         ct_maketest(btdepth_returnszero_ifemptytree),