--- /dev/null
+From 82cd588052815eb4146f9f7c5347ca5e32c56360 Mon Sep 17 00:00:00 2001
+From: Nick Desaulniers <ndesaulniers@google.com>
+Date: Thu, 3 Aug 2017 11:03:58 -0700
+Subject: arm64: avoid overflow in VA_START and PAGE_OFFSET
+
+From: Nick Desaulniers <ndesaulniers@google.com>
+
+commit 82cd588052815eb4146f9f7c5347ca5e32c56360 upstream.
+
+The bitmask used to define these values produces overflow, as seen by
+this compiler warning:
+
+arch/arm64/kernel/head.S:47:8: warning:
+ integer overflow in preprocessor expression
+ #elif (PAGE_OFFSET & 0x1fffff) != 0
+ ^~~~~~~~~~~
+arch/arm64/include/asm/memory.h:52:46: note:
+ expanded from macro 'PAGE_OFFSET'
+ #define PAGE_OFFSET (UL(0xffffffffffffffff) << (VA_BITS -
+1))
+ ~~~~~~~~~~~~~~~~~~ ^
+
+It would be preferrable to use GENMASK_ULL() instead, but it's not set
+up to be used from assembly (the UL() macro token pastes UL suffixes
+when not included in assembly sources).
+
+Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Suggested-by: Yury Norov <ynorov@caviumnetworks.com>
+Suggested-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm64/include/asm/memory.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/arch/arm64/include/asm/memory.h
++++ b/arch/arm64/include/asm/memory.h
+@@ -64,8 +64,10 @@
+ * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area.
+ */
+ #define VA_BITS (CONFIG_ARM64_VA_BITS)
+-#define VA_START (UL(0xffffffffffffffff) << VA_BITS)
+-#define PAGE_OFFSET (UL(0xffffffffffffffff) << (VA_BITS - 1))
++#define VA_START (UL(0xffffffffffffffff) - \
++ (UL(1) << VA_BITS) + 1)
++#define PAGE_OFFSET (UL(0xffffffffffffffff) - \
++ (UL(1) << (VA_BITS - 1)) + 1)
+ #define KIMAGE_VADDR (MODULES_END)
+ #define MODULES_END (MODULES_VADDR + MODULES_VSIZE)
+ #define MODULES_VADDR (VA_START + KASAN_SHADOW_SIZE)
--- /dev/null
+From 0dde10bed2c44a4024eb446cc72fe4e0cb97ec06 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Thu, 27 Jul 2017 14:30:23 -0700
+Subject: btrfs: Remove extra parentheses from condition in copy_items()
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 0dde10bed2c44a4024eb446cc72fe4e0cb97ec06 upstream.
+
+There is no need for the extra pair of parentheses, remove it. This
+fixes the following warning when building with clang:
+
+fs/btrfs/tree-log.c:3694:10: warning: equality comparison with extraneous
+ parentheses [-Wparentheses-equality]
+ if ((i == (nr - 1)))
+ ~~^~~~~~~~~~~
+
+Also remove the unnecessary parentheses around the substraction.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/tree-log.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/btrfs/tree-log.c
++++ b/fs/btrfs/tree-log.c
+@@ -3664,7 +3664,7 @@ static noinline int copy_items(struct bt
+
+ src_offset = btrfs_item_ptr_offset(src, start_slot + i);
+
+- if ((i == (nr - 1)))
++ if (i == nr - 1)
+ last_key = ins_keys[i];
+
+ if (ins_keys[i].type == BTRFS_INODE_ITEM_KEY) {
--- /dev/null
+From aa1702dd162f420bf85ecef0c77686ef0dbc1496 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Thu, 13 Apr 2017 10:05:04 -0700
+Subject: cfg80211: Fix array-bounds warning in fragment copy
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit aa1702dd162f420bf85ecef0c77686ef0dbc1496 upstream.
+
+__ieee80211_amsdu_copy_frag intentionally initializes a pointer to
+array[-1] to increment it later to valid values. clang rightfully
+generates an array-bounds warning on the initialization statement.
+
+Initialize the pointer to array[0] and change the algorithm from
+increment before to increment after consume.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/wireless/util.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/net/wireless/util.c
++++ b/net/wireless/util.c
+@@ -663,7 +663,7 @@ __ieee80211_amsdu_copy_frag(struct sk_bu
+ int offset, int len)
+ {
+ struct skb_shared_info *sh = skb_shinfo(skb);
+- const skb_frag_t *frag = &sh->frags[-1];
++ const skb_frag_t *frag = &sh->frags[0];
+ struct page *frag_page;
+ void *frag_ptr;
+ int frag_len, frag_size;
+@@ -676,10 +676,10 @@ __ieee80211_amsdu_copy_frag(struct sk_bu
+
+ while (offset >= frag_size) {
+ offset -= frag_size;
+- frag++;
+ frag_page = skb_frag_page(frag);
+ frag_ptr = skb_frag_address(frag);
+ frag_size = skb_frag_size(frag);
++ frag++;
+ }
+
+ frag_ptr += offset;
+@@ -691,12 +691,12 @@ __ieee80211_amsdu_copy_frag(struct sk_bu
+ len -= cur_len;
+
+ while (len > 0) {
+- frag++;
+ frag_len = skb_frag_size(frag);
+ cur_len = min(len, frag_len);
+ __frame_add_frag(frame, skb_frag_page(frag),
+ skb_frag_address(frag), cur_len, frag_len);
+ len -= cur_len;
++ frag++;
+ }
+ }
+
--- /dev/null
+From 765a1077c85e5f2efcc43582f80caf43a052e903 Mon Sep 17 00:00:00 2001
+From: Frank Praznik <frank.praznik@gmail.com>
+Date: Wed, 8 Feb 2017 13:58:43 -0500
+Subject: HID: sony: Use LED_CORE_SUSPENDRESUME
+
+From: Frank Praznik <frank.praznik@gmail.com>
+
+commit 765a1077c85e5f2efcc43582f80caf43a052e903 upstream.
+
+The LED subsystem provides the LED_CORE_SUSPENDRESUME flag to handle
+automatically turning off and restoring the state of device LEDs during
+suspend/resume. Use this flag instead of saving and restoring the state
+locally.
+
+Signed-off-by: Frank Praznik <frank.praznik@gmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hid/hid-sony.c | 45 +++++++++++++++------------------------------
+ 1 file changed, 15 insertions(+), 30 deletions(-)
+
+--- a/drivers/hid/hid-sony.c
++++ b/drivers/hid/hid-sony.c
+@@ -1056,7 +1056,6 @@ struct sony_sc {
+ u8 battery_charging;
+ u8 battery_capacity;
+ u8 led_state[MAX_LEDS];
+- u8 resume_led_state[MAX_LEDS];
+ u8 led_delay_on[MAX_LEDS];
+ u8 led_delay_off[MAX_LEDS];
+ u8 led_count;
+@@ -1793,6 +1792,7 @@ static int sony_leds_init(struct sony_sc
+ led->name = name;
+ led->brightness = sc->led_state[n];
+ led->max_brightness = max_brightness[n];
++ led->flags = LED_CORE_SUSPENDRESUME;
+ led->brightness_get = sony_led_get_brightness;
+ led->brightness_set = sony_led_set_brightness;
+
+@@ -2509,47 +2509,32 @@ static void sony_remove(struct hid_devic
+
+ static int sony_suspend(struct hid_device *hdev, pm_message_t message)
+ {
+- /*
+- * On suspend save the current LED state,
+- * stop running force-feedback and blank the LEDS.
+- */
+- if (SONY_LED_SUPPORT || SONY_FF_SUPPORT) {
+- struct sony_sc *sc = hid_get_drvdata(hdev);
+-
+ #ifdef CONFIG_SONY_FF
+- sc->left = sc->right = 0;
+-#endif
+
+- memcpy(sc->resume_led_state, sc->led_state,
+- sizeof(sc->resume_led_state));
+- memset(sc->led_state, 0, sizeof(sc->led_state));
++ /* On suspend stop any running force-feedback events */
++ if (SONY_FF_SUPPORT) {
++ struct sony_sc *sc = hid_get_drvdata(hdev);
+
++ sc->left = sc->right = 0;
+ sony_send_output_report(sc);
+ }
+
++#endif
+ return 0;
+ }
+
+ static int sony_resume(struct hid_device *hdev)
+ {
+- /* Restore the state of controller LEDs on resume */
+- if (SONY_LED_SUPPORT) {
+- struct sony_sc *sc = hid_get_drvdata(hdev);
+-
+- memcpy(sc->led_state, sc->resume_led_state,
+- sizeof(sc->led_state));
+-
+- /*
+- * The Sixaxis and navigation controllers on USB need to be
+- * reinitialized on resume or they won't behave properly.
+- */
+- if ((sc->quirks & SIXAXIS_CONTROLLER_USB) ||
+- (sc->quirks & NAVIGATION_CONTROLLER_USB)) {
+- sixaxis_set_operational_usb(sc->hdev);
+- sc->defer_initialization = 1;
+- }
++ struct sony_sc *sc = hid_get_drvdata(hdev);
+
+- sony_set_leds(sc);
++ /*
++ * The Sixaxis and navigation controllers on USB need to be
++ * reinitialized on resume or they won't behave properly.
++ */
++ if ((sc->quirks & SIXAXIS_CONTROLLER_USB) ||
++ (sc->quirks & NAVIGATION_CONTROLLER_USB)) {
++ sixaxis_set_operational_usb(sc->hdev);
++ sc->defer_initialization = 1;
+ }
+
+ return 0;
--- /dev/null
+From 93f56de259376d7e4fff2b2d104082e1fa66e237 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Thu, 6 Apr 2017 16:31:41 -0700
+Subject: mac80211: Fix clang warning about constant operand in logical operation
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 93f56de259376d7e4fff2b2d104082e1fa66e237 upstream.
+
+When clang detects a non-boolean constant in a logical operation it
+generates a 'constant-logical-operand' warning. In
+ieee80211_try_rate_control_ops_get() the result of strlen(<const str>)
+is used in a logical operation, clang resolves the expression to an
+(integer) constant at compile time when clang's builtin strlen function
+is used.
+
+Change the condition to check for strlen() > 0 to make the constant
+operand boolean and thus avoid the warning.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/rate.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/net/mac80211/rate.c
++++ b/net/mac80211/rate.c
+@@ -173,9 +173,11 @@ ieee80211_rate_control_ops_get(const cha
+ /* try default if specific alg requested but not found */
+ ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo);
+
+- /* try built-in one if specific alg requested but not found */
+- if (!ops && strlen(CONFIG_MAC80211_RC_DEFAULT))
++ /* Note: check for > 0 is intentional to avoid clang warning */
++ if (!ops && (strlen(CONFIG_MAC80211_RC_DEFAULT) > 0))
++ /* try built-in one if specific alg requested but not found */
+ ops = ieee80211_try_rate_control_ops_get(CONFIG_MAC80211_RC_DEFAULT);
++
+ kernel_param_unlock(THIS_MODULE);
+
+ return ops;
--- /dev/null
+From a4ac6f2e53e568a77a2eb3710efd99ca08634c0a Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Mon, 17 Apr 2017 13:59:53 -0700
+Subject: mac80211: ibss: Fix channel type enum in ieee80211_sta_join_ibss()
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit a4ac6f2e53e568a77a2eb3710efd99ca08634c0a upstream.
+
+cfg80211_chandef_create() expects an 'enum nl80211_channel_type' as
+channel type however in ieee80211_sta_join_ibss()
+NL80211_CHAN_WIDTH_20_NOHT is passed in two occasions, which is of
+the enum type 'nl80211_chan_width'. Change the value to NL80211_CHAN_NO_HT
+(20 MHz, non-HT channel) of the channel type enum.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/ibss.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/mac80211/ibss.c
++++ b/net/mac80211/ibss.c
+@@ -427,7 +427,7 @@ static void ieee80211_sta_join_ibss(stru
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
+ cfg80211_chandef_create(&chandef, cbss->channel,
+- NL80211_CHAN_WIDTH_20_NOHT);
++ NL80211_CHAN_NO_HT);
+ chandef.width = sdata->u.ibss.chandef.width;
+ break;
+ case NL80211_CHAN_WIDTH_80:
+@@ -439,7 +439,7 @@ static void ieee80211_sta_join_ibss(stru
+ default:
+ /* fall back to 20 MHz for unsupported modes */
+ cfg80211_chandef_create(&chandef, cbss->channel,
+- NL80211_CHAN_WIDTH_20_NOHT);
++ NL80211_CHAN_NO_HT);
+ break;
+ }
+
--- /dev/null
+From f2f43e566a02a3bdde0a65e6a2e88d707c212a29 Mon Sep 17 00:00:00 2001
+From: Nick Desaulniers <nick.desaulniers@gmail.com>
+Date: Thu, 6 Jul 2017 15:36:50 -0700
+Subject: mm/vmscan.c: fix unsequenced modification and access warning
+
+From: Nick Desaulniers <nick.desaulniers@gmail.com>
+
+commit f2f43e566a02a3bdde0a65e6a2e88d707c212a29 upstream.
+
+Clang and its -Wunsequenced emits a warning
+
+ mm/vmscan.c:2961:25: error: unsequenced modification and access to 'gfp_mask' [-Wunsequenced]
+ .gfp_mask = (gfp_mask = current_gfp_context(gfp_mask)),
+ ^
+
+While it is not clear to me whether the initialization code violates the
+specification (6.7.8 par 19 (ISO/IEC 9899) looks like it disagrees) the
+code is quite confusing and worth cleaning up anyway. Fix this by
+reusing sc.gfp_mask rather than the updated input gfp_mask parameter.
+
+Link: http://lkml.kernel.org/r/20170510154030.10720-1-nick.desaulniers@gmail.com
+Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
+Acked-by: Michal Hocko <mhocko@suse.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+[natechancellor: Adjust context due to abscence of 7dea19f9ee63]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/vmscan.c | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+--- a/mm/vmscan.c
++++ b/mm/vmscan.c
+@@ -2966,7 +2966,7 @@ unsigned long try_to_free_pages(struct z
+ unsigned long nr_reclaimed;
+ struct scan_control sc = {
+ .nr_to_reclaim = SWAP_CLUSTER_MAX,
+- .gfp_mask = (gfp_mask = memalloc_noio_flags(gfp_mask)),
++ .gfp_mask = memalloc_noio_flags(gfp_mask),
+ .reclaim_idx = gfp_zone(gfp_mask),
+ .order = order,
+ .nodemask = nodemask,
+@@ -2981,12 +2981,12 @@ unsigned long try_to_free_pages(struct z
+ * 1 is returned so that the page allocator does not OOM kill at this
+ * point.
+ */
+- if (throttle_direct_reclaim(gfp_mask, zonelist, nodemask))
++ if (throttle_direct_reclaim(sc.gfp_mask, zonelist, nodemask))
+ return 1;
+
+ trace_mm_vmscan_direct_reclaim_begin(order,
+ sc.may_writepage,
+- gfp_mask,
++ sc.gfp_mask,
+ sc.reclaim_idx);
+
+ nr_reclaimed = do_try_to_free_pages(zonelist, &sc);
+@@ -3749,16 +3749,15 @@ static int __node_reclaim(struct pglist_
+ const unsigned long nr_pages = 1 << order;
+ struct task_struct *p = current;
+ struct reclaim_state reclaim_state;
+- int classzone_idx = gfp_zone(gfp_mask);
+ struct scan_control sc = {
+ .nr_to_reclaim = max(nr_pages, SWAP_CLUSTER_MAX),
+- .gfp_mask = (gfp_mask = memalloc_noio_flags(gfp_mask)),
++ .gfp_mask = memalloc_noio_flags(gfp_mask),
+ .order = order,
+ .priority = NODE_RECLAIM_PRIORITY,
+ .may_writepage = !!(node_reclaim_mode & RECLAIM_WRITE),
+ .may_unmap = !!(node_reclaim_mode & RECLAIM_UNMAP),
+ .may_swap = 1,
+- .reclaim_idx = classzone_idx,
++ .reclaim_idx = gfp_zone(gfp_mask),
+ };
+
+ cond_resched();
+@@ -3768,7 +3767,7 @@ static int __node_reclaim(struct pglist_
+ * and RECLAIM_UNMAP.
+ */
+ p->flags |= PF_MEMALLOC | PF_SWAPWRITE;
+- lockdep_set_current_reclaim_state(gfp_mask);
++ lockdep_set_current_reclaim_state(sc.gfp_mask);
+ reclaim_state.reclaimed_slab = 0;
+ p->reclaim_state = &reclaim_state;
+
--- /dev/null
+From a2b7cbdd2559aff06cebc28a7150f81c307a90d3 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Wed, 19 Apr 2017 11:39:20 -0700
+Subject: netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit a2b7cbdd2559aff06cebc28a7150f81c307a90d3 upstream.
+
+Not all parameters passed to ctnetlink_parse_tuple() and
+ctnetlink_exp_dump_tuple() match the enum type in the signatures of these
+functions. Since this is intended change the argument type of to be an
+unsigned integer value.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/nf_conntrack_netlink.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/net/netfilter/nf_conntrack_netlink.c
++++ b/net/netfilter/nf_conntrack_netlink.c
+@@ -1008,9 +1008,8 @@ static const struct nla_policy tuple_nla
+
+ static int
+ ctnetlink_parse_tuple(const struct nlattr * const cda[],
+- struct nf_conntrack_tuple *tuple,
+- enum ctattr_type type, u_int8_t l3num,
+- struct nf_conntrack_zone *zone)
++ struct nf_conntrack_tuple *tuple, u32 type,
++ u_int8_t l3num, struct nf_conntrack_zone *zone)
+ {
+ struct nlattr *tb[CTA_TUPLE_MAX+1];
+ int err;
+@@ -2409,7 +2408,7 @@ static struct nfnl_ct_hook ctnetlink_glu
+
+ static int ctnetlink_exp_dump_tuple(struct sk_buff *skb,
+ const struct nf_conntrack_tuple *tuple,
+- enum ctattr_expect type)
++ u32 type)
+ {
+ struct nlattr *nest_parms;
+
--- /dev/null
+From bbf67e450a5dc2a595e1e7a67b4869f1a7f5a338 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Mon, 17 Apr 2017 15:59:52 -0700
+Subject: nl80211: Fix enum type of variable in nl80211_put_sta_rate()
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit bbf67e450a5dc2a595e1e7a67b4869f1a7f5a338 upstream.
+
+rate_flg is of type 'enum nl80211_attrs', however it is assigned with
+'enum nl80211_rate_info' values. Change the type of rate_flg accordingly.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/wireless/nl80211.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -4081,7 +4081,7 @@ static bool nl80211_put_sta_rate(struct
+ struct nlattr *rate;
+ u32 bitrate;
+ u16 bitrate_compat;
+- enum nl80211_attrs rate_flg;
++ enum nl80211_rate_info rate_flg;
+
+ rate = nla_nest_start(msg, attr);
+ if (!rate)
--- /dev/null
+From 270e8573145a26de924e2dc644596332d400445b Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Fri, 19 May 2017 10:09:32 -0700
+Subject: selinux: Remove redundant check for unknown labeling behavior
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 270e8573145a26de924e2dc644596332d400445b upstream.
+
+The check is already performed in ocontext_read() when the policy is
+loaded. Removing the array also fixes the following warning when
+building with clang:
+
+security/selinux/hooks.c:338:20: error: variable 'labeling_behaviors'
+ is not needed and will not be emitted
+ [-Werror,-Wunneeded-internal-declaration]
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
+Signed-off-by: Paul Moore <paul@paul-moore.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ security/selinux/hooks.c | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+--- a/security/selinux/hooks.c
++++ b/security/selinux/hooks.c
+@@ -406,18 +406,6 @@ static void superblock_free_security(str
+ kfree(sbsec);
+ }
+
+-/* The file system's label must be initialized prior to use. */
+-
+-static const char *labeling_behaviors[7] = {
+- "uses xattr",
+- "uses transition SIDs",
+- "uses task SIDs",
+- "uses genfs_contexts",
+- "not configured for labeling",
+- "uses mountpoint labeling",
+- "uses native labeling",
+-};
+-
+ static inline int inode_doinit(struct inode *inode)
+ {
+ return inode_doinit_with_dentry(inode, NULL);
+@@ -528,10 +516,6 @@ static int sb_finish_set_opts(struct sup
+ }
+ }
+
+- if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
+- printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
+- sb->s_id, sb->s_type->name);
+-
+ sbsec->flags |= SE_SBINITIALIZED;
+ if (selinux_is_sblabel_mnt(sb))
+ sbsec->flags |= SBLABEL_MNT;
fs-compat-remove-warning-from-compatible_ioctl.patch
jiffies.h-declare-jiffies-and-jiffies_64-with-____cacheline_aligned_in_smp.patch
frv-declare-jiffies-to-be-located-in-the-.data-section.patch
+usb-gadget-remove-redundant-self-assignment.patch
+xgene_enet-remove-bogus-forward-declarations.patch
+nl80211-fix-enum-type-of-variable-in-nl80211_put_sta_rate.patch
+cfg80211-fix-array-bounds-warning-in-fragment-copy.patch
+hid-sony-use-led_core_suspendresume.patch
+netfilter-ctnetlink-make-some-parameters-integer-to-avoid-enum-mismatch.patch
+mac80211-fix-clang-warning-about-constant-operand-in-logical-operation.patch
+mac80211-ibss-fix-channel-type-enum-in-ieee80211_sta_join_ibss.patch
+btrfs-remove-extra-parentheses-from-condition-in-copy_items.patch
+arm64-avoid-overflow-in-va_start-and-page_offset.patch
+selinux-remove-redundant-check-for-unknown-labeling-behavior.patch
+mm-vmscan.c-fix-unsequenced-modification-and-access-warning.patch
--- /dev/null
+From 8a8b161df5ce06ef5a315899f83978e765be09e8 Mon Sep 17 00:00:00 2001
+From: Stefan Agner <stefan@agner.ch>
+Date: Sun, 16 Apr 2017 20:12:50 -0700
+Subject: usb: gadget: remove redundant self assignment
+
+From: Stefan Agner <stefan@agner.ch>
+
+commit 8a8b161df5ce06ef5a315899f83978e765be09e8 upstream.
+
+The assignment ret = ret is redundant and can be removed.
+
+Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
+Reviewed-by: Peter Chen <peter.chen@nxp.com>
+Signed-off-by: Stefan Agner <stefan@agner.ch>
+Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/gadget/udc/core.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/drivers/usb/gadget/udc/core.c
++++ b/drivers/usb/gadget/udc/core.c
+@@ -139,10 +139,8 @@ int usb_ep_disable(struct usb_ep *ep)
+ goto out;
+
+ ret = ep->ops->disable(ep);
+- if (ret) {
+- ret = ret;
++ if (ret)
+ goto out;
+- }
+
+ ep->enabled = false;
+
--- /dev/null
+From 1f3d62090d3ba4d0c14e5271be87812fc577b197 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Wed, 1 Feb 2017 17:46:02 +0100
+Subject: xgene_enet: remove bogus forward declarations
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 1f3d62090d3ba4d0c14e5271be87812fc577b197 upstream.
+
+The device match tables for both the xgene_enet driver and its phy driver
+have forward declarations that declare an array without a length, leading
+to a clang warning when they are not followed by an actual defitinition:
+
+drivers/net/ethernet/apm/xgene/../../../phy/mdio-xgene.h:135:34: warning: tentative array definition assumed to have one element
+drivers/net/ethernet/apm/xgene/xgene_enet_main.c:33:36: warning: tentative array definition assumed to have one element
+
+The declarations for the mdio driver are even in a header file, so they
+cause duplicate definitions of the tables for each file that includes
+them.
+
+This removes all four forward declarations and moves the actual
+definitions up a little, so they are in front of their first user. For
+the OF match tables, this means having to remove the #ifdef around them,
+and passing the actual structure into of_match_device(). This has no
+effect on the generated object code though, as the of_match_device
+function has an empty stub that does not evaluate its argument, and
+the symbol gets dropped either way.
+
+Fixes: 43b3cf6634a4 ("drivers: net: phy: xgene: Add MDIO driver")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 50 +++++++++++------------
+ drivers/net/phy/mdio-xgene.c | 50 +++++++++++------------
+ drivers/net/phy/mdio-xgene.h | 4 -
+ 3 files changed, 48 insertions(+), 56 deletions(-)
+
+--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
++++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+@@ -1680,6 +1680,30 @@ static void xgene_enet_napi_add(struct x
+ }
+ }
+
++#ifdef CONFIG_ACPI
++static const struct acpi_device_id xgene_enet_acpi_match[] = {
++ { "APMC0D05", XGENE_ENET1},
++ { "APMC0D30", XGENE_ENET1},
++ { "APMC0D31", XGENE_ENET1},
++ { "APMC0D3F", XGENE_ENET1},
++ { "APMC0D26", XGENE_ENET2},
++ { "APMC0D25", XGENE_ENET2},
++ { }
++};
++MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
++#endif
++
++static const struct of_device_id xgene_enet_of_match[] = {
++ {.compatible = "apm,xgene-enet", .data = (void *)XGENE_ENET1},
++ {.compatible = "apm,xgene1-sgenet", .data = (void *)XGENE_ENET1},
++ {.compatible = "apm,xgene1-xgenet", .data = (void *)XGENE_ENET1},
++ {.compatible = "apm,xgene2-sgenet", .data = (void *)XGENE_ENET2},
++ {.compatible = "apm,xgene2-xgenet", .data = (void *)XGENE_ENET2},
++ {},
++};
++
++MODULE_DEVICE_TABLE(of, xgene_enet_of_match);
++
+ static int xgene_enet_probe(struct platform_device *pdev)
+ {
+ struct net_device *ndev;
+@@ -1826,32 +1850,6 @@ static void xgene_enet_shutdown(struct p
+ xgene_enet_remove(pdev);
+ }
+
+-#ifdef CONFIG_ACPI
+-static const struct acpi_device_id xgene_enet_acpi_match[] = {
+- { "APMC0D05", XGENE_ENET1},
+- { "APMC0D30", XGENE_ENET1},
+- { "APMC0D31", XGENE_ENET1},
+- { "APMC0D3F", XGENE_ENET1},
+- { "APMC0D26", XGENE_ENET2},
+- { "APMC0D25", XGENE_ENET2},
+- { }
+-};
+-MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
+-#endif
+-
+-#ifdef CONFIG_OF
+-static const struct of_device_id xgene_enet_of_match[] = {
+- {.compatible = "apm,xgene-enet", .data = (void *)XGENE_ENET1},
+- {.compatible = "apm,xgene1-sgenet", .data = (void *)XGENE_ENET1},
+- {.compatible = "apm,xgene1-xgenet", .data = (void *)XGENE_ENET1},
+- {.compatible = "apm,xgene2-sgenet", .data = (void *)XGENE_ENET2},
+- {.compatible = "apm,xgene2-xgenet", .data = (void *)XGENE_ENET2},
+- {},
+-};
+-
+-MODULE_DEVICE_TABLE(of, xgene_enet_of_match);
+-#endif
+-
+ static struct platform_driver xgene_enet_driver = {
+ .driver = {
+ .name = "xgene-enet",
+--- a/drivers/net/phy/mdio-xgene.c
++++ b/drivers/net/phy/mdio-xgene.c
+@@ -314,6 +314,30 @@ static acpi_status acpi_register_phy(acp
+ }
+ #endif
+
++static const struct of_device_id xgene_mdio_of_match[] = {
++ {
++ .compatible = "apm,xgene-mdio-rgmii",
++ .data = (void *)XGENE_MDIO_RGMII
++ },
++ {
++ .compatible = "apm,xgene-mdio-xfi",
++ .data = (void *)XGENE_MDIO_XFI
++ },
++ {},
++};
++MODULE_DEVICE_TABLE(of, xgene_mdio_of_match);
++
++#ifdef CONFIG_ACPI
++static const struct acpi_device_id xgene_mdio_acpi_match[] = {
++ { "APMC0D65", XGENE_MDIO_RGMII },
++ { "APMC0D66", XGENE_MDIO_XFI },
++ { }
++};
++
++MODULE_DEVICE_TABLE(acpi, xgene_mdio_acpi_match);
++#endif
++
++
+ static int xgene_mdio_probe(struct platform_device *pdev)
+ {
+ struct device *dev = &pdev->dev;
+@@ -439,32 +463,6 @@ static int xgene_mdio_remove(struct plat
+ return 0;
+ }
+
+-#ifdef CONFIG_OF
+-static const struct of_device_id xgene_mdio_of_match[] = {
+- {
+- .compatible = "apm,xgene-mdio-rgmii",
+- .data = (void *)XGENE_MDIO_RGMII
+- },
+- {
+- .compatible = "apm,xgene-mdio-xfi",
+- .data = (void *)XGENE_MDIO_XFI
+- },
+- {},
+-};
+-
+-MODULE_DEVICE_TABLE(of, xgene_mdio_of_match);
+-#endif
+-
+-#ifdef CONFIG_ACPI
+-static const struct acpi_device_id xgene_mdio_acpi_match[] = {
+- { "APMC0D65", XGENE_MDIO_RGMII },
+- { "APMC0D66", XGENE_MDIO_XFI },
+- { }
+-};
+-
+-MODULE_DEVICE_TABLE(acpi, xgene_mdio_acpi_match);
+-#endif
+-
+ static struct platform_driver xgene_mdio_driver = {
+ .driver = {
+ .name = "xgene-mdio",
+--- a/drivers/net/phy/mdio-xgene.h
++++ b/drivers/net/phy/mdio-xgene.h
+@@ -132,10 +132,6 @@ static inline u64 xgene_enet_get_field_v
+ #define GET_BIT(field, src) \
+ xgene_enet_get_field_value(field ## _POS, 1, src)
+
+-static const struct of_device_id xgene_mdio_of_match[];
+-#ifdef CONFIG_ACPI
+-static const struct acpi_device_id xgene_mdio_acpi_match[];
+-#endif
+ int xgene_mdio_rgmii_read(struct mii_bus *bus, int phy_id, int reg);
+ int xgene_mdio_rgmii_write(struct mii_bus *bus, int phy_id, int reg, u16 data);
+ struct phy_device *xgene_enet_phy_register(struct mii_bus *bus, int phy_addr);