Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 157cee056174349e7323cdf9e4edc17e1762de20
- Author: Arnd Bergmann <arnd@arndb.de>
- Date: Wed Jun 14 11:42:51 2023 +0200
- clang-warnings
- Signed-off-by: Arnd Bergmann <arnd@arndb.de>
- diff --git a/.gitignore b/.gitignore
- index 7f86e08379094..ca9c3090bd846 100644
- --- a/.gitignore
- +++ b/.gitignore
- @@ -125,6 +125,7 @@ series
- # ctags files
- tags
- TAGS
- +!tags/
- # cscope files
- cscope.*
- diff --git a/arch/arm/crypto/sha256_glue.c b/arch/arm/crypto/sha256_glue.c
- index 433ee4ddce6c8..d80448d96ab38 100644
- --- a/arch/arm/crypto/sha256_glue.c
- +++ b/arch/arm/crypto/sha256_glue.c
- @@ -27,29 +27,31 @@
- asmlinkage void sha256_block_data_order(u32 *digest, const void *data,
- unsigned int num_blks);
- -int crypto_sha256_arm_update(struct shash_desc *desc, const u8 *data,
- - unsigned int len)
- +static void sha256_block_data_order_wrapper(struct sha256_state *sst, u8 const *src, int blocks)
- {
- /* make sure casting to sha256_block_fn() is safe */
- BUILD_BUG_ON(offsetof(struct sha256_state, state) != 0);
- - return sha256_base_do_update(desc, data, len,
- - (sha256_block_fn *)sha256_block_data_order);
- + return sha256_block_data_order((u32 *)sst, src, blocks);
- +}
- +
- +int crypto_sha256_arm_update(struct shash_desc *desc, const u8 *data,
- + unsigned int len)
- +{
- + return sha256_base_do_update(desc, data, len, sha256_block_data_order_wrapper);
- }
- EXPORT_SYMBOL(crypto_sha256_arm_update);
- static int crypto_sha256_arm_final(struct shash_desc *desc, u8 *out)
- {
- - sha256_base_do_finalize(desc,
- - (sha256_block_fn *)sha256_block_data_order);
- + sha256_base_do_finalize(desc, sha256_block_data_order_wrapper);
- return sha256_base_finish(desc, out);
- }
- int crypto_sha256_arm_finup(struct shash_desc *desc, const u8 *data,
- unsigned int len, u8 *out)
- {
- - sha256_base_do_update(desc, data, len,
- - (sha256_block_fn *)sha256_block_data_order);
- + sha256_base_do_update(desc, data, len, sha256_block_data_order_wrapper);
- return crypto_sha256_arm_final(desc, out);
- }
- EXPORT_SYMBOL(crypto_sha256_arm_finup);
- diff --git a/arch/arm/crypto/sha512-glue.c b/arch/arm/crypto/sha512-glue.c
- index 0635a65aa488b..1b2c9c0c8a5f3 100644
- --- a/arch/arm/crypto/sha512-glue.c
- +++ b/arch/arm/crypto/sha512-glue.c
- @@ -27,17 +27,22 @@ MODULE_ALIAS_CRYPTO("sha512-arm");
- asmlinkage void sha512_block_data_order(u64 *state, u8 const *src, int blocks);
- +static void sha512_block_data_order_wrapper(struct sha512_state *sst, u8 const *src, int blocks)
- +{
- + return sha512_block_data_order((u64 *)sst, src, blocks);
- +}
- +
- int sha512_arm_update(struct shash_desc *desc, const u8 *data,
- unsigned int len)
- {
- return sha512_base_do_update(desc, data, len,
- - (sha512_block_fn *)sha512_block_data_order);
- + sha512_block_data_order_wrapper);
- }
- static int sha512_arm_final(struct shash_desc *desc, u8 *out)
- {
- sha512_base_do_finalize(desc,
- - (sha512_block_fn *)sha512_block_data_order);
- + sha512_block_data_order_wrapper);
- return sha512_base_finish(desc, out);
- }
- @@ -45,7 +50,7 @@ int sha512_arm_finup(struct shash_desc *desc, const u8 *data,
- unsigned int len, u8 *out)
- {
- sha512_base_do_update(desc, data, len,
- - (sha512_block_fn *)sha512_block_data_order);
- + sha512_block_data_order_wrapper);
- return sha512_arm_final(desc, out);
- }
- diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
- index f568ac9129744..c22754ad28a06 100644
- --- a/arch/arm/kernel/entry-armv.S
- +++ b/arch/arm/kernel/entry-armv.S
- @@ -482,7 +482,7 @@ __und_usr:
- __und_usr_thumb:
- @ Thumb instruction
- sub r4, r2, #2 @ First half of thumb instr at LR - 2
- -#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
- +#if defined(CONFIG_ARM_THUMB) && __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_V7)
- /*
- * Thumb-2 instruction handling. Note that because pre-v6 and >= v6 platforms
- * can never be supported in a single kernel, this code is not applicable at
- @@ -541,7 +541,7 @@ ENDPROC(__und_usr)
- .popsection
- .pushsection __ex_table,"a"
- .long 1b, 4b
- -#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
- +#if defined(CONFIG_ARM_THUMB) && __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_V7)
- .long 2b, 4b
- .long 3b, 4b
- #endif
- diff --git a/arch/arm64/include/asm/kernel-pgtable.h b/arch/arm64/include/asm/kernel-pgtable.h
- index 577773870b66f..9f2197857cda0 100644
- --- a/arch/arm64/include/asm/kernel-pgtable.h
- +++ b/arch/arm64/include/asm/kernel-pgtable.h
- @@ -126,10 +126,12 @@
- * in the page tables: 32 * PMD_SIZE (16k granule)
- */
- #if defined(CONFIG_ARM64_4K_PAGES)
- +#ifdef PUD_SHIFT
- #define ARM64_MEMSTART_SHIFT PUD_SHIFT
- +#endif
- #elif defined(CONFIG_ARM64_16K_PAGES)
- #define ARM64_MEMSTART_SHIFT CONT_PMD_SHIFT
- -#else
- +#elif defined(PMD_SHIFT)
- #define ARM64_MEMSTART_SHIFT PMD_SHIFT
- #endif
- @@ -139,10 +141,12 @@
- * has a direct correspondence, and needs to appear sufficiently aligned
- * in the virtual address space.
- */
- +#if defined(ARM64_MEMSTART_SHIFT) && defined(PMD_SHIFT)
- #if ARM64_MEMSTART_SHIFT < SECTION_SIZE_BITS
- #define ARM64_MEMSTART_ALIGN (1UL << SECTION_SIZE_BITS)
- #else
- #define ARM64_MEMSTART_ALIGN (1UL << ARM64_MEMSTART_SHIFT)
- #endif
- +#endif
- #endif /* __ASM_KERNEL_PGTABLE_H */
- diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
- index 7d4ad8907297c..6c46e440421e4 100644
- --- a/arch/x86/include/asm/pgtable_32.h
- +++ b/arch/x86/include/asm/pgtable_32.h
- @@ -56,7 +56,7 @@ do { \
- * With PAE paging (PTRS_PER_PMD > 1), we allocate PTRS_PER_PGD == 4 pages for
- * the PMD's in addition to the pages required for the last level pagetables.
- */
- -#if PTRS_PER_PMD > 1
- +#ifdef CONFIG_X86_PAE
- #define PAGE_TABLE_SIZE(pages) (((pages) / PTRS_PER_PMD) + PTRS_PER_PGD)
- #else
- #define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD)
- diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
- index eb67aa4cc5ef8..64a6bba70d183 100644
- --- a/arch/x86/kernel/paravirt.c
- +++ b/arch/x86/kernel/paravirt.c
- @@ -233,6 +233,11 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
- return this_cpu_read(paravirt_lazy_mode);
- }
- +static void native_tlb_remove_table(struct mmu_gather *tlb, void *table)
- +{
- + tlb_remove_table(tlb, table);
- +}
- +
- struct pv_info pv_info = {
- .name = "bare hardware",
- #ifdef CONFIG_PARAVIRT_XXL
- @@ -297,8 +302,7 @@ struct paravirt_patch_template pv_ops = {
- .mmu.flush_tlb_kernel = native_flush_tlb_global,
- .mmu.flush_tlb_one_user = native_flush_tlb_one_user,
- .mmu.flush_tlb_multi = native_flush_tlb_multi,
- - .mmu.tlb_remove_table =
- - (void (*)(struct mmu_gather *, void *))tlb_remove_page,
- + .mmu.tlb_remove_table = native_tlb_remove_table,
- .mmu.exit_mmap = paravirt_nop,
- .mmu.notify_page_enc_status_changed = paravirt_nop,
- diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
- index 287a8d1d3f707..e858e7e0383f2 100644
- --- a/drivers/block/drbd/drbd_state.c
- +++ b/drivers/block/drbd/drbd_state.c
- @@ -1542,9 +1542,10 @@ int drbd_bitmap_io_from_worker(struct drbd_device *device,
- int notify_resource_state_change(struct sk_buff *skb,
- unsigned int seq,
- - struct drbd_resource_state_change *resource_state_change,
- + void *state_change,
- enum drbd_notification_type type)
- {
- + struct drbd_resource_state_change *resource_state_change = state_change;
- struct drbd_resource *resource = resource_state_change->resource;
- struct resource_info resource_info = {
- .res_role = resource_state_change->role[NEW],
- @@ -1558,13 +1559,14 @@ int notify_resource_state_change(struct sk_buff *skb,
- int notify_connection_state_change(struct sk_buff *skb,
- unsigned int seq,
- - struct drbd_connection_state_change *connection_state_change,
- + void *state_change,
- enum drbd_notification_type type)
- {
- - struct drbd_connection *connection = connection_state_change->connection;
- + struct drbd_connection_state_change *p = state_change;
- + struct drbd_connection *connection = p->connection;
- struct connection_info connection_info = {
- - .conn_connection_state = connection_state_change->cstate[NEW],
- - .conn_role = connection_state_change->peer_role[NEW],
- + .conn_connection_state = p->cstate[NEW],
- + .conn_role = p->peer_role[NEW],
- };
- return notify_connection_state(skb, seq, connection, &connection_info, type);
- @@ -1572,9 +1574,10 @@ int notify_connection_state_change(struct sk_buff *skb,
- int notify_device_state_change(struct sk_buff *skb,
- unsigned int seq,
- - struct drbd_device_state_change *device_state_change,
- + void *state_change,
- enum drbd_notification_type type)
- {
- + struct drbd_device_state_change *device_state_change = state_change;
- struct drbd_device *device = device_state_change->device;
- struct device_info device_info = {
- .dev_disk_state = device_state_change->disk_state[NEW],
- @@ -1585,9 +1588,10 @@ int notify_device_state_change(struct sk_buff *skb,
- int notify_peer_device_state_change(struct sk_buff *skb,
- unsigned int seq,
- - struct drbd_peer_device_state_change *p,
- + void *state_change,
- enum drbd_notification_type type)
- {
- + struct drbd_peer_device_state_change *p = state_change;
- struct drbd_peer_device *peer_device = p->peer_device;
- struct peer_device_info peer_device_info = {
- .peer_repl_state = p->repl_state[NEW],
- @@ -1605,8 +1609,8 @@ static void broadcast_state_change(struct drbd_state_change *state_change)
- struct drbd_resource_state_change *resource_state_change = &state_change->resource[0];
- bool resource_state_has_changed;
- unsigned int n_device, n_connection, n_peer_device, n_peer_devices;
- - int (*last_func)(struct sk_buff *, unsigned int, void *,
- - enum drbd_notification_type) = NULL;
- + int (*last_func)(struct sk_buff *, unsigned int,
- + void *, enum drbd_notification_type) = NULL;
- void *last_arg = NULL;
- #define HAS_CHANGED(state) ((state)[OLD] != (state)[NEW])
- @@ -1616,7 +1620,7 @@ static void broadcast_state_change(struct drbd_state_change *state_change)
- })
- #define REMEMBER_STATE_CHANGE(func, arg, type) \
- ({ FINAL_STATE_CHANGE(type | NOTIFY_CONTINUES); \
- - last_func = (typeof(last_func))func; \
- + last_func = func; \
- last_arg = arg; \
- })
- diff --git a/drivers/block/drbd/drbd_state_change.h b/drivers/block/drbd/drbd_state_change.h
- index 9d78d8e3912ee..a56a57d676862 100644
- --- a/drivers/block/drbd/drbd_state_change.h
- +++ b/drivers/block/drbd/drbd_state_change.h
- @@ -46,19 +46,19 @@ extern void forget_state_change(struct drbd_state_change *);
- extern int notify_resource_state_change(struct sk_buff *,
- unsigned int,
- - struct drbd_resource_state_change *,
- + void *,
- enum drbd_notification_type type);
- extern int notify_connection_state_change(struct sk_buff *,
- unsigned int,
- - struct drbd_connection_state_change *,
- + void *,
- enum drbd_notification_type type);
- extern int notify_device_state_change(struct sk_buff *,
- unsigned int,
- - struct drbd_device_state_change *,
- + void *,
- enum drbd_notification_type type);
- extern int notify_peer_device_state_change(struct sk_buff *,
- unsigned int,
- - struct drbd_peer_device_state_change *,
- + void *,
- enum drbd_notification_type type);
- #endif /* DRBD_STATE_CHANGE_H */
- diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
- index 2db9b186b977a..f3ad9d9cb243b 100644
- --- a/drivers/block/floppy.c
- +++ b/drivers/block/floppy.c
- @@ -530,14 +530,13 @@ static struct format_descr format_req;
- static char *floppy_track_buffer;
- static int max_buffer_sectors;
- -typedef void (*done_f)(int);
- static const struct cont_t {
- void (*interrupt)(void);
- /* this is called after the interrupt of the
- * main command */
- void (*redo)(void); /* this is called to retry the operation */
- void (*error)(void); /* this is called to tally an error */
- - done_f done; /* this is called to say if the operation has
- + void (*done)(int); /* this is called to say if the operation has
- * succeeded/failed */
- } *cont;
- @@ -985,6 +984,10 @@ static void empty(void)
- {
- }
- +static void empty_done(int result)
- +{
- +}
- +
- static void (*floppy_work_fn)(void);
- static void floppy_work_workfn(struct work_struct *work)
- @@ -1998,14 +2001,14 @@ static const struct cont_t wakeup_cont = {
- .interrupt = empty,
- .redo = do_wakeup,
- .error = empty,
- - .done = (done_f)empty
- + .done = empty_done,
- };
- static const struct cont_t intr_cont = {
- .interrupt = empty,
- .redo = process_fd_request,
- .error = empty,
- - .done = (done_f)empty
- + .done = empty_done,
- };
- /* schedules handler, waiting for completion. May be interrupted, will then
- diff --git a/drivers/dma/dw-edma/dw-edma-v0-regs.h b/drivers/dma/dw-edma/dw-edma-v0-regs.h
- index e175f7b20480e..54800f9d9e460 100644
- --- a/drivers/dma/dw-edma/dw-edma-v0-regs.h
- +++ b/drivers/dma/dw-edma/dw-edma-v0-regs.h
- @@ -29,41 +29,41 @@ struct dw_edma_v0_ch_regs {
- u32 ch_control2; /* 0x0004 */
- u32 transfer_size; /* 0x0008 */
- union {
- - u64 reg; /* 0x000c..0x0010 */
- + u64 reg __packed; /* 0x000c..0x0010 */
- struct {
- u32 lsb; /* 0x000c */
- u32 msb; /* 0x0010 */
- };
- } sar;
- union {
- - u64 reg; /* 0x0014..0x0018 */
- + u64 reg __packed; /* 0x0014..0x0018 */
- struct {
- u32 lsb; /* 0x0014 */
- u32 msb; /* 0x0018 */
- };
- } dar;
- union {
- - u64 reg; /* 0x001c..0x0020 */
- + u64 reg __packed; /* 0x001c..0x0020 */
- struct {
- u32 lsb; /* 0x001c */
- u32 msb; /* 0x0020 */
- };
- } llp;
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_ch {
- struct dw_edma_v0_ch_regs wr; /* 0x0200 */
- u32 padding_1[55]; /* 0x0224..0x02fc */
- struct dw_edma_v0_ch_regs rd; /* 0x0300 */
- u32 padding_2[55]; /* 0x0324..0x03fc */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_unroll {
- u32 padding_1; /* 0x00f8 */
- u32 wr_engine_chgroup; /* 0x0100 */
- u32 rd_engine_chgroup; /* 0x0104 */
- union {
- - u64 reg; /* 0x0108..0x010c */
- + u64 reg __packed; /* 0x0108..0x010c */
- struct {
- u32 lsb; /* 0x0108 */
- u32 msb; /* 0x010c */
- @@ -71,7 +71,7 @@ struct dw_edma_v0_unroll {
- } wr_engine_hshake_cnt;
- u32 padding_2[2]; /* 0x0110..0x0114 */
- union {
- - u64 reg; /* 0x0120..0x0124 */
- + u64 reg __packed; /* 0x0120..0x0124 */
- struct {
- u32 lsb; /* 0x0120 */
- u32 msb; /* 0x0124 */
- @@ -97,12 +97,12 @@ struct dw_edma_v0_unroll {
- u32 rd_ch7_pwr_en; /* 0x0184 */
- u32 padding_5[30]; /* 0x0188..0x01fc */
- struct dw_edma_v0_ch ch[EDMA_V0_MAX_NR_CH]; /* 0x0200..0x1120 */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_legacy {
- u32 viewport_sel; /* 0x00f8 */
- struct dw_edma_v0_ch_regs ch; /* 0x0100..0x0120 */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_regs {
- /* eDMA global registers */
- @@ -113,7 +113,7 @@ struct dw_edma_v0_regs {
- u32 wr_doorbell; /* 0x0010 */
- u32 padding_2; /* 0x0014 */
- union {
- - u64 reg; /* 0x0018..0x001c */
- + u64 reg __packed; /* 0x0018..0x001c */
- struct {
- u32 lsb; /* 0x0018 */
- u32 msb; /* 0x001c */
- @@ -124,7 +124,7 @@ struct dw_edma_v0_regs {
- u32 rd_doorbell; /* 0x0030 */
- u32 padding_4; /* 0x0034 */
- union {
- - u64 reg; /* 0x0038..0x003c */
- + u64 reg __packed; /* 0x0038..0x003c */
- struct {
- u32 lsb; /* 0x0038 */
- u32 msb; /* 0x003c */
- @@ -138,14 +138,14 @@ struct dw_edma_v0_regs {
- u32 wr_int_clear; /* 0x0058 */
- u32 wr_err_status; /* 0x005c */
- union {
- - u64 reg; /* 0x0060..0x0064 */
- + u64 reg __packed; /* 0x0060..0x0064 */
- struct {
- u32 lsb; /* 0x0060 */
- u32 msb; /* 0x0064 */
- };
- } wr_done_imwr;
- union {
- - u64 reg; /* 0x0068..0x006c */
- + u64 reg __packed; /* 0x0068..0x006c */
- struct {
- u32 lsb; /* 0x0068 */
- u32 msb; /* 0x006c */
- @@ -164,7 +164,7 @@ struct dw_edma_v0_regs {
- u32 rd_int_clear; /* 0x00ac */
- u32 padding_10; /* 0x00b0 */
- union {
- - u64 reg; /* 0x00b4..0x00b8 */
- + u64 reg __packed; /* 0x00b4..0x00b8 */
- struct {
- u32 lsb; /* 0x00b4 */
- u32 msb; /* 0x00b8 */
- @@ -174,14 +174,14 @@ struct dw_edma_v0_regs {
- u32 rd_linked_list_err_en; /* 0x00c4 */
- u32 padding_12; /* 0x00c8 */
- union {
- - u64 reg; /* 0x00cc..0x00d0 */
- + u64 reg __packed; /* 0x00cc..0x00d0 */
- struct {
- u32 lsb; /* 0x00cc */
- u32 msb; /* 0x00d0 */
- };
- } rd_done_imwr;
- union {
- - u64 reg; /* 0x00d4..0x00d8 */
- + u64 reg __packed; /* 0x00d4..0x00d8 */
- struct {
- u32 lsb; /* 0x00d4 */
- u32 msb; /* 0x00d8 */
- @@ -196,38 +196,38 @@ struct dw_edma_v0_regs {
- union dw_edma_v0_type {
- struct dw_edma_v0_legacy legacy; /* 0x00f8..0x0120 */
- struct dw_edma_v0_unroll unroll; /* 0x00f8..0x1120 */
- - } type;
- -} __packed;
- + } type __packed __aligned(4);
- +} __packed __aligned(4);
- struct dw_edma_v0_lli {
- u32 control;
- u32 transfer_size;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } sar;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } dar;
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_llp {
- u32 control;
- u32 reserved;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } llp;
- -} __packed;
- +} __packed __aligned(4);
- #endif /* _DW_EDMA_V0_REGS_H */
- diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
- index 5f3a3e913d28f..d19c78a78ae3a 100644
- --- a/drivers/firmware/dmi-id.c
- +++ b/drivers/firmware/dmi-id.c
- @@ -169,9 +169,14 @@ static int dmi_dev_uevent(const struct device *dev, struct kobj_uevent_env *env)
- return 0;
- }
- +static void dmi_dev_release(struct device *dev)
- +{
- + kfree(dev);
- +}
- +
- static struct class dmi_class = {
- .name = "dmi",
- - .dev_release = (void(*)(struct device *)) kfree,
- + .dev_release = dmi_dev_release,
- .dev_uevent = dmi_dev_uevent,
- };
- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
- index e25f085ee8867..fd679ab1d98be 100644
- --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
- +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
- @@ -1341,7 +1341,7 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
- pci_bus_for_each_resource(root, res, i) {
- if (res && res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) &&
- - res->start > 0x100000000ull)
- + (u64)res->start > 0x100000000ull)
- break;
- }
- diff --git a/drivers/gpu/drm/i915/i915_drm_client.h b/drivers/gpu/drm/i915/i915_drm_client.h
- index 4c18b99e10a4e..67816c912bca1 100644
- --- a/drivers/gpu/drm/i915/i915_drm_client.h
- +++ b/drivers/gpu/drm/i915/i915_drm_client.h
- @@ -47,8 +47,6 @@ static inline void i915_drm_client_put(struct i915_drm_client *client)
- struct i915_drm_client *i915_drm_client_alloc(void);
- -#ifdef CONFIG_PROC_FS
- void i915_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file);
- -#endif
- #endif /* !__I915_DRM_CLIENT_H__ */
- diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
- index 19188683c8fca..8c2bf1c16f2a9 100644
- --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
- +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
- @@ -154,11 +154,17 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name)
- return (void *)fw;
- }
- +static void
- +shadow_fw_release(void *fw)
- +{
- + release_firmware(fw);
- +}
- +
- static const struct nvbios_source
- shadow_fw = {
- .name = "firmware",
- .init = shadow_fw_init,
- - .fini = (void(*)(void *))release_firmware,
- + .fini = shadow_fw_release,
- .read = shadow_fw_read,
- .rw = false,
- };
- diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
- index 7a9e160158f7e..a468138d905bc 100644
- --- a/drivers/hid/Makefile
- +++ b/drivers/hid/Makefile
- @@ -131,10 +131,8 @@ obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o
- obj-$(CONFIG_HID_TOPRE) += hid-topre.o
- obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o
- obj-$(CONFIG_HID_U2FZERO) += hid-u2fzero.o
- -hid-uclogic-objs := hid-uclogic-core.o \
- - hid-uclogic-rdesc.o \
- - hid-uclogic-params.o
- -obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o
- +hid-uclogic-objs := hid-uclogic-core.o
- +obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o hid-uclogic-rdesc.o hid-uclogic-params.o
- obj-$(CONFIG_HID_UDRAW_PS3) += hid-udraw-ps3.o
- obj-$(CONFIG_HID_LED) += hid-led.o
- obj-$(CONFIG_HID_XIAOMI) += hid-xiaomi.o
- @@ -151,10 +149,8 @@ obj-$(CONFIG_HID_WIIMOTE) += hid-wiimote.o
- obj-$(CONFIG_HID_SENSOR_HUB) += hid-sensor-hub.o
- obj-$(CONFIG_HID_SENSOR_CUSTOM_SENSOR) += hid-sensor-custom.o
- -hid-uclogic-test-objs := hid-uclogic-rdesc.o \
- - hid-uclogic-params.o \
- - hid-uclogic-rdesc-test.o
- -obj-$(CONFIG_HID_KUNIT_TEST) += hid-uclogic-test.o
- +hid-uclogic-test-objs := hid-uclogic-rdesc-test.o
- +obj-$(CONFIG_HID_KUNIT_TEST) += hid-uclogic-test.o hid-uclogic-params.o hid-uclogic-params.o
- obj-$(CONFIG_USB_HID) += usbhid/
- obj-$(CONFIG_USB_MOUSE) += usbhid/
- diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c
- index 85700cec5eac6..da28b87b7ab8b 100644
- --- a/drivers/hid/hid-nvidia-shield.c
- +++ b/drivers/hid/hid-nvidia-shield.c
- @@ -63,7 +63,7 @@ static_assert(sizeof(enum thunderstrike_led_state) == 1);
- struct thunderstrike_hostcmd_board_info {
- __le16 revision;
- __le16 serial[7];
- -};
- +} __packed;
- struct thunderstrike_hostcmd_haptics {
- u8 motor_left;
- @@ -81,7 +81,7 @@ struct thunderstrike_hostcmd_resp_report {
- __le16 fw_version;
- enum thunderstrike_led_state led_state;
- u8 payload[30];
- - };
- + } __packed;
- } __packed;
- static_assert(sizeof(struct thunderstrike_hostcmd_resp_report) ==
- THUNDERSTRIKE_HOSTCMD_REPORT_SIZE);
- diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
- index 9859dad36495a..54e9f1284fcbc 100644
- --- a/drivers/hid/hid-uclogic-params.c
- +++ b/drivers/hid/hid-uclogic-params.c
- @@ -133,6 +133,7 @@ void uclogic_params_hid_dbg(const struct hid_device *hdev,
- }
- hid_dbg(hdev, "}\n");
- }
- +EXPORT_SYMBOL_GPL(uclogic_params_hid_dbg);
- /**
- * uclogic_params_get_str_desc - retrieve a string descriptor from a HID
- @@ -660,6 +661,7 @@ void uclogic_params_cleanup(struct uclogic_params *params)
- memset(params, 0, sizeof(*params));
- }
- }
- +EXPORT_SYMBOL_GPL(uclogic_params_cleanup);
- /**
- * uclogic_params_get_desc() - Get a replacement report descriptor for a
- @@ -732,6 +734,7 @@ int uclogic_params_get_desc(const struct uclogic_params *params,
- kfree(desc);
- return rc;
- }
- +EXPORT_SYMBOL_GPL(uclogic_params_get_desc);
- /**
- * uclogic_params_init_invalid() - initialize tablet interface parameters,
- @@ -1856,7 +1859,10 @@ int uclogic_params_init(struct uclogic_params *params,
- uclogic_params_cleanup(&p);
- return rc;
- }
- +EXPORT_SYMBOL_GPL(uclogic_params_init);
- #ifdef CONFIG_HID_KUNIT_TEST
- #include "hid-uclogic-params-test.c"
- #endif
- +
- +MODULE_LICENSE("GPL");
- diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c
- index b6dfdf6356a60..aa80aff2a1914 100644
- --- a/drivers/hid/hid-uclogic-rdesc.c
- +++ b/drivers/hid/hid-uclogic-rdesc.c
- @@ -59,9 +59,11 @@ __u8 uclogic_rdesc_wp4030u_fixed_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp4030u_fixed_arr);
- const size_t uclogic_rdesc_wp4030u_fixed_size =
- sizeof(uclogic_rdesc_wp4030u_fixed_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp4030u_fixed_size);
- /* Fixed WP5540U report descriptor */
- __u8 uclogic_rdesc_wp5540u_fixed_arr[] = {
- @@ -136,9 +138,11 @@ __u8 uclogic_rdesc_wp5540u_fixed_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp5540u_fixed_arr);
- const size_t uclogic_rdesc_wp5540u_fixed_size =
- sizeof(uclogic_rdesc_wp5540u_fixed_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp5540u_fixed_size);
- /* Fixed WP8060U report descriptor */
- __u8 uclogic_rdesc_wp8060u_fixed_arr[] = {
- @@ -213,9 +217,11 @@ __u8 uclogic_rdesc_wp8060u_fixed_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp8060u_fixed_arr);
- const size_t uclogic_rdesc_wp8060u_fixed_size =
- sizeof(uclogic_rdesc_wp8060u_fixed_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp8060u_fixed_size);
- /* Fixed WP1062 report descriptor */
- __u8 uclogic_rdesc_wp1062_fixed_arr[] = {
- @@ -261,9 +267,11 @@ __u8 uclogic_rdesc_wp1062_fixed_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp1062_fixed_arr);
- const size_t uclogic_rdesc_wp1062_fixed_size =
- sizeof(uclogic_rdesc_wp1062_fixed_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp1062_fixed_size);
- /* Fixed PF1209 report descriptor */
- __u8 uclogic_rdesc_pf1209_fixed_arr[] = {
- @@ -338,9 +346,11 @@ __u8 uclogic_rdesc_pf1209_fixed_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_pf1209_fixed_arr);
- const size_t uclogic_rdesc_pf1209_fixed_size =
- sizeof(uclogic_rdesc_pf1209_fixed_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_pf1209_fixed_size);
- /* Fixed PID 0522 tablet report descriptor, interface 0 (stylus) */
- __u8 uclogic_rdesc_twhl850_fixed0_arr[] = {
- @@ -384,9 +394,11 @@ __u8 uclogic_rdesc_twhl850_fixed0_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed0_arr);
- const size_t uclogic_rdesc_twhl850_fixed0_size =
- sizeof(uclogic_rdesc_twhl850_fixed0_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed0_size);
- /* Fixed PID 0522 tablet report descriptor, interface 1 (mouse) */
- __u8 uclogic_rdesc_twhl850_fixed1_arr[] = {
- @@ -424,9 +436,11 @@ __u8 uclogic_rdesc_twhl850_fixed1_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed1_arr);
- const size_t uclogic_rdesc_twhl850_fixed1_size =
- sizeof(uclogic_rdesc_twhl850_fixed1_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed1_size);
- /* Fixed PID 0522 tablet report descriptor, interface 2 (frame buttons) */
- __u8 uclogic_rdesc_twhl850_fixed2_arr[] = {
- @@ -450,9 +464,11 @@ __u8 uclogic_rdesc_twhl850_fixed2_arr[] = {
- 0x80, /* Input, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed2_arr);
- const size_t uclogic_rdesc_twhl850_fixed2_size =
- sizeof(uclogic_rdesc_twhl850_fixed2_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed2_size);
- /* Fixed TWHA60 report descriptor, interface 0 (stylus) */
- __u8 uclogic_rdesc_twha60_fixed0_arr[] = {
- @@ -499,9 +515,11 @@ __u8 uclogic_rdesc_twha60_fixed0_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twha60_fixed0_arr);
- const size_t uclogic_rdesc_twha60_fixed0_size =
- sizeof(uclogic_rdesc_twha60_fixed0_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twha60_fixed0_size);
- /* Fixed TWHA60 report descriptor, interface 1 (frame buttons) */
- __u8 uclogic_rdesc_twha60_fixed1_arr[] = {
- @@ -527,9 +545,11 @@ __u8 uclogic_rdesc_twha60_fixed1_arr[] = {
- 0x81, 0x01, /* Input (Constant), */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twha60_fixed1_arr);
- const size_t uclogic_rdesc_twha60_fixed1_size =
- sizeof(uclogic_rdesc_twha60_fixed1_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_twha60_fixed1_size);
- /* Fixed report descriptor template for (tweaked) v1 pen reports */
- const __u8 uclogic_rdesc_v1_pen_template_arr[] = {
- @@ -581,9 +601,11 @@ const __u8 uclogic_rdesc_v1_pen_template_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v1_pen_template_arr);
- const size_t uclogic_rdesc_v1_pen_template_size =
- sizeof(uclogic_rdesc_v1_pen_template_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v1_pen_template_size);
- /* Fixed report descriptor template for (tweaked) v2 pen reports */
- const __u8 uclogic_rdesc_v2_pen_template_arr[] = {
- @@ -647,9 +669,11 @@ const __u8 uclogic_rdesc_v2_pen_template_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_pen_template_arr);
- const size_t uclogic_rdesc_v2_pen_template_size =
- sizeof(uclogic_rdesc_v2_pen_template_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_pen_template_size);
- /*
- * Expand to the contents of a generic frame buttons report descriptor.
- @@ -702,16 +726,22 @@ const size_t uclogic_rdesc_v2_pen_template_size =
- const __u8 uclogic_rdesc_v1_frame_arr[] = {
- UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(UCLOGIC_RDESC_V1_FRAME_ID, 8)
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v1_frame_arr);
- +
- const size_t uclogic_rdesc_v1_frame_size =
- sizeof(uclogic_rdesc_v1_frame_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v1_frame_size);
- /* Fixed report descriptor for (tweaked) v2 frame button reports */
- const __u8 uclogic_rdesc_v2_frame_buttons_arr[] = {
- UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID,
- 12)
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_buttons_arr);
- +
- const size_t uclogic_rdesc_v2_frame_buttons_size =
- sizeof(uclogic_rdesc_v2_frame_buttons_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_buttons_size);
- /* Fixed report descriptor for (tweaked) v2 frame touch ring reports */
- const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[] = {
- @@ -758,8 +788,11 @@ const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_touch_ring_arr);
- +
- const size_t uclogic_rdesc_v2_frame_touch_ring_size =
- sizeof(uclogic_rdesc_v2_frame_touch_ring_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_touch_ring_size);
- /* Fixed report descriptor for (tweaked) v2 frame touch strip reports */
- const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[] = {
- @@ -806,8 +839,11 @@ const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_touch_strip_arr);
- +
- const size_t uclogic_rdesc_v2_frame_touch_strip_size =
- sizeof(uclogic_rdesc_v2_frame_touch_strip_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_touch_strip_size);
- /* Fixed report descriptor for (tweaked) v2 frame dial reports */
- const __u8 uclogic_rdesc_v2_frame_dial_arr[] = {
- @@ -856,14 +892,22 @@ const __u8 uclogic_rdesc_v2_frame_dial_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_dial_arr);
- +
- const size_t uclogic_rdesc_v2_frame_dial_size =
- sizeof(uclogic_rdesc_v2_frame_dial_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_dial_size);
- const __u8 uclogic_ugee_v2_probe_arr[] = {
- 0x02, 0xb0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
- +EXPORT_SYMBOL_GPL(uclogic_ugee_v2_probe_arr);
- +
- const size_t uclogic_ugee_v2_probe_size = sizeof(uclogic_ugee_v2_probe_arr);
- +EXPORT_SYMBOL_GPL(uclogic_ugee_v2_probe_size);
- +
- const int uclogic_ugee_v2_probe_endpoint = 0x03;
- +EXPORT_SYMBOL_GPL(uclogic_ugee_v2_probe_endpoint);
- /* Fixed report descriptor template for UGEE v2 pen reports */
- const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[] = {
- @@ -935,8 +979,11 @@ const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[] = {
- 0xc0, /* End Collection, */
- 0xc0, /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_pen_template_arr);
- +
- const size_t uclogic_rdesc_ugee_v2_pen_template_size =
- sizeof(uclogic_rdesc_ugee_v2_pen_template_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_pen_template_size);
- /* Fixed report descriptor template for UGEE v2 frame reports (buttons only) */
- const __u8 uclogic_rdesc_ugee_v2_frame_btn_template_arr[] = {
- @@ -964,8 +1011,11 @@ const __u8 uclogic_rdesc_ugee_v2_frame_btn_template_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_btn_template_arr);
- +
- const size_t uclogic_rdesc_ugee_v2_frame_btn_template_size =
- sizeof(uclogic_rdesc_ugee_v2_frame_btn_template_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_btn_template_size);
- /* Fixed report descriptor template for UGEE v2 frame reports (dial) */
- const __u8 uclogic_rdesc_ugee_v2_frame_dial_template_arr[] = {
- @@ -1004,8 +1054,11 @@ const __u8 uclogic_rdesc_ugee_v2_frame_dial_template_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_dial_template_arr);
- +
- const size_t uclogic_rdesc_ugee_v2_frame_dial_template_size =
- sizeof(uclogic_rdesc_ugee_v2_frame_dial_template_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_dial_template_size);
- /* Fixed report descriptor template for UGEE v2 frame reports (mouse) */
- const __u8 uclogic_rdesc_ugee_v2_frame_mouse_template_arr[] = {
- @@ -1038,8 +1091,11 @@ const __u8 uclogic_rdesc_ugee_v2_frame_mouse_template_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_mouse_template_arr);
- +
- const size_t uclogic_rdesc_ugee_v2_frame_mouse_template_size =
- sizeof(uclogic_rdesc_ugee_v2_frame_mouse_template_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_mouse_template_size);
- /* Fixed report descriptor template for UGEE v2 battery reports */
- const __u8 uclogic_rdesc_ugee_v2_battery_template_arr[] = {
- @@ -1072,8 +1128,11 @@ const __u8 uclogic_rdesc_ugee_v2_battery_template_arr[] = {
- 0x81, 0x01, /* Input (Constant), */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_battery_template_arr);
- +
- const size_t uclogic_rdesc_ugee_v2_battery_template_size =
- sizeof(uclogic_rdesc_ugee_v2_battery_template_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_battery_template_size);
- /* Fixed report descriptor for Ugee EX07 frame */
- const __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = {
- @@ -1099,8 +1158,11 @@ const __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_ex07_frame_arr);
- +
- const size_t uclogic_rdesc_ugee_ex07_frame_size =
- sizeof(uclogic_rdesc_ugee_ex07_frame_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_ex07_frame_size);
- /* Fixed report descriptor for Ugee G5 frame controls */
- const __u8 uclogic_rdesc_ugee_g5_frame_arr[] = {
- @@ -1153,8 +1215,10 @@ const __u8 uclogic_rdesc_ugee_g5_frame_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_g5_frame_arr);
- const size_t uclogic_rdesc_ugee_g5_frame_size =
- sizeof(uclogic_rdesc_ugee_g5_frame_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_g5_frame_size);
- /* Fixed report descriptor for XP-Pen Deco 01 frame controls */
- const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
- @@ -1187,9 +1251,11 @@ const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
- 0xC0, /* End Collection, */
- 0xC0 /* End Collection */
- };
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_xppen_deco01_frame_arr);
- const size_t uclogic_rdesc_xppen_deco01_frame_size =
- sizeof(uclogic_rdesc_xppen_deco01_frame_arr);
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_xppen_deco01_frame_size);
- /**
- * uclogic_rdesc_template_apply() - apply report descriptor parameters to a
- @@ -1242,3 +1308,6 @@ __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
- return rdesc_ptr;
- }
- +EXPORT_SYMBOL_GPL(uclogic_rdesc_template_apply);
- +
- +MODULE_LICENSE("GPL");
- diff --git a/drivers/infiniband/core/mad_priv.h b/drivers/infiniband/core/mad_priv.h
- index 1b7445a6f6714..f2d607bb0b967 100644
- --- a/drivers/infiniband/core/mad_priv.h
- +++ b/drivers/infiniband/core/mad_priv.h
- @@ -73,14 +73,14 @@ struct ib_mad_private_header {
- struct ib_mad_recv_wc recv_wc;
- struct ib_wc wc;
- u64 mapping;
- -} __packed;
- +};
- struct ib_mad_private {
- struct ib_mad_private_header header;
- size_t mad_size;
- struct ib_grh grh;
- u8 mad[];
- -} __packed;
- +};
- struct ib_rmpp_segment {
- struct list_head list;
- diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
- index dee8c97ff0568..07e24ede7d1ce 100644
- --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
- +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
- @@ -270,7 +270,7 @@ struct iser_rx_desc {
- struct ib_sge rx_sg;
- struct ib_cqe cqe;
- char pad[ISER_RX_PAD_SIZE];
- -} __packed;
- +} __packed __aligned(4);
- /**
- * struct iser_login_desc - iSER login descriptor
- diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
- index c12005eab14c1..342a7a7ae4e2f 100644
- --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
- +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
- @@ -212,8 +212,10 @@ static const char *get_ch_state_name(enum rdma_ch_state s)
- * @event: Description of the event that occurred.
- * @ch: SRPT RDMA channel.
- */
- -static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch)
- +static void srpt_qp_event(struct ib_event *event, void *ptr)
- {
- + struct srpt_rdma_ch *ch = ptr;
- +
- pr_debug("QP event %d on ch=%p sess_name=%s-%d state=%s\n",
- event->event, ch, ch->sess_name, ch->qp->qp_num,
- get_ch_state_name(ch->state));
- @@ -1807,8 +1809,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
- ch->cq_size = ch->rq_size + sq_size;
- qp_init->qp_context = (void *)ch;
- - qp_init->event_handler
- - = (void(*)(struct ib_event *, void*))srpt_qp_event;
- + qp_init->event_handler = srpt_qp_event;
- qp_init->send_cq = ch->cq;
- qp_init->recv_cq = ch->cq;
- qp_init->sq_sig_type = IB_SIGNAL_REQ_WR;
- diff --git a/drivers/media/dvb-frontends/as102_fe_types.h b/drivers/media/dvb-frontends/as102_fe_types.h
- index 297f9520ebf9d..981e79e75db13 100644
- --- a/drivers/media/dvb-frontends/as102_fe_types.h
- +++ b/drivers/media/dvb-frontends/as102_fe_types.h
- @@ -174,6 +174,7 @@ struct as10x_register_addr {
- uint32_t addr;
- /* register mode access */
- uint8_t mode;
- -};
- + uint8_t __pad[3];
- +} __packed;
- #endif
- diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c
- index 49fc2e9d45dd5..c4f1c49b9d52a 100644
- --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c
- +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c
- @@ -77,10 +77,10 @@ void mdp_vpu_shared_mem_free(struct mdp_vpu_dev *vpu)
- dma_free_wc(dev, vpu->config_size, vpu->config, vpu->config_addr);
- }
- -static void mdp_vpu_ipi_handle_init_ack(void *data, unsigned int len,
- +static void mdp_vpu_ipi_handle_init_ack(const void *data, unsigned int len,
- void *priv)
- {
- - struct mdp_ipi_init_msg *msg = (struct mdp_ipi_init_msg *)data;
- + const struct mdp_ipi_init_msg *msg = data;
- struct mdp_vpu_dev *vpu =
- (struct mdp_vpu_dev *)(unsigned long)msg->drv_data;
- @@ -91,10 +91,10 @@ static void mdp_vpu_ipi_handle_init_ack(void *data, unsigned int len,
- complete(&vpu->ipi_acked);
- }
- -static void mdp_vpu_ipi_handle_deinit_ack(void *data, unsigned int len,
- +static void mdp_vpu_ipi_handle_deinit_ack(const void *data, unsigned int len,
- void *priv)
- {
- - struct mdp_ipi_deinit_msg *msg = (struct mdp_ipi_deinit_msg *)data;
- + const struct mdp_ipi_deinit_msg *msg = data;
- struct mdp_vpu_dev *vpu =
- (struct mdp_vpu_dev *)(unsigned long)msg->drv_data;
- @@ -102,10 +102,10 @@ static void mdp_vpu_ipi_handle_deinit_ack(void *data, unsigned int len,
- complete(&vpu->ipi_acked);
- }
- -static void mdp_vpu_ipi_handle_frame_ack(void *data, unsigned int len,
- +static void mdp_vpu_ipi_handle_frame_ack(const void *data, unsigned int len,
- void *priv)
- {
- - struct img_sw_addr *addr = (struct img_sw_addr *)data;
- + const struct img_sw_addr *addr = data;
- struct img_ipi_frameparam *param =
- (struct img_ipi_frameparam *)(unsigned long)addr->va;
- struct mdp_vpu_dev *vpu =
- diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h
- index 16824114657f0..a2cc77f9b31b9 100644
- --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h
- +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h
- @@ -22,7 +22,7 @@ enum mtk_vcodec_fw_use {
- struct mtk_vcodec_fw;
- -typedef void (*mtk_vcodec_ipi_handler) (void *data,
- +typedef void (*mtk_vcodec_ipi_handler) (const void *data,
- unsigned int len, void *priv);
- struct mtk_vcodec_fw *mtk_vcodec_fw_select(struct mtk_vcodec_dev *dev,
- diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c
- index cfc7ebed8fb7a..1ec29f1b163a1 100644
- --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c
- +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c
- @@ -29,15 +29,7 @@ static int mtk_vcodec_vpu_set_ipi_register(struct mtk_vcodec_fw *fw, int id,
- mtk_vcodec_ipi_handler handler,
- const char *name, void *priv)
- {
- - /*
- - * The handler we receive takes a void * as its first argument. We
- - * cannot change this because it needs to be passed down to the rproc
- - * subsystem when SCP is used. VPU takes a const argument, which is
- - * more constrained, so the conversion below is safe.
- - */
- - ipi_handler_t handler_const = (ipi_handler_t)handler;
- -
- - return vpu_ipi_register(fw->pdev, id, handler_const, name, priv);
- + return vpu_ipi_register(fw->pdev, id, handler, name, priv);
- }
- static int mtk_vcodec_vpu_ipi_send(struct mtk_vcodec_fw *fw, int id, void *buf,
- diff --git a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
- index df309e8e93798..c350c1a50b7d9 100644
- --- a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
- +++ b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
- @@ -85,7 +85,7 @@ static void handle_get_param_msg_ack(const struct vdec_vpu_ipi_get_param_ack *ms
- * This function runs in interrupt context and it means there's an IPI MSG
- * from VPU.
- */
- -static void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv)
- +static void vpu_dec_ipi_handler(const void *data, unsigned int len, void *priv)
- {
- const struct vdec_vpu_ipi_ack *msg = data;
- struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)
- diff --git a/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c b/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c
- index 09e7eaa25aabe..41017b82174bd 100644
- --- a/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c
- +++ b/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c
- @@ -44,7 +44,7 @@ static void handle_enc_encode_msg(struct venc_vpu_inst *vpu, const void *data)
- vpu->is_key_frm = msg->is_key_frm;
- }
- -static void vpu_enc_ipi_handler(void *data, unsigned int len, void *priv)
- +static void vpu_enc_ipi_handler(const void *data, unsigned int len, void *priv)
- {
- const struct venc_vpu_ipi_msg_common *msg = data;
- struct venc_vpu_inst *vpu =
- diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
- index 14170a5d72b35..1bc7fdc2acfa4 100644
- --- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
- +++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
- @@ -90,8 +90,10 @@ static void pvr2_context_destroy(struct pvr2_context *mp)
- }
- -static void pvr2_context_notify(struct pvr2_context *mp)
- +static void pvr2_context_notify(void *ptr)
- {
- + struct pvr2_context *mp = ptr;
- +
- pvr2_context_set_notify(mp,!0);
- }
- @@ -106,9 +108,7 @@ static void pvr2_context_check(struct pvr2_context *mp)
- pvr2_trace(PVR2_TRACE_CTXT,
- "pvr2_context %p (initialize)", mp);
- /* Finish hardware initialization */
- - if (pvr2_hdw_initialize(mp->hdw,
- - (void (*)(void *))pvr2_context_notify,
- - mp)) {
- + if (pvr2_hdw_initialize(mp->hdw, pvr2_context_notify, mp)) {
- mp->video_stream.stream =
- pvr2_hdw_get_video_stream(mp->hdw);
- /* Trigger interface initialization. By doing this
- diff --git a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
- index 26811efe0fb58..9a9bae21c6147 100644
- --- a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
- +++ b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
- @@ -88,8 +88,10 @@ static int pvr2_dvb_feed_thread(void *data)
- return stat;
- }
- -static void pvr2_dvb_notify(struct pvr2_dvb_adapter *adap)
- +static void pvr2_dvb_notify(void *ptr)
- {
- + struct pvr2_dvb_adapter *adap = ptr;
- +
- wake_up(&adap->buffer_wait_data);
- }
- @@ -149,7 +151,7 @@ static int pvr2_dvb_stream_do_start(struct pvr2_dvb_adapter *adap)
- }
- pvr2_stream_set_callback(pvr->video_stream.stream,
- - (pvr2_stream_callback) pvr2_dvb_notify, adap);
- + pvr2_dvb_notify, adap);
- ret = pvr2_stream_set_buffer_count(stream, PVR2_DVB_BUFFER_COUNT);
- if (ret < 0) return ret;
- diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
- index c04ab7258d645..b305ae7ed4150 100644
- --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
- +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
- @@ -1033,8 +1033,10 @@ static int pvr2_v4l2_open(struct file *file)
- }
- -static void pvr2_v4l2_notify(struct pvr2_v4l2_fh *fhp)
- +static void pvr2_v4l2_notify(void *ptr)
- {
- + struct pvr2_v4l2_fh *fhp = ptr;
- +
- wake_up(&fhp->wait_data);
- }
- @@ -1067,7 +1069,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
- hdw = fh->channel.mc_head->hdw;
- sp = fh->pdi->stream->stream;
- - pvr2_stream_set_callback(sp,(pvr2_stream_callback)pvr2_v4l2_notify,fh);
- + pvr2_stream_set_callback(sp, pvr2_v4l2_notify, fh);
- pvr2_hdw_set_stream_type(hdw,fh->pdi->config);
- if ((ret = pvr2_hdw_set_streaming(hdw,!0)) < 0) return ret;
- return pvr2_ioread_set_enabled(fh->rhp,!0);
- diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
- index 39c4615361812..d4202a0dacca5 100644
- --- a/drivers/mfd/Makefile
- +++ b/drivers/mfd/Makefile
- @@ -276,7 +276,5 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC_PMCI) += intel-m10-bmc-pmci.o
- obj-$(CONFIG_MFD_ATC260X) += atc260x-core.o
- obj-$(CONFIG_MFD_ATC260X_I2C) += atc260x-i2c.o
- -rsmu-i2c-objs := rsmu_core.o rsmu_i2c.o
- -rsmu-spi-objs := rsmu_core.o rsmu_spi.o
- -obj-$(CONFIG_MFD_RSMU_I2C) += rsmu-i2c.o
- -obj-$(CONFIG_MFD_RSMU_SPI) += rsmu-spi.o
- +obj-$(CONFIG_MFD_RSMU_I2C) += rsmu_i2c.o rsmu_core.o
- +obj-$(CONFIG_MFD_RSMU_SPI) += rsmu_spi.o rsmu_core.o
- diff --git a/drivers/mfd/rsmu_core.c b/drivers/mfd/rsmu_core.c
- index 29437fd0bd5bf..fd04a6e5dfa31 100644
- --- a/drivers/mfd/rsmu_core.c
- +++ b/drivers/mfd/rsmu_core.c
- @@ -78,11 +78,13 @@ int rsmu_core_init(struct rsmu_ddata *rsmu)
- return ret;
- }
- +EXPORT_SYMBOL_GPL(rsmu_core_init);
- void rsmu_core_exit(struct rsmu_ddata *rsmu)
- {
- mutex_destroy(&rsmu->lock);
- }
- +EXPORT_SYMBOL_GPL(rsmu_core_exit);
- MODULE_DESCRIPTION("Renesas SMU core driver");
- MODULE_LICENSE("GPL");
- diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c
- index b3136ae6f4e94..de8290ba8e6d8 100644
- --- a/drivers/mtd/nand/raw/lpc32xx_mlc.c
- +++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c
- @@ -303,8 +303,9 @@ static int lpc32xx_nand_device_ready(struct nand_chip *nand_chip)
- return 0;
- }
- -static irqreturn_t lpc3xxx_nand_irq(int irq, struct lpc32xx_nand_host *host)
- +static irqreturn_t lpc3xxx_nand_irq(int irq, void *data)
- {
- + struct lpc32xx_nand_host *host = data;
- uint8_t sr;
- /* Clear interrupt flag by reading status */
- diff --git a/drivers/mtd/tests/Makefile b/drivers/mtd/tests/Makefile
- index 5de0378f90dbd..7dae831ee8b6b 100644
- --- a/drivers/mtd/tests/Makefile
- +++ b/drivers/mtd/tests/Makefile
- @@ -1,19 +1,19 @@
- # SPDX-License-Identifier: GPL-2.0
- -obj-$(CONFIG_MTD_TESTS) += mtd_oobtest.o
- -obj-$(CONFIG_MTD_TESTS) += mtd_pagetest.o
- -obj-$(CONFIG_MTD_TESTS) += mtd_readtest.o
- -obj-$(CONFIG_MTD_TESTS) += mtd_speedtest.o
- -obj-$(CONFIG_MTD_TESTS) += mtd_stresstest.o
- -obj-$(CONFIG_MTD_TESTS) += mtd_subpagetest.o
- -obj-$(CONFIG_MTD_TESTS) += mtd_torturetest.o
- -obj-$(CONFIG_MTD_TESTS) += mtd_nandecctest.o
- -obj-$(CONFIG_MTD_TESTS) += mtd_nandbiterrs.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_oobtest.o mtd_test.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_pagetest.o mtd_test.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_readtest.o mtd_test.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_speedtest.o mtd_test.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_stresstest.o mtd_test.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_subpagetest.o mtd_test.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_torturetest.o mtd_test.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_nandecctest.o mtd_test.o
- +obj-$(CONFIG_MTD_TESTS) += mtd_nandbiterrs.o mtd_test.o
- -mtd_oobtest-objs := oobtest.o mtd_test.o
- -mtd_pagetest-objs := pagetest.o mtd_test.o
- -mtd_readtest-objs := readtest.o mtd_test.o
- -mtd_speedtest-objs := speedtest.o mtd_test.o
- -mtd_stresstest-objs := stresstest.o mtd_test.o
- -mtd_subpagetest-objs := subpagetest.o mtd_test.o
- -mtd_torturetest-objs := torturetest.o mtd_test.o
- -mtd_nandbiterrs-objs := nandbiterrs.o mtd_test.o
- +mtd_oobtest-objs := oobtest.o
- +mtd_pagetest-objs := pagetest.o
- +mtd_readtest-objs := readtest.o
- +mtd_speedtest-objs := speedtest.o
- +mtd_stresstest-objs := stresstest.o
- +mtd_subpagetest-objs := subpagetest.o
- +mtd_torturetest-objs := torturetest.o
- +mtd_nandbiterrs-objs := nandbiterrs.o
- diff --git a/drivers/mtd/tests/mtd_test.c b/drivers/mtd/tests/mtd_test.c
- index c84250beffdc9..7ce5129a4502f 100644
- --- a/drivers/mtd/tests/mtd_test.c
- +++ b/drivers/mtd/tests/mtd_test.c
- @@ -25,6 +25,7 @@ int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum)
- return 0;
- }
- +EXPORT_SYMBOL_GPL(mtdtest_erase_eraseblock);
- static int is_block_bad(struct mtd_info *mtd, unsigned int ebnum)
- {
- @@ -57,6 +58,7 @@ int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
- return 0;
- }
- +EXPORT_SYMBOL_GPL(mtdtest_scan_for_bad_eraseblocks);
- int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
- unsigned int eb, int ebcnt)
- @@ -75,6 +77,7 @@ int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
- return 0;
- }
- +EXPORT_SYMBOL_GPL(mtdtest_erase_good_eraseblocks);
- int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf)
- {
- @@ -92,6 +95,7 @@ int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf)
- return err;
- }
- +EXPORT_SYMBOL_GPL(mtdtest_read);
- int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
- const void *buf)
- @@ -107,3 +111,6 @@ int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
- return err;
- }
- +EXPORT_SYMBOL_GPL(mtdtest_write);
- +
- +MODULE_LICENSE("GPL");
- diff --git a/drivers/net/ethernet/3com/typhoon.h b/drivers/net/ethernet/3com/typhoon.h
- index 38e6dcab4e941..1ee8d1643e082 100644
- --- a/drivers/net/ethernet/3com/typhoon.h
- +++ b/drivers/net/ethernet/3com/typhoon.h
- @@ -171,7 +171,7 @@ struct tx_desc {
- __le32 addr;
- __le32 addrHi;
- } frag;
- - u64 tx_addr; /* opaque for hardware, for TX_DESC */
- + u64 tx_addr __packed; /* opaque for hardware, for TX_DESC */
- };
- __le32 processFlags;
- #define TYPHOON_TX_PF_NO_CRC cpu_to_le32(0x00000001)
- @@ -187,7 +187,7 @@ struct tx_desc {
- #define TYPHOON_TX_PF_VLAN_MASK cpu_to_le32(0x0ffff000)
- #define TYPHOON_TX_PF_INTERNAL cpu_to_le32(0xf0000000)
- #define TYPHOON_TX_PF_VLAN_TAG_SHIFT 12
- -} __packed;
- +} __packed __aligned(4);
- /* The TCP Segmentation offload option descriptor
- *
- diff --git a/drivers/net/ethernet/brocade/bna/bfa_cs.h b/drivers/net/ethernet/brocade/bna/bfa_cs.h
- index 858c921294517..d7bca7a4cf2e0 100644
- --- a/drivers/net/ethernet/brocade/bna/bfa_cs.h
- +++ b/drivers/net/ethernet/brocade/bna/bfa_cs.h
- @@ -56,9 +56,6 @@ BFA_SM_TABLE(rx, bna_rx, bna_rx_event, bna_fsm_rx_t)
- #define BFA_SM(_sm) (_sm)
- -/* State machine with entry actions. */
- -typedef void (*bfa_fsm_t)(void *fsm, int event);
- -
- /* oc - object class eg. bfa_ioc
- * st - state, eg. reset
- * otype - object type, eg. struct bfa_ioc
- diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
- index d6d90f9722a7e..757d430253b5e 100644
- --- a/drivers/net/ethernet/brocade/bna/bnad.c
- +++ b/drivers/net/ethernet/brocade/bna/bnad.c
- @@ -1092,10 +1092,10 @@ bnad_cb_tx_resume(struct bnad *bnad, struct bna_tx *tx)
- * Free all TxQs buffers and then notify TX_E_CLEANUP_DONE to Tx fsm.
- */
- static void
- -bnad_tx_cleanup(struct delayed_work *work)
- +bnad_tx_cleanup(struct work_struct *work)
- {
- struct bnad_tx_info *tx_info =
- - container_of(work, struct bnad_tx_info, tx_cleanup_work);
- + container_of(work, struct bnad_tx_info, tx_cleanup_work.work);
- struct bnad *bnad = NULL;
- struct bna_tcb *tcb;
- unsigned long flags;
- @@ -1171,7 +1171,7 @@ bnad_cb_rx_stall(struct bnad *bnad, struct bna_rx *rx)
- * Free all RxQs buffers and then notify RX_E_CLEANUP_DONE to Rx fsm.
- */
- static void
- -bnad_rx_cleanup(void *work)
- +bnad_rx_cleanup(struct work_struct *work)
- {
- struct bnad_rx_info *rx_info =
- container_of(work, struct bnad_rx_info, rx_cleanup_work);
- @@ -1992,8 +1992,7 @@ bnad_setup_tx(struct bnad *bnad, u32 tx_id)
- }
- tx_info->tx = tx;
- - INIT_DELAYED_WORK(&tx_info->tx_cleanup_work,
- - (work_func_t)bnad_tx_cleanup);
- + INIT_DELAYED_WORK(&tx_info->tx_cleanup_work, bnad_tx_cleanup);
- /* Register ISR for the Tx object */
- if (intr_info->intr_type == BNA_INTR_T_MSIX) {
- @@ -2249,8 +2248,7 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_id)
- rx_info->rx = rx;
- spin_unlock_irqrestore(&bnad->bna_lock, flags);
- - INIT_WORK(&rx_info->rx_cleanup_work,
- - (work_func_t)(bnad_rx_cleanup));
- + INIT_WORK(&rx_info->rx_cleanup_work, bnad_rx_cleanup);
- /*
- * Init NAPI, so that state is set to NAPI_STATE_SCHED,
- diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
- index 068ed52b66c94..90669bc734508 100644
- --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
- +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
- @@ -1459,9 +1459,9 @@ void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx,
- EXPORT_SYMBOL_GPL(cn23xx_tell_vf_its_macaddr_changed);
- static void
- -cn23xx_get_vf_stats_callback(struct octeon_device *oct,
- - struct octeon_mbox_cmd *cmd, void *arg)
- +cn23xx_get_vf_stats_callback(void *octp, void *cmdp, void *arg)
- {
- + struct octeon_mbox_cmd *cmd = cmdp;
- struct oct_vf_stats_ctx *ctx = arg;
- memcpy(ctx->stats, cmd->data, sizeof(struct oct_vf_stats));
- @@ -1490,7 +1490,7 @@ int cn23xx_get_vf_stats(struct octeon_device *oct, int vfidx,
- mbox_cmd.q_no = vfidx * oct->sriov_info.rings_per_vf;
- mbox_cmd.recv_len = 0;
- mbox_cmd.recv_status = 0;
- - mbox_cmd.fn = (octeon_mbox_callback_t)cn23xx_get_vf_stats_callback;
- + mbox_cmd.fn = cn23xx_get_vf_stats_callback;
- ctx.stats = stats;
- atomic_set(&ctx.status, 0);
- mbox_cmd.fn_arg = (void *)&ctx;
- diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
- index dd5d80fee24f0..910a09c4f641c 100644
- --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
- +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
- @@ -386,10 +386,10 @@ void cn23xx_vf_ask_pf_to_do_flr(struct octeon_device *oct)
- }
- EXPORT_SYMBOL_GPL(cn23xx_vf_ask_pf_to_do_flr);
- -static void octeon_pfvf_hs_callback(struct octeon_device *oct,
- - struct octeon_mbox_cmd *cmd,
- - void *arg)
- +static void octeon_pfvf_hs_callback(void *octp, void *cmdp, void *arg)
- {
- + struct octeon_device *oct = octp;
- + struct octeon_mbox_cmd *cmd = cmdp;
- u32 major = 0;
- memcpy((uint8_t *)&oct->pfvf_hsword, cmd->msg.s.params,
- @@ -429,7 +429,7 @@ int cn23xx_octeon_pfvf_handshake(struct octeon_device *oct)
- mbox_cmd.q_no = 0;
- mbox_cmd.recv_len = 0;
- mbox_cmd.recv_status = 0;
- - mbox_cmd.fn = (octeon_mbox_callback_t)octeon_pfvf_hs_callback;
- + mbox_cmd.fn = octeon_pfvf_hs_callback;
- mbox_cmd.fn_arg = &status;
- octeon_mbox_write(oct, &mbox_cmd);
- diff --git a/drivers/net/ethernet/sfc/falcon/selftest.c b/drivers/net/ethernet/sfc/falcon/selftest.c
- index 6a454ac6f8763..bc3d6e098a2f2 100644
- --- a/drivers/net/ethernet/sfc/falcon/selftest.c
- +++ b/drivers/net/ethernet/sfc/falcon/selftest.c
- @@ -40,7 +40,26 @@
- */
- struct ef4_loopback_payload {
- struct ethhdr header;
- - struct iphdr ip;
- + struct {
- +#if defined(__LITTLE_ENDIAN_BITFIELD)
- + __u8 ihl:4,
- + version:4;
- +#elif defined (__BIG_ENDIAN_BITFIELD)
- + __u8 version:4,
- + ihl:4;
- +#else
- +#error "Please fix <asm/byteorder.h>"
- +#endif
- + __u8 tos;
- + __be16 tot_len;
- + __be16 id;
- + __be16 frag_off;
- + __u8 ttl;
- + __u8 protocol;
- + __sum16 check;
- + __be32 saddr;
- + __be32 daddr;
- + } __packed ip; /* unaligned struct iphdr */
- struct udphdr udp;
- __be16 iteration;
- char msg[64];
- diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
- index 3c5227afd4977..8ac9d81436de4 100644
- --- a/drivers/net/ethernet/sfc/selftest.c
- +++ b/drivers/net/ethernet/sfc/selftest.c
- @@ -43,7 +43,26 @@
- */
- struct efx_loopback_payload {
- struct ethhdr header;
- - struct iphdr ip;
- + struct {
- +#if defined(__LITTLE_ENDIAN_BITFIELD)
- + __u8 ihl:4,
- + version:4;
- +#elif defined (__BIG_ENDIAN_BITFIELD)
- + __u8 version:4,
- + ihl:4;
- +#else
- +#error "Please fix <asm/byteorder.h>"
- +#endif
- + __u8 tos;
- + __be16 tot_len;
- + __be16 id;
- + __be16 frag_off;
- + __u8 ttl;
- + __u8 protocol;
- + __sum16 check;
- + __be32 saddr;
- + __be32 daddr;
- + } __packed ip; /* unaligned struct iphdr */
- struct udphdr udp;
- __be16 iteration;
- char msg[64];
- diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c
- index ccc621b8ed9f2..4a1fe982a948e 100644
- --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c
- +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c
- @@ -383,8 +383,9 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)
- return sh;
- }
- -static void wlc_phy_timercb_phycal(struct brcms_phy *pi)
- +static void wlc_phy_timercb_phycal(void *ptr)
- {
- + struct brcms_phy *pi = ptr;
- uint delay = 5;
- if (PHY_PERICAL_MPHASE_PENDING(pi)) {
- diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c
- index a0de5db0cd646..b723817915365 100644
- --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c
- +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c
- @@ -57,12 +57,11 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim)
- }
- struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
- - void (*fn)(struct brcms_phy *pi),
- + void (*fn)(void *pi),
- void *arg, const char *name)
- {
- return (struct wlapi_timer *)
- - brcms_init_timer(physhim->wl, (void (*)(void *))fn,
- - arg, name);
- + brcms_init_timer(physhim->wl, fn, arg, name);
- }
- void wlapi_free_timer(struct wlapi_timer *t)
- diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h
- index dd8774717adee..27d0934e600ed 100644
- --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h
- +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h
- @@ -131,7 +131,7 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim);
- /* PHY to WL utility functions */
- struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
- - void (*fn)(struct brcms_phy *pi),
- + void (*fn)(void *pi),
- void *arg, const char *name);
- void wlapi_free_timer(struct wlapi_timer *t);
- void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
- diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c
- index b19c39dcfbd93..839bad09cdff8 100644
- --- a/drivers/nfc/pn533/pn533.c
- +++ b/drivers/nfc/pn533/pn533.c
- @@ -778,7 +778,9 @@ static int pn533_target_found_felica(struct nfc_target *nfc_tgt, u8 *tgt_data,
- else
- nfc_tgt->supported_protocols = NFC_PROTO_FELICA_MASK;
- - memcpy(nfc_tgt->sensf_res, &tgt_felica->opcode, 9);
- + nfc_tgt->sensf_res[0] = tgt_felica->opcode;
- + memcpy(&nfc_tgt->sensf_res[1], &tgt_felica->nfcid2,
- + sizeof(tgt_felica->nfcid2));
- nfc_tgt->sensf_res_len = 9;
- memcpy(nfc_tgt->nfcid2, tgt_felica->nfcid2, NFC_NFCID2_MAXSIZE);
- diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c
- index d6b533497ce1a..660a0e78070c7 100644
- --- a/drivers/nvmem/meson-efuse.c
- +++ b/drivers/nvmem/meson-efuse.c
- @@ -38,6 +38,11 @@ static const struct of_device_id meson_efuse_match[] = {
- };
- MODULE_DEVICE_TABLE(of, meson_efuse_match);
- +static void meson_efuse_clk_disable(void *clk)
- +{
- + clk_disable_unprepare(clk);
- +}
- +
- static int meson_efuse_probe(struct platform_device *pdev)
- {
- struct device *dev = &pdev->dev;
- @@ -74,9 +79,7 @@ static int meson_efuse_probe(struct platform_device *pdev)
- return ret;
- }
- - ret = devm_add_action_or_reset(dev,
- - (void(*)(void *))clk_disable_unprepare,
- - clk);
- + ret = devm_add_action_or_reset(dev, meson_efuse_clk_disable, clk);
- if (ret) {
- dev_err(dev, "failed to add disable callback");
- return ret;
- diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
- index c1527693bed93..2f5359f04920b 100644
- --- a/drivers/pci/controller/dwc/pci-meson.c
- +++ b/drivers/pci/controller/dwc/pci-meson.c
- @@ -163,6 +163,11 @@ static int meson_pcie_reset(struct meson_pcie *mp)
- return 0;
- }
- +static void meson_pcie_clk_disable(void *clk)
- +{
- + clk_disable_unprepare(clk);
- +}
- +
- static inline struct clk *meson_pcie_probe_clock(struct device *dev,
- const char *id, u64 rate)
- {
- @@ -187,9 +192,7 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev,
- return ERR_PTR(ret);
- }
- - devm_add_action_or_reset(dev,
- - (void (*) (void *))clk_disable_unprepare,
- - clk);
- + devm_add_action_or_reset(dev, meson_pcie_clk_disable, clk);
- return clk;
- }
- diff --git a/drivers/pci/controller/dwc/pcie-keembay.c b/drivers/pci/controller/dwc/pcie-keembay.c
- index f90f36bac0185..d6e5c2e4bb007 100644
- --- a/drivers/pci/controller/dwc/pcie-keembay.c
- +++ b/drivers/pci/controller/dwc/pcie-keembay.c
- @@ -148,6 +148,11 @@ static const struct dw_pcie_ops keembay_pcie_ops = {
- .stop_link = keembay_pcie_stop_link,
- };
- +static void keembay_pci_clk_disable(void *clk)
- +{
- + clk_disable_unprepare(clk);
- +}
- +
- static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
- const char *id, u64 rate)
- {
- @@ -168,9 +173,7 @@ static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
- if (ret)
- return ERR_PTR(ret);
- - ret = devm_add_action_or_reset(dev,
- - (void(*)(void *))clk_disable_unprepare,
- - clk);
- + ret = devm_add_action_or_reset(dev, keembay_pci_clk_disable, clk);
- if (ret)
- return ERR_PTR(ret);
- diff --git a/drivers/pci/controller/pcie-microchip-host.c b/drivers/pci/controller/pcie-microchip-host.c
- index 5e710e4854646..33efec4d3ccfc 100644
- --- a/drivers/pci/controller/pcie-microchip-host.c
- +++ b/drivers/pci/controller/pcie-microchip-host.c
- @@ -848,6 +848,11 @@ static const struct irq_domain_ops event_domain_ops = {
- .map = mc_pcie_event_map,
- };
- +static void mc_pcie_clk_disable(void *clk)
- +{
- + clk_disable_unprepare(clk);
- +}
- +
- static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
- {
- struct clk *clk;
- @@ -863,8 +868,7 @@ static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
- if (ret)
- return ERR_PTR(ret);
- - devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare,
- - clk);
- + devm_add_action_or_reset(dev, mc_pcie_clk_disable, clk);
- return clk;
- }
- diff --git a/drivers/platform/x86/intel/int3472/Makefile b/drivers/platform/x86/intel/int3472/Makefile
- index 9f16cb5143973..a8aba07bf1dc2 100644
- --- a/drivers/platform/x86/intel/int3472/Makefile
- +++ b/drivers/platform/x86/intel/int3472/Makefile
- @@ -1,4 +1,7 @@
- obj-$(CONFIG_INTEL_SKL_INT3472) += intel_skl_int3472_discrete.o \
- - intel_skl_int3472_tps68470.o
- -intel_skl_int3472_discrete-y := discrete.o clk_and_regulator.o led.o common.o
- -intel_skl_int3472_tps68470-y := tps68470.o tps68470_board_data.o common.o
- + intel_skl_int3472_tps68470.o \
- + intel_skl_int3472_common.o
- +intel_skl_int3472_discrete-y := discrete.o clk_and_regulator.o led.o
- +intel_skl_int3472_tps68470-y := tps68470.o tps68470_board_data.o
- +
- +intel_skl_int3472_common-y += common.o
- diff --git a/drivers/platform/x86/intel/int3472/common.c b/drivers/platform/x86/intel/int3472/common.c
- index 9db2bb0bbba4b..2262234ff71e4 100644
- --- a/drivers/platform/x86/intel/int3472/common.c
- +++ b/drivers/platform/x86/intel/int3472/common.c
- @@ -29,6 +29,7 @@ union acpi_object *skl_int3472_get_acpi_buffer(struct acpi_device *adev, char *i
- return obj;
- }
- +EXPORT_SYMBOL_GPL(skl_int3472_get_acpi_buffer);
- int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb)
- {
- @@ -52,6 +53,7 @@ int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb)
- kfree(obj);
- return ret;
- }
- +EXPORT_SYMBOL_GPL(skl_int3472_fill_cldb);
- /* sensor_adev_ret may be NULL, name_ret must not be NULL */
- int skl_int3472_get_sensor_adev_and_name(struct device *dev,
- @@ -80,3 +82,6 @@ int skl_int3472_get_sensor_adev_and_name(struct device *dev,
- return ret;
- }
- +EXPORT_SYMBOL_GPL(skl_int3472_get_sensor_adev_and_name);
- +
- +MODULE_LICENSE("GPL");
- diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
- index dcc94ee2458d8..b39e2ca3c2322 100644
- --- a/drivers/remoteproc/mtk_scp.c
- +++ b/drivers/remoteproc/mtk_scp.c
- @@ -72,10 +72,10 @@ static void scp_wdt_handler(struct mtk_scp *scp, u32 scp_to_host)
- rproc_report_crash(scp->rproc, RPROC_WATCHDOG);
- }
- -static void scp_init_ipi_handler(void *data, unsigned int len, void *priv)
- +static void scp_init_ipi_handler(const void *data, unsigned int len, void *priv)
- {
- struct mtk_scp *scp = priv;
- - struct scp_run *run = data;
- + struct scp_run *run = (void *)data;
- scp->run.signaled = run->signaled;
- strscpy(scp->run.fw_ver, run->fw_ver, SCP_FW_VER_LEN);
- diff --git a/drivers/rpmsg/mtk_rpmsg.c b/drivers/rpmsg/mtk_rpmsg.c
- index d1213c33da204..6ab98e429cc34 100644
- --- a/drivers/rpmsg/mtk_rpmsg.c
- +++ b/drivers/rpmsg/mtk_rpmsg.c
- @@ -69,13 +69,13 @@ static void __mtk_ept_release(struct kref *kref)
- kfree(to_mtk_rpmsg_endpoint(ept));
- }
- -static void mtk_rpmsg_ipi_handler(void *data, unsigned int len, void *priv)
- +static void mtk_rpmsg_ipi_handler(const void *data, unsigned int len, void *priv)
- {
- struct mtk_rpmsg_endpoint *mept = priv;
- struct rpmsg_endpoint *ept = &mept->ept;
- int ret;
- - ret = (*ept->cb)(ept->rpdev, data, len, ept->priv, ept->addr);
- + ret = (*ept->cb)(ept->rpdev, (void *)data, len, ept->priv, ept->addr);
- if (ret)
- dev_warn(&ept->rpdev->dev, "rpmsg handler return error = %d",
- ret);
- diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
- index 5e115e8b2ba46..7d5a155073c62 100644
- --- a/drivers/scsi/aacraid/aacraid.h
- +++ b/drivers/scsi/aacraid/aacraid.h
- @@ -2617,7 +2617,7 @@ struct aac_hba_info {
- struct aac_aifcmd {
- __le32 command; /* Tell host what type of notify this is */
- __le32 seqnum; /* To allow ordering of reports (if necessary) */
- - u8 data[1]; /* Undefined length (from kernel viewpoint) */
- + u8 data[]; /* Undefined length (from kernel viewpoint) */
- };
- /**
- diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h
- index 6b606bf589b42..b6666c18e6e4c 100644
- --- a/drivers/scsi/bfa/bfa_cs.h
- +++ b/drivers/scsi/bfa/bfa_cs.h
- @@ -200,7 +200,7 @@ struct bfa_sm_table_s {
- int state; /* state machine encoding */
- char *name; /* state name for display */
- };
- -#define BFA_SM(_sm) ((bfa_sm_t)(_sm))
- +#define BFA_SM(_sm) (_sm)
- /*
- * State machine with entry actions.
- @@ -218,7 +218,7 @@ typedef void (*bfa_fsm_t)(void *fsm, int event);
- static void oc ## _sm_ ## st ## _entry(otype * fsm)
- #define bfa_fsm_set_state(_fsm, _state) do { \
- - (_fsm)->fsm = (bfa_fsm_t)(_state); \
- + (_fsm)->fsm = (_state); \
- _state ## _entry(_fsm); \
- } while (0)
- diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
- index e1ed1424fddb2..a4d678e0074d5 100644
- --- a/drivers/scsi/bfa/bfa_ioc.c
- +++ b/drivers/scsi/bfa/bfa_ioc.c
- @@ -114,21 +114,6 @@ static enum bfi_ioc_img_ver_cmp_e bfa_ioc_flash_fwver_cmp(
- /*
- * IOC state machine definitions/declarations
- */
- -enum ioc_event {
- - IOC_E_RESET = 1, /* IOC reset request */
- - IOC_E_ENABLE = 2, /* IOC enable request */
- - IOC_E_DISABLE = 3, /* IOC disable request */
- - IOC_E_DETACH = 4, /* driver detach cleanup */
- - IOC_E_ENABLED = 5, /* f/w enabled */
- - IOC_E_FWRSP_GETATTR = 6, /* IOC get attribute response */
- - IOC_E_DISABLED = 7, /* f/w disabled */
- - IOC_E_PFFAILED = 8, /* failure notice by iocpf sm */
- - IOC_E_HBFAIL = 9, /* heartbeat failure */
- - IOC_E_HWERROR = 10, /* hardware error interrupt */
- - IOC_E_TIMEOUT = 11, /* timeout */
- - IOC_E_HWFAILED = 12, /* PCI mapping failure notice */
- -};
- -
- bfa_fsm_state_decl(bfa_ioc, uninit, struct bfa_ioc_s, enum ioc_event);
- bfa_fsm_state_decl(bfa_ioc, reset, struct bfa_ioc_s, enum ioc_event);
- bfa_fsm_state_decl(bfa_ioc, enabling, struct bfa_ioc_s, enum ioc_event);
- @@ -140,7 +125,13 @@ bfa_fsm_state_decl(bfa_ioc, disabling, struct bfa_ioc_s, enum ioc_event);
- bfa_fsm_state_decl(bfa_ioc, disabled, struct bfa_ioc_s, enum ioc_event);
- bfa_fsm_state_decl(bfa_ioc, hwfail, struct bfa_ioc_s, enum ioc_event);
- -static struct bfa_sm_table_s ioc_sm_table[] = {
- +struct bfa_ioc_sm_table {
- + bfa_ioc_sm_t sm; /* state machine function */
- + enum bfa_ioc_state state; /* state machine encoding */
- + char *name; /* state name for display */
- +};
- +
- +static struct bfa_ioc_sm_table ioc_sm_table[] = {
- {BFA_SM(bfa_ioc_sm_uninit), BFA_IOC_UNINIT},
- {BFA_SM(bfa_ioc_sm_reset), BFA_IOC_RESET},
- {BFA_SM(bfa_ioc_sm_enabling), BFA_IOC_ENABLING},
- @@ -153,6 +144,16 @@ static struct bfa_sm_table_s ioc_sm_table[] = {
- {BFA_SM(bfa_ioc_sm_hwfail), BFA_IOC_HWFAIL},
- };
- +static inline enum bfa_ioc_state
- +bfa_ioc_sm_to_state(struct bfa_ioc_sm_table *smt, bfa_ioc_sm_t sm)
- +{
- + int i = 0;
- +
- + while (smt[i].sm && smt[i].sm != sm)
- + i++;
- + return smt[i].state;
- +}
- +
- /*
- * IOCPF state machine definitions/declarations
- */
- @@ -178,24 +179,6 @@ static void bfa_iocpf_timeout(void *ioc_arg);
- static void bfa_iocpf_sem_timeout(void *ioc_arg);
- static void bfa_iocpf_poll_timeout(void *ioc_arg);
- -/*
- - * IOCPF state machine events
- - */
- -enum iocpf_event {
- - IOCPF_E_ENABLE = 1, /* IOCPF enable request */
- - IOCPF_E_DISABLE = 2, /* IOCPF disable request */
- - IOCPF_E_STOP = 3, /* stop on driver detach */
- - IOCPF_E_FWREADY = 4, /* f/w initialization done */
- - IOCPF_E_FWRSP_ENABLE = 5, /* enable f/w response */
- - IOCPF_E_FWRSP_DISABLE = 6, /* disable f/w response */
- - IOCPF_E_FAIL = 7, /* failure notice by ioc sm */
- - IOCPF_E_INITFAIL = 8, /* init fail notice by ioc sm */
- - IOCPF_E_GETATTRFAIL = 9, /* init fail notice by ioc sm */
- - IOCPF_E_SEMLOCKED = 10, /* h/w semaphore is locked */
- - IOCPF_E_TIMEOUT = 11, /* f/w response timeout */
- - IOCPF_E_SEM_ERROR = 12, /* h/w sem mapping error */
- -};
- -
- /*
- * IOCPF states
- */
- @@ -228,7 +211,13 @@ bfa_fsm_state_decl(bfa_iocpf, disabling_sync, struct bfa_iocpf_s,
- enum iocpf_event);
- bfa_fsm_state_decl(bfa_iocpf, disabled, struct bfa_iocpf_s, enum iocpf_event);
- -static struct bfa_sm_table_s iocpf_sm_table[] = {
- +struct bfa_iocpf_sm_table {
- + bfa_iocpf_sm_t sm; /* state machine function */
- + enum bfa_iocpf_state state; /* state machine encoding */
- + char *name; /* state name for display */
- +};
- +
- +static struct bfa_iocpf_sm_table iocpf_sm_table[] = {
- {BFA_SM(bfa_iocpf_sm_reset), BFA_IOCPF_RESET},
- {BFA_SM(bfa_iocpf_sm_fwcheck), BFA_IOCPF_FWMISMATCH},
- {BFA_SM(bfa_iocpf_sm_mismatch), BFA_IOCPF_FWMISMATCH},
- @@ -2815,12 +2804,12 @@ enum bfa_ioc_state
- bfa_ioc_get_state(struct bfa_ioc_s *ioc)
- {
- enum bfa_iocpf_state iocpf_st;
- - enum bfa_ioc_state ioc_st = bfa_sm_to_state(ioc_sm_table, ioc->fsm);
- + enum bfa_ioc_state ioc_st = bfa_ioc_sm_to_state(ioc_sm_table, ioc->fsm);
- if (ioc_st == BFA_IOC_ENABLING ||
- ioc_st == BFA_IOC_FAIL || ioc_st == BFA_IOC_INITFAIL) {
- - iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
- + iocpf_st = bfa_ioc_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
- switch (iocpf_st) {
- case BFA_IOCPF_SEMWAIT:
- diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
- index 933a1c3890ff5..debb5eeec9dcb 100644
- --- a/drivers/scsi/bfa/bfa_ioc.h
- +++ b/drivers/scsi/bfa/bfa_ioc.h
- @@ -260,6 +260,24 @@ struct bfa_ioc_cbfn_s {
- /*
- * IOC event notification mechanism.
- */
- +enum ioc_event {
- + IOC_E_RESET = 1, /* IOC reset request */
- + IOC_E_ENABLE = 2, /* IOC enable request */
- + IOC_E_DISABLE = 3, /* IOC disable request */
- + IOC_E_DETACH = 4, /* driver detach cleanup */
- + IOC_E_ENABLED = 5, /* f/w enabled */
- + IOC_E_FWRSP_GETATTR = 6, /* IOC get attribute response */
- + IOC_E_DISABLED = 7, /* f/w disabled */
- + IOC_E_PFFAILED = 8, /* failure notice by iocpf sm */
- + IOC_E_HBFAIL = 9, /* heartbeat failure */
- + IOC_E_HWERROR = 10, /* hardware error interrupt */
- + IOC_E_TIMEOUT = 11, /* timeout */
- + IOC_E_HWFAILED = 12, /* PCI mapping failure notice */
- +};
- +
- +struct bfa_ioc_s;
- +typedef void (*bfa_ioc_sm_t)(struct bfa_ioc_s *fsm, enum ioc_event);
- +
- enum bfa_ioc_event_e {
- BFA_IOC_E_ENABLED = 1,
- BFA_IOC_E_DISABLED = 2,
- @@ -282,8 +300,29 @@ struct bfa_ioc_notify_s {
- (__notify)->cbarg = (__cbarg); \
- } while (0)
- +/*
- + * IOCPF state machine events
- + */
- +enum iocpf_event {
- + IOCPF_E_ENABLE = 1, /* IOCPF enable request */
- + IOCPF_E_DISABLE = 2, /* IOCPF disable request */
- + IOCPF_E_STOP = 3, /* stop on driver detach */
- + IOCPF_E_FWREADY = 4, /* f/w initialization done */
- + IOCPF_E_FWRSP_ENABLE = 5, /* enable f/w response */
- + IOCPF_E_FWRSP_DISABLE = 6, /* disable f/w response */
- + IOCPF_E_FAIL = 7, /* failure notice by ioc sm */
- + IOCPF_E_INITFAIL = 8, /* init fail notice by ioc sm */
- + IOCPF_E_GETATTRFAIL = 9, /* init fail notice by ioc sm */
- + IOCPF_E_SEMLOCKED = 10, /* h/w semaphore is locked */
- + IOCPF_E_TIMEOUT = 11, /* f/w response timeout */
- + IOCPF_E_SEM_ERROR = 12, /* h/w sem mapping error */
- +};
- +
- +struct bfa_iocpf_s;
- +typedef void (*bfa_iocpf_sm_t)(struct bfa_iocpf_s *fsm, enum iocpf_event);
- +
- struct bfa_iocpf_s {
- - bfa_fsm_t fsm;
- + bfa_iocpf_sm_t fsm;
- struct bfa_ioc_s *ioc;
- bfa_boolean_t fw_mismatch_notified;
- bfa_boolean_t auto_recover;
- @@ -291,7 +330,7 @@ struct bfa_iocpf_s {
- };
- struct bfa_ioc_s {
- - bfa_fsm_t fsm;
- + bfa_ioc_sm_t fsm;
- struct bfa_s *bfa;
- struct bfa_pcidev_s pcidev;
- struct bfa_timer_mod_s *timer_mod;
- diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
- index 62cb7a864fd53..9d2242e8057ea 100644
- --- a/drivers/scsi/bfa/bfad.c
- +++ b/drivers/scsi/bfa/bfad.c
- @@ -142,19 +142,19 @@ module_param(max_rport_logins, int, S_IRUGO | S_IWUSR);
- MODULE_PARM_DESC(max_rport_logins, "Max number of logins to initiator and target rports on a port (physical/logical), default=1024");
- static void
- -bfad_sm_uninit(struct bfad_s *bfad, enum bfad_sm_event event);
- +bfad_sm_uninit(void *bfad, int event);
- static void
- -bfad_sm_created(struct bfad_s *bfad, enum bfad_sm_event event);
- +bfad_sm_created(void *bfad, int event);
- static void
- -bfad_sm_initializing(struct bfad_s *bfad, enum bfad_sm_event event);
- +bfad_sm_initializing(void *bfad, int event);
- static void
- -bfad_sm_operational(struct bfad_s *bfad, enum bfad_sm_event event);
- +bfad_sm_operational(void *bfad, int event);
- static void
- -bfad_sm_stopping(struct bfad_s *bfad, enum bfad_sm_event event);
- +bfad_sm_stopping(void *bfad, int event);
- static void
- -bfad_sm_failed(struct bfad_s *bfad, enum bfad_sm_event event);
- +bfad_sm_failed(void *bfad, int event);
- static void
- -bfad_sm_fcs_exit(struct bfad_s *bfad, enum bfad_sm_event event);
- +bfad_sm_fcs_exit(void *bfad, int event);
- /*
- * Beginning state for the driver instance, awaiting the pci_probe event
- diff --git a/drivers/scsi/csiostor/csio_defs.h b/drivers/scsi/csiostor/csio_defs.h
- index c38017b4af982..e50e93e7fe5a1 100644
- --- a/drivers/scsi/csiostor/csio_defs.h
- +++ b/drivers/scsi/csiostor/csio_defs.h
- @@ -73,7 +73,21 @@ csio_list_deleted(struct list_head *list)
- #define csio_list_prev(elem) (((struct list_head *)(elem))->prev)
- /* State machine */
- -typedef void (*csio_sm_state_t)(void *, uint32_t);
- +struct csio_lnode;
- +
- +/* State machine evets */
- +enum csio_ln_ev {
- + CSIO_LNE_NONE = (uint32_t)0,
- + CSIO_LNE_LINKUP,
- + CSIO_LNE_FAB_INIT_DONE,
- + CSIO_LNE_LINK_DOWN,
- + CSIO_LNE_DOWN_LINK,
- + CSIO_LNE_LOGO,
- + CSIO_LNE_CLOSE,
- + CSIO_LNE_MAX_EVENT,
- +};
- +
- +typedef void (*csio_sm_state_t)(struct csio_lnode *ln, enum csio_ln_ev evt);
- struct csio_sm {
- struct list_head sm_list;
- @@ -83,7 +97,7 @@ struct csio_sm {
- static inline void
- csio_set_state(void *smp, void *state)
- {
- - ((struct csio_sm *)smp)->sm_state = (csio_sm_state_t)state;
- + ((struct csio_sm *)smp)->sm_state = state;
- }
- static inline void
- diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c
- index d5ac938970232..5b3ffefae476d 100644
- --- a/drivers/scsi/csiostor/csio_lnode.c
- +++ b/drivers/scsi/csiostor/csio_lnode.c
- @@ -1095,7 +1095,7 @@ csio_handle_link_down(struct csio_hw *hw, uint8_t portid, uint32_t fcfi,
- int
- csio_is_lnode_ready(struct csio_lnode *ln)
- {
- - return (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_ready));
- + return (csio_get_state(ln) == csio_lns_ready);
- }
- /*****************************************************************************/
- @@ -1366,15 +1366,15 @@ csio_free_fcfinfo(struct kref *kref)
- void
- csio_lnode_state_to_str(struct csio_lnode *ln, int8_t *str)
- {
- - if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_uninit)) {
- + if (csio_get_state(ln) == csio_lns_uninit) {
- strcpy(str, "UNINIT");
- return;
- }
- - if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_ready)) {
- + if (csio_get_state(ln) == csio_lns_ready) {
- strcpy(str, "READY");
- return;
- }
- - if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_offline)) {
- + if (csio_get_state(ln) == csio_lns_offline) {
- strcpy(str, "OFFLINE");
- return;
- }
- diff --git a/drivers/scsi/csiostor/csio_lnode.h b/drivers/scsi/csiostor/csio_lnode.h
- index 372a67d122d38..607698a0f0631 100644
- --- a/drivers/scsi/csiostor/csio_lnode.h
- +++ b/drivers/scsi/csiostor/csio_lnode.h
- @@ -53,19 +53,6 @@
- extern int csio_fcoe_rnodes;
- extern int csio_fdmi_enable;
- -/* State machine evets */
- -enum csio_ln_ev {
- - CSIO_LNE_NONE = (uint32_t)0,
- - CSIO_LNE_LINKUP,
- - CSIO_LNE_FAB_INIT_DONE,
- - CSIO_LNE_LINK_DOWN,
- - CSIO_LNE_DOWN_LINK,
- - CSIO_LNE_LOGO,
- - CSIO_LNE_CLOSE,
- - CSIO_LNE_MAX_EVENT,
- -};
- -
- -
- struct csio_fcf_info {
- struct list_head list;
- uint8_t priority;
- diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
- index 73cd25f30ca58..ea9b4c3d3150b 100644
- --- a/drivers/scsi/pm8001/pm8001_hwi.c
- +++ b/drivers/scsi/pm8001/pm8001_hwi.c
- @@ -3265,8 +3265,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
- phy->sas_phy.oob_mode = SATA_OOB_MODE;
- sas_notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE, GFP_ATOMIC);
- spin_lock_irqsave(&phy->sas_phy.frame_rcvd_lock, flags);
- - memcpy(phy->frame_rcvd, ((u8 *)&pPayload->sata_fis - 4),
- - sizeof(struct dev_to_host_fis));
- + memcpy(phy->frame_rcvd, piomb, sizeof(struct dev_to_host_fis));
- phy->frame_rcvd_size = sizeof(struct dev_to_host_fis);
- phy->identify.target_port_protocols = SAS_PROTOCOL_SATA;
- phy->identify.device_type = SAS_SATA_DEV;
- diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h
- index 961d0465b923f..0b6d1c704be1a 100644
- --- a/drivers/scsi/pm8001/pm8001_hwi.h
- +++ b/drivers/scsi/pm8001/pm8001_hwi.h
- @@ -402,10 +402,10 @@ struct smp_req {
- union {
- u8 smp_req[32];
- struct {
- - __le64 long_req_addr;/* sg dma address, LE */
- + __le64 long_req_addr __packed;/* sg dma address, LE */
- __le32 long_req_size;/* LE */
- u32 _r_a;
- - __le64 long_resp_addr;/* sg dma address, LE */
- + __le64 long_resp_addr __packed;/* sg dma address, LE */
- __le32 long_resp_size;/* LE */
- u32 _r_b;
- } long_smp_req;/* sequencer extension */
- diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
- index acf6e3005b842..f3cc469a18602 100644
- --- a/drivers/scsi/pm8001/pm80xx_hwi.h
- +++ b/drivers/scsi/pm8001/pm80xx_hwi.h
- @@ -639,10 +639,10 @@ struct smp_req {
- union {
- u8 smp_req[32];
- struct {
- - __le64 long_req_addr;/* sg dma address, LE */
- + __le64 long_req_addr __packed;/* sg dma address, LE */
- __le32 long_req_size;/* LE */
- u32 _r_a;
- - __le64 long_resp_addr;/* sg dma address, LE */
- + __le64 long_resp_addr __packed;/* sg dma address, LE */
- __le32 long_resp_size;/* LE */
- u32 _r_b;
- } long_smp_req;/* sequencer extension */
- diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
- index f41a385a5c421..b8f9e52e6db6b 100644
- --- a/drivers/usb/gadget/function/f_fs.c
- +++ b/drivers/usb/gadget/function/f_fs.c
- @@ -2933,8 +2933,9 @@ static int __ffs_func_bind_do_os_desc(enum ffs_os_desc_type type,
- t = &func->function.os_desc_table[desc->bFirstInterfaceNumber];
- t->if_id = func->interfaces_nums[desc->bFirstInterfaceNumber];
- memcpy(t->os_desc->ext_compat_id, &desc->CompatibleID,
- - ARRAY_SIZE(desc->CompatibleID) +
- - ARRAY_SIZE(desc->SubCompatibleID));
- + sizeof(desc->CompatibleID));
- + memcpy(t->os_desc->ext_compat_id + sizeof(desc->CompatibleID),
- + &desc->SubCompatibleID, sizeof(desc->SubCompatibleID));
- length = sizeof(*desc);
- }
- break;
- diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
- index 37b56ce75f39d..1f2d14077f764 100644
- --- a/drivers/usb/typec/tipd/core.c
- +++ b/drivers/usb/typec/tipd/core.c
- @@ -56,8 +56,8 @@ enum {
- /* TPS_REG_RX_IDENTITY_SOP */
- struct tps6598x_rx_identity_reg {
- u8 status;
- - struct usb_pd_identity identity;
- -} __packed;
- + struct usb_pd_identity identity __packed;
- +};
- /* Standard Task return codes */
- #define TPS_TASK_TIMEOUT 1
- diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c
- index 873e6e1c92b5c..1cb79b167a4f8 100644
- --- a/fs/ubifs/find.c
- +++ b/fs/ubifs/find.c
- @@ -726,11 +726,10 @@ int ubifs_find_free_leb_for_idx(struct ubifs_info *c)
- return err;
- }
- -static int cmp_dirty_idx(const struct ubifs_lprops **a,
- - const struct ubifs_lprops **b)
- +static int cmp_dirty_idx(const void *a, const void *b)
- {
- - const struct ubifs_lprops *lpa = *a;
- - const struct ubifs_lprops *lpb = *b;
- + const struct ubifs_lprops *lpa = *(const struct ubifs_lprops **)a;
- + const struct ubifs_lprops *lpb = *(const struct ubifs_lprops **)b;
- return lpa->dirty + lpa->free - lpb->dirty - lpb->free;
- }
- @@ -754,7 +753,7 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c)
- sizeof(void *) * c->dirty_idx.cnt);
- /* Sort it so that the dirtiest is now at the end */
- sort(c->dirty_idx.arr, c->dirty_idx.cnt, sizeof(void *),
- - (int (*)(const void *, const void *))cmp_dirty_idx, NULL);
- + cmp_dirty_idx, NULL);
- dbg_find("found %d dirty index LEBs", c->dirty_idx.cnt);
- if (c->dirty_idx.cnt)
- dbg_find("dirtiest index LEB is %d with dirty %d and free %d",
- diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c
- index 6d6cd85c2b4ca..017dd88186ca9 100644
- --- a/fs/ubifs/lprops.c
- +++ b/fs/ubifs/lprops.c
- @@ -1014,8 +1014,9 @@ void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
- */
- static int scan_check_cb(struct ubifs_info *c,
- const struct ubifs_lprops *lp, int in_tree,
- - struct ubifs_lp_stats *lst)
- + struct scan_data *data)
- {
- + struct ubifs_lp_stats *lst = (void *)data;
- struct ubifs_scan_leb *sleb;
- struct ubifs_scan_node *snod;
- int cat, lnum = lp->lnum, is_idx = 0, used = 0, free, dirty, ret;
- diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
- index 4c36044140e7e..81df9925a7f54 100644
- --- a/fs/ubifs/ubifs.h
- +++ b/fs/ubifs/ubifs.h
- @@ -654,9 +654,10 @@ enum {
- struct ubifs_info;
- /* Callback used by the 'ubifs_lpt_scan_nolock()' function */
- +struct scan_data;
- typedef int (*ubifs_lpt_scan_callback)(struct ubifs_info *c,
- const struct ubifs_lprops *lprops,
- - int in_tree, void *data);
- + int in_tree, struct scan_data *data);
- /**
- * struct ubifs_wbuf - UBIFS write-buffer.
- diff --git a/include/linux/fortify-string.h b/include/linux/fortify-string.h
- index da51a83b28293..f6db238d4d1d5 100644
- --- a/include/linux/fortify-string.h
- +++ b/include/linux/fortify-string.h
- @@ -586,7 +586,7 @@ __FORTIFY_INLINE bool fortify_memcpy_chk(__kernel_size_t size,
- * or when an over-write happened, so both can be fixed at
- * the same time.
- */
- - if ((IS_ENABLED(KBUILD_EXTRA_WARN1) ||
- + if ((IS_ENABLED(KBUILD_EXTRA_WARN2) ||
- __compiletime_lessthan(p_size_field, size)) &&
- __compiletime_lessthan(q_size_field, size))
- __read_overflow2_field(q_size_field, size);
- diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
- index ab721cf13a986..61a5dde1511fc 100644
- --- a/include/linux/platform_data/cros_ec_commands.h
- +++ b/include/linux/platform_data/cros_ec_commands.h
- @@ -2684,7 +2684,7 @@ struct ec_params_motion_sense {
- */
- int16_t hys_degree;
- } tablet_mode_threshold;
- - };
- + } __packed;
- } __ec_todo_packed;
- struct ec_response_motion_sense {
- diff --git a/include/linux/remoteproc/mtk_scp.h b/include/linux/remoteproc/mtk_scp.h
- index 7c2b7cc9fe6c1..84e579940b8e5 100644
- --- a/include/linux/remoteproc/mtk_scp.h
- +++ b/include/linux/remoteproc/mtk_scp.h
- @@ -8,7 +8,7 @@
- #include <linux/platform_device.h>
- -typedef void (*scp_ipi_handler_t) (void *data,
- +typedef void (*scp_ipi_handler_t) (const void *data,
- unsigned int len,
- void *priv);
- struct mtk_scp;
- diff --git a/include/linux/rpmsg/mtk_rpmsg.h b/include/linux/rpmsg/mtk_rpmsg.h
- index 363b60178040b..9d67507471fba 100644
- --- a/include/linux/rpmsg/mtk_rpmsg.h
- +++ b/include/linux/rpmsg/mtk_rpmsg.h
- @@ -9,7 +9,7 @@
- #include <linux/platform_device.h>
- #include <linux/remoteproc.h>
- -typedef void (*ipi_handler_t)(void *data, unsigned int len, void *priv);
- +typedef void (*ipi_handler_t)(const void *data, unsigned int len, void *priv);
- /*
- * struct mtk_rpmsg_info - IPI functions tied to the rpmsg device.
- diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
- index f89ec4b5ea169..6736121ee6a03 100644
- --- a/include/linux/sunrpc/xdr.h
- +++ b/include/linux/sunrpc/xdr.h
- @@ -775,7 +775,7 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
- if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
- return -EBADMSG;
- - if (len > SIZE_MAX / sizeof(*p))
- + if ((size_t)len > SIZE_MAX / sizeof(*p))
- return -EBADMSG;
- p = xdr_inline_decode(xdr, len * sizeof(*p));
- if (unlikely(!p))
- diff --git a/include/linux/tpm.h b/include/linux/tpm.h
- index 6a1e8f1572551..d8bc599e0a679 100644
- --- a/include/linux/tpm.h
- +++ b/include/linux/tpm.h
- @@ -288,13 +288,13 @@ enum tpm_chip_flags {
- #define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)
- struct tpm_header {
- - __be16 tag;
- - __be32 length;
- + __be16 tag __packed;
- + __be32 length __packed;
- union {
- - __be32 ordinal;
- - __be32 return_code;
- + __be32 ordinal __packed;
- + __be32 return_code __packed;
- };
- -} __packed;
- +};
- /* A string buffer type for constructing TPM commands. This is based on the
- * ideas of string buffer code in security/keys/trusted.h but is heap based
- diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
- index c59fb79a42e86..09fb71f7375cf 100644
- --- a/include/linux/usb/pd.h
- +++ b/include/linux/usb/pd.h
- @@ -195,7 +195,7 @@ struct pd_chunked_ext_message_data {
- struct pd_message {
- __le16 header;
- union {
- - __le32 payload[PD_MAX_PAYLOAD];
- + __le32 payload[PD_MAX_PAYLOAD] __packed;
- struct pd_chunked_ext_message_data ext_msg;
- };
- } __packed;
- diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
- index 5c72d1864dd6c..796e5595a7c11 100644
- --- a/include/net/sctp/structs.h
- +++ b/include/net/sctp/structs.h
- @@ -341,7 +341,7 @@ struct sctp_signed_cookie {
- __u8 signature[SCTP_SECRET_SIZE];
- __u32 __pad; /* force sctp_cookie alignment to 64 bits */
- struct sctp_cookie c;
- -} __packed;
- +} __aligned(__alignof__(struct sctp_cookie));
- /* This is another convenience type to allocate memory for address
- * params for the maximum size and pass such structures around
- diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
- index 1e7774ac808f0..905b4146426b7 100644
- --- a/include/rdma/ib_verbs.h
- +++ b/include/rdma/ib_verbs.h
- @@ -1366,7 +1366,7 @@ enum ib_send_flags {
- };
- struct ib_sge {
- - u64 addr;
- + u64 addr __packed;
- u32 length;
- u32 lkey;
- };
- diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h
- index 9b1f0f424a793..5410c55799606 100644
- --- a/include/scsi/scsi_bsg_iscsi.h
- +++ b/include/scsi/scsi_bsg_iscsi.h
- @@ -53,7 +53,7 @@ struct iscsi_bsg_host_vendor {
- /* start of vendor command area */
- uint32_t vendor_cmd[];
- -};
- +} __packed;
- /* Response:
- */
- diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
- index b0197b1d1fe46..973c83f9b7310 100644
- --- a/include/sound/rawmidi.h
- +++ b/include/sound/rawmidi.h
- @@ -161,8 +161,7 @@ int snd_rawmidi_free(struct snd_rawmidi *rmidi);
- /* callbacks */
- -int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
- - const unsigned char *buffer, int count);
- +int snd_rawmidi_receive(void *ptr, const void *buffer, int count);
- int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream);
- int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
- unsigned char *buffer, int count);
- diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
- index c8621671fa70d..804194d7c6061 100644
- --- a/include/sound/seq_kernel.h
- +++ b/include/sound/seq_kernel.h
- @@ -67,7 +67,7 @@ int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
- #define SNDRV_SEQ_EXT_USRPTR 0x80000000
- #define SNDRV_SEQ_EXT_CHAINED 0x40000000
- -typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
- +typedef int (*snd_seq_dump_func_t)(void *ptr, const void *buf, int count);
- int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
- int in_kernel, int size_aligned);
- int snd_seq_expand_var_event_at(const struct snd_seq_event *event, int count,
- diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h
- index 7e0983b987c2d..1cb79399f7b5c 100644
- --- a/include/uapi/linux/dvb/frontend.h
- +++ b/include/uapi/linux/dvb/frontend.h
- @@ -854,8 +854,8 @@ struct dtv_stats {
- union {
- __u64 uvalue; /* for counters and relative scales */
- __s64 svalue; /* for 0.001 dB measures */
- - };
- -} __attribute__ ((packed));
- + } __packed;
- +};
- #define MAX_DTV_STATS 4
- diff --git a/include/uapi/linux/if_pppol2tp.h b/include/uapi/linux/if_pppol2tp.h
- index a91044328bc90..d5bbe250971a3 100644
- --- a/include/uapi/linux/if_pppol2tp.h
- +++ b/include/uapi/linux/if_pppol2tp.h
- @@ -33,7 +33,7 @@ struct pppol2tp_addr {
- __u16 s_tunnel, s_session; /* For matching incoming packets */
- __u16 d_tunnel, d_session; /* For sending outgoing packets */
- -};
- +} __packed;
- /* Structure used to connect() the socket to a particular tunnel UDP
- * socket over IPv6.
- @@ -47,7 +47,7 @@ struct pppol2tpin6_addr {
- __u16 d_tunnel, d_session; /* For sending outgoing packets */
- struct sockaddr_in6 addr; /* IP address and port to send to */
- -};
- +} __packed;
- /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
- * bits. So we need a different sockaddr structure.
- @@ -61,7 +61,7 @@ struct pppol2tpv3_addr {
- __u32 s_tunnel, s_session; /* For matching incoming packets */
- __u32 d_tunnel, d_session; /* For sending outgoing packets */
- -};
- +} __packed;
- struct pppol2tpv3in6_addr {
- __kernel_pid_t pid; /* pid that owns the fd.
- @@ -72,7 +72,7 @@ struct pppol2tpv3in6_addr {
- __u32 d_tunnel, d_session; /* For sending outgoing packets */
- struct sockaddr_in6 addr; /* IP address and port to send to */
- -};
- +} __packed;
- /* Socket options:
- * DEBUG - bitmask of debug message categories (not used)
- diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
- index 9abd80dcc46f9..add1f683906cb 100644
- --- a/include/uapi/linux/if_pppox.h
- +++ b/include/uapi/linux/if_pppox.h
- @@ -66,8 +66,8 @@ struct sockaddr_pppox {
- __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
- unsigned int sa_protocol; /* protocol identifier */
- union {
- - struct pppoe_addr pppoe;
- - struct pptp_addr pptp;
- + struct pppoe_addr pppoe __packed;
- + struct pptp_addr pptp __packed;
- } sa_addr;
- } __packed;
- @@ -79,7 +79,7 @@ struct sockaddr_pppox {
- struct sockaddr_pppol2tp {
- __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
- unsigned int sa_protocol; /* protocol identifier */
- - struct pppol2tp_addr pppol2tp;
- + struct pppol2tp_addr pppol2tp __packed;
- } __packed;
- struct sockaddr_pppol2tpin6 {
- diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
- index ac56605fe9bca..fa1bc4dff17fc 100644
- --- a/include/uapi/linux/ipv6.h
- +++ b/include/uapi/linux/ipv6.h
- @@ -105,8 +105,8 @@ struct rt2_hdr {
- struct ipv6_destopt_hao {
- __u8 type;
- __u8 length;
- - struct in6_addr addr;
- -} __attribute__((packed));
- + struct in6_addr addr __packed;
- +};
- /*
- * IPv6 fixed header
- diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
- index c21edb966c196..4f999cb5c28ea 100644
- --- a/include/uapi/linux/rds.h
- +++ b/include/uapi/linux/rds.h
- @@ -212,7 +212,7 @@ struct rds6_info_socket {
- __be16 connected_port;
- __u32 rcvbuf;
- __u64 inum;
- -} __attribute__((packed));
- +} __attribute__((packed)) __attribute__((aligned(4)));
- struct rds_info_tcp_socket {
- __be32 local_addr;
- @@ -227,17 +227,27 @@ struct rds_info_tcp_socket {
- __u8 tos;
- } __attribute__((packed));
- +struct unaligned_in6_addr {
- + union {
- + __u8 u6_addr8[16];
- +#if __UAPI_DEF_IN6_ADDR_ALT
- + __be16 u6_addr16[8] __attribute__((packed));
- + __be32 u6_addr32[4] __attribute__((packed));
- +#endif
- + } in6_u;
- +};
- +
- struct rds6_info_tcp_socket {
- struct in6_addr local_addr;
- __be16 local_port;
- - struct in6_addr peer_addr;
- + struct unaligned_in6_addr peer_addr;
- __be16 peer_port;
- __u64 hdr_rem;
- __u64 data_rem;
- __u32 last_sent_nxt;
- __u32 last_expected_una;
- __u32 last_seen_una;
- -} __attribute__((packed));
- +} __attribute__((packed)) __attribute__((aligned(4)));
- #define RDS_IB_GID_LEN 16
- struct rds_info_rdma_connection {
- diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
- index cef7534d2d19b..47e1043e77509 100644
- --- a/include/uapi/linux/uhid.h
- +++ b/include/uapi/linux/uhid.h
- @@ -194,7 +194,7 @@ struct uhid_event {
- struct uhid_set_report_req set_report;
- struct uhid_set_report_reply_req set_report_reply;
- struct uhid_start_req start;
- - } u;
- + } __packed u;
- } __attribute__((__packed__));
- #endif /* __UHID_H_ */
- diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h
- index d77ee6b65328e..2329bbd6bc130 100644
- --- a/include/uapi/linux/usb/functionfs.h
- +++ b/include/uapi/linux/usb/functionfs.h
- @@ -67,7 +67,7 @@ struct usb_os_desc_header {
- __u8 Reserved;
- };
- __le16 wCount;
- - };
- + } __packed;
- } __attribute__((packed));
- struct usb_ext_compat_desc {
- diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
- index 3af6a82d0cade..96dffc1f52fc9 100644
- --- a/include/uapi/linux/videodev2.h
- +++ b/include/uapi/linux/videodev2.h
- @@ -1835,7 +1835,7 @@ struct v4l2_ext_control {
- struct v4l2_ctrl_av1_frame __user *p_av1_frame;
- struct v4l2_ctrl_av1_film_grain __user *p_av1_film_grain;
- void __user *ptr;
- - };
- + } __packed;
- } __attribute__ ((packed));
- struct v4l2_ext_controls {
- diff --git a/include/uapi/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h
- index 5e46cf1054af4..3f402fc48d12e 100644
- --- a/include/uapi/scsi/scsi_bsg_fc.h
- +++ b/include/uapi/scsi/scsi_bsg_fc.h
- @@ -188,7 +188,7 @@ struct fc_bsg_host_ct {
- __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
- __u32 preamble_word2; /* Cmd Code, Max Size */
- -};
- +} __packed;
- /* Response:
- *
- * The reply structure is an fc_bsg_ctels_reply structure
- @@ -210,7 +210,7 @@ struct fc_bsg_host_vendor {
- /* start of vendor command area */
- __u32 vendor_cmd[];
- -};
- +} __packed;
- /* Response:
- */
- @@ -256,7 +256,7 @@ struct fc_bsg_rport_ct {
- __u32 preamble_word0; /* revision & IN_ID */
- __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
- __u32 preamble_word2; /* Cmd Code, Max Size */
- -};
- +} __packed;
- /* Response:
- *
- * The reply structure is an fc_bsg_ctels_reply structure
- diff --git a/lib/Makefile b/lib/Makefile
- index 42d307ade225e..aeea894cebbef 100644
- --- a/lib/Makefile
- +++ b/lib/Makefile
- @@ -408,7 +408,7 @@ quiet_cmd_test_fortify = TEST $@
- cmd_test_fortify = $(CONFIG_SHELL) $(srctree)/scripts/test_fortify.sh \
- $< $@ "$(NM)" $(CC) $(c_flags) \
- $(call cc-disable-warning,fortify-source) \
- - -DKBUILD_EXTRA_WARN1
- + -DKBUILD_EXTRA_WARN2
- targets += $(TEST_FORTIFY_LOGS)
- clean-files += $(TEST_FORTIFY_LOGS)
- diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c
- index ce6749af374de..2cbb0eabc5870 100644
- --- a/lib/kunit/executor_test.c
- +++ b/lib/kunit/executor_test.c
- @@ -125,6 +125,11 @@ kunit_test_suites(&executor_test_suite);
- /* Test helpers */
- +static void __kunit_kfree(void *ptr)
- +{
- + return kfree(ptr);
- +}
- +
- /* Use the resource API to register a call to kfree(to_free).
- * Since we never actually use the resource, it's safe to use on const data.
- */
- @@ -134,9 +139,7 @@ static void kfree_at_end(struct kunit *test, const void *to_free)
- if (IS_ERR_OR_NULL(to_free))
- return;
- - kunit_add_action(test,
- - (kunit_action_t *)kfree,
- - (void *)to_free);
- + kunit_add_action(test, __kunit_kfree, (void *)to_free);
- }
- static struct kunit_suite *alloc_fake_suite(struct kunit *test,
- diff --git a/lib/kunit/test.c b/lib/kunit/test.c
- index 84e4666555c94..b00f217ccd2f2 100644
- --- a/lib/kunit/test.c
- +++ b/lib/kunit/test.c
- @@ -763,6 +763,11 @@ static struct notifier_block kunit_mod_nb = {
- };
- #endif
- +static void __kunit_kfree(void *ptr)
- +{
- + kfree(ptr);
- +}
- +
- void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t gfp)
- {
- void *data;
- @@ -772,7 +777,7 @@ void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t gfp)
- if (!data)
- return NULL;
- - if (kunit_add_action_or_reset(test, (kunit_action_t *)kfree, data) != 0)
- + if (kunit_add_action_or_reset(test, __kunit_kfree, data) != 0)
- return NULL;
- return data;
- @@ -784,7 +789,7 @@ void kunit_kfree(struct kunit *test, const void *ptr)
- if (!ptr)
- return;
- - kunit_release_action(test, (kunit_action_t *)kfree, (void *)ptr);
- + kunit_release_action(test, __kunit_kfree, (void *)ptr);
- }
- EXPORT_SYMBOL_GPL(kunit_kfree);
- diff --git a/net/rds/tcp.c b/net/rds/tcp.c
- index c5b86066ff663..6a7fe28be727f 100644
- --- a/net/rds/tcp.c
- +++ b/net/rds/tcp.c
- @@ -293,7 +293,7 @@ static void rds6_tcp_tc_info(struct socket *sock, unsigned int len,
- tsinfo6.local_addr = sk->sk_v6_rcv_saddr;
- tsinfo6.local_port = inet->inet_sport;
- - tsinfo6.peer_addr = sk->sk_v6_daddr;
- + memcpy(&tsinfo6.peer_addr, &sk->sk_v6_daddr, sizeof(sk->sk_v6_daddr));
- tsinfo6.peer_port = inet->inet_dport;
- tsinfo6.hdr_rem = tc->t_tinc_hdr_rem;
- diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
- index 90f0b60b196ab..1c720c2093d91 100644
- --- a/net/smc/smc_llc.c
- +++ b/net/smc/smc_llc.c
- @@ -35,7 +35,7 @@ struct smc_llc_hdr {
- #endif
- };
- u16 length_v2; /* 44 - 8192*/
- - };
- + } __packed;
- u8 flags;
- } __packed; /* format defined in
- * IBM Shared Memory Communications Version 2
- diff --git a/scripts/Makefile.build b/scripts/Makefile.build
- index fcf6a574a7023..d3f5f6c1dc017 100644
- --- a/scripts/Makefile.build
- +++ b/scripts/Makefile.build
- @@ -100,7 +100,7 @@ else ifeq ($(KBUILD_CHECKSRC),2)
- cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
- endif
- -ifneq ($(KBUILD_EXTRA_WARN),)
- +ifneq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
- cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $(KDOCFLAGS) \
- $(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \
- $<
- diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
- index 2d3cec908154d..ed6204b9af2cd 100644
- --- a/sound/core/rawmidi.c
- +++ b/sound/core/rawmidi.c
- @@ -1165,9 +1165,9 @@ static struct timespec64 get_framing_tstamp(struct snd_rawmidi_substream *substr
- *
- * Return: The size of read data, or a negative error code on failure.
- */
- -int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
- - const unsigned char *buffer, int count)
- +int snd_rawmidi_receive(void *ptr, const void *buffer, int count)
- {
- + struct snd_rawmidi_substream *substream = ptr;
- unsigned long flags;
- struct timespec64 ts64 = get_framing_tstamp(substream);
- int result = 0, count1;
- @@ -1195,7 +1195,7 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
- } else if (count == 1) { /* special case, faster code */
- substream->bytes++;
- if (runtime->avail < runtime->buffer_size) {
- - runtime->buffer[runtime->hw_ptr++] = buffer[0];
- + runtime->buffer[runtime->hw_ptr++] = ((u8 *)buffer)[0];
- runtime->hw_ptr %= runtime->buffer_size;
- runtime->avail++;
- result++;
- diff --git a/sound/core/seq/oss/seq_oss_readq.c b/sound/core/seq/oss/seq_oss_readq.c
- index f0db5d3dcba47..3679938c0ad96 100644
- --- a/sound/core/seq/oss/seq_oss_readq.c
- +++ b/sound/core/seq/oss/seq_oss_readq.c
- @@ -86,7 +86,7 @@ snd_seq_oss_readq_clear(struct seq_oss_readq *q)
- * put a midi byte
- */
- int
- -snd_seq_oss_readq_puts(struct seq_oss_readq *q, int dev, unsigned char *data, int len)
- +snd_seq_oss_readq_puts(struct seq_oss_readq *q, int dev, const unsigned char *data, int len)
- {
- union evrec rec;
- int result;
- @@ -113,7 +113,7 @@ struct readq_sysex_ctx {
- int dev;
- };
- -static int readq_dump_sysex(void *ptr, void *buf, int count)
- +static int readq_dump_sysex(void *ptr, const void *buf, int count)
- {
- struct readq_sysex_ctx *ctx = ptr;
- diff --git a/sound/core/seq/oss/seq_oss_readq.h b/sound/core/seq/oss/seq_oss_readq.h
- index 38d0c4682b298..bb99743fec7db 100644
- --- a/sound/core/seq/oss/seq_oss_readq.h
- +++ b/sound/core/seq/oss/seq_oss_readq.h
- @@ -30,7 +30,7 @@ struct seq_oss_readq *snd_seq_oss_readq_new(struct seq_oss_devinfo *dp, int maxl
- void snd_seq_oss_readq_delete(struct seq_oss_readq *q);
- void snd_seq_oss_readq_clear(struct seq_oss_readq *readq);
- unsigned int snd_seq_oss_readq_poll(struct seq_oss_readq *readq, struct file *file, poll_table *wait);
- -int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, unsigned char *data, int len);
- +int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, const unsigned char *data, int len);
- int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev,
- struct snd_seq_event *ev);
- int snd_seq_oss_readq_put_event(struct seq_oss_readq *readq, union evrec *ev);
- diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
- index 174585bf59d29..00e24f99d0de8 100644
- --- a/sound/core/seq/seq_memory.c
- +++ b/sound/core/seq/seq_memory.c
- @@ -135,7 +135,7 @@ EXPORT_SYMBOL(snd_seq_dump_var_event);
- * expand the variable length event to linear buffer space.
- */
- -static int seq_copy_in_kernel(void *ptr, void *src, int size)
- +static int seq_copy_in_kernel(void *ptr, const void *src, int size)
- {
- char **bufptr = ptr;
- @@ -144,7 +144,7 @@ static int seq_copy_in_kernel(void *ptr, void *src, int size)
- return 0;
- }
- -static int seq_copy_in_user(void *ptr, void *src, int size)
- +static int seq_copy_in_user(void *ptr, const void *src, int size)
- {
- char __user **bufptr = ptr;
- diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
- index 44302d98950e8..eb1e78c22dc33 100644
- --- a/sound/core/seq/seq_midi.c
- +++ b/sound/core/seq/seq_midi.c
- @@ -94,8 +94,9 @@ static void snd_midi_input_event(struct snd_rawmidi_substream *substream)
- }
- }
- -static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, int count)
- +static int dump_midi(void *ptr, const void *buf, int count)
- {
- + struct snd_rawmidi_substream *substream = ptr;
- struct snd_rawmidi_runtime *runtime;
- int tmp;
- @@ -132,7 +133,7 @@ static int event_process_midi(struct snd_seq_event *ev, int direct,
- pr_debug("ALSA: seq_midi: invalid sysex event flags = 0x%x\n", ev->flags);
- return 0;
- }
- - snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)dump_midi, substream);
- + snd_seq_dump_var_event(ev, dump_midi, substream);
- snd_midi_event_reset_decode(msynth->parser);
- } else {
- if (msynth->parser == NULL)
- diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c
- index 1b9260108e482..ef8536408af4f 100644
- --- a/sound/core/seq/seq_virmidi.c
- +++ b/sound/core/seq/seq_virmidi.c
- @@ -80,7 +80,7 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev,
- if (ev->type == SNDRV_SEQ_EVENT_SYSEX) {
- if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
- continue;
- - snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream);
- + snd_seq_dump_var_event(ev, snd_rawmidi_receive, vmidi->substream);
- snd_midi_event_reset_decode(vmidi->parser);
- } else {
- len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev);
- diff --git a/sound/pci/aw2/aw2-saa7146.h b/sound/pci/aw2/aw2-saa7146.h
- index b5c5a71c0ac38..3a3de56b9b07a 100644
- --- a/sound/pci/aw2/aw2-saa7146.h
- +++ b/sound/pci/aw2/aw2-saa7146.h
- @@ -19,11 +19,12 @@
- #define NUM_STREAM_CAPTURE_ANA 0
- -typedef void (*snd_aw2_saa7146_it_cb) (void *);
- +struct snd_pcm_substream;
- +typedef void (*snd_aw2_saa7146_it_cb) (struct snd_pcm_substream *);
- struct snd_aw2_saa7146_cb_param {
- snd_aw2_saa7146_it_cb p_it_callback;
- - void *p_callback_param;
- + struct snd_pcm_substream *p_callback_param;
- };
- /* definition of the chip-specific record */
- diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c
- index d074727c3e21d..397900929aa65 100644
- --- a/sound/pci/ctxfi/ctamixer.c
- +++ b/sound/pci/ctxfi/ctamixer.c
- @@ -292,7 +292,7 @@ static int put_amixer_rsc(struct amixer_mgr *mgr, struct amixer *amixer)
- return 0;
- }
- -int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr)
- +int amixer_mgr_create(struct hw *hw, void **ramixer_mgr)
- {
- int err;
- struct amixer_mgr *amixer_mgr;
- @@ -321,8 +321,9 @@ int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr)
- return err;
- }
- -int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr)
- +int amixer_mgr_destroy(void *ptr)
- {
- + struct amixer_mgr *amixer_mgr = ptr;
- rsc_mgr_uninit(&amixer_mgr->mgr);
- kfree(amixer_mgr);
- return 0;
- @@ -446,7 +447,7 @@ static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum)
- return 0;
- }
- -int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr)
- +int sum_mgr_create(struct hw *hw, void **rsum_mgr)
- {
- int err;
- struct sum_mgr *sum_mgr;
- @@ -475,8 +476,9 @@ int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr)
- return err;
- }
- -int sum_mgr_destroy(struct sum_mgr *sum_mgr)
- +int sum_mgr_destroy(void *ptr)
- {
- + struct sum_mgr *sum_mgr = ptr;
- rsc_mgr_uninit(&sum_mgr->mgr);
- kfree(sum_mgr);
- return 0;
- diff --git a/sound/pci/ctxfi/ctamixer.h b/sound/pci/ctxfi/ctamixer.h
- index 4498e6139d0ef..8fc017da6bda8 100644
- --- a/sound/pci/ctxfi/ctamixer.h
- +++ b/sound/pci/ctxfi/ctamixer.h
- @@ -43,8 +43,8 @@ struct sum_mgr {
- };
- /* Constructor and destructor of daio resource manager */
- -int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr);
- -int sum_mgr_destroy(struct sum_mgr *sum_mgr);
- +int sum_mgr_create(struct hw *hw, void **ptr);
- +int sum_mgr_destroy(void *ptr);
- /* Define the descriptor of a amixer resource */
- struct amixer_rsc_ops;
- @@ -89,7 +89,7 @@ struct amixer_mgr {
- };
- /* Constructor and destructor of amixer resource manager */
- -int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr);
- -int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr);
- +int amixer_mgr_create(struct hw *hw, void **ramixer_mgr);
- +int amixer_mgr_destroy(void *amixer_mgr);
- #endif /* CTAMIXER_H */
- diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
- index fbdb8a3d5b8e5..2a3e9d8ba7dbe 100644
- --- a/sound/pci/ctxfi/ctatc.c
- +++ b/sound/pci/ctxfi/ctatc.c
- @@ -105,23 +105,20 @@ static struct {
- .public_name = "Mixer"}
- };
- -typedef int (*create_t)(struct hw *, void **);
- -typedef int (*destroy_t)(void *);
- -
- static struct {
- int (*create)(struct hw *hw, void **rmgr);
- int (*destroy)(void *mgr);
- } rsc_mgr_funcs[NUM_RSCTYP] = {
- - [SRC] = { .create = (create_t)src_mgr_create,
- - .destroy = (destroy_t)src_mgr_destroy },
- - [SRCIMP] = { .create = (create_t)srcimp_mgr_create,
- - .destroy = (destroy_t)srcimp_mgr_destroy },
- - [AMIXER] = { .create = (create_t)amixer_mgr_create,
- - .destroy = (destroy_t)amixer_mgr_destroy },
- - [SUM] = { .create = (create_t)sum_mgr_create,
- - .destroy = (destroy_t)sum_mgr_destroy },
- - [DAIO] = { .create = (create_t)daio_mgr_create,
- - .destroy = (destroy_t)daio_mgr_destroy }
- + [SRC] = { .create = src_mgr_create,
- + .destroy = src_mgr_destroy },
- + [SRCIMP] = { .create = srcimp_mgr_create,
- + .destroy = srcimp_mgr_destroy },
- + [AMIXER] = { .create = amixer_mgr_create,
- + .destroy = amixer_mgr_destroy },
- + [SUM] = { .create = sum_mgr_create,
- + .destroy = sum_mgr_destroy },
- + [DAIO] = { .create = daio_mgr_create,
- + .destroy = daio_mgr_destroy }
- };
- static int
- diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
- index 7fc720046ce29..83aaf9441ef30 100644
- --- a/sound/pci/ctxfi/ctdaio.c
- +++ b/sound/pci/ctxfi/ctdaio.c
- @@ -684,7 +684,7 @@ static int daio_mgr_commit_write(struct daio_mgr *mgr)
- return 0;
- }
- -int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr)
- +int daio_mgr_create(struct hw *hw, void **rdaio_mgr)
- {
- int err, i;
- struct daio_mgr *daio_mgr;
- @@ -738,8 +738,9 @@ int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr)
- return err;
- }
- -int daio_mgr_destroy(struct daio_mgr *daio_mgr)
- +int daio_mgr_destroy(void *ptr)
- {
- + struct daio_mgr *daio_mgr = ptr;
- unsigned long flags;
- /* free daio input mapper list */
- diff --git a/sound/pci/ctxfi/ctdaio.h b/sound/pci/ctxfi/ctdaio.h
- index bd6310f480139..15147fe5f74a0 100644
- --- a/sound/pci/ctxfi/ctdaio.h
- +++ b/sound/pci/ctxfi/ctdaio.h
- @@ -115,7 +115,7 @@ struct daio_mgr {
- };
- /* Constructor and destructor of daio resource manager */
- -int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr);
- -int daio_mgr_destroy(struct daio_mgr *daio_mgr);
- +int daio_mgr_create(struct hw *hw, void **ptr);
- +int daio_mgr_destroy(void *ptr);
- #endif /* CTDAIO_H */
- diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c
- index 4a94b4708a77e..159bd40080691 100644
- --- a/sound/pci/ctxfi/ctsrc.c
- +++ b/sound/pci/ctxfi/ctsrc.c
- @@ -540,7 +540,7 @@ static int src_mgr_commit_write(struct src_mgr *mgr)
- return 0;
- }
- -int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr)
- +int src_mgr_create(struct hw *hw, void **rsrc_mgr)
- {
- int err, i;
- struct src_mgr *src_mgr;
- @@ -580,8 +580,9 @@ int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr)
- return err;
- }
- -int src_mgr_destroy(struct src_mgr *src_mgr)
- +int src_mgr_destroy(void *ptr)
- {
- + struct src_mgr *src_mgr = ptr;
- rsc_mgr_uninit(&src_mgr->mgr);
- kfree(src_mgr);
- @@ -821,7 +822,7 @@ static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry)
- return err;
- }
- -int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrcimp_mgr)
- +int srcimp_mgr_create(struct hw *hw, void **rsrcimp_mgr)
- {
- int err;
- struct srcimp_mgr *srcimp_mgr;
- @@ -866,8 +867,9 @@ int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrcimp_mgr)
- return err;
- }
- -int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr)
- +int srcimp_mgr_destroy(void *ptr)
- {
- + struct srcimp_mgr *srcimp_mgr = ptr;
- unsigned long flags;
- /* free src input mapper list */
- diff --git a/sound/pci/ctxfi/ctsrc.h b/sound/pci/ctxfi/ctsrc.h
- index 1124daf50c9be..e6366cc6a7ae6 100644
- --- a/sound/pci/ctxfi/ctsrc.h
- +++ b/sound/pci/ctxfi/ctsrc.h
- @@ -139,10 +139,10 @@ struct srcimp_mgr {
- };
- /* Constructor and destructor of SRC resource manager */
- -int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr);
- -int src_mgr_destroy(struct src_mgr *src_mgr);
- +int src_mgr_create(struct hw *hw, void **ptr);
- +int src_mgr_destroy(void *ptr);
- /* Constructor and destructor of SRCIMP resource manager */
- -int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrc_mgr);
- -int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr);
- +int srcimp_mgr_create(struct hw *hw, void **ptr);
- +int srcimp_mgr_destroy(void *ptr);
- #endif /* CTSRC_H */
- diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
- index 67f336a12d74a..9b96a9de913b9 100644
- --- a/sound/soc/codecs/Makefile
- +++ b/sound/soc/codecs/Makefile
- @@ -297,9 +297,10 @@ snd-soc-uda1334-objs := uda1334.o
- snd-soc-uda134x-objs := uda134x.o
- snd-soc-uda1380-objs := uda1380.o
- snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o
- -snd-soc-wcd9335-objs := wcd-clsh-v2.o wcd9335.o
- -snd-soc-wcd934x-objs := wcd-clsh-v2.o wcd934x.o
- -snd-soc-wcd938x-objs := wcd938x.o wcd-clsh-v2.o
- +snd-soc-wcd-clsh-objs := wcd-clsh-v2.o
- +snd-soc-wcd9335-objs := wcd9335.o
- +snd-soc-wcd934x-objs := wcd934x.o
- +snd-soc-wcd938x-objs := wcd938x.o
- snd-soc-wcd938x-sdw-objs := wcd938x-sdw.o
- snd-soc-wl1273-objs := wl1273.o
- snd-soc-wm-adsp-objs := wm_adsp.o
- @@ -671,12 +672,12 @@ obj-$(CONFIG_SND_SOC_UDA1334) += snd-soc-uda1334.o
- obj-$(CONFIG_SND_SOC_UDA134X) += snd-soc-uda134x.o
- obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o
- obj-$(CONFIG_SND_SOC_WCD_MBHC) += snd-soc-wcd-mbhc.o
- -obj-$(CONFIG_SND_SOC_WCD9335) += snd-soc-wcd9335.o
- -obj-$(CONFIG_SND_SOC_WCD934X) += snd-soc-wcd934x.o
- -obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x.o
- +obj-$(CONFIG_SND_SOC_WCD9335) += snd-soc-wcd9335.o snd-soc-wcd-clsh.o
- +obj-$(CONFIG_SND_SOC_WCD934X) += snd-soc-wcd934x.o snd-soc-wcd-clsh.o
- +obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x.o snd-soc-wcd-clsh.o
- ifdef CONFIG_SND_SOC_WCD938X_SDW
- # avoid link failure by forcing sdw code built-in when needed
- -obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x-sdw.o
- +obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x-sdw.o snd-soc-wcd-clsh.o
- endif
- obj-$(CONFIG_SND_SOC_WL1273) += snd-soc-wl1273.o
- obj-$(CONFIG_SND_SOC_WM0010) += snd-soc-wm0010.o
- diff --git a/sound/soc/codecs/mt6660.h b/sound/soc/codecs/mt6660.h
- index 054a3c56ec1fe..6c40b4065f24a 100644
- --- a/sound/soc/codecs/mt6660.h
- +++ b/sound/soc/codecs/mt6660.h
- @@ -9,7 +9,6 @@
- #include <linux/mutex.h>
- #include <linux/regmap.h>
- -#pragma pack(push, 1)
- struct mt6660_platform_data {
- u8 init_setting_num;
- u32 *init_setting_addr;
- @@ -26,7 +25,6 @@ struct mt6660_chip {
- struct regmap *regmap;
- u16 chip_rev;
- };
- -#pragma pack(pop)
- #define MT6660_REG_DEVID (0x00)
- #define MT6660_REG_SYSTEM_CTRL (0x03)
- diff --git a/sound/soc/codecs/wcd-clsh-v2.c b/sound/soc/codecs/wcd-clsh-v2.c
- index a75db27e52055..73b99c51d48b4 100644
- --- a/sound/soc/codecs/wcd-clsh-v2.c
- +++ b/sound/soc/codecs/wcd-clsh-v2.c
- @@ -355,6 +355,7 @@ void wcd_clsh_set_hph_mode(struct wcd_clsh_ctrl *ctrl, int mode)
- wcd_clsh_v2_set_hph_mode(comp, mode);
- }
- +EXPORT_SYMBOL_GPL(wcd_clsh_set_hph_mode);
- static void wcd_clsh_set_flyback_current(struct snd_soc_component *comp,
- int mode)
- @@ -869,11 +870,13 @@ int wcd_clsh_ctrl_set_state(struct wcd_clsh_ctrl *ctrl,
- return 0;
- }
- +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_set_state);
- int wcd_clsh_ctrl_get_state(struct wcd_clsh_ctrl *ctrl)
- {
- return ctrl->state;
- }
- +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_get_state);
- struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp,
- int version)
- @@ -890,8 +893,12 @@ struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp,
- return ctrl;
- }
- +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_alloc);
- void wcd_clsh_ctrl_free(struct wcd_clsh_ctrl *ctrl)
- {
- kfree(ctrl);
- }
- +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_free);
- +
- +MODULE_LICENSE("GPL");
- diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c
- index da351a60df0c4..1f55519408e16 100644
- --- a/sound/soc/meson/aiu.c
- +++ b/sound/soc/meson/aiu.c
- @@ -215,6 +215,11 @@ static const char * const aiu_spdif_ids[] = {
- [MCLK] = "spdif_mclk_sel"
- };
- +static void aiu_clk_disable(void *clk)
- +{
- + clk_disable_unprepare(clk);
- +}
- +
- static int aiu_clk_get(struct device *dev)
- {
- struct aiu *aiu = dev_get_drvdata(dev);
- @@ -245,9 +250,7 @@ static int aiu_clk_get(struct device *dev)
- return ret;
- }
- - ret = devm_add_action_or_reset(dev,
- - (void(*)(void *))clk_disable_unprepare,
- - aiu->pclk);
- + ret = devm_add_action_or_reset(dev, aiu_clk_disable, aiu->pclk);
- if (ret)
- dev_err(dev, "failed to add reset action on pclk");
- diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
- index 9c6b4dac68932..e0f9a603a5e99 100644
- --- a/sound/soc/meson/t9015.c
- +++ b/sound/soc/meson/t9015.c
- @@ -243,6 +243,11 @@ static const struct regmap_config t9015_regmap_config = {
- .max_register = POWER_CFG,
- };
- +static void t9015_clk_disable(void *clk)
- +{
- + clk_disable_unprepare(clk);
- +}
- +
- static int t9015_probe(struct platform_device *pdev)
- {
- struct device *dev = &pdev->dev;
- @@ -270,9 +275,7 @@ static int t9015_probe(struct platform_device *pdev)
- return ret;
- }
- - ret = devm_add_action_or_reset(dev,
- - (void(*)(void *))clk_disable_unprepare,
- - priv->pclk);
- + ret = devm_add_action_or_reset(dev, t9015_clk_disable, priv->pclk);
- if (ret)
- return ret;
- diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c
- index 7f02f5b2c33fd..dc94a257cfd51 100644
- --- a/sound/soc/qcom/qdsp6/q6apm-dai.c
- +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c
- @@ -99,7 +99,7 @@ static struct snd_pcm_hardware q6apm_dai_hardware_playback = {
- .fifo_size = 0,
- };
- -static void event_handler(uint32_t opcode, uint32_t token, uint32_t *payload, void *priv)
- +static void event_handler(uint32_t opcode, uint32_t token, void *payload, void *priv)
- {
- struct q6apm_dai_rtd *prtd = priv;
- struct snd_pcm_substream *substream = prtd->substream;
- @@ -264,7 +264,7 @@ static int q6apm_dai_open(struct snd_soc_component *component,
- spin_lock_init(&prtd->lock);
- prtd->substream = substream;
- - prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler, prtd, graph_id);
- + prtd->graph = q6apm_graph_open(dev, event_handler, prtd, graph_id);
- if (IS_ERR(prtd->graph)) {
- dev_err(dev, "%s: Could not allocate memory\n", __func__);
- ret = PTR_ERR(prtd->graph);
- diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
- index 6d9381d60172f..67c7dadd9f773 100644
- --- a/tools/testing/selftests/kvm/.gitignore
- +++ b/tools/testing/selftests/kvm/.gitignore
- @@ -5,3 +5,7 @@
- !*.h
- !*.S
- !*.sh
- +!.gitignore
- +!Makefile
- +!config
- +!settings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement