diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c
index 0283a5713d6c..930a424cc4a0 100644
--- a/drivers/clk/at91/clk-usb.c
+++ b/drivers/clk/at91/clk-usb.c
@@ -59,7 +59,7 @@ static unsigned long
at91sam9x5_clk_usb_recalc_rate(struct clk_hw *hw,
 static long at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw,
       unsigned long rate,
       unsigned long *best_parent_rate,
-      struct clk_hw **best_parent_hw)
+      struct clk **best_parent_hw)
 {
  struct clk *parent = NULL;
  long best_rate = -EINVAL;
@@ -91,7 +91,7 @@ static long at91sam9x5_clk_usb_determine_rate(struct
clk_hw *hw,
  best_rate = tmp_rate;
  best_diff = tmp_diff;
  *best_parent_rate = tmp_parent_rate;
- *best_parent_hw = __clk_get_hw(parent);
+ *best_parent_hw = parent;
  }

  if (!best_diff || tmp_rate < rate)
---------->8

> ath79_defconfig (mips) — PASS, 0 errors, 2 warnings, 0 section mismatches
>
> Warnings:
> arch/mips/kernel/entry.S:170: Warning: tried to set unrecognized symbol:
> MIPS_ISA_LEVEL_RAW

aebac99384f7 ("MIPS: kernel: entry.S: Set correct ISA level for mips_ihb")

> cerfcube_defconfig (arm) — PASS, 0 errors, 2 warnings, 0 section mismatches
>
> Warnings:
> fs/nfsd/nfs4state.c:3781:3: warning: 'old_deny_bmap' may be used
> uninitialized in this function [-Wmaybe-uninitialized]

5368e1a6 ("nfsd: work around a gcc-5.1 warning")

> corgi_defconfig (arm) — PASS, 0 errors, 2 warnings, 0 section mismatches
>
> Warnings:
> drivers/usb/gadget/legacy/inode.c:648:10: warning: 'value' may be used
> uninitialized in this function [-Wmaybe-uninitialized]

This is caused by the backport of f01d35a15fa0416 from 4.0 to 3.18:
c81fc59be42c6e0 gadgetfs: use-after-free in ->aio_read()

The backported patch was buggy, but the mainline code was
rewritten in a larger patch directly following this one in a way that
fixed the bug.

For stable, we should need only a one-line change, which I sent now:

diff --git a/drivers/usb/gadget/legacy/inode.c
b/drivers/usb/gadget/legacy/inode.c
index 54f964bbc79a..fe45311f243e 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -654,6 +654,7 @@ fail:
    GFP_KERNEL);
  if (!priv->iv) {
  kfree(priv);
+ value = -ENOMEM;
  goto fail;
  }
  }

> defconfig+CONFIG_LKDTM=y (mips) — PASS, 0 errors, 3 warnings, 0 section
> mismatches
>
> Warnings:
> include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer
> types lacks a cast
> include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer
> types lacks a cast

2ae83bf93882 ("[CIFS] Fix setting time before epoch (negative time values)")

> efm32_defconfig (arm) — PASS, 0 errors, 1 warning, 0 section mismatches
>
> Warnings:
> arch/arm/kernel/head-nommu.S:167: Warning: Use of r13 as a source register
> is deprecated when r15 is the destination register.

970d96f9a81b ("ARM: 8383/1: nommu: avoid deprecated source register on mov")

> imx_v6_v7_defconfig (arm) — PASS, 0 errors, 2 warnings, 0 section mismatches
>
> Warnings:
> drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb'
> may be used uninitialized in this function [-Wmaybe-uninitialized]

22f44150aad7 ("brcmfmac: avoid gcc-5.1 warning")

> ip27_defconfig (mips) — PASS, 0 errors, 6 warnings, 0 section mismatches
>
> Warnings:
> lib/cpumask.c:194:25: warning: the address of 'cpu_all_bits' will always
> evaluate as 'true' [-Waddress]

f36963c9d3f6f4 cpumask_set_cpu_local_first => cpumask_local_spread, lament

> include/linux/sched.h:1975:56: warning: 'noio_flag' may be used
> uninitialized in this function [-Wmaybe-uninitialized]

I've bisected this to
be0c37c985ed ("MIPS: Rearrange PTE bits into fixed positions.")
which accidentally shuts up the warning, but does not apply to
3.18, and is not appropriate for a stable backport.

The code is correct, so we can probably just add an initialization
for the variable. Patch sent.

> drivers/tty/nozomi.c:857:9: warning: 'size' may be used uninitialized in
> this function [-Wmaybe-uninitialized]

a4f642a8a3c2 ("tty: nozomi: avoid a harmless gcc warning")

> drivers/net/ethernet/neterion/vxge/vxge-main.c:2149:13: warning:
> 'adaptive_coalesce_rx_interrupts' defined but not used [-Wunused-function]
> drivers/net/ethernet/neterion/vxge/vxge-main.c:2121:13: warning:
> 'adaptive_coalesce_tx_interrupts' defined but not used [-Wunused-function]

57e7c8cef224 ("net: vxge: avoid unused function warnings")

> ip32_defconfig (mips) — PASS, 0 errors, 2 warnings, 0 section mismatches
>
> Warnings:
> drivers/misc/ioc4.c:194:16: warning: 'start' may be used uninitialized in
> this function [-Wmaybe-uninitialized]

769105aa740d ("misc: ioc4: simplify wave period measurement in clock_calibrate")

> malta_defconfig (mips) — PASS, 0 errors, 3 warnings, 0 section mismatches
>
> Warnings:
> drivers/net/wireless/hostap/hostap_hw.c:842:5: warning: 'rec' may be used
> uninitialized in this function [-Wmaybe-uninitialized]

48dc5fb3ba53b2 hostap: avoid uninitialized variable use in hfa384x_get_rid

> msp71xx_defconfig (mips) — PASS, 0 errors, 3 warnings, 0 section mismatches
>
> Warnings:
> arch/mips/pci/ops-pmcmsp.c:196:24: warning: 'bpci_lock' defined but not used
> [-Wunused-variable]

c4a305374bbf ("MIPS: MSP71xx: remove odd locking in PCI config space
access code")
> mtx1_defconfig (mips) — PASS, 0 errors, 4 warnings, 0 section mismatches
>
> Warnings:
> drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning
> Processor architecture undefined [-Wcpp]

de92718883dd ("net: tulip: turn compile-time warning into dev_warn()")

> multi_v7_defconfig+CONFIG_ARM_LPAE=y (arm) — PASS, 0 errors, 3 warnings, 0
> section mismatches
>
> Warnings:
> drivers/mmc/host/sunxi-mmc.c:297:35: warning: cast to pointer from integer
> of different size [-Wint-to-pointer-cast]

d34712d2e3db ("mmc: sunxi: avoid invalid pointer calculation")

> multi_v7_defconfig+CONFIG_SMP=n (arm) — FAIL, 1 error, 2 warnings, 0 section
> mismatches
>
> Errors:
> arch/arm/kernel/psci.c:287:12: error: redefinition of 'psci_init'
> Warnings:

patch sent:

commit 37290221124afbaa9a11f17d2b1fc6bf2e829872
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Fri Apr 21 15:54:10 2017 +0200

    [3.18-stable regression] ARM: psci: fix header file

    Commit be95485a0b828 was incorrectly backported to 3.18 and
    now causes a different build error when CONFIG_SMP is disabled:

     arch/arm/kernel/psci.c:287:12: error: redefinition of 'psci_init'

    This version is how it should be on 3.18, with the main psci
    code built for both SMP and UP, but the psci_smp_available()
    function only being available for SMP builds.

    Fixes: dbcfee724255 ("ARM: 8457/1: psci-smp is built only for SMP")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
index e3789fb02c9c..8ca5308a05d7 100644
--- a/arch/arm/include/asm/psci.h
+++ b/arch/arm/include/asm/psci.h
@@ -37,11 +37,15 @@ struct psci_operations {
 extern struct psci_operations psci_ops;
 extern struct smp_operations psci_smp_ops;

-#if defined(CONFIG_SMP) && defined(CONFIG_ARM_PSCI)
+#ifdef CONFIG_ARM_PSCI
 int psci_init(void);
-bool psci_smp_available(void);
 #else
 static inline int psci_init(void) { return 0; }
+#endif
+
+#if defined(CONFIG_SMP) && defined(CONFIG_ARM_PSCI)
+bool psci_smp_available(void);
+#else
 static inline bool psci_smp_available(void) { return false; }
 #endif

