Advertisement
Guest User

Untitled

a guest
Jun 14th, 2023
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 120.56 KB | None | 0 0
  1. commit 157cee056174349e7323cdf9e4edc17e1762de20
  2. Author: Arnd Bergmann <arnd@arndb.de>
  3. Date: Wed Jun 14 11:42:51 2023 +0200
  4.  
  5. clang-warnings
  6.  
  7. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  8.  
  9. diff --git a/.gitignore b/.gitignore
  10. index 7f86e08379094..ca9c3090bd846 100644
  11. --- a/.gitignore
  12. +++ b/.gitignore
  13. @@ -125,6 +125,7 @@ series
  14. # ctags files
  15. tags
  16. TAGS
  17. +!tags/
  18.  
  19. # cscope files
  20. cscope.*
  21. diff --git a/arch/arm/crypto/sha256_glue.c b/arch/arm/crypto/sha256_glue.c
  22. index 433ee4ddce6c8..d80448d96ab38 100644
  23. --- a/arch/arm/crypto/sha256_glue.c
  24. +++ b/arch/arm/crypto/sha256_glue.c
  25. @@ -27,29 +27,31 @@
  26. asmlinkage void sha256_block_data_order(u32 *digest, const void *data,
  27. unsigned int num_blks);
  28.  
  29. -int crypto_sha256_arm_update(struct shash_desc *desc, const u8 *data,
  30. - unsigned int len)
  31. +static void sha256_block_data_order_wrapper(struct sha256_state *sst, u8 const *src, int blocks)
  32. {
  33. /* make sure casting to sha256_block_fn() is safe */
  34. BUILD_BUG_ON(offsetof(struct sha256_state, state) != 0);
  35.  
  36. - return sha256_base_do_update(desc, data, len,
  37. - (sha256_block_fn *)sha256_block_data_order);
  38. + return sha256_block_data_order((u32 *)sst, src, blocks);
  39. +}
  40. +
  41. +int crypto_sha256_arm_update(struct shash_desc *desc, const u8 *data,
  42. + unsigned int len)
  43. +{
  44. + return sha256_base_do_update(desc, data, len, sha256_block_data_order_wrapper);
  45. }
  46. EXPORT_SYMBOL(crypto_sha256_arm_update);
  47.  
  48. static int crypto_sha256_arm_final(struct shash_desc *desc, u8 *out)
  49. {
  50. - sha256_base_do_finalize(desc,
  51. - (sha256_block_fn *)sha256_block_data_order);
  52. + sha256_base_do_finalize(desc, sha256_block_data_order_wrapper);
  53. return sha256_base_finish(desc, out);
  54. }
  55.  
  56. int crypto_sha256_arm_finup(struct shash_desc *desc, const u8 *data,
  57. unsigned int len, u8 *out)
  58. {
  59. - sha256_base_do_update(desc, data, len,
  60. - (sha256_block_fn *)sha256_block_data_order);
  61. + sha256_base_do_update(desc, data, len, sha256_block_data_order_wrapper);
  62. return crypto_sha256_arm_final(desc, out);
  63. }
  64. EXPORT_SYMBOL(crypto_sha256_arm_finup);
  65. diff --git a/arch/arm/crypto/sha512-glue.c b/arch/arm/crypto/sha512-glue.c
  66. index 0635a65aa488b..1b2c9c0c8a5f3 100644
  67. --- a/arch/arm/crypto/sha512-glue.c
  68. +++ b/arch/arm/crypto/sha512-glue.c
  69. @@ -27,17 +27,22 @@ MODULE_ALIAS_CRYPTO("sha512-arm");
  70.  
  71. asmlinkage void sha512_block_data_order(u64 *state, u8 const *src, int blocks);
  72.  
  73. +static void sha512_block_data_order_wrapper(struct sha512_state *sst, u8 const *src, int blocks)
  74. +{
  75. + return sha512_block_data_order((u64 *)sst, src, blocks);
  76. +}
  77. +
  78. int sha512_arm_update(struct shash_desc *desc, const u8 *data,
  79. unsigned int len)
  80. {
  81. return sha512_base_do_update(desc, data, len,
  82. - (sha512_block_fn *)sha512_block_data_order);
  83. + sha512_block_data_order_wrapper);
  84. }
  85.  
  86. static int sha512_arm_final(struct shash_desc *desc, u8 *out)
  87. {
  88. sha512_base_do_finalize(desc,
  89. - (sha512_block_fn *)sha512_block_data_order);
  90. + sha512_block_data_order_wrapper);
  91. return sha512_base_finish(desc, out);
  92. }
  93.  
  94. @@ -45,7 +50,7 @@ int sha512_arm_finup(struct shash_desc *desc, const u8 *data,
  95. unsigned int len, u8 *out)
  96. {
  97. sha512_base_do_update(desc, data, len,
  98. - (sha512_block_fn *)sha512_block_data_order);
  99. + sha512_block_data_order_wrapper);
  100. return sha512_arm_final(desc, out);
  101. }
  102.  
  103. diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
  104. index f568ac9129744..c22754ad28a06 100644
  105. --- a/arch/arm/kernel/entry-armv.S
  106. +++ b/arch/arm/kernel/entry-armv.S
  107. @@ -482,7 +482,7 @@ __und_usr:
  108. __und_usr_thumb:
  109. @ Thumb instruction
  110. sub r4, r2, #2 @ First half of thumb instr at LR - 2
  111. -#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
  112. +#if defined(CONFIG_ARM_THUMB) && __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_V7)
  113. /*
  114. * Thumb-2 instruction handling. Note that because pre-v6 and >= v6 platforms
  115. * can never be supported in a single kernel, this code is not applicable at
  116. @@ -541,7 +541,7 @@ ENDPROC(__und_usr)
  117. .popsection
  118. .pushsection __ex_table,"a"
  119. .long 1b, 4b
  120. -#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
  121. +#if defined(CONFIG_ARM_THUMB) && __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_V7)
  122. .long 2b, 4b
  123. .long 3b, 4b
  124. #endif
  125. diff --git a/arch/arm64/include/asm/kernel-pgtable.h b/arch/arm64/include/asm/kernel-pgtable.h
  126. index 577773870b66f..9f2197857cda0 100644
  127. --- a/arch/arm64/include/asm/kernel-pgtable.h
  128. +++ b/arch/arm64/include/asm/kernel-pgtable.h
  129. @@ -126,10 +126,12 @@
  130. * in the page tables: 32 * PMD_SIZE (16k granule)
  131. */
  132. #if defined(CONFIG_ARM64_4K_PAGES)
  133. +#ifdef PUD_SHIFT
  134. #define ARM64_MEMSTART_SHIFT PUD_SHIFT
  135. +#endif
  136. #elif defined(CONFIG_ARM64_16K_PAGES)
  137. #define ARM64_MEMSTART_SHIFT CONT_PMD_SHIFT
  138. -#else
  139. +#elif defined(PMD_SHIFT)
  140. #define ARM64_MEMSTART_SHIFT PMD_SHIFT
  141. #endif
  142.  
  143. @@ -139,10 +141,12 @@
  144. * has a direct correspondence, and needs to appear sufficiently aligned
  145. * in the virtual address space.
  146. */
  147. +#if defined(ARM64_MEMSTART_SHIFT) && defined(PMD_SHIFT)
  148. #if ARM64_MEMSTART_SHIFT < SECTION_SIZE_BITS
  149. #define ARM64_MEMSTART_ALIGN (1UL << SECTION_SIZE_BITS)
  150. #else
  151. #define ARM64_MEMSTART_ALIGN (1UL << ARM64_MEMSTART_SHIFT)
  152. #endif
  153. +#endif
  154.  
  155. #endif /* __ASM_KERNEL_PGTABLE_H */
  156. diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
  157. index 7d4ad8907297c..6c46e440421e4 100644
  158. --- a/arch/x86/include/asm/pgtable_32.h
  159. +++ b/arch/x86/include/asm/pgtable_32.h
  160. @@ -56,7 +56,7 @@ do { \
  161. * With PAE paging (PTRS_PER_PMD > 1), we allocate PTRS_PER_PGD == 4 pages for
  162. * the PMD's in addition to the pages required for the last level pagetables.
  163. */
  164. -#if PTRS_PER_PMD > 1
  165. +#ifdef CONFIG_X86_PAE
  166. #define PAGE_TABLE_SIZE(pages) (((pages) / PTRS_PER_PMD) + PTRS_PER_PGD)
  167. #else
  168. #define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD)
  169. diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
  170. index eb67aa4cc5ef8..64a6bba70d183 100644
  171. --- a/arch/x86/kernel/paravirt.c
  172. +++ b/arch/x86/kernel/paravirt.c
  173. @@ -233,6 +233,11 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
  174. return this_cpu_read(paravirt_lazy_mode);
  175. }
  176.  
  177. +static void native_tlb_remove_table(struct mmu_gather *tlb, void *table)
  178. +{
  179. + tlb_remove_table(tlb, table);
  180. +}
  181. +
  182. struct pv_info pv_info = {
  183. .name = "bare hardware",
  184. #ifdef CONFIG_PARAVIRT_XXL
  185. @@ -297,8 +302,7 @@ struct paravirt_patch_template pv_ops = {
  186. .mmu.flush_tlb_kernel = native_flush_tlb_global,
  187. .mmu.flush_tlb_one_user = native_flush_tlb_one_user,
  188. .mmu.flush_tlb_multi = native_flush_tlb_multi,
  189. - .mmu.tlb_remove_table =
  190. - (void (*)(struct mmu_gather *, void *))tlb_remove_page,
  191. + .mmu.tlb_remove_table = native_tlb_remove_table,
  192.  
  193. .mmu.exit_mmap = paravirt_nop,
  194. .mmu.notify_page_enc_status_changed = paravirt_nop,
  195. diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
  196. index 287a8d1d3f707..e858e7e0383f2 100644
  197. --- a/drivers/block/drbd/drbd_state.c
  198. +++ b/drivers/block/drbd/drbd_state.c
  199. @@ -1542,9 +1542,10 @@ int drbd_bitmap_io_from_worker(struct drbd_device *device,
  200.  
  201. int notify_resource_state_change(struct sk_buff *skb,
  202. unsigned int seq,
  203. - struct drbd_resource_state_change *resource_state_change,
  204. + void *state_change,
  205. enum drbd_notification_type type)
  206. {
  207. + struct drbd_resource_state_change *resource_state_change = state_change;
  208. struct drbd_resource *resource = resource_state_change->resource;
  209. struct resource_info resource_info = {
  210. .res_role = resource_state_change->role[NEW],
  211. @@ -1558,13 +1559,14 @@ int notify_resource_state_change(struct sk_buff *skb,
  212.  
  213. int notify_connection_state_change(struct sk_buff *skb,
  214. unsigned int seq,
  215. - struct drbd_connection_state_change *connection_state_change,
  216. + void *state_change,
  217. enum drbd_notification_type type)
  218. {
  219. - struct drbd_connection *connection = connection_state_change->connection;
  220. + struct drbd_connection_state_change *p = state_change;
  221. + struct drbd_connection *connection = p->connection;
  222. struct connection_info connection_info = {
  223. - .conn_connection_state = connection_state_change->cstate[NEW],
  224. - .conn_role = connection_state_change->peer_role[NEW],
  225. + .conn_connection_state = p->cstate[NEW],
  226. + .conn_role = p->peer_role[NEW],
  227. };
  228.  
  229. return notify_connection_state(skb, seq, connection, &connection_info, type);
  230. @@ -1572,9 +1574,10 @@ int notify_connection_state_change(struct sk_buff *skb,
  231.  
  232. int notify_device_state_change(struct sk_buff *skb,
  233. unsigned int seq,
  234. - struct drbd_device_state_change *device_state_change,
  235. + void *state_change,
  236. enum drbd_notification_type type)
  237. {
  238. + struct drbd_device_state_change *device_state_change = state_change;
  239. struct drbd_device *device = device_state_change->device;
  240. struct device_info device_info = {
  241. .dev_disk_state = device_state_change->disk_state[NEW],
  242. @@ -1585,9 +1588,10 @@ int notify_device_state_change(struct sk_buff *skb,
  243.  
  244. int notify_peer_device_state_change(struct sk_buff *skb,
  245. unsigned int seq,
  246. - struct drbd_peer_device_state_change *p,
  247. + void *state_change,
  248. enum drbd_notification_type type)
  249. {
  250. + struct drbd_peer_device_state_change *p = state_change;
  251. struct drbd_peer_device *peer_device = p->peer_device;
  252. struct peer_device_info peer_device_info = {
  253. .peer_repl_state = p->repl_state[NEW],
  254. @@ -1605,8 +1609,8 @@ static void broadcast_state_change(struct drbd_state_change *state_change)
  255. struct drbd_resource_state_change *resource_state_change = &state_change->resource[0];
  256. bool resource_state_has_changed;
  257. unsigned int n_device, n_connection, n_peer_device, n_peer_devices;
  258. - int (*last_func)(struct sk_buff *, unsigned int, void *,
  259. - enum drbd_notification_type) = NULL;
  260. + int (*last_func)(struct sk_buff *, unsigned int,
  261. + void *, enum drbd_notification_type) = NULL;
  262. void *last_arg = NULL;
  263.  
  264. #define HAS_CHANGED(state) ((state)[OLD] != (state)[NEW])
  265. @@ -1616,7 +1620,7 @@ static void broadcast_state_change(struct drbd_state_change *state_change)
  266. })
  267. #define REMEMBER_STATE_CHANGE(func, arg, type) \
  268. ({ FINAL_STATE_CHANGE(type | NOTIFY_CONTINUES); \
  269. - last_func = (typeof(last_func))func; \
  270. + last_func = func; \
  271. last_arg = arg; \
  272. })
  273.  
  274. diff --git a/drivers/block/drbd/drbd_state_change.h b/drivers/block/drbd/drbd_state_change.h
  275. index 9d78d8e3912ee..a56a57d676862 100644
  276. --- a/drivers/block/drbd/drbd_state_change.h
  277. +++ b/drivers/block/drbd/drbd_state_change.h
  278. @@ -46,19 +46,19 @@ extern void forget_state_change(struct drbd_state_change *);
  279.  
  280. extern int notify_resource_state_change(struct sk_buff *,
  281. unsigned int,
  282. - struct drbd_resource_state_change *,
  283. + void *,
  284. enum drbd_notification_type type);
  285. extern int notify_connection_state_change(struct sk_buff *,
  286. unsigned int,
  287. - struct drbd_connection_state_change *,
  288. + void *,
  289. enum drbd_notification_type type);
  290. extern int notify_device_state_change(struct sk_buff *,
  291. unsigned int,
  292. - struct drbd_device_state_change *,
  293. + void *,
  294. enum drbd_notification_type type);
  295. extern int notify_peer_device_state_change(struct sk_buff *,
  296. unsigned int,
  297. - struct drbd_peer_device_state_change *,
  298. + void *,
  299. enum drbd_notification_type type);
  300.  
  301. #endif /* DRBD_STATE_CHANGE_H */
  302. diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
  303. index 2db9b186b977a..f3ad9d9cb243b 100644
  304. --- a/drivers/block/floppy.c
  305. +++ b/drivers/block/floppy.c
  306. @@ -530,14 +530,13 @@ static struct format_descr format_req;
  307. static char *floppy_track_buffer;
  308. static int max_buffer_sectors;
  309.  
  310. -typedef void (*done_f)(int);
  311. static const struct cont_t {
  312. void (*interrupt)(void);
  313. /* this is called after the interrupt of the
  314. * main command */
  315. void (*redo)(void); /* this is called to retry the operation */
  316. void (*error)(void); /* this is called to tally an error */
  317. - done_f done; /* this is called to say if the operation has
  318. + void (*done)(int); /* this is called to say if the operation has
  319. * succeeded/failed */
  320. } *cont;
  321.  
  322. @@ -985,6 +984,10 @@ static void empty(void)
  323. {
  324. }
  325.  
  326. +static void empty_done(int result)
  327. +{
  328. +}
  329. +
  330. static void (*floppy_work_fn)(void);
  331.  
  332. static void floppy_work_workfn(struct work_struct *work)
  333. @@ -1998,14 +2001,14 @@ static const struct cont_t wakeup_cont = {
  334. .interrupt = empty,
  335. .redo = do_wakeup,
  336. .error = empty,
  337. - .done = (done_f)empty
  338. + .done = empty_done,
  339. };
  340.  
  341. static const struct cont_t intr_cont = {
  342. .interrupt = empty,
  343. .redo = process_fd_request,
  344. .error = empty,
  345. - .done = (done_f)empty
  346. + .done = empty_done,
  347. };
  348.  
  349. /* schedules handler, waiting for completion. May be interrupted, will then
  350. diff --git a/drivers/dma/dw-edma/dw-edma-v0-regs.h b/drivers/dma/dw-edma/dw-edma-v0-regs.h
  351. index e175f7b20480e..54800f9d9e460 100644
  352. --- a/drivers/dma/dw-edma/dw-edma-v0-regs.h
  353. +++ b/drivers/dma/dw-edma/dw-edma-v0-regs.h
  354. @@ -29,41 +29,41 @@ struct dw_edma_v0_ch_regs {
  355. u32 ch_control2; /* 0x0004 */
  356. u32 transfer_size; /* 0x0008 */
  357. union {
  358. - u64 reg; /* 0x000c..0x0010 */
  359. + u64 reg __packed; /* 0x000c..0x0010 */
  360. struct {
  361. u32 lsb; /* 0x000c */
  362. u32 msb; /* 0x0010 */
  363. };
  364. } sar;
  365. union {
  366. - u64 reg; /* 0x0014..0x0018 */
  367. + u64 reg __packed; /* 0x0014..0x0018 */
  368. struct {
  369. u32 lsb; /* 0x0014 */
  370. u32 msb; /* 0x0018 */
  371. };
  372. } dar;
  373. union {
  374. - u64 reg; /* 0x001c..0x0020 */
  375. + u64 reg __packed; /* 0x001c..0x0020 */
  376. struct {
  377. u32 lsb; /* 0x001c */
  378. u32 msb; /* 0x0020 */
  379. };
  380. } llp;
  381. -} __packed;
  382. +} __packed __aligned(4);
  383.  
  384. struct dw_edma_v0_ch {
  385. struct dw_edma_v0_ch_regs wr; /* 0x0200 */
  386. u32 padding_1[55]; /* 0x0224..0x02fc */
  387. struct dw_edma_v0_ch_regs rd; /* 0x0300 */
  388. u32 padding_2[55]; /* 0x0324..0x03fc */
  389. -} __packed;
  390. +} __packed __aligned(4);
  391.  
  392. struct dw_edma_v0_unroll {
  393. u32 padding_1; /* 0x00f8 */
  394. u32 wr_engine_chgroup; /* 0x0100 */
  395. u32 rd_engine_chgroup; /* 0x0104 */
  396. union {
  397. - u64 reg; /* 0x0108..0x010c */
  398. + u64 reg __packed; /* 0x0108..0x010c */
  399. struct {
  400. u32 lsb; /* 0x0108 */
  401. u32 msb; /* 0x010c */
  402. @@ -71,7 +71,7 @@ struct dw_edma_v0_unroll {
  403. } wr_engine_hshake_cnt;
  404. u32 padding_2[2]; /* 0x0110..0x0114 */
  405. union {
  406. - u64 reg; /* 0x0120..0x0124 */
  407. + u64 reg __packed; /* 0x0120..0x0124 */
  408. struct {
  409. u32 lsb; /* 0x0120 */
  410. u32 msb; /* 0x0124 */
  411. @@ -97,12 +97,12 @@ struct dw_edma_v0_unroll {
  412. u32 rd_ch7_pwr_en; /* 0x0184 */
  413. u32 padding_5[30]; /* 0x0188..0x01fc */
  414. struct dw_edma_v0_ch ch[EDMA_V0_MAX_NR_CH]; /* 0x0200..0x1120 */
  415. -} __packed;
  416. +} __packed __aligned(4);
  417.  
  418. struct dw_edma_v0_legacy {
  419. u32 viewport_sel; /* 0x00f8 */
  420. struct dw_edma_v0_ch_regs ch; /* 0x0100..0x0120 */
  421. -} __packed;
  422. +} __packed __aligned(4);
  423.  
  424. struct dw_edma_v0_regs {
  425. /* eDMA global registers */
  426. @@ -113,7 +113,7 @@ struct dw_edma_v0_regs {
  427. u32 wr_doorbell; /* 0x0010 */
  428. u32 padding_2; /* 0x0014 */
  429. union {
  430. - u64 reg; /* 0x0018..0x001c */
  431. + u64 reg __packed; /* 0x0018..0x001c */
  432. struct {
  433. u32 lsb; /* 0x0018 */
  434. u32 msb; /* 0x001c */
  435. @@ -124,7 +124,7 @@ struct dw_edma_v0_regs {
  436. u32 rd_doorbell; /* 0x0030 */
  437. u32 padding_4; /* 0x0034 */
  438. union {
  439. - u64 reg; /* 0x0038..0x003c */
  440. + u64 reg __packed; /* 0x0038..0x003c */
  441. struct {
  442. u32 lsb; /* 0x0038 */
  443. u32 msb; /* 0x003c */
  444. @@ -138,14 +138,14 @@ struct dw_edma_v0_regs {
  445. u32 wr_int_clear; /* 0x0058 */
  446. u32 wr_err_status; /* 0x005c */
  447. union {
  448. - u64 reg; /* 0x0060..0x0064 */
  449. + u64 reg __packed; /* 0x0060..0x0064 */
  450. struct {
  451. u32 lsb; /* 0x0060 */
  452. u32 msb; /* 0x0064 */
  453. };
  454. } wr_done_imwr;
  455. union {
  456. - u64 reg; /* 0x0068..0x006c */
  457. + u64 reg __packed; /* 0x0068..0x006c */
  458. struct {
  459. u32 lsb; /* 0x0068 */
  460. u32 msb; /* 0x006c */
  461. @@ -164,7 +164,7 @@ struct dw_edma_v0_regs {
  462. u32 rd_int_clear; /* 0x00ac */
  463. u32 padding_10; /* 0x00b0 */
  464. union {
  465. - u64 reg; /* 0x00b4..0x00b8 */
  466. + u64 reg __packed; /* 0x00b4..0x00b8 */
  467. struct {
  468. u32 lsb; /* 0x00b4 */
  469. u32 msb; /* 0x00b8 */
  470. @@ -174,14 +174,14 @@ struct dw_edma_v0_regs {
  471. u32 rd_linked_list_err_en; /* 0x00c4 */
  472. u32 padding_12; /* 0x00c8 */
  473. union {
  474. - u64 reg; /* 0x00cc..0x00d0 */
  475. + u64 reg __packed; /* 0x00cc..0x00d0 */
  476. struct {
  477. u32 lsb; /* 0x00cc */
  478. u32 msb; /* 0x00d0 */
  479. };
  480. } rd_done_imwr;
  481. union {
  482. - u64 reg; /* 0x00d4..0x00d8 */
  483. + u64 reg __packed; /* 0x00d4..0x00d8 */
  484. struct {
  485. u32 lsb; /* 0x00d4 */
  486. u32 msb; /* 0x00d8 */
  487. @@ -196,38 +196,38 @@ struct dw_edma_v0_regs {
  488. union dw_edma_v0_type {
  489. struct dw_edma_v0_legacy legacy; /* 0x00f8..0x0120 */
  490. struct dw_edma_v0_unroll unroll; /* 0x00f8..0x1120 */
  491. - } type;
  492. -} __packed;
  493. + } type __packed __aligned(4);
  494. +} __packed __aligned(4);
  495.  
  496. struct dw_edma_v0_lli {
  497. u32 control;
  498. u32 transfer_size;
  499. union {
  500. - u64 reg;
  501. + u64 reg __packed;
  502. struct {
  503. u32 lsb;
  504. u32 msb;
  505. };
  506. } sar;
  507. union {
  508. - u64 reg;
  509. + u64 reg __packed;
  510. struct {
  511. u32 lsb;
  512. u32 msb;
  513. };
  514. } dar;
  515. -} __packed;
  516. +} __packed __aligned(4);
  517.  
  518. struct dw_edma_v0_llp {
  519. u32 control;
  520. u32 reserved;
  521. union {
  522. - u64 reg;
  523. + u64 reg __packed;
  524. struct {
  525. u32 lsb;
  526. u32 msb;
  527. };
  528. } llp;
  529. -} __packed;
  530. +} __packed __aligned(4);
  531.  
  532. #endif /* _DW_EDMA_V0_REGS_H */
  533. diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
  534. index 5f3a3e913d28f..d19c78a78ae3a 100644
  535. --- a/drivers/firmware/dmi-id.c
  536. +++ b/drivers/firmware/dmi-id.c
  537. @@ -169,9 +169,14 @@ static int dmi_dev_uevent(const struct device *dev, struct kobj_uevent_env *env)
  538. return 0;
  539. }
  540.  
  541. +static void dmi_dev_release(struct device *dev)
  542. +{
  543. + kfree(dev);
  544. +}
  545. +
  546. static struct class dmi_class = {
  547. .name = "dmi",
  548. - .dev_release = (void(*)(struct device *)) kfree,
  549. + .dev_release = dmi_dev_release,
  550. .dev_uevent = dmi_dev_uevent,
  551. };
  552.  
  553. diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
  554. index e25f085ee8867..fd679ab1d98be 100644
  555. --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
  556. +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
  557. @@ -1341,7 +1341,7 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
  558.  
  559. pci_bus_for_each_resource(root, res, i) {
  560. if (res && res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) &&
  561. - res->start > 0x100000000ull)
  562. + (u64)res->start > 0x100000000ull)
  563. break;
  564. }
  565.  
  566. diff --git a/drivers/gpu/drm/i915/i915_drm_client.h b/drivers/gpu/drm/i915/i915_drm_client.h
  567. index 4c18b99e10a4e..67816c912bca1 100644
  568. --- a/drivers/gpu/drm/i915/i915_drm_client.h
  569. +++ b/drivers/gpu/drm/i915/i915_drm_client.h
  570. @@ -47,8 +47,6 @@ static inline void i915_drm_client_put(struct i915_drm_client *client)
  571.  
  572. struct i915_drm_client *i915_drm_client_alloc(void);
  573.  
  574. -#ifdef CONFIG_PROC_FS
  575. void i915_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file);
  576. -#endif
  577.  
  578. #endif /* !__I915_DRM_CLIENT_H__ */
  579. diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
  580. index 19188683c8fca..8c2bf1c16f2a9 100644
  581. --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
  582. +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
  583. @@ -154,11 +154,17 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name)
  584. return (void *)fw;
  585. }
  586.  
  587. +static void
  588. +shadow_fw_release(void *fw)
  589. +{
  590. + release_firmware(fw);
  591. +}
  592. +
  593. static const struct nvbios_source
  594. shadow_fw = {
  595. .name = "firmware",
  596. .init = shadow_fw_init,
  597. - .fini = (void(*)(void *))release_firmware,
  598. + .fini = shadow_fw_release,
  599. .read = shadow_fw_read,
  600. .rw = false,
  601. };
  602. diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
  603. index 7a9e160158f7e..a468138d905bc 100644
  604. --- a/drivers/hid/Makefile
  605. +++ b/drivers/hid/Makefile
  606. @@ -131,10 +131,8 @@ obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o
  607. obj-$(CONFIG_HID_TOPRE) += hid-topre.o
  608. obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o
  609. obj-$(CONFIG_HID_U2FZERO) += hid-u2fzero.o
  610. -hid-uclogic-objs := hid-uclogic-core.o \
  611. - hid-uclogic-rdesc.o \
  612. - hid-uclogic-params.o
  613. -obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o
  614. +hid-uclogic-objs := hid-uclogic-core.o
  615. +obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o hid-uclogic-rdesc.o hid-uclogic-params.o
  616. obj-$(CONFIG_HID_UDRAW_PS3) += hid-udraw-ps3.o
  617. obj-$(CONFIG_HID_LED) += hid-led.o
  618. obj-$(CONFIG_HID_XIAOMI) += hid-xiaomi.o
  619. @@ -151,10 +149,8 @@ obj-$(CONFIG_HID_WIIMOTE) += hid-wiimote.o
  620. obj-$(CONFIG_HID_SENSOR_HUB) += hid-sensor-hub.o
  621. obj-$(CONFIG_HID_SENSOR_CUSTOM_SENSOR) += hid-sensor-custom.o
  622.  
  623. -hid-uclogic-test-objs := hid-uclogic-rdesc.o \
  624. - hid-uclogic-params.o \
  625. - hid-uclogic-rdesc-test.o
  626. -obj-$(CONFIG_HID_KUNIT_TEST) += hid-uclogic-test.o
  627. +hid-uclogic-test-objs := hid-uclogic-rdesc-test.o
  628. +obj-$(CONFIG_HID_KUNIT_TEST) += hid-uclogic-test.o hid-uclogic-params.o hid-uclogic-params.o
  629.  
  630. obj-$(CONFIG_USB_HID) += usbhid/
  631. obj-$(CONFIG_USB_MOUSE) += usbhid/
  632. diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c
  633. index 85700cec5eac6..da28b87b7ab8b 100644
  634. --- a/drivers/hid/hid-nvidia-shield.c
  635. +++ b/drivers/hid/hid-nvidia-shield.c
  636. @@ -63,7 +63,7 @@ static_assert(sizeof(enum thunderstrike_led_state) == 1);
  637. struct thunderstrike_hostcmd_board_info {
  638. __le16 revision;
  639. __le16 serial[7];
  640. -};
  641. +} __packed;
  642.  
  643. struct thunderstrike_hostcmd_haptics {
  644. u8 motor_left;
  645. @@ -81,7 +81,7 @@ struct thunderstrike_hostcmd_resp_report {
  646. __le16 fw_version;
  647. enum thunderstrike_led_state led_state;
  648. u8 payload[30];
  649. - };
  650. + } __packed;
  651. } __packed;
  652. static_assert(sizeof(struct thunderstrike_hostcmd_resp_report) ==
  653. THUNDERSTRIKE_HOSTCMD_REPORT_SIZE);
  654. diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
  655. index 9859dad36495a..54e9f1284fcbc 100644
  656. --- a/drivers/hid/hid-uclogic-params.c
  657. +++ b/drivers/hid/hid-uclogic-params.c
  658. @@ -133,6 +133,7 @@ void uclogic_params_hid_dbg(const struct hid_device *hdev,
  659. }
  660. hid_dbg(hdev, "}\n");
  661. }
  662. +EXPORT_SYMBOL_GPL(uclogic_params_hid_dbg);
  663.  
  664. /**
  665. * uclogic_params_get_str_desc - retrieve a string descriptor from a HID
  666. @@ -660,6 +661,7 @@ void uclogic_params_cleanup(struct uclogic_params *params)
  667. memset(params, 0, sizeof(*params));
  668. }
  669. }
  670. +EXPORT_SYMBOL_GPL(uclogic_params_cleanup);
  671.  
  672. /**
  673. * uclogic_params_get_desc() - Get a replacement report descriptor for a
  674. @@ -732,6 +734,7 @@ int uclogic_params_get_desc(const struct uclogic_params *params,
  675. kfree(desc);
  676. return rc;
  677. }
  678. +EXPORT_SYMBOL_GPL(uclogic_params_get_desc);
  679.  
  680. /**
  681. * uclogic_params_init_invalid() - initialize tablet interface parameters,
  682. @@ -1856,7 +1859,10 @@ int uclogic_params_init(struct uclogic_params *params,
  683. uclogic_params_cleanup(&p);
  684. return rc;
  685. }
  686. +EXPORT_SYMBOL_GPL(uclogic_params_init);
  687.  
  688. #ifdef CONFIG_HID_KUNIT_TEST
  689. #include "hid-uclogic-params-test.c"
  690. #endif
  691. +
  692. +MODULE_LICENSE("GPL");
  693. diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c
  694. index b6dfdf6356a60..aa80aff2a1914 100644
  695. --- a/drivers/hid/hid-uclogic-rdesc.c
  696. +++ b/drivers/hid/hid-uclogic-rdesc.c
  697. @@ -59,9 +59,11 @@ __u8 uclogic_rdesc_wp4030u_fixed_arr[] = {
  698. 0xC0, /* End Collection, */
  699. 0xC0 /* End Collection */
  700. };
  701. +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp4030u_fixed_arr);
  702.  
  703. const size_t uclogic_rdesc_wp4030u_fixed_size =
  704. sizeof(uclogic_rdesc_wp4030u_fixed_arr);
  705. +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp4030u_fixed_size);
  706.  
  707. /* Fixed WP5540U report descriptor */
  708. __u8 uclogic_rdesc_wp5540u_fixed_arr[] = {
  709. @@ -136,9 +138,11 @@ __u8 uclogic_rdesc_wp5540u_fixed_arr[] = {
  710. 0xC0, /* End Collection, */
  711. 0xC0 /* End Collection */
  712. };
  713. +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp5540u_fixed_arr);
  714.  
  715. const size_t uclogic_rdesc_wp5540u_fixed_size =
  716. sizeof(uclogic_rdesc_wp5540u_fixed_arr);
  717. +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp5540u_fixed_size);
  718.  
  719. /* Fixed WP8060U report descriptor */
  720. __u8 uclogic_rdesc_wp8060u_fixed_arr[] = {
  721. @@ -213,9 +217,11 @@ __u8 uclogic_rdesc_wp8060u_fixed_arr[] = {
  722. 0xC0, /* End Collection, */
  723. 0xC0 /* End Collection */
  724. };
  725. +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp8060u_fixed_arr);
  726.  
  727. const size_t uclogic_rdesc_wp8060u_fixed_size =
  728. sizeof(uclogic_rdesc_wp8060u_fixed_arr);
  729. +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp8060u_fixed_size);
  730.  
  731. /* Fixed WP1062 report descriptor */
  732. __u8 uclogic_rdesc_wp1062_fixed_arr[] = {
  733. @@ -261,9 +267,11 @@ __u8 uclogic_rdesc_wp1062_fixed_arr[] = {
  734. 0xC0, /* End Collection, */
  735. 0xC0 /* End Collection */
  736. };
  737. +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp1062_fixed_arr);
  738.  
  739. const size_t uclogic_rdesc_wp1062_fixed_size =
  740. sizeof(uclogic_rdesc_wp1062_fixed_arr);
  741. +EXPORT_SYMBOL_GPL(uclogic_rdesc_wp1062_fixed_size);
  742.  
  743. /* Fixed PF1209 report descriptor */
  744. __u8 uclogic_rdesc_pf1209_fixed_arr[] = {
  745. @@ -338,9 +346,11 @@ __u8 uclogic_rdesc_pf1209_fixed_arr[] = {
  746. 0xC0, /* End Collection, */
  747. 0xC0 /* End Collection */
  748. };
  749. +EXPORT_SYMBOL_GPL(uclogic_rdesc_pf1209_fixed_arr);
  750.  
  751. const size_t uclogic_rdesc_pf1209_fixed_size =
  752. sizeof(uclogic_rdesc_pf1209_fixed_arr);
  753. +EXPORT_SYMBOL_GPL(uclogic_rdesc_pf1209_fixed_size);
  754.  
  755. /* Fixed PID 0522 tablet report descriptor, interface 0 (stylus) */
  756. __u8 uclogic_rdesc_twhl850_fixed0_arr[] = {
  757. @@ -384,9 +394,11 @@ __u8 uclogic_rdesc_twhl850_fixed0_arr[] = {
  758. 0xC0, /* End Collection, */
  759. 0xC0 /* End Collection */
  760. };
  761. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed0_arr);
  762.  
  763. const size_t uclogic_rdesc_twhl850_fixed0_size =
  764. sizeof(uclogic_rdesc_twhl850_fixed0_arr);
  765. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed0_size);
  766.  
  767. /* Fixed PID 0522 tablet report descriptor, interface 1 (mouse) */
  768. __u8 uclogic_rdesc_twhl850_fixed1_arr[] = {
  769. @@ -424,9 +436,11 @@ __u8 uclogic_rdesc_twhl850_fixed1_arr[] = {
  770. 0xC0, /* End Collection, */
  771. 0xC0 /* End Collection */
  772. };
  773. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed1_arr);
  774.  
  775. const size_t uclogic_rdesc_twhl850_fixed1_size =
  776. sizeof(uclogic_rdesc_twhl850_fixed1_arr);
  777. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed1_size);
  778.  
  779. /* Fixed PID 0522 tablet report descriptor, interface 2 (frame buttons) */
  780. __u8 uclogic_rdesc_twhl850_fixed2_arr[] = {
  781. @@ -450,9 +464,11 @@ __u8 uclogic_rdesc_twhl850_fixed2_arr[] = {
  782. 0x80, /* Input, */
  783. 0xC0 /* End Collection */
  784. };
  785. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed2_arr);
  786.  
  787. const size_t uclogic_rdesc_twhl850_fixed2_size =
  788. sizeof(uclogic_rdesc_twhl850_fixed2_arr);
  789. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twhl850_fixed2_size);
  790.  
  791. /* Fixed TWHA60 report descriptor, interface 0 (stylus) */
  792. __u8 uclogic_rdesc_twha60_fixed0_arr[] = {
  793. @@ -499,9 +515,11 @@ __u8 uclogic_rdesc_twha60_fixed0_arr[] = {
  794. 0xC0, /* End Collection, */
  795. 0xC0 /* End Collection */
  796. };
  797. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twha60_fixed0_arr);
  798.  
  799. const size_t uclogic_rdesc_twha60_fixed0_size =
  800. sizeof(uclogic_rdesc_twha60_fixed0_arr);
  801. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twha60_fixed0_size);
  802.  
  803. /* Fixed TWHA60 report descriptor, interface 1 (frame buttons) */
  804. __u8 uclogic_rdesc_twha60_fixed1_arr[] = {
  805. @@ -527,9 +545,11 @@ __u8 uclogic_rdesc_twha60_fixed1_arr[] = {
  806. 0x81, 0x01, /* Input (Constant), */
  807. 0xC0 /* End Collection */
  808. };
  809. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twha60_fixed1_arr);
  810.  
  811. const size_t uclogic_rdesc_twha60_fixed1_size =
  812. sizeof(uclogic_rdesc_twha60_fixed1_arr);
  813. +EXPORT_SYMBOL_GPL(uclogic_rdesc_twha60_fixed1_size);
  814.  
  815. /* Fixed report descriptor template for (tweaked) v1 pen reports */
  816. const __u8 uclogic_rdesc_v1_pen_template_arr[] = {
  817. @@ -581,9 +601,11 @@ const __u8 uclogic_rdesc_v1_pen_template_arr[] = {
  818. 0xC0, /* End Collection, */
  819. 0xC0 /* End Collection */
  820. };
  821. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v1_pen_template_arr);
  822.  
  823. const size_t uclogic_rdesc_v1_pen_template_size =
  824. sizeof(uclogic_rdesc_v1_pen_template_arr);
  825. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v1_pen_template_size);
  826.  
  827. /* Fixed report descriptor template for (tweaked) v2 pen reports */
  828. const __u8 uclogic_rdesc_v2_pen_template_arr[] = {
  829. @@ -647,9 +669,11 @@ const __u8 uclogic_rdesc_v2_pen_template_arr[] = {
  830. 0xC0, /* End Collection, */
  831. 0xC0 /* End Collection */
  832. };
  833. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_pen_template_arr);
  834.  
  835. const size_t uclogic_rdesc_v2_pen_template_size =
  836. sizeof(uclogic_rdesc_v2_pen_template_arr);
  837. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_pen_template_size);
  838.  
  839. /*
  840. * Expand to the contents of a generic frame buttons report descriptor.
  841. @@ -702,16 +726,22 @@ const size_t uclogic_rdesc_v2_pen_template_size =
  842. const __u8 uclogic_rdesc_v1_frame_arr[] = {
  843. UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(UCLOGIC_RDESC_V1_FRAME_ID, 8)
  844. };
  845. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v1_frame_arr);
  846. +
  847. const size_t uclogic_rdesc_v1_frame_size =
  848. sizeof(uclogic_rdesc_v1_frame_arr);
  849. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v1_frame_size);
  850.  
  851. /* Fixed report descriptor for (tweaked) v2 frame button reports */
  852. const __u8 uclogic_rdesc_v2_frame_buttons_arr[] = {
  853. UCLOGIC_RDESC_FRAME_BUTTONS_BYTES(UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID,
  854. 12)
  855. };
  856. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_buttons_arr);
  857. +
  858. const size_t uclogic_rdesc_v2_frame_buttons_size =
  859. sizeof(uclogic_rdesc_v2_frame_buttons_arr);
  860. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_buttons_size);
  861.  
  862. /* Fixed report descriptor for (tweaked) v2 frame touch ring reports */
  863. const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[] = {
  864. @@ -758,8 +788,11 @@ const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[] = {
  865. 0xC0, /* End Collection, */
  866. 0xC0 /* End Collection */
  867. };
  868. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_touch_ring_arr);
  869. +
  870. const size_t uclogic_rdesc_v2_frame_touch_ring_size =
  871. sizeof(uclogic_rdesc_v2_frame_touch_ring_arr);
  872. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_touch_ring_size);
  873.  
  874. /* Fixed report descriptor for (tweaked) v2 frame touch strip reports */
  875. const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[] = {
  876. @@ -806,8 +839,11 @@ const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[] = {
  877. 0xC0, /* End Collection, */
  878. 0xC0 /* End Collection */
  879. };
  880. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_touch_strip_arr);
  881. +
  882. const size_t uclogic_rdesc_v2_frame_touch_strip_size =
  883. sizeof(uclogic_rdesc_v2_frame_touch_strip_arr);
  884. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_touch_strip_size);
  885.  
  886. /* Fixed report descriptor for (tweaked) v2 frame dial reports */
  887. const __u8 uclogic_rdesc_v2_frame_dial_arr[] = {
  888. @@ -856,14 +892,22 @@ const __u8 uclogic_rdesc_v2_frame_dial_arr[] = {
  889. 0xC0, /* End Collection, */
  890. 0xC0 /* End Collection */
  891. };
  892. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_dial_arr);
  893. +
  894. const size_t uclogic_rdesc_v2_frame_dial_size =
  895. sizeof(uclogic_rdesc_v2_frame_dial_arr);
  896. +EXPORT_SYMBOL_GPL(uclogic_rdesc_v2_frame_dial_size);
  897.  
  898. const __u8 uclogic_ugee_v2_probe_arr[] = {
  899. 0x02, 0xb0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  900. };
  901. +EXPORT_SYMBOL_GPL(uclogic_ugee_v2_probe_arr);
  902. +
  903. const size_t uclogic_ugee_v2_probe_size = sizeof(uclogic_ugee_v2_probe_arr);
  904. +EXPORT_SYMBOL_GPL(uclogic_ugee_v2_probe_size);
  905. +
  906. const int uclogic_ugee_v2_probe_endpoint = 0x03;
  907. +EXPORT_SYMBOL_GPL(uclogic_ugee_v2_probe_endpoint);
  908.  
  909. /* Fixed report descriptor template for UGEE v2 pen reports */
  910. const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[] = {
  911. @@ -935,8 +979,11 @@ const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[] = {
  912. 0xc0, /* End Collection, */
  913. 0xc0, /* End Collection */
  914. };
  915. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_pen_template_arr);
  916. +
  917. const size_t uclogic_rdesc_ugee_v2_pen_template_size =
  918. sizeof(uclogic_rdesc_ugee_v2_pen_template_arr);
  919. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_pen_template_size);
  920.  
  921. /* Fixed report descriptor template for UGEE v2 frame reports (buttons only) */
  922. const __u8 uclogic_rdesc_ugee_v2_frame_btn_template_arr[] = {
  923. @@ -964,8 +1011,11 @@ const __u8 uclogic_rdesc_ugee_v2_frame_btn_template_arr[] = {
  924. 0xC0, /* End Collection, */
  925. 0xC0 /* End Collection */
  926. };
  927. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_btn_template_arr);
  928. +
  929. const size_t uclogic_rdesc_ugee_v2_frame_btn_template_size =
  930. sizeof(uclogic_rdesc_ugee_v2_frame_btn_template_arr);
  931. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_btn_template_size);
  932.  
  933. /* Fixed report descriptor template for UGEE v2 frame reports (dial) */
  934. const __u8 uclogic_rdesc_ugee_v2_frame_dial_template_arr[] = {
  935. @@ -1004,8 +1054,11 @@ const __u8 uclogic_rdesc_ugee_v2_frame_dial_template_arr[] = {
  936. 0xC0, /* End Collection, */
  937. 0xC0 /* End Collection */
  938. };
  939. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_dial_template_arr);
  940. +
  941. const size_t uclogic_rdesc_ugee_v2_frame_dial_template_size =
  942. sizeof(uclogic_rdesc_ugee_v2_frame_dial_template_arr);
  943. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_dial_template_size);
  944.  
  945. /* Fixed report descriptor template for UGEE v2 frame reports (mouse) */
  946. const __u8 uclogic_rdesc_ugee_v2_frame_mouse_template_arr[] = {
  947. @@ -1038,8 +1091,11 @@ const __u8 uclogic_rdesc_ugee_v2_frame_mouse_template_arr[] = {
  948. 0xC0, /* End Collection, */
  949. 0xC0 /* End Collection */
  950. };
  951. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_mouse_template_arr);
  952. +
  953. const size_t uclogic_rdesc_ugee_v2_frame_mouse_template_size =
  954. sizeof(uclogic_rdesc_ugee_v2_frame_mouse_template_arr);
  955. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_frame_mouse_template_size);
  956.  
  957. /* Fixed report descriptor template for UGEE v2 battery reports */
  958. const __u8 uclogic_rdesc_ugee_v2_battery_template_arr[] = {
  959. @@ -1072,8 +1128,11 @@ const __u8 uclogic_rdesc_ugee_v2_battery_template_arr[] = {
  960. 0x81, 0x01, /* Input (Constant), */
  961. 0xC0 /* End Collection */
  962. };
  963. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_battery_template_arr);
  964. +
  965. const size_t uclogic_rdesc_ugee_v2_battery_template_size =
  966. sizeof(uclogic_rdesc_ugee_v2_battery_template_arr);
  967. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_v2_battery_template_size);
  968.  
  969. /* Fixed report descriptor for Ugee EX07 frame */
  970. const __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = {
  971. @@ -1099,8 +1158,11 @@ const __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = {
  972. 0xC0, /* End Collection, */
  973. 0xC0 /* End Collection */
  974. };
  975. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_ex07_frame_arr);
  976. +
  977. const size_t uclogic_rdesc_ugee_ex07_frame_size =
  978. sizeof(uclogic_rdesc_ugee_ex07_frame_arr);
  979. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_ex07_frame_size);
  980.  
  981. /* Fixed report descriptor for Ugee G5 frame controls */
  982. const __u8 uclogic_rdesc_ugee_g5_frame_arr[] = {
  983. @@ -1153,8 +1215,10 @@ const __u8 uclogic_rdesc_ugee_g5_frame_arr[] = {
  984. 0xC0, /* End Collection, */
  985. 0xC0 /* End Collection */
  986. };
  987. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_g5_frame_arr);
  988. const size_t uclogic_rdesc_ugee_g5_frame_size =
  989. sizeof(uclogic_rdesc_ugee_g5_frame_arr);
  990. +EXPORT_SYMBOL_GPL(uclogic_rdesc_ugee_g5_frame_size);
  991.  
  992. /* Fixed report descriptor for XP-Pen Deco 01 frame controls */
  993. const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
  994. @@ -1187,9 +1251,11 @@ const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
  995. 0xC0, /* End Collection, */
  996. 0xC0 /* End Collection */
  997. };
  998. +EXPORT_SYMBOL_GPL(uclogic_rdesc_xppen_deco01_frame_arr);
  999.  
  1000. const size_t uclogic_rdesc_xppen_deco01_frame_size =
  1001. sizeof(uclogic_rdesc_xppen_deco01_frame_arr);
  1002. +EXPORT_SYMBOL_GPL(uclogic_rdesc_xppen_deco01_frame_size);
  1003.  
  1004. /**
  1005. * uclogic_rdesc_template_apply() - apply report descriptor parameters to a
  1006. @@ -1242,3 +1308,6 @@ __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
  1007.  
  1008. return rdesc_ptr;
  1009. }
  1010. +EXPORT_SYMBOL_GPL(uclogic_rdesc_template_apply);
  1011. +
  1012. +MODULE_LICENSE("GPL");
  1013. diff --git a/drivers/infiniband/core/mad_priv.h b/drivers/infiniband/core/mad_priv.h
  1014. index 1b7445a6f6714..f2d607bb0b967 100644
  1015. --- a/drivers/infiniband/core/mad_priv.h
  1016. +++ b/drivers/infiniband/core/mad_priv.h
  1017. @@ -73,14 +73,14 @@ struct ib_mad_private_header {
  1018. struct ib_mad_recv_wc recv_wc;
  1019. struct ib_wc wc;
  1020. u64 mapping;
  1021. -} __packed;
  1022. +};
  1023.  
  1024. struct ib_mad_private {
  1025. struct ib_mad_private_header header;
  1026. size_t mad_size;
  1027. struct ib_grh grh;
  1028. u8 mad[];
  1029. -} __packed;
  1030. +};
  1031.  
  1032. struct ib_rmpp_segment {
  1033. struct list_head list;
  1034. diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
  1035. index dee8c97ff0568..07e24ede7d1ce 100644
  1036. --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
  1037. +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
  1038. @@ -270,7 +270,7 @@ struct iser_rx_desc {
  1039. struct ib_sge rx_sg;
  1040. struct ib_cqe cqe;
  1041. char pad[ISER_RX_PAD_SIZE];
  1042. -} __packed;
  1043. +} __packed __aligned(4);
  1044.  
  1045. /**
  1046. * struct iser_login_desc - iSER login descriptor
  1047. diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
  1048. index c12005eab14c1..342a7a7ae4e2f 100644
  1049. --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
  1050. +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
  1051. @@ -212,8 +212,10 @@ static const char *get_ch_state_name(enum rdma_ch_state s)
  1052. * @event: Description of the event that occurred.
  1053. * @ch: SRPT RDMA channel.
  1054. */
  1055. -static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch)
  1056. +static void srpt_qp_event(struct ib_event *event, void *ptr)
  1057. {
  1058. + struct srpt_rdma_ch *ch = ptr;
  1059. +
  1060. pr_debug("QP event %d on ch=%p sess_name=%s-%d state=%s\n",
  1061. event->event, ch, ch->sess_name, ch->qp->qp_num,
  1062. get_ch_state_name(ch->state));
  1063. @@ -1807,8 +1809,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
  1064. ch->cq_size = ch->rq_size + sq_size;
  1065.  
  1066. qp_init->qp_context = (void *)ch;
  1067. - qp_init->event_handler
  1068. - = (void(*)(struct ib_event *, void*))srpt_qp_event;
  1069. + qp_init->event_handler = srpt_qp_event;
  1070. qp_init->send_cq = ch->cq;
  1071. qp_init->recv_cq = ch->cq;
  1072. qp_init->sq_sig_type = IB_SIGNAL_REQ_WR;
  1073. diff --git a/drivers/media/dvb-frontends/as102_fe_types.h b/drivers/media/dvb-frontends/as102_fe_types.h
  1074. index 297f9520ebf9d..981e79e75db13 100644
  1075. --- a/drivers/media/dvb-frontends/as102_fe_types.h
  1076. +++ b/drivers/media/dvb-frontends/as102_fe_types.h
  1077. @@ -174,6 +174,7 @@ struct as10x_register_addr {
  1078. uint32_t addr;
  1079. /* register mode access */
  1080. uint8_t mode;
  1081. -};
  1082. + uint8_t __pad[3];
  1083. +} __packed;
  1084.  
  1085. #endif
  1086. diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c
  1087. index 49fc2e9d45dd5..c4f1c49b9d52a 100644
  1088. --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c
  1089. +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c
  1090. @@ -77,10 +77,10 @@ void mdp_vpu_shared_mem_free(struct mdp_vpu_dev *vpu)
  1091. dma_free_wc(dev, vpu->config_size, vpu->config, vpu->config_addr);
  1092. }
  1093.  
  1094. -static void mdp_vpu_ipi_handle_init_ack(void *data, unsigned int len,
  1095. +static void mdp_vpu_ipi_handle_init_ack(const void *data, unsigned int len,
  1096. void *priv)
  1097. {
  1098. - struct mdp_ipi_init_msg *msg = (struct mdp_ipi_init_msg *)data;
  1099. + const struct mdp_ipi_init_msg *msg = data;
  1100. struct mdp_vpu_dev *vpu =
  1101. (struct mdp_vpu_dev *)(unsigned long)msg->drv_data;
  1102.  
  1103. @@ -91,10 +91,10 @@ static void mdp_vpu_ipi_handle_init_ack(void *data, unsigned int len,
  1104. complete(&vpu->ipi_acked);
  1105. }
  1106.  
  1107. -static void mdp_vpu_ipi_handle_deinit_ack(void *data, unsigned int len,
  1108. +static void mdp_vpu_ipi_handle_deinit_ack(const void *data, unsigned int len,
  1109. void *priv)
  1110. {
  1111. - struct mdp_ipi_deinit_msg *msg = (struct mdp_ipi_deinit_msg *)data;
  1112. + const struct mdp_ipi_deinit_msg *msg = data;
  1113. struct mdp_vpu_dev *vpu =
  1114. (struct mdp_vpu_dev *)(unsigned long)msg->drv_data;
  1115.  
  1116. @@ -102,10 +102,10 @@ static void mdp_vpu_ipi_handle_deinit_ack(void *data, unsigned int len,
  1117. complete(&vpu->ipi_acked);
  1118. }
  1119.  
  1120. -static void mdp_vpu_ipi_handle_frame_ack(void *data, unsigned int len,
  1121. +static void mdp_vpu_ipi_handle_frame_ack(const void *data, unsigned int len,
  1122. void *priv)
  1123. {
  1124. - struct img_sw_addr *addr = (struct img_sw_addr *)data;
  1125. + const struct img_sw_addr *addr = data;
  1126. struct img_ipi_frameparam *param =
  1127. (struct img_ipi_frameparam *)(unsigned long)addr->va;
  1128. struct mdp_vpu_dev *vpu =
  1129. diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h
  1130. index 16824114657f0..a2cc77f9b31b9 100644
  1131. --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h
  1132. +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h
  1133. @@ -22,7 +22,7 @@ enum mtk_vcodec_fw_use {
  1134.  
  1135. struct mtk_vcodec_fw;
  1136.  
  1137. -typedef void (*mtk_vcodec_ipi_handler) (void *data,
  1138. +typedef void (*mtk_vcodec_ipi_handler) (const void *data,
  1139. unsigned int len, void *priv);
  1140.  
  1141. struct mtk_vcodec_fw *mtk_vcodec_fw_select(struct mtk_vcodec_dev *dev,
  1142. diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c
  1143. index cfc7ebed8fb7a..1ec29f1b163a1 100644
  1144. --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c
  1145. +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c
  1146. @@ -29,15 +29,7 @@ static int mtk_vcodec_vpu_set_ipi_register(struct mtk_vcodec_fw *fw, int id,
  1147. mtk_vcodec_ipi_handler handler,
  1148. const char *name, void *priv)
  1149. {
  1150. - /*
  1151. - * The handler we receive takes a void * as its first argument. We
  1152. - * cannot change this because it needs to be passed down to the rproc
  1153. - * subsystem when SCP is used. VPU takes a const argument, which is
  1154. - * more constrained, so the conversion below is safe.
  1155. - */
  1156. - ipi_handler_t handler_const = (ipi_handler_t)handler;
  1157. -
  1158. - return vpu_ipi_register(fw->pdev, id, handler_const, name, priv);
  1159. + return vpu_ipi_register(fw->pdev, id, handler, name, priv);
  1160. }
  1161.  
  1162. static int mtk_vcodec_vpu_ipi_send(struct mtk_vcodec_fw *fw, int id, void *buf,
  1163. diff --git a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
  1164. index df309e8e93798..c350c1a50b7d9 100644
  1165. --- a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
  1166. +++ b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
  1167. @@ -85,7 +85,7 @@ static void handle_get_param_msg_ack(const struct vdec_vpu_ipi_get_param_ack *ms
  1168. * This function runs in interrupt context and it means there's an IPI MSG
  1169. * from VPU.
  1170. */
  1171. -static void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv)
  1172. +static void vpu_dec_ipi_handler(const void *data, unsigned int len, void *priv)
  1173. {
  1174. const struct vdec_vpu_ipi_ack *msg = data;
  1175. struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)
  1176. diff --git a/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c b/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c
  1177. index 09e7eaa25aabe..41017b82174bd 100644
  1178. --- a/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c
  1179. +++ b/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c
  1180. @@ -44,7 +44,7 @@ static void handle_enc_encode_msg(struct venc_vpu_inst *vpu, const void *data)
  1181. vpu->is_key_frm = msg->is_key_frm;
  1182. }
  1183.  
  1184. -static void vpu_enc_ipi_handler(void *data, unsigned int len, void *priv)
  1185. +static void vpu_enc_ipi_handler(const void *data, unsigned int len, void *priv)
  1186. {
  1187. const struct venc_vpu_ipi_msg_common *msg = data;
  1188. struct venc_vpu_inst *vpu =
  1189. diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
  1190. index 14170a5d72b35..1bc7fdc2acfa4 100644
  1191. --- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
  1192. +++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
  1193. @@ -90,8 +90,10 @@ static void pvr2_context_destroy(struct pvr2_context *mp)
  1194. }
  1195.  
  1196.  
  1197. -static void pvr2_context_notify(struct pvr2_context *mp)
  1198. +static void pvr2_context_notify(void *ptr)
  1199. {
  1200. + struct pvr2_context *mp = ptr;
  1201. +
  1202. pvr2_context_set_notify(mp,!0);
  1203. }
  1204.  
  1205. @@ -106,9 +108,7 @@ static void pvr2_context_check(struct pvr2_context *mp)
  1206. pvr2_trace(PVR2_TRACE_CTXT,
  1207. "pvr2_context %p (initialize)", mp);
  1208. /* Finish hardware initialization */
  1209. - if (pvr2_hdw_initialize(mp->hdw,
  1210. - (void (*)(void *))pvr2_context_notify,
  1211. - mp)) {
  1212. + if (pvr2_hdw_initialize(mp->hdw, pvr2_context_notify, mp)) {
  1213. mp->video_stream.stream =
  1214. pvr2_hdw_get_video_stream(mp->hdw);
  1215. /* Trigger interface initialization. By doing this
  1216. diff --git a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
  1217. index 26811efe0fb58..9a9bae21c6147 100644
  1218. --- a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
  1219. +++ b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
  1220. @@ -88,8 +88,10 @@ static int pvr2_dvb_feed_thread(void *data)
  1221. return stat;
  1222. }
  1223.  
  1224. -static void pvr2_dvb_notify(struct pvr2_dvb_adapter *adap)
  1225. +static void pvr2_dvb_notify(void *ptr)
  1226. {
  1227. + struct pvr2_dvb_adapter *adap = ptr;
  1228. +
  1229. wake_up(&adap->buffer_wait_data);
  1230. }
  1231.  
  1232. @@ -149,7 +151,7 @@ static int pvr2_dvb_stream_do_start(struct pvr2_dvb_adapter *adap)
  1233. }
  1234.  
  1235. pvr2_stream_set_callback(pvr->video_stream.stream,
  1236. - (pvr2_stream_callback) pvr2_dvb_notify, adap);
  1237. + pvr2_dvb_notify, adap);
  1238.  
  1239. ret = pvr2_stream_set_buffer_count(stream, PVR2_DVB_BUFFER_COUNT);
  1240. if (ret < 0) return ret;
  1241. diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
  1242. index c04ab7258d645..b305ae7ed4150 100644
  1243. --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
  1244. +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
  1245. @@ -1033,8 +1033,10 @@ static int pvr2_v4l2_open(struct file *file)
  1246. }
  1247.  
  1248.  
  1249. -static void pvr2_v4l2_notify(struct pvr2_v4l2_fh *fhp)
  1250. +static void pvr2_v4l2_notify(void *ptr)
  1251. {
  1252. + struct pvr2_v4l2_fh *fhp = ptr;
  1253. +
  1254. wake_up(&fhp->wait_data);
  1255. }
  1256.  
  1257. @@ -1067,7 +1069,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
  1258.  
  1259. hdw = fh->channel.mc_head->hdw;
  1260. sp = fh->pdi->stream->stream;
  1261. - pvr2_stream_set_callback(sp,(pvr2_stream_callback)pvr2_v4l2_notify,fh);
  1262. + pvr2_stream_set_callback(sp, pvr2_v4l2_notify, fh);
  1263. pvr2_hdw_set_stream_type(hdw,fh->pdi->config);
  1264. if ((ret = pvr2_hdw_set_streaming(hdw,!0)) < 0) return ret;
  1265. return pvr2_ioread_set_enabled(fh->rhp,!0);
  1266. diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
  1267. index 39c4615361812..d4202a0dacca5 100644
  1268. --- a/drivers/mfd/Makefile
  1269. +++ b/drivers/mfd/Makefile
  1270. @@ -276,7 +276,5 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC_PMCI) += intel-m10-bmc-pmci.o
  1271. obj-$(CONFIG_MFD_ATC260X) += atc260x-core.o
  1272. obj-$(CONFIG_MFD_ATC260X_I2C) += atc260x-i2c.o
  1273.  
  1274. -rsmu-i2c-objs := rsmu_core.o rsmu_i2c.o
  1275. -rsmu-spi-objs := rsmu_core.o rsmu_spi.o
  1276. -obj-$(CONFIG_MFD_RSMU_I2C) += rsmu-i2c.o
  1277. -obj-$(CONFIG_MFD_RSMU_SPI) += rsmu-spi.o
  1278. +obj-$(CONFIG_MFD_RSMU_I2C) += rsmu_i2c.o rsmu_core.o
  1279. +obj-$(CONFIG_MFD_RSMU_SPI) += rsmu_spi.o rsmu_core.o
  1280. diff --git a/drivers/mfd/rsmu_core.c b/drivers/mfd/rsmu_core.c
  1281. index 29437fd0bd5bf..fd04a6e5dfa31 100644
  1282. --- a/drivers/mfd/rsmu_core.c
  1283. +++ b/drivers/mfd/rsmu_core.c
  1284. @@ -78,11 +78,13 @@ int rsmu_core_init(struct rsmu_ddata *rsmu)
  1285.  
  1286. return ret;
  1287. }
  1288. +EXPORT_SYMBOL_GPL(rsmu_core_init);
  1289.  
  1290. void rsmu_core_exit(struct rsmu_ddata *rsmu)
  1291. {
  1292. mutex_destroy(&rsmu->lock);
  1293. }
  1294. +EXPORT_SYMBOL_GPL(rsmu_core_exit);
  1295.  
  1296. MODULE_DESCRIPTION("Renesas SMU core driver");
  1297. MODULE_LICENSE("GPL");
  1298. diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c
  1299. index b3136ae6f4e94..de8290ba8e6d8 100644
  1300. --- a/drivers/mtd/nand/raw/lpc32xx_mlc.c
  1301. +++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c
  1302. @@ -303,8 +303,9 @@ static int lpc32xx_nand_device_ready(struct nand_chip *nand_chip)
  1303. return 0;
  1304. }
  1305.  
  1306. -static irqreturn_t lpc3xxx_nand_irq(int irq, struct lpc32xx_nand_host *host)
  1307. +static irqreturn_t lpc3xxx_nand_irq(int irq, void *data)
  1308. {
  1309. + struct lpc32xx_nand_host *host = data;
  1310. uint8_t sr;
  1311.  
  1312. /* Clear interrupt flag by reading status */
  1313. diff --git a/drivers/mtd/tests/Makefile b/drivers/mtd/tests/Makefile
  1314. index 5de0378f90dbd..7dae831ee8b6b 100644
  1315. --- a/drivers/mtd/tests/Makefile
  1316. +++ b/drivers/mtd/tests/Makefile
  1317. @@ -1,19 +1,19 @@
  1318. # SPDX-License-Identifier: GPL-2.0
  1319. -obj-$(CONFIG_MTD_TESTS) += mtd_oobtest.o
  1320. -obj-$(CONFIG_MTD_TESTS) += mtd_pagetest.o
  1321. -obj-$(CONFIG_MTD_TESTS) += mtd_readtest.o
  1322. -obj-$(CONFIG_MTD_TESTS) += mtd_speedtest.o
  1323. -obj-$(CONFIG_MTD_TESTS) += mtd_stresstest.o
  1324. -obj-$(CONFIG_MTD_TESTS) += mtd_subpagetest.o
  1325. -obj-$(CONFIG_MTD_TESTS) += mtd_torturetest.o
  1326. -obj-$(CONFIG_MTD_TESTS) += mtd_nandecctest.o
  1327. -obj-$(CONFIG_MTD_TESTS) += mtd_nandbiterrs.o
  1328. +obj-$(CONFIG_MTD_TESTS) += mtd_oobtest.o mtd_test.o
  1329. +obj-$(CONFIG_MTD_TESTS) += mtd_pagetest.o mtd_test.o
  1330. +obj-$(CONFIG_MTD_TESTS) += mtd_readtest.o mtd_test.o
  1331. +obj-$(CONFIG_MTD_TESTS) += mtd_speedtest.o mtd_test.o
  1332. +obj-$(CONFIG_MTD_TESTS) += mtd_stresstest.o mtd_test.o
  1333. +obj-$(CONFIG_MTD_TESTS) += mtd_subpagetest.o mtd_test.o
  1334. +obj-$(CONFIG_MTD_TESTS) += mtd_torturetest.o mtd_test.o
  1335. +obj-$(CONFIG_MTD_TESTS) += mtd_nandecctest.o mtd_test.o
  1336. +obj-$(CONFIG_MTD_TESTS) += mtd_nandbiterrs.o mtd_test.o
  1337.  
  1338. -mtd_oobtest-objs := oobtest.o mtd_test.o
  1339. -mtd_pagetest-objs := pagetest.o mtd_test.o
  1340. -mtd_readtest-objs := readtest.o mtd_test.o
  1341. -mtd_speedtest-objs := speedtest.o mtd_test.o
  1342. -mtd_stresstest-objs := stresstest.o mtd_test.o
  1343. -mtd_subpagetest-objs := subpagetest.o mtd_test.o
  1344. -mtd_torturetest-objs := torturetest.o mtd_test.o
  1345. -mtd_nandbiterrs-objs := nandbiterrs.o mtd_test.o
  1346. +mtd_oobtest-objs := oobtest.o
  1347. +mtd_pagetest-objs := pagetest.o
  1348. +mtd_readtest-objs := readtest.o
  1349. +mtd_speedtest-objs := speedtest.o
  1350. +mtd_stresstest-objs := stresstest.o
  1351. +mtd_subpagetest-objs := subpagetest.o
  1352. +mtd_torturetest-objs := torturetest.o
  1353. +mtd_nandbiterrs-objs := nandbiterrs.o
  1354. diff --git a/drivers/mtd/tests/mtd_test.c b/drivers/mtd/tests/mtd_test.c
  1355. index c84250beffdc9..7ce5129a4502f 100644
  1356. --- a/drivers/mtd/tests/mtd_test.c
  1357. +++ b/drivers/mtd/tests/mtd_test.c
  1358. @@ -25,6 +25,7 @@ int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum)
  1359.  
  1360. return 0;
  1361. }
  1362. +EXPORT_SYMBOL_GPL(mtdtest_erase_eraseblock);
  1363.  
  1364. static int is_block_bad(struct mtd_info *mtd, unsigned int ebnum)
  1365. {
  1366. @@ -57,6 +58,7 @@ int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
  1367.  
  1368. return 0;
  1369. }
  1370. +EXPORT_SYMBOL_GPL(mtdtest_scan_for_bad_eraseblocks);
  1371.  
  1372. int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
  1373. unsigned int eb, int ebcnt)
  1374. @@ -75,6 +77,7 @@ int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
  1375.  
  1376. return 0;
  1377. }
  1378. +EXPORT_SYMBOL_GPL(mtdtest_erase_good_eraseblocks);
  1379.  
  1380. int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf)
  1381. {
  1382. @@ -92,6 +95,7 @@ int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf)
  1383.  
  1384. return err;
  1385. }
  1386. +EXPORT_SYMBOL_GPL(mtdtest_read);
  1387.  
  1388. int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
  1389. const void *buf)
  1390. @@ -107,3 +111,6 @@ int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
  1391.  
  1392. return err;
  1393. }
  1394. +EXPORT_SYMBOL_GPL(mtdtest_write);
  1395. +
  1396. +MODULE_LICENSE("GPL");
  1397. diff --git a/drivers/net/ethernet/3com/typhoon.h b/drivers/net/ethernet/3com/typhoon.h
  1398. index 38e6dcab4e941..1ee8d1643e082 100644
  1399. --- a/drivers/net/ethernet/3com/typhoon.h
  1400. +++ b/drivers/net/ethernet/3com/typhoon.h
  1401. @@ -171,7 +171,7 @@ struct tx_desc {
  1402. __le32 addr;
  1403. __le32 addrHi;
  1404. } frag;
  1405. - u64 tx_addr; /* opaque for hardware, for TX_DESC */
  1406. + u64 tx_addr __packed; /* opaque for hardware, for TX_DESC */
  1407. };
  1408. __le32 processFlags;
  1409. #define TYPHOON_TX_PF_NO_CRC cpu_to_le32(0x00000001)
  1410. @@ -187,7 +187,7 @@ struct tx_desc {
  1411. #define TYPHOON_TX_PF_VLAN_MASK cpu_to_le32(0x0ffff000)
  1412. #define TYPHOON_TX_PF_INTERNAL cpu_to_le32(0xf0000000)
  1413. #define TYPHOON_TX_PF_VLAN_TAG_SHIFT 12
  1414. -} __packed;
  1415. +} __packed __aligned(4);
  1416.  
  1417. /* The TCP Segmentation offload option descriptor
  1418. *
  1419. diff --git a/drivers/net/ethernet/brocade/bna/bfa_cs.h b/drivers/net/ethernet/brocade/bna/bfa_cs.h
  1420. index 858c921294517..d7bca7a4cf2e0 100644
  1421. --- a/drivers/net/ethernet/brocade/bna/bfa_cs.h
  1422. +++ b/drivers/net/ethernet/brocade/bna/bfa_cs.h
  1423. @@ -56,9 +56,6 @@ BFA_SM_TABLE(rx, bna_rx, bna_rx_event, bna_fsm_rx_t)
  1424.  
  1425. #define BFA_SM(_sm) (_sm)
  1426.  
  1427. -/* State machine with entry actions. */
  1428. -typedef void (*bfa_fsm_t)(void *fsm, int event);
  1429. -
  1430. /* oc - object class eg. bfa_ioc
  1431. * st - state, eg. reset
  1432. * otype - object type, eg. struct bfa_ioc
  1433. diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
  1434. index d6d90f9722a7e..757d430253b5e 100644
  1435. --- a/drivers/net/ethernet/brocade/bna/bnad.c
  1436. +++ b/drivers/net/ethernet/brocade/bna/bnad.c
  1437. @@ -1092,10 +1092,10 @@ bnad_cb_tx_resume(struct bnad *bnad, struct bna_tx *tx)
  1438. * Free all TxQs buffers and then notify TX_E_CLEANUP_DONE to Tx fsm.
  1439. */
  1440. static void
  1441. -bnad_tx_cleanup(struct delayed_work *work)
  1442. +bnad_tx_cleanup(struct work_struct *work)
  1443. {
  1444. struct bnad_tx_info *tx_info =
  1445. - container_of(work, struct bnad_tx_info, tx_cleanup_work);
  1446. + container_of(work, struct bnad_tx_info, tx_cleanup_work.work);
  1447. struct bnad *bnad = NULL;
  1448. struct bna_tcb *tcb;
  1449. unsigned long flags;
  1450. @@ -1171,7 +1171,7 @@ bnad_cb_rx_stall(struct bnad *bnad, struct bna_rx *rx)
  1451. * Free all RxQs buffers and then notify RX_E_CLEANUP_DONE to Rx fsm.
  1452. */
  1453. static void
  1454. -bnad_rx_cleanup(void *work)
  1455. +bnad_rx_cleanup(struct work_struct *work)
  1456. {
  1457. struct bnad_rx_info *rx_info =
  1458. container_of(work, struct bnad_rx_info, rx_cleanup_work);
  1459. @@ -1992,8 +1992,7 @@ bnad_setup_tx(struct bnad *bnad, u32 tx_id)
  1460. }
  1461. tx_info->tx = tx;
  1462.  
  1463. - INIT_DELAYED_WORK(&tx_info->tx_cleanup_work,
  1464. - (work_func_t)bnad_tx_cleanup);
  1465. + INIT_DELAYED_WORK(&tx_info->tx_cleanup_work, bnad_tx_cleanup);
  1466.  
  1467. /* Register ISR for the Tx object */
  1468. if (intr_info->intr_type == BNA_INTR_T_MSIX) {
  1469. @@ -2249,8 +2248,7 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_id)
  1470. rx_info->rx = rx;
  1471. spin_unlock_irqrestore(&bnad->bna_lock, flags);
  1472.  
  1473. - INIT_WORK(&rx_info->rx_cleanup_work,
  1474. - (work_func_t)(bnad_rx_cleanup));
  1475. + INIT_WORK(&rx_info->rx_cleanup_work, bnad_rx_cleanup);
  1476.  
  1477. /*
  1478. * Init NAPI, so that state is set to NAPI_STATE_SCHED,
  1479. diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
  1480. index 068ed52b66c94..90669bc734508 100644
  1481. --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
  1482. +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
  1483. @@ -1459,9 +1459,9 @@ void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx,
  1484. EXPORT_SYMBOL_GPL(cn23xx_tell_vf_its_macaddr_changed);
  1485.  
  1486. static void
  1487. -cn23xx_get_vf_stats_callback(struct octeon_device *oct,
  1488. - struct octeon_mbox_cmd *cmd, void *arg)
  1489. +cn23xx_get_vf_stats_callback(void *octp, void *cmdp, void *arg)
  1490. {
  1491. + struct octeon_mbox_cmd *cmd = cmdp;
  1492. struct oct_vf_stats_ctx *ctx = arg;
  1493.  
  1494. memcpy(ctx->stats, cmd->data, sizeof(struct oct_vf_stats));
  1495. @@ -1490,7 +1490,7 @@ int cn23xx_get_vf_stats(struct octeon_device *oct, int vfidx,
  1496. mbox_cmd.q_no = vfidx * oct->sriov_info.rings_per_vf;
  1497. mbox_cmd.recv_len = 0;
  1498. mbox_cmd.recv_status = 0;
  1499. - mbox_cmd.fn = (octeon_mbox_callback_t)cn23xx_get_vf_stats_callback;
  1500. + mbox_cmd.fn = cn23xx_get_vf_stats_callback;
  1501. ctx.stats = stats;
  1502. atomic_set(&ctx.status, 0);
  1503. mbox_cmd.fn_arg = (void *)&ctx;
  1504. diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
  1505. index dd5d80fee24f0..910a09c4f641c 100644
  1506. --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
  1507. +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c
  1508. @@ -386,10 +386,10 @@ void cn23xx_vf_ask_pf_to_do_flr(struct octeon_device *oct)
  1509. }
  1510. EXPORT_SYMBOL_GPL(cn23xx_vf_ask_pf_to_do_flr);
  1511.  
  1512. -static void octeon_pfvf_hs_callback(struct octeon_device *oct,
  1513. - struct octeon_mbox_cmd *cmd,
  1514. - void *arg)
  1515. +static void octeon_pfvf_hs_callback(void *octp, void *cmdp, void *arg)
  1516. {
  1517. + struct octeon_device *oct = octp;
  1518. + struct octeon_mbox_cmd *cmd = cmdp;
  1519. u32 major = 0;
  1520.  
  1521. memcpy((uint8_t *)&oct->pfvf_hsword, cmd->msg.s.params,
  1522. @@ -429,7 +429,7 @@ int cn23xx_octeon_pfvf_handshake(struct octeon_device *oct)
  1523. mbox_cmd.q_no = 0;
  1524. mbox_cmd.recv_len = 0;
  1525. mbox_cmd.recv_status = 0;
  1526. - mbox_cmd.fn = (octeon_mbox_callback_t)octeon_pfvf_hs_callback;
  1527. + mbox_cmd.fn = octeon_pfvf_hs_callback;
  1528. mbox_cmd.fn_arg = &status;
  1529.  
  1530. octeon_mbox_write(oct, &mbox_cmd);
  1531. diff --git a/drivers/net/ethernet/sfc/falcon/selftest.c b/drivers/net/ethernet/sfc/falcon/selftest.c
  1532. index 6a454ac6f8763..bc3d6e098a2f2 100644
  1533. --- a/drivers/net/ethernet/sfc/falcon/selftest.c
  1534. +++ b/drivers/net/ethernet/sfc/falcon/selftest.c
  1535. @@ -40,7 +40,26 @@
  1536. */
  1537. struct ef4_loopback_payload {
  1538. struct ethhdr header;
  1539. - struct iphdr ip;
  1540. + struct {
  1541. +#if defined(__LITTLE_ENDIAN_BITFIELD)
  1542. + __u8 ihl:4,
  1543. + version:4;
  1544. +#elif defined (__BIG_ENDIAN_BITFIELD)
  1545. + __u8 version:4,
  1546. + ihl:4;
  1547. +#else
  1548. +#error "Please fix <asm/byteorder.h>"
  1549. +#endif
  1550. + __u8 tos;
  1551. + __be16 tot_len;
  1552. + __be16 id;
  1553. + __be16 frag_off;
  1554. + __u8 ttl;
  1555. + __u8 protocol;
  1556. + __sum16 check;
  1557. + __be32 saddr;
  1558. + __be32 daddr;
  1559. + } __packed ip; /* unaligned struct iphdr */
  1560. struct udphdr udp;
  1561. __be16 iteration;
  1562. char msg[64];
  1563. diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
  1564. index 3c5227afd4977..8ac9d81436de4 100644
  1565. --- a/drivers/net/ethernet/sfc/selftest.c
  1566. +++ b/drivers/net/ethernet/sfc/selftest.c
  1567. @@ -43,7 +43,26 @@
  1568. */
  1569. struct efx_loopback_payload {
  1570. struct ethhdr header;
  1571. - struct iphdr ip;
  1572. + struct {
  1573. +#if defined(__LITTLE_ENDIAN_BITFIELD)
  1574. + __u8 ihl:4,
  1575. + version:4;
  1576. +#elif defined (__BIG_ENDIAN_BITFIELD)
  1577. + __u8 version:4,
  1578. + ihl:4;
  1579. +#else
  1580. +#error "Please fix <asm/byteorder.h>"
  1581. +#endif
  1582. + __u8 tos;
  1583. + __be16 tot_len;
  1584. + __be16 id;
  1585. + __be16 frag_off;
  1586. + __u8 ttl;
  1587. + __u8 protocol;
  1588. + __sum16 check;
  1589. + __be32 saddr;
  1590. + __be32 daddr;
  1591. + } __packed ip; /* unaligned struct iphdr */
  1592. struct udphdr udp;
  1593. __be16 iteration;
  1594. char msg[64];
  1595. diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c
  1596. index ccc621b8ed9f2..4a1fe982a948e 100644
  1597. --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c
  1598. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c
  1599. @@ -383,8 +383,9 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)
  1600. return sh;
  1601. }
  1602.  
  1603. -static void wlc_phy_timercb_phycal(struct brcms_phy *pi)
  1604. +static void wlc_phy_timercb_phycal(void *ptr)
  1605. {
  1606. + struct brcms_phy *pi = ptr;
  1607. uint delay = 5;
  1608.  
  1609. if (PHY_PERICAL_MPHASE_PENDING(pi)) {
  1610. diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c
  1611. index a0de5db0cd646..b723817915365 100644
  1612. --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c
  1613. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c
  1614. @@ -57,12 +57,11 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim)
  1615. }
  1616.  
  1617. struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
  1618. - void (*fn)(struct brcms_phy *pi),
  1619. + void (*fn)(void *pi),
  1620. void *arg, const char *name)
  1621. {
  1622. return (struct wlapi_timer *)
  1623. - brcms_init_timer(physhim->wl, (void (*)(void *))fn,
  1624. - arg, name);
  1625. + brcms_init_timer(physhim->wl, fn, arg, name);
  1626. }
  1627.  
  1628. void wlapi_free_timer(struct wlapi_timer *t)
  1629. diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h
  1630. index dd8774717adee..27d0934e600ed 100644
  1631. --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h
  1632. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h
  1633. @@ -131,7 +131,7 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim);
  1634.  
  1635. /* PHY to WL utility functions */
  1636. struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
  1637. - void (*fn)(struct brcms_phy *pi),
  1638. + void (*fn)(void *pi),
  1639. void *arg, const char *name);
  1640. void wlapi_free_timer(struct wlapi_timer *t);
  1641. void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
  1642. diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c
  1643. index b19c39dcfbd93..839bad09cdff8 100644
  1644. --- a/drivers/nfc/pn533/pn533.c
  1645. +++ b/drivers/nfc/pn533/pn533.c
  1646. @@ -778,7 +778,9 @@ static int pn533_target_found_felica(struct nfc_target *nfc_tgt, u8 *tgt_data,
  1647. else
  1648. nfc_tgt->supported_protocols = NFC_PROTO_FELICA_MASK;
  1649.  
  1650. - memcpy(nfc_tgt->sensf_res, &tgt_felica->opcode, 9);
  1651. + nfc_tgt->sensf_res[0] = tgt_felica->opcode;
  1652. + memcpy(&nfc_tgt->sensf_res[1], &tgt_felica->nfcid2,
  1653. + sizeof(tgt_felica->nfcid2));
  1654. nfc_tgt->sensf_res_len = 9;
  1655.  
  1656. memcpy(nfc_tgt->nfcid2, tgt_felica->nfcid2, NFC_NFCID2_MAXSIZE);
  1657. diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c
  1658. index d6b533497ce1a..660a0e78070c7 100644
  1659. --- a/drivers/nvmem/meson-efuse.c
  1660. +++ b/drivers/nvmem/meson-efuse.c
  1661. @@ -38,6 +38,11 @@ static const struct of_device_id meson_efuse_match[] = {
  1662. };
  1663. MODULE_DEVICE_TABLE(of, meson_efuse_match);
  1664.  
  1665. +static void meson_efuse_clk_disable(void *clk)
  1666. +{
  1667. + clk_disable_unprepare(clk);
  1668. +}
  1669. +
  1670. static int meson_efuse_probe(struct platform_device *pdev)
  1671. {
  1672. struct device *dev = &pdev->dev;
  1673. @@ -74,9 +79,7 @@ static int meson_efuse_probe(struct platform_device *pdev)
  1674. return ret;
  1675. }
  1676.  
  1677. - ret = devm_add_action_or_reset(dev,
  1678. - (void(*)(void *))clk_disable_unprepare,
  1679. - clk);
  1680. + ret = devm_add_action_or_reset(dev, meson_efuse_clk_disable, clk);
  1681. if (ret) {
  1682. dev_err(dev, "failed to add disable callback");
  1683. return ret;
  1684. diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
  1685. index c1527693bed93..2f5359f04920b 100644
  1686. --- a/drivers/pci/controller/dwc/pci-meson.c
  1687. +++ b/drivers/pci/controller/dwc/pci-meson.c
  1688. @@ -163,6 +163,11 @@ static int meson_pcie_reset(struct meson_pcie *mp)
  1689. return 0;
  1690. }
  1691.  
  1692. +static void meson_pcie_clk_disable(void *clk)
  1693. +{
  1694. + clk_disable_unprepare(clk);
  1695. +}
  1696. +
  1697. static inline struct clk *meson_pcie_probe_clock(struct device *dev,
  1698. const char *id, u64 rate)
  1699. {
  1700. @@ -187,9 +192,7 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev,
  1701. return ERR_PTR(ret);
  1702. }
  1703.  
  1704. - devm_add_action_or_reset(dev,
  1705. - (void (*) (void *))clk_disable_unprepare,
  1706. - clk);
  1707. + devm_add_action_or_reset(dev, meson_pcie_clk_disable, clk);
  1708.  
  1709. return clk;
  1710. }
  1711. diff --git a/drivers/pci/controller/dwc/pcie-keembay.c b/drivers/pci/controller/dwc/pcie-keembay.c
  1712. index f90f36bac0185..d6e5c2e4bb007 100644
  1713. --- a/drivers/pci/controller/dwc/pcie-keembay.c
  1714. +++ b/drivers/pci/controller/dwc/pcie-keembay.c
  1715. @@ -148,6 +148,11 @@ static const struct dw_pcie_ops keembay_pcie_ops = {
  1716. .stop_link = keembay_pcie_stop_link,
  1717. };
  1718.  
  1719. +static void keembay_pci_clk_disable(void *clk)
  1720. +{
  1721. + clk_disable_unprepare(clk);
  1722. +}
  1723. +
  1724. static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
  1725. const char *id, u64 rate)
  1726. {
  1727. @@ -168,9 +173,7 @@ static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
  1728. if (ret)
  1729. return ERR_PTR(ret);
  1730.  
  1731. - ret = devm_add_action_or_reset(dev,
  1732. - (void(*)(void *))clk_disable_unprepare,
  1733. - clk);
  1734. + ret = devm_add_action_or_reset(dev, keembay_pci_clk_disable, clk);
  1735. if (ret)
  1736. return ERR_PTR(ret);
  1737.  
  1738. diff --git a/drivers/pci/controller/pcie-microchip-host.c b/drivers/pci/controller/pcie-microchip-host.c
  1739. index 5e710e4854646..33efec4d3ccfc 100644
  1740. --- a/drivers/pci/controller/pcie-microchip-host.c
  1741. +++ b/drivers/pci/controller/pcie-microchip-host.c
  1742. @@ -848,6 +848,11 @@ static const struct irq_domain_ops event_domain_ops = {
  1743. .map = mc_pcie_event_map,
  1744. };
  1745.  
  1746. +static void mc_pcie_clk_disable(void *clk)
  1747. +{
  1748. + clk_disable_unprepare(clk);
  1749. +}
  1750. +
  1751. static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
  1752. {
  1753. struct clk *clk;
  1754. @@ -863,8 +868,7 @@ static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
  1755. if (ret)
  1756. return ERR_PTR(ret);
  1757.  
  1758. - devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare,
  1759. - clk);
  1760. + devm_add_action_or_reset(dev, mc_pcie_clk_disable, clk);
  1761.  
  1762. return clk;
  1763. }
  1764. diff --git a/drivers/platform/x86/intel/int3472/Makefile b/drivers/platform/x86/intel/int3472/Makefile
  1765. index 9f16cb5143973..a8aba07bf1dc2 100644
  1766. --- a/drivers/platform/x86/intel/int3472/Makefile
  1767. +++ b/drivers/platform/x86/intel/int3472/Makefile
  1768. @@ -1,4 +1,7 @@
  1769. obj-$(CONFIG_INTEL_SKL_INT3472) += intel_skl_int3472_discrete.o \
  1770. - intel_skl_int3472_tps68470.o
  1771. -intel_skl_int3472_discrete-y := discrete.o clk_and_regulator.o led.o common.o
  1772. -intel_skl_int3472_tps68470-y := tps68470.o tps68470_board_data.o common.o
  1773. + intel_skl_int3472_tps68470.o \
  1774. + intel_skl_int3472_common.o
  1775. +intel_skl_int3472_discrete-y := discrete.o clk_and_regulator.o led.o
  1776. +intel_skl_int3472_tps68470-y := tps68470.o tps68470_board_data.o
  1777. +
  1778. +intel_skl_int3472_common-y += common.o
  1779. diff --git a/drivers/platform/x86/intel/int3472/common.c b/drivers/platform/x86/intel/int3472/common.c
  1780. index 9db2bb0bbba4b..2262234ff71e4 100644
  1781. --- a/drivers/platform/x86/intel/int3472/common.c
  1782. +++ b/drivers/platform/x86/intel/int3472/common.c
  1783. @@ -29,6 +29,7 @@ union acpi_object *skl_int3472_get_acpi_buffer(struct acpi_device *adev, char *i
  1784.  
  1785. return obj;
  1786. }
  1787. +EXPORT_SYMBOL_GPL(skl_int3472_get_acpi_buffer);
  1788.  
  1789. int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb)
  1790. {
  1791. @@ -52,6 +53,7 @@ int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb)
  1792. kfree(obj);
  1793. return ret;
  1794. }
  1795. +EXPORT_SYMBOL_GPL(skl_int3472_fill_cldb);
  1796.  
  1797. /* sensor_adev_ret may be NULL, name_ret must not be NULL */
  1798. int skl_int3472_get_sensor_adev_and_name(struct device *dev,
  1799. @@ -80,3 +82,6 @@ int skl_int3472_get_sensor_adev_and_name(struct device *dev,
  1800.  
  1801. return ret;
  1802. }
  1803. +EXPORT_SYMBOL_GPL(skl_int3472_get_sensor_adev_and_name);
  1804. +
  1805. +MODULE_LICENSE("GPL");
  1806. diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
  1807. index dcc94ee2458d8..b39e2ca3c2322 100644
  1808. --- a/drivers/remoteproc/mtk_scp.c
  1809. +++ b/drivers/remoteproc/mtk_scp.c
  1810. @@ -72,10 +72,10 @@ static void scp_wdt_handler(struct mtk_scp *scp, u32 scp_to_host)
  1811. rproc_report_crash(scp->rproc, RPROC_WATCHDOG);
  1812. }
  1813.  
  1814. -static void scp_init_ipi_handler(void *data, unsigned int len, void *priv)
  1815. +static void scp_init_ipi_handler(const void *data, unsigned int len, void *priv)
  1816. {
  1817. struct mtk_scp *scp = priv;
  1818. - struct scp_run *run = data;
  1819. + struct scp_run *run = (void *)data;
  1820.  
  1821. scp->run.signaled = run->signaled;
  1822. strscpy(scp->run.fw_ver, run->fw_ver, SCP_FW_VER_LEN);
  1823. diff --git a/drivers/rpmsg/mtk_rpmsg.c b/drivers/rpmsg/mtk_rpmsg.c
  1824. index d1213c33da204..6ab98e429cc34 100644
  1825. --- a/drivers/rpmsg/mtk_rpmsg.c
  1826. +++ b/drivers/rpmsg/mtk_rpmsg.c
  1827. @@ -69,13 +69,13 @@ static void __mtk_ept_release(struct kref *kref)
  1828. kfree(to_mtk_rpmsg_endpoint(ept));
  1829. }
  1830.  
  1831. -static void mtk_rpmsg_ipi_handler(void *data, unsigned int len, void *priv)
  1832. +static void mtk_rpmsg_ipi_handler(const void *data, unsigned int len, void *priv)
  1833. {
  1834. struct mtk_rpmsg_endpoint *mept = priv;
  1835. struct rpmsg_endpoint *ept = &mept->ept;
  1836. int ret;
  1837.  
  1838. - ret = (*ept->cb)(ept->rpdev, data, len, ept->priv, ept->addr);
  1839. + ret = (*ept->cb)(ept->rpdev, (void *)data, len, ept->priv, ept->addr);
  1840. if (ret)
  1841. dev_warn(&ept->rpdev->dev, "rpmsg handler return error = %d",
  1842. ret);
  1843. diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
  1844. index 5e115e8b2ba46..7d5a155073c62 100644
  1845. --- a/drivers/scsi/aacraid/aacraid.h
  1846. +++ b/drivers/scsi/aacraid/aacraid.h
  1847. @@ -2617,7 +2617,7 @@ struct aac_hba_info {
  1848. struct aac_aifcmd {
  1849. __le32 command; /* Tell host what type of notify this is */
  1850. __le32 seqnum; /* To allow ordering of reports (if necessary) */
  1851. - u8 data[1]; /* Undefined length (from kernel viewpoint) */
  1852. + u8 data[]; /* Undefined length (from kernel viewpoint) */
  1853. };
  1854.  
  1855. /**
  1856. diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h
  1857. index 6b606bf589b42..b6666c18e6e4c 100644
  1858. --- a/drivers/scsi/bfa/bfa_cs.h
  1859. +++ b/drivers/scsi/bfa/bfa_cs.h
  1860. @@ -200,7 +200,7 @@ struct bfa_sm_table_s {
  1861. int state; /* state machine encoding */
  1862. char *name; /* state name for display */
  1863. };
  1864. -#define BFA_SM(_sm) ((bfa_sm_t)(_sm))
  1865. +#define BFA_SM(_sm) (_sm)
  1866.  
  1867. /*
  1868. * State machine with entry actions.
  1869. @@ -218,7 +218,7 @@ typedef void (*bfa_fsm_t)(void *fsm, int event);
  1870. static void oc ## _sm_ ## st ## _entry(otype * fsm)
  1871.  
  1872. #define bfa_fsm_set_state(_fsm, _state) do { \
  1873. - (_fsm)->fsm = (bfa_fsm_t)(_state); \
  1874. + (_fsm)->fsm = (_state); \
  1875. _state ## _entry(_fsm); \
  1876. } while (0)
  1877.  
  1878. diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
  1879. index e1ed1424fddb2..a4d678e0074d5 100644
  1880. --- a/drivers/scsi/bfa/bfa_ioc.c
  1881. +++ b/drivers/scsi/bfa/bfa_ioc.c
  1882. @@ -114,21 +114,6 @@ static enum bfi_ioc_img_ver_cmp_e bfa_ioc_flash_fwver_cmp(
  1883. /*
  1884. * IOC state machine definitions/declarations
  1885. */
  1886. -enum ioc_event {
  1887. - IOC_E_RESET = 1, /* IOC reset request */
  1888. - IOC_E_ENABLE = 2, /* IOC enable request */
  1889. - IOC_E_DISABLE = 3, /* IOC disable request */
  1890. - IOC_E_DETACH = 4, /* driver detach cleanup */
  1891. - IOC_E_ENABLED = 5, /* f/w enabled */
  1892. - IOC_E_FWRSP_GETATTR = 6, /* IOC get attribute response */
  1893. - IOC_E_DISABLED = 7, /* f/w disabled */
  1894. - IOC_E_PFFAILED = 8, /* failure notice by iocpf sm */
  1895. - IOC_E_HBFAIL = 9, /* heartbeat failure */
  1896. - IOC_E_HWERROR = 10, /* hardware error interrupt */
  1897. - IOC_E_TIMEOUT = 11, /* timeout */
  1898. - IOC_E_HWFAILED = 12, /* PCI mapping failure notice */
  1899. -};
  1900. -
  1901. bfa_fsm_state_decl(bfa_ioc, uninit, struct bfa_ioc_s, enum ioc_event);
  1902. bfa_fsm_state_decl(bfa_ioc, reset, struct bfa_ioc_s, enum ioc_event);
  1903. bfa_fsm_state_decl(bfa_ioc, enabling, struct bfa_ioc_s, enum ioc_event);
  1904. @@ -140,7 +125,13 @@ bfa_fsm_state_decl(bfa_ioc, disabling, struct bfa_ioc_s, enum ioc_event);
  1905. bfa_fsm_state_decl(bfa_ioc, disabled, struct bfa_ioc_s, enum ioc_event);
  1906. bfa_fsm_state_decl(bfa_ioc, hwfail, struct bfa_ioc_s, enum ioc_event);
  1907.  
  1908. -static struct bfa_sm_table_s ioc_sm_table[] = {
  1909. +struct bfa_ioc_sm_table {
  1910. + bfa_ioc_sm_t sm; /* state machine function */
  1911. + enum bfa_ioc_state state; /* state machine encoding */
  1912. + char *name; /* state name for display */
  1913. +};
  1914. +
  1915. +static struct bfa_ioc_sm_table ioc_sm_table[] = {
  1916. {BFA_SM(bfa_ioc_sm_uninit), BFA_IOC_UNINIT},
  1917. {BFA_SM(bfa_ioc_sm_reset), BFA_IOC_RESET},
  1918. {BFA_SM(bfa_ioc_sm_enabling), BFA_IOC_ENABLING},
  1919. @@ -153,6 +144,16 @@ static struct bfa_sm_table_s ioc_sm_table[] = {
  1920. {BFA_SM(bfa_ioc_sm_hwfail), BFA_IOC_HWFAIL},
  1921. };
  1922.  
  1923. +static inline enum bfa_ioc_state
  1924. +bfa_ioc_sm_to_state(struct bfa_ioc_sm_table *smt, bfa_ioc_sm_t sm)
  1925. +{
  1926. + int i = 0;
  1927. +
  1928. + while (smt[i].sm && smt[i].sm != sm)
  1929. + i++;
  1930. + return smt[i].state;
  1931. +}
  1932. +
  1933. /*
  1934. * IOCPF state machine definitions/declarations
  1935. */
  1936. @@ -178,24 +179,6 @@ static void bfa_iocpf_timeout(void *ioc_arg);
  1937. static void bfa_iocpf_sem_timeout(void *ioc_arg);
  1938. static void bfa_iocpf_poll_timeout(void *ioc_arg);
  1939.  
  1940. -/*
  1941. - * IOCPF state machine events
  1942. - */
  1943. -enum iocpf_event {
  1944. - IOCPF_E_ENABLE = 1, /* IOCPF enable request */
  1945. - IOCPF_E_DISABLE = 2, /* IOCPF disable request */
  1946. - IOCPF_E_STOP = 3, /* stop on driver detach */
  1947. - IOCPF_E_FWREADY = 4, /* f/w initialization done */
  1948. - IOCPF_E_FWRSP_ENABLE = 5, /* enable f/w response */
  1949. - IOCPF_E_FWRSP_DISABLE = 6, /* disable f/w response */
  1950. - IOCPF_E_FAIL = 7, /* failure notice by ioc sm */
  1951. - IOCPF_E_INITFAIL = 8, /* init fail notice by ioc sm */
  1952. - IOCPF_E_GETATTRFAIL = 9, /* init fail notice by ioc sm */
  1953. - IOCPF_E_SEMLOCKED = 10, /* h/w semaphore is locked */
  1954. - IOCPF_E_TIMEOUT = 11, /* f/w response timeout */
  1955. - IOCPF_E_SEM_ERROR = 12, /* h/w sem mapping error */
  1956. -};
  1957. -
  1958. /*
  1959. * IOCPF states
  1960. */
  1961. @@ -228,7 +211,13 @@ bfa_fsm_state_decl(bfa_iocpf, disabling_sync, struct bfa_iocpf_s,
  1962. enum iocpf_event);
  1963. bfa_fsm_state_decl(bfa_iocpf, disabled, struct bfa_iocpf_s, enum iocpf_event);
  1964.  
  1965. -static struct bfa_sm_table_s iocpf_sm_table[] = {
  1966. +struct bfa_iocpf_sm_table {
  1967. + bfa_iocpf_sm_t sm; /* state machine function */
  1968. + enum bfa_iocpf_state state; /* state machine encoding */
  1969. + char *name; /* state name for display */
  1970. +};
  1971. +
  1972. +static struct bfa_iocpf_sm_table iocpf_sm_table[] = {
  1973. {BFA_SM(bfa_iocpf_sm_reset), BFA_IOCPF_RESET},
  1974. {BFA_SM(bfa_iocpf_sm_fwcheck), BFA_IOCPF_FWMISMATCH},
  1975. {BFA_SM(bfa_iocpf_sm_mismatch), BFA_IOCPF_FWMISMATCH},
  1976. @@ -2815,12 +2804,12 @@ enum bfa_ioc_state
  1977. bfa_ioc_get_state(struct bfa_ioc_s *ioc)
  1978. {
  1979. enum bfa_iocpf_state iocpf_st;
  1980. - enum bfa_ioc_state ioc_st = bfa_sm_to_state(ioc_sm_table, ioc->fsm);
  1981. + enum bfa_ioc_state ioc_st = bfa_ioc_sm_to_state(ioc_sm_table, ioc->fsm);
  1982.  
  1983. if (ioc_st == BFA_IOC_ENABLING ||
  1984. ioc_st == BFA_IOC_FAIL || ioc_st == BFA_IOC_INITFAIL) {
  1985.  
  1986. - iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
  1987. + iocpf_st = bfa_ioc_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
  1988.  
  1989. switch (iocpf_st) {
  1990. case BFA_IOCPF_SEMWAIT:
  1991. diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
  1992. index 933a1c3890ff5..debb5eeec9dcb 100644
  1993. --- a/drivers/scsi/bfa/bfa_ioc.h
  1994. +++ b/drivers/scsi/bfa/bfa_ioc.h
  1995. @@ -260,6 +260,24 @@ struct bfa_ioc_cbfn_s {
  1996. /*
  1997. * IOC event notification mechanism.
  1998. */
  1999. +enum ioc_event {
  2000. + IOC_E_RESET = 1, /* IOC reset request */
  2001. + IOC_E_ENABLE = 2, /* IOC enable request */
  2002. + IOC_E_DISABLE = 3, /* IOC disable request */
  2003. + IOC_E_DETACH = 4, /* driver detach cleanup */
  2004. + IOC_E_ENABLED = 5, /* f/w enabled */
  2005. + IOC_E_FWRSP_GETATTR = 6, /* IOC get attribute response */
  2006. + IOC_E_DISABLED = 7, /* f/w disabled */
  2007. + IOC_E_PFFAILED = 8, /* failure notice by iocpf sm */
  2008. + IOC_E_HBFAIL = 9, /* heartbeat failure */
  2009. + IOC_E_HWERROR = 10, /* hardware error interrupt */
  2010. + IOC_E_TIMEOUT = 11, /* timeout */
  2011. + IOC_E_HWFAILED = 12, /* PCI mapping failure notice */
  2012. +};
  2013. +
  2014. +struct bfa_ioc_s;
  2015. +typedef void (*bfa_ioc_sm_t)(struct bfa_ioc_s *fsm, enum ioc_event);
  2016. +
  2017. enum bfa_ioc_event_e {
  2018. BFA_IOC_E_ENABLED = 1,
  2019. BFA_IOC_E_DISABLED = 2,
  2020. @@ -282,8 +300,29 @@ struct bfa_ioc_notify_s {
  2021. (__notify)->cbarg = (__cbarg); \
  2022. } while (0)
  2023.  
  2024. +/*
  2025. + * IOCPF state machine events
  2026. + */
  2027. +enum iocpf_event {
  2028. + IOCPF_E_ENABLE = 1, /* IOCPF enable request */
  2029. + IOCPF_E_DISABLE = 2, /* IOCPF disable request */
  2030. + IOCPF_E_STOP = 3, /* stop on driver detach */
  2031. + IOCPF_E_FWREADY = 4, /* f/w initialization done */
  2032. + IOCPF_E_FWRSP_ENABLE = 5, /* enable f/w response */
  2033. + IOCPF_E_FWRSP_DISABLE = 6, /* disable f/w response */
  2034. + IOCPF_E_FAIL = 7, /* failure notice by ioc sm */
  2035. + IOCPF_E_INITFAIL = 8, /* init fail notice by ioc sm */
  2036. + IOCPF_E_GETATTRFAIL = 9, /* init fail notice by ioc sm */
  2037. + IOCPF_E_SEMLOCKED = 10, /* h/w semaphore is locked */
  2038. + IOCPF_E_TIMEOUT = 11, /* f/w response timeout */
  2039. + IOCPF_E_SEM_ERROR = 12, /* h/w sem mapping error */
  2040. +};
  2041. +
  2042. +struct bfa_iocpf_s;
  2043. +typedef void (*bfa_iocpf_sm_t)(struct bfa_iocpf_s *fsm, enum iocpf_event);
  2044. +
  2045. struct bfa_iocpf_s {
  2046. - bfa_fsm_t fsm;
  2047. + bfa_iocpf_sm_t fsm;
  2048. struct bfa_ioc_s *ioc;
  2049. bfa_boolean_t fw_mismatch_notified;
  2050. bfa_boolean_t auto_recover;
  2051. @@ -291,7 +330,7 @@ struct bfa_iocpf_s {
  2052. };
  2053.  
  2054. struct bfa_ioc_s {
  2055. - bfa_fsm_t fsm;
  2056. + bfa_ioc_sm_t fsm;
  2057. struct bfa_s *bfa;
  2058. struct bfa_pcidev_s pcidev;
  2059. struct bfa_timer_mod_s *timer_mod;
  2060. diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
  2061. index 62cb7a864fd53..9d2242e8057ea 100644
  2062. --- a/drivers/scsi/bfa/bfad.c
  2063. +++ b/drivers/scsi/bfa/bfad.c
  2064. @@ -142,19 +142,19 @@ module_param(max_rport_logins, int, S_IRUGO | S_IWUSR);
  2065. MODULE_PARM_DESC(max_rport_logins, "Max number of logins to initiator and target rports on a port (physical/logical), default=1024");
  2066.  
  2067. static void
  2068. -bfad_sm_uninit(struct bfad_s *bfad, enum bfad_sm_event event);
  2069. +bfad_sm_uninit(void *bfad, int event);
  2070. static void
  2071. -bfad_sm_created(struct bfad_s *bfad, enum bfad_sm_event event);
  2072. +bfad_sm_created(void *bfad, int event);
  2073. static void
  2074. -bfad_sm_initializing(struct bfad_s *bfad, enum bfad_sm_event event);
  2075. +bfad_sm_initializing(void *bfad, int event);
  2076. static void
  2077. -bfad_sm_operational(struct bfad_s *bfad, enum bfad_sm_event event);
  2078. +bfad_sm_operational(void *bfad, int event);
  2079. static void
  2080. -bfad_sm_stopping(struct bfad_s *bfad, enum bfad_sm_event event);
  2081. +bfad_sm_stopping(void *bfad, int event);
  2082. static void
  2083. -bfad_sm_failed(struct bfad_s *bfad, enum bfad_sm_event event);
  2084. +bfad_sm_failed(void *bfad, int event);
  2085. static void
  2086. -bfad_sm_fcs_exit(struct bfad_s *bfad, enum bfad_sm_event event);
  2087. +bfad_sm_fcs_exit(void *bfad, int event);
  2088.  
  2089. /*
  2090. * Beginning state for the driver instance, awaiting the pci_probe event
  2091. diff --git a/drivers/scsi/csiostor/csio_defs.h b/drivers/scsi/csiostor/csio_defs.h
  2092. index c38017b4af982..e50e93e7fe5a1 100644
  2093. --- a/drivers/scsi/csiostor/csio_defs.h
  2094. +++ b/drivers/scsi/csiostor/csio_defs.h
  2095. @@ -73,7 +73,21 @@ csio_list_deleted(struct list_head *list)
  2096. #define csio_list_prev(elem) (((struct list_head *)(elem))->prev)
  2097.  
  2098. /* State machine */
  2099. -typedef void (*csio_sm_state_t)(void *, uint32_t);
  2100. +struct csio_lnode;
  2101. +
  2102. +/* State machine evets */
  2103. +enum csio_ln_ev {
  2104. + CSIO_LNE_NONE = (uint32_t)0,
  2105. + CSIO_LNE_LINKUP,
  2106. + CSIO_LNE_FAB_INIT_DONE,
  2107. + CSIO_LNE_LINK_DOWN,
  2108. + CSIO_LNE_DOWN_LINK,
  2109. + CSIO_LNE_LOGO,
  2110. + CSIO_LNE_CLOSE,
  2111. + CSIO_LNE_MAX_EVENT,
  2112. +};
  2113. +
  2114. +typedef void (*csio_sm_state_t)(struct csio_lnode *ln, enum csio_ln_ev evt);
  2115.  
  2116. struct csio_sm {
  2117. struct list_head sm_list;
  2118. @@ -83,7 +97,7 @@ struct csio_sm {
  2119. static inline void
  2120. csio_set_state(void *smp, void *state)
  2121. {
  2122. - ((struct csio_sm *)smp)->sm_state = (csio_sm_state_t)state;
  2123. + ((struct csio_sm *)smp)->sm_state = state;
  2124. }
  2125.  
  2126. static inline void
  2127. diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c
  2128. index d5ac938970232..5b3ffefae476d 100644
  2129. --- a/drivers/scsi/csiostor/csio_lnode.c
  2130. +++ b/drivers/scsi/csiostor/csio_lnode.c
  2131. @@ -1095,7 +1095,7 @@ csio_handle_link_down(struct csio_hw *hw, uint8_t portid, uint32_t fcfi,
  2132. int
  2133. csio_is_lnode_ready(struct csio_lnode *ln)
  2134. {
  2135. - return (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_ready));
  2136. + return (csio_get_state(ln) == csio_lns_ready);
  2137. }
  2138.  
  2139. /*****************************************************************************/
  2140. @@ -1366,15 +1366,15 @@ csio_free_fcfinfo(struct kref *kref)
  2141. void
  2142. csio_lnode_state_to_str(struct csio_lnode *ln, int8_t *str)
  2143. {
  2144. - if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_uninit)) {
  2145. + if (csio_get_state(ln) == csio_lns_uninit) {
  2146. strcpy(str, "UNINIT");
  2147. return;
  2148. }
  2149. - if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_ready)) {
  2150. + if (csio_get_state(ln) == csio_lns_ready) {
  2151. strcpy(str, "READY");
  2152. return;
  2153. }
  2154. - if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_offline)) {
  2155. + if (csio_get_state(ln) == csio_lns_offline) {
  2156. strcpy(str, "OFFLINE");
  2157. return;
  2158. }
  2159. diff --git a/drivers/scsi/csiostor/csio_lnode.h b/drivers/scsi/csiostor/csio_lnode.h
  2160. index 372a67d122d38..607698a0f0631 100644
  2161. --- a/drivers/scsi/csiostor/csio_lnode.h
  2162. +++ b/drivers/scsi/csiostor/csio_lnode.h
  2163. @@ -53,19 +53,6 @@
  2164. extern int csio_fcoe_rnodes;
  2165. extern int csio_fdmi_enable;
  2166.  
  2167. -/* State machine evets */
  2168. -enum csio_ln_ev {
  2169. - CSIO_LNE_NONE = (uint32_t)0,
  2170. - CSIO_LNE_LINKUP,
  2171. - CSIO_LNE_FAB_INIT_DONE,
  2172. - CSIO_LNE_LINK_DOWN,
  2173. - CSIO_LNE_DOWN_LINK,
  2174. - CSIO_LNE_LOGO,
  2175. - CSIO_LNE_CLOSE,
  2176. - CSIO_LNE_MAX_EVENT,
  2177. -};
  2178. -
  2179. -
  2180. struct csio_fcf_info {
  2181. struct list_head list;
  2182. uint8_t priority;
  2183. diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
  2184. index 73cd25f30ca58..ea9b4c3d3150b 100644
  2185. --- a/drivers/scsi/pm8001/pm8001_hwi.c
  2186. +++ b/drivers/scsi/pm8001/pm8001_hwi.c
  2187. @@ -3265,8 +3265,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
  2188. phy->sas_phy.oob_mode = SATA_OOB_MODE;
  2189. sas_notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE, GFP_ATOMIC);
  2190. spin_lock_irqsave(&phy->sas_phy.frame_rcvd_lock, flags);
  2191. - memcpy(phy->frame_rcvd, ((u8 *)&pPayload->sata_fis - 4),
  2192. - sizeof(struct dev_to_host_fis));
  2193. + memcpy(phy->frame_rcvd, piomb, sizeof(struct dev_to_host_fis));
  2194. phy->frame_rcvd_size = sizeof(struct dev_to_host_fis);
  2195. phy->identify.target_port_protocols = SAS_PROTOCOL_SATA;
  2196. phy->identify.device_type = SAS_SATA_DEV;
  2197. diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h
  2198. index 961d0465b923f..0b6d1c704be1a 100644
  2199. --- a/drivers/scsi/pm8001/pm8001_hwi.h
  2200. +++ b/drivers/scsi/pm8001/pm8001_hwi.h
  2201. @@ -402,10 +402,10 @@ struct smp_req {
  2202. union {
  2203. u8 smp_req[32];
  2204. struct {
  2205. - __le64 long_req_addr;/* sg dma address, LE */
  2206. + __le64 long_req_addr __packed;/* sg dma address, LE */
  2207. __le32 long_req_size;/* LE */
  2208. u32 _r_a;
  2209. - __le64 long_resp_addr;/* sg dma address, LE */
  2210. + __le64 long_resp_addr __packed;/* sg dma address, LE */
  2211. __le32 long_resp_size;/* LE */
  2212. u32 _r_b;
  2213. } long_smp_req;/* sequencer extension */
  2214. diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
  2215. index acf6e3005b842..f3cc469a18602 100644
  2216. --- a/drivers/scsi/pm8001/pm80xx_hwi.h
  2217. +++ b/drivers/scsi/pm8001/pm80xx_hwi.h
  2218. @@ -639,10 +639,10 @@ struct smp_req {
  2219. union {
  2220. u8 smp_req[32];
  2221. struct {
  2222. - __le64 long_req_addr;/* sg dma address, LE */
  2223. + __le64 long_req_addr __packed;/* sg dma address, LE */
  2224. __le32 long_req_size;/* LE */
  2225. u32 _r_a;
  2226. - __le64 long_resp_addr;/* sg dma address, LE */
  2227. + __le64 long_resp_addr __packed;/* sg dma address, LE */
  2228. __le32 long_resp_size;/* LE */
  2229. u32 _r_b;
  2230. } long_smp_req;/* sequencer extension */
  2231. diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
  2232. index f41a385a5c421..b8f9e52e6db6b 100644
  2233. --- a/drivers/usb/gadget/function/f_fs.c
  2234. +++ b/drivers/usb/gadget/function/f_fs.c
  2235. @@ -2933,8 +2933,9 @@ static int __ffs_func_bind_do_os_desc(enum ffs_os_desc_type type,
  2236. t = &func->function.os_desc_table[desc->bFirstInterfaceNumber];
  2237. t->if_id = func->interfaces_nums[desc->bFirstInterfaceNumber];
  2238. memcpy(t->os_desc->ext_compat_id, &desc->CompatibleID,
  2239. - ARRAY_SIZE(desc->CompatibleID) +
  2240. - ARRAY_SIZE(desc->SubCompatibleID));
  2241. + sizeof(desc->CompatibleID));
  2242. + memcpy(t->os_desc->ext_compat_id + sizeof(desc->CompatibleID),
  2243. + &desc->SubCompatibleID, sizeof(desc->SubCompatibleID));
  2244. length = sizeof(*desc);
  2245. }
  2246. break;
  2247. diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
  2248. index 37b56ce75f39d..1f2d14077f764 100644
  2249. --- a/drivers/usb/typec/tipd/core.c
  2250. +++ b/drivers/usb/typec/tipd/core.c
  2251. @@ -56,8 +56,8 @@ enum {
  2252. /* TPS_REG_RX_IDENTITY_SOP */
  2253. struct tps6598x_rx_identity_reg {
  2254. u8 status;
  2255. - struct usb_pd_identity identity;
  2256. -} __packed;
  2257. + struct usb_pd_identity identity __packed;
  2258. +};
  2259.  
  2260. /* Standard Task return codes */
  2261. #define TPS_TASK_TIMEOUT 1
  2262. diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c
  2263. index 873e6e1c92b5c..1cb79b167a4f8 100644
  2264. --- a/fs/ubifs/find.c
  2265. +++ b/fs/ubifs/find.c
  2266. @@ -726,11 +726,10 @@ int ubifs_find_free_leb_for_idx(struct ubifs_info *c)
  2267. return err;
  2268. }
  2269.  
  2270. -static int cmp_dirty_idx(const struct ubifs_lprops **a,
  2271. - const struct ubifs_lprops **b)
  2272. +static int cmp_dirty_idx(const void *a, const void *b)
  2273. {
  2274. - const struct ubifs_lprops *lpa = *a;
  2275. - const struct ubifs_lprops *lpb = *b;
  2276. + const struct ubifs_lprops *lpa = *(const struct ubifs_lprops **)a;
  2277. + const struct ubifs_lprops *lpb = *(const struct ubifs_lprops **)b;
  2278.  
  2279. return lpa->dirty + lpa->free - lpb->dirty - lpb->free;
  2280. }
  2281. @@ -754,7 +753,7 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c)
  2282. sizeof(void *) * c->dirty_idx.cnt);
  2283. /* Sort it so that the dirtiest is now at the end */
  2284. sort(c->dirty_idx.arr, c->dirty_idx.cnt, sizeof(void *),
  2285. - (int (*)(const void *, const void *))cmp_dirty_idx, NULL);
  2286. + cmp_dirty_idx, NULL);
  2287. dbg_find("found %d dirty index LEBs", c->dirty_idx.cnt);
  2288. if (c->dirty_idx.cnt)
  2289. dbg_find("dirtiest index LEB is %d with dirty %d and free %d",
  2290. diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c
  2291. index 6d6cd85c2b4ca..017dd88186ca9 100644
  2292. --- a/fs/ubifs/lprops.c
  2293. +++ b/fs/ubifs/lprops.c
  2294. @@ -1014,8 +1014,9 @@ void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
  2295. */
  2296. static int scan_check_cb(struct ubifs_info *c,
  2297. const struct ubifs_lprops *lp, int in_tree,
  2298. - struct ubifs_lp_stats *lst)
  2299. + struct scan_data *data)
  2300. {
  2301. + struct ubifs_lp_stats *lst = (void *)data;
  2302. struct ubifs_scan_leb *sleb;
  2303. struct ubifs_scan_node *snod;
  2304. int cat, lnum = lp->lnum, is_idx = 0, used = 0, free, dirty, ret;
  2305. diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
  2306. index 4c36044140e7e..81df9925a7f54 100644
  2307. --- a/fs/ubifs/ubifs.h
  2308. +++ b/fs/ubifs/ubifs.h
  2309. @@ -654,9 +654,10 @@ enum {
  2310. struct ubifs_info;
  2311.  
  2312. /* Callback used by the 'ubifs_lpt_scan_nolock()' function */
  2313. +struct scan_data;
  2314. typedef int (*ubifs_lpt_scan_callback)(struct ubifs_info *c,
  2315. const struct ubifs_lprops *lprops,
  2316. - int in_tree, void *data);
  2317. + int in_tree, struct scan_data *data);
  2318.  
  2319. /**
  2320. * struct ubifs_wbuf - UBIFS write-buffer.
  2321. diff --git a/include/linux/fortify-string.h b/include/linux/fortify-string.h
  2322. index da51a83b28293..f6db238d4d1d5 100644
  2323. --- a/include/linux/fortify-string.h
  2324. +++ b/include/linux/fortify-string.h
  2325. @@ -586,7 +586,7 @@ __FORTIFY_INLINE bool fortify_memcpy_chk(__kernel_size_t size,
  2326. * or when an over-write happened, so both can be fixed at
  2327. * the same time.
  2328. */
  2329. - if ((IS_ENABLED(KBUILD_EXTRA_WARN1) ||
  2330. + if ((IS_ENABLED(KBUILD_EXTRA_WARN2) ||
  2331. __compiletime_lessthan(p_size_field, size)) &&
  2332. __compiletime_lessthan(q_size_field, size))
  2333. __read_overflow2_field(q_size_field, size);
  2334. diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
  2335. index ab721cf13a986..61a5dde1511fc 100644
  2336. --- a/include/linux/platform_data/cros_ec_commands.h
  2337. +++ b/include/linux/platform_data/cros_ec_commands.h
  2338. @@ -2684,7 +2684,7 @@ struct ec_params_motion_sense {
  2339. */
  2340. int16_t hys_degree;
  2341. } tablet_mode_threshold;
  2342. - };
  2343. + } __packed;
  2344. } __ec_todo_packed;
  2345.  
  2346. struct ec_response_motion_sense {
  2347. diff --git a/include/linux/remoteproc/mtk_scp.h b/include/linux/remoteproc/mtk_scp.h
  2348. index 7c2b7cc9fe6c1..84e579940b8e5 100644
  2349. --- a/include/linux/remoteproc/mtk_scp.h
  2350. +++ b/include/linux/remoteproc/mtk_scp.h
  2351. @@ -8,7 +8,7 @@
  2352.  
  2353. #include <linux/platform_device.h>
  2354.  
  2355. -typedef void (*scp_ipi_handler_t) (void *data,
  2356. +typedef void (*scp_ipi_handler_t) (const void *data,
  2357. unsigned int len,
  2358. void *priv);
  2359. struct mtk_scp;
  2360. diff --git a/include/linux/rpmsg/mtk_rpmsg.h b/include/linux/rpmsg/mtk_rpmsg.h
  2361. index 363b60178040b..9d67507471fba 100644
  2362. --- a/include/linux/rpmsg/mtk_rpmsg.h
  2363. +++ b/include/linux/rpmsg/mtk_rpmsg.h
  2364. @@ -9,7 +9,7 @@
  2365. #include <linux/platform_device.h>
  2366. #include <linux/remoteproc.h>
  2367.  
  2368. -typedef void (*ipi_handler_t)(void *data, unsigned int len, void *priv);
  2369. +typedef void (*ipi_handler_t)(const void *data, unsigned int len, void *priv);
  2370.  
  2371. /*
  2372. * struct mtk_rpmsg_info - IPI functions tied to the rpmsg device.
  2373. diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
  2374. index f89ec4b5ea169..6736121ee6a03 100644
  2375. --- a/include/linux/sunrpc/xdr.h
  2376. +++ b/include/linux/sunrpc/xdr.h
  2377. @@ -775,7 +775,7 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
  2378.  
  2379. if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
  2380. return -EBADMSG;
  2381. - if (len > SIZE_MAX / sizeof(*p))
  2382. + if ((size_t)len > SIZE_MAX / sizeof(*p))
  2383. return -EBADMSG;
  2384. p = xdr_inline_decode(xdr, len * sizeof(*p));
  2385. if (unlikely(!p))
  2386. diff --git a/include/linux/tpm.h b/include/linux/tpm.h
  2387. index 6a1e8f1572551..d8bc599e0a679 100644
  2388. --- a/include/linux/tpm.h
  2389. +++ b/include/linux/tpm.h
  2390. @@ -288,13 +288,13 @@ enum tpm_chip_flags {
  2391. #define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)
  2392.  
  2393. struct tpm_header {
  2394. - __be16 tag;
  2395. - __be32 length;
  2396. + __be16 tag __packed;
  2397. + __be32 length __packed;
  2398. union {
  2399. - __be32 ordinal;
  2400. - __be32 return_code;
  2401. + __be32 ordinal __packed;
  2402. + __be32 return_code __packed;
  2403. };
  2404. -} __packed;
  2405. +};
  2406.  
  2407. /* A string buffer type for constructing TPM commands. This is based on the
  2408. * ideas of string buffer code in security/keys/trusted.h but is heap based
  2409. diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
  2410. index c59fb79a42e86..09fb71f7375cf 100644
  2411. --- a/include/linux/usb/pd.h
  2412. +++ b/include/linux/usb/pd.h
  2413. @@ -195,7 +195,7 @@ struct pd_chunked_ext_message_data {
  2414. struct pd_message {
  2415. __le16 header;
  2416. union {
  2417. - __le32 payload[PD_MAX_PAYLOAD];
  2418. + __le32 payload[PD_MAX_PAYLOAD] __packed;
  2419. struct pd_chunked_ext_message_data ext_msg;
  2420. };
  2421. } __packed;
  2422. diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
  2423. index 5c72d1864dd6c..796e5595a7c11 100644
  2424. --- a/include/net/sctp/structs.h
  2425. +++ b/include/net/sctp/structs.h
  2426. @@ -341,7 +341,7 @@ struct sctp_signed_cookie {
  2427. __u8 signature[SCTP_SECRET_SIZE];
  2428. __u32 __pad; /* force sctp_cookie alignment to 64 bits */
  2429. struct sctp_cookie c;
  2430. -} __packed;
  2431. +} __aligned(__alignof__(struct sctp_cookie));
  2432.  
  2433. /* This is another convenience type to allocate memory for address
  2434. * params for the maximum size and pass such structures around
  2435. diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
  2436. index 1e7774ac808f0..905b4146426b7 100644
  2437. --- a/include/rdma/ib_verbs.h
  2438. +++ b/include/rdma/ib_verbs.h
  2439. @@ -1366,7 +1366,7 @@ enum ib_send_flags {
  2440. };
  2441.  
  2442. struct ib_sge {
  2443. - u64 addr;
  2444. + u64 addr __packed;
  2445. u32 length;
  2446. u32 lkey;
  2447. };
  2448. diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h
  2449. index 9b1f0f424a793..5410c55799606 100644
  2450. --- a/include/scsi/scsi_bsg_iscsi.h
  2451. +++ b/include/scsi/scsi_bsg_iscsi.h
  2452. @@ -53,7 +53,7 @@ struct iscsi_bsg_host_vendor {
  2453.  
  2454. /* start of vendor command area */
  2455. uint32_t vendor_cmd[];
  2456. -};
  2457. +} __packed;
  2458.  
  2459. /* Response:
  2460. */
  2461. diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
  2462. index b0197b1d1fe46..973c83f9b7310 100644
  2463. --- a/include/sound/rawmidi.h
  2464. +++ b/include/sound/rawmidi.h
  2465. @@ -161,8 +161,7 @@ int snd_rawmidi_free(struct snd_rawmidi *rmidi);
  2466.  
  2467. /* callbacks */
  2468.  
  2469. -int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
  2470. - const unsigned char *buffer, int count);
  2471. +int snd_rawmidi_receive(void *ptr, const void *buffer, int count);
  2472. int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream);
  2473. int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
  2474. unsigned char *buffer, int count);
  2475. diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
  2476. index c8621671fa70d..804194d7c6061 100644
  2477. --- a/include/sound/seq_kernel.h
  2478. +++ b/include/sound/seq_kernel.h
  2479. @@ -67,7 +67,7 @@ int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
  2480. #define SNDRV_SEQ_EXT_USRPTR 0x80000000
  2481. #define SNDRV_SEQ_EXT_CHAINED 0x40000000
  2482.  
  2483. -typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
  2484. +typedef int (*snd_seq_dump_func_t)(void *ptr, const void *buf, int count);
  2485. int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
  2486. int in_kernel, int size_aligned);
  2487. int snd_seq_expand_var_event_at(const struct snd_seq_event *event, int count,
  2488. diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h
  2489. index 7e0983b987c2d..1cb79399f7b5c 100644
  2490. --- a/include/uapi/linux/dvb/frontend.h
  2491. +++ b/include/uapi/linux/dvb/frontend.h
  2492. @@ -854,8 +854,8 @@ struct dtv_stats {
  2493. union {
  2494. __u64 uvalue; /* for counters and relative scales */
  2495. __s64 svalue; /* for 0.001 dB measures */
  2496. - };
  2497. -} __attribute__ ((packed));
  2498. + } __packed;
  2499. +};
  2500.  
  2501.  
  2502. #define MAX_DTV_STATS 4
  2503. diff --git a/include/uapi/linux/if_pppol2tp.h b/include/uapi/linux/if_pppol2tp.h
  2504. index a91044328bc90..d5bbe250971a3 100644
  2505. --- a/include/uapi/linux/if_pppol2tp.h
  2506. +++ b/include/uapi/linux/if_pppol2tp.h
  2507. @@ -33,7 +33,7 @@ struct pppol2tp_addr {
  2508.  
  2509. __u16 s_tunnel, s_session; /* For matching incoming packets */
  2510. __u16 d_tunnel, d_session; /* For sending outgoing packets */
  2511. -};
  2512. +} __packed;
  2513.  
  2514. /* Structure used to connect() the socket to a particular tunnel UDP
  2515. * socket over IPv6.
  2516. @@ -47,7 +47,7 @@ struct pppol2tpin6_addr {
  2517. __u16 d_tunnel, d_session; /* For sending outgoing packets */
  2518.  
  2519. struct sockaddr_in6 addr; /* IP address and port to send to */
  2520. -};
  2521. +} __packed;
  2522.  
  2523. /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
  2524. * bits. So we need a different sockaddr structure.
  2525. @@ -61,7 +61,7 @@ struct pppol2tpv3_addr {
  2526.  
  2527. __u32 s_tunnel, s_session; /* For matching incoming packets */
  2528. __u32 d_tunnel, d_session; /* For sending outgoing packets */
  2529. -};
  2530. +} __packed;
  2531.  
  2532. struct pppol2tpv3in6_addr {
  2533. __kernel_pid_t pid; /* pid that owns the fd.
  2534. @@ -72,7 +72,7 @@ struct pppol2tpv3in6_addr {
  2535. __u32 d_tunnel, d_session; /* For sending outgoing packets */
  2536.  
  2537. struct sockaddr_in6 addr; /* IP address and port to send to */
  2538. -};
  2539. +} __packed;
  2540.  
  2541. /* Socket options:
  2542. * DEBUG - bitmask of debug message categories (not used)
  2543. diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
  2544. index 9abd80dcc46f9..add1f683906cb 100644
  2545. --- a/include/uapi/linux/if_pppox.h
  2546. +++ b/include/uapi/linux/if_pppox.h
  2547. @@ -66,8 +66,8 @@ struct sockaddr_pppox {
  2548. __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
  2549. unsigned int sa_protocol; /* protocol identifier */
  2550. union {
  2551. - struct pppoe_addr pppoe;
  2552. - struct pptp_addr pptp;
  2553. + struct pppoe_addr pppoe __packed;
  2554. + struct pptp_addr pptp __packed;
  2555. } sa_addr;
  2556. } __packed;
  2557.  
  2558. @@ -79,7 +79,7 @@ struct sockaddr_pppox {
  2559. struct sockaddr_pppol2tp {
  2560. __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
  2561. unsigned int sa_protocol; /* protocol identifier */
  2562. - struct pppol2tp_addr pppol2tp;
  2563. + struct pppol2tp_addr pppol2tp __packed;
  2564. } __packed;
  2565.  
  2566. struct sockaddr_pppol2tpin6 {
  2567. diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
  2568. index ac56605fe9bca..fa1bc4dff17fc 100644
  2569. --- a/include/uapi/linux/ipv6.h
  2570. +++ b/include/uapi/linux/ipv6.h
  2571. @@ -105,8 +105,8 @@ struct rt2_hdr {
  2572. struct ipv6_destopt_hao {
  2573. __u8 type;
  2574. __u8 length;
  2575. - struct in6_addr addr;
  2576. -} __attribute__((packed));
  2577. + struct in6_addr addr __packed;
  2578. +};
  2579.  
  2580. /*
  2581. * IPv6 fixed header
  2582. diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
  2583. index c21edb966c196..4f999cb5c28ea 100644
  2584. --- a/include/uapi/linux/rds.h
  2585. +++ b/include/uapi/linux/rds.h
  2586. @@ -212,7 +212,7 @@ struct rds6_info_socket {
  2587. __be16 connected_port;
  2588. __u32 rcvbuf;
  2589. __u64 inum;
  2590. -} __attribute__((packed));
  2591. +} __attribute__((packed)) __attribute__((aligned(4)));
  2592.  
  2593. struct rds_info_tcp_socket {
  2594. __be32 local_addr;
  2595. @@ -227,17 +227,27 @@ struct rds_info_tcp_socket {
  2596. __u8 tos;
  2597. } __attribute__((packed));
  2598.  
  2599. +struct unaligned_in6_addr {
  2600. + union {
  2601. + __u8 u6_addr8[16];
  2602. +#if __UAPI_DEF_IN6_ADDR_ALT
  2603. + __be16 u6_addr16[8] __attribute__((packed));
  2604. + __be32 u6_addr32[4] __attribute__((packed));
  2605. +#endif
  2606. + } in6_u;
  2607. +};
  2608. +
  2609. struct rds6_info_tcp_socket {
  2610. struct in6_addr local_addr;
  2611. __be16 local_port;
  2612. - struct in6_addr peer_addr;
  2613. + struct unaligned_in6_addr peer_addr;
  2614. __be16 peer_port;
  2615. __u64 hdr_rem;
  2616. __u64 data_rem;
  2617. __u32 last_sent_nxt;
  2618. __u32 last_expected_una;
  2619. __u32 last_seen_una;
  2620. -} __attribute__((packed));
  2621. +} __attribute__((packed)) __attribute__((aligned(4)));
  2622.  
  2623. #define RDS_IB_GID_LEN 16
  2624. struct rds_info_rdma_connection {
  2625. diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
  2626. index cef7534d2d19b..47e1043e77509 100644
  2627. --- a/include/uapi/linux/uhid.h
  2628. +++ b/include/uapi/linux/uhid.h
  2629. @@ -194,7 +194,7 @@ struct uhid_event {
  2630. struct uhid_set_report_req set_report;
  2631. struct uhid_set_report_reply_req set_report_reply;
  2632. struct uhid_start_req start;
  2633. - } u;
  2634. + } __packed u;
  2635. } __attribute__((__packed__));
  2636.  
  2637. #endif /* __UHID_H_ */
  2638. diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h
  2639. index d77ee6b65328e..2329bbd6bc130 100644
  2640. --- a/include/uapi/linux/usb/functionfs.h
  2641. +++ b/include/uapi/linux/usb/functionfs.h
  2642. @@ -67,7 +67,7 @@ struct usb_os_desc_header {
  2643. __u8 Reserved;
  2644. };
  2645. __le16 wCount;
  2646. - };
  2647. + } __packed;
  2648. } __attribute__((packed));
  2649.  
  2650. struct usb_ext_compat_desc {
  2651. diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
  2652. index 3af6a82d0cade..96dffc1f52fc9 100644
  2653. --- a/include/uapi/linux/videodev2.h
  2654. +++ b/include/uapi/linux/videodev2.h
  2655. @@ -1835,7 +1835,7 @@ struct v4l2_ext_control {
  2656. struct v4l2_ctrl_av1_frame __user *p_av1_frame;
  2657. struct v4l2_ctrl_av1_film_grain __user *p_av1_film_grain;
  2658. void __user *ptr;
  2659. - };
  2660. + } __packed;
  2661. } __attribute__ ((packed));
  2662.  
  2663. struct v4l2_ext_controls {
  2664. diff --git a/include/uapi/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h
  2665. index 5e46cf1054af4..3f402fc48d12e 100644
  2666. --- a/include/uapi/scsi/scsi_bsg_fc.h
  2667. +++ b/include/uapi/scsi/scsi_bsg_fc.h
  2668. @@ -188,7 +188,7 @@ struct fc_bsg_host_ct {
  2669. __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
  2670. __u32 preamble_word2; /* Cmd Code, Max Size */
  2671.  
  2672. -};
  2673. +} __packed;
  2674. /* Response:
  2675. *
  2676. * The reply structure is an fc_bsg_ctels_reply structure
  2677. @@ -210,7 +210,7 @@ struct fc_bsg_host_vendor {
  2678.  
  2679. /* start of vendor command area */
  2680. __u32 vendor_cmd[];
  2681. -};
  2682. +} __packed;
  2683.  
  2684. /* Response:
  2685. */
  2686. @@ -256,7 +256,7 @@ struct fc_bsg_rport_ct {
  2687. __u32 preamble_word0; /* revision & IN_ID */
  2688. __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
  2689. __u32 preamble_word2; /* Cmd Code, Max Size */
  2690. -};
  2691. +} __packed;
  2692. /* Response:
  2693. *
  2694. * The reply structure is an fc_bsg_ctels_reply structure
  2695. diff --git a/lib/Makefile b/lib/Makefile
  2696. index 42d307ade225e..aeea894cebbef 100644
  2697. --- a/lib/Makefile
  2698. +++ b/lib/Makefile
  2699. @@ -408,7 +408,7 @@ quiet_cmd_test_fortify = TEST $@
  2700. cmd_test_fortify = $(CONFIG_SHELL) $(srctree)/scripts/test_fortify.sh \
  2701. $< $@ "$(NM)" $(CC) $(c_flags) \
  2702. $(call cc-disable-warning,fortify-source) \
  2703. - -DKBUILD_EXTRA_WARN1
  2704. + -DKBUILD_EXTRA_WARN2
  2705.  
  2706. targets += $(TEST_FORTIFY_LOGS)
  2707. clean-files += $(TEST_FORTIFY_LOGS)
  2708. diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c
  2709. index ce6749af374de..2cbb0eabc5870 100644
  2710. --- a/lib/kunit/executor_test.c
  2711. +++ b/lib/kunit/executor_test.c
  2712. @@ -125,6 +125,11 @@ kunit_test_suites(&executor_test_suite);
  2713.  
  2714. /* Test helpers */
  2715.  
  2716. +static void __kunit_kfree(void *ptr)
  2717. +{
  2718. + return kfree(ptr);
  2719. +}
  2720. +
  2721. /* Use the resource API to register a call to kfree(to_free).
  2722. * Since we never actually use the resource, it's safe to use on const data.
  2723. */
  2724. @@ -134,9 +139,7 @@ static void kfree_at_end(struct kunit *test, const void *to_free)
  2725. if (IS_ERR_OR_NULL(to_free))
  2726. return;
  2727.  
  2728. - kunit_add_action(test,
  2729. - (kunit_action_t *)kfree,
  2730. - (void *)to_free);
  2731. + kunit_add_action(test, __kunit_kfree, (void *)to_free);
  2732. }
  2733.  
  2734. static struct kunit_suite *alloc_fake_suite(struct kunit *test,
  2735. diff --git a/lib/kunit/test.c b/lib/kunit/test.c
  2736. index 84e4666555c94..b00f217ccd2f2 100644
  2737. --- a/lib/kunit/test.c
  2738. +++ b/lib/kunit/test.c
  2739. @@ -763,6 +763,11 @@ static struct notifier_block kunit_mod_nb = {
  2740. };
  2741. #endif
  2742.  
  2743. +static void __kunit_kfree(void *ptr)
  2744. +{
  2745. + kfree(ptr);
  2746. +}
  2747. +
  2748. void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t gfp)
  2749. {
  2750. void *data;
  2751. @@ -772,7 +777,7 @@ void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t gfp)
  2752. if (!data)
  2753. return NULL;
  2754.  
  2755. - if (kunit_add_action_or_reset(test, (kunit_action_t *)kfree, data) != 0)
  2756. + if (kunit_add_action_or_reset(test, __kunit_kfree, data) != 0)
  2757. return NULL;
  2758.  
  2759. return data;
  2760. @@ -784,7 +789,7 @@ void kunit_kfree(struct kunit *test, const void *ptr)
  2761. if (!ptr)
  2762. return;
  2763.  
  2764. - kunit_release_action(test, (kunit_action_t *)kfree, (void *)ptr);
  2765. + kunit_release_action(test, __kunit_kfree, (void *)ptr);
  2766. }
  2767. EXPORT_SYMBOL_GPL(kunit_kfree);
  2768.  
  2769. diff --git a/net/rds/tcp.c b/net/rds/tcp.c
  2770. index c5b86066ff663..6a7fe28be727f 100644
  2771. --- a/net/rds/tcp.c
  2772. +++ b/net/rds/tcp.c
  2773. @@ -293,7 +293,7 @@ static void rds6_tcp_tc_info(struct socket *sock, unsigned int len,
  2774.  
  2775. tsinfo6.local_addr = sk->sk_v6_rcv_saddr;
  2776. tsinfo6.local_port = inet->inet_sport;
  2777. - tsinfo6.peer_addr = sk->sk_v6_daddr;
  2778. + memcpy(&tsinfo6.peer_addr, &sk->sk_v6_daddr, sizeof(sk->sk_v6_daddr));
  2779. tsinfo6.peer_port = inet->inet_dport;
  2780.  
  2781. tsinfo6.hdr_rem = tc->t_tinc_hdr_rem;
  2782. diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
  2783. index 90f0b60b196ab..1c720c2093d91 100644
  2784. --- a/net/smc/smc_llc.c
  2785. +++ b/net/smc/smc_llc.c
  2786. @@ -35,7 +35,7 @@ struct smc_llc_hdr {
  2787. #endif
  2788. };
  2789. u16 length_v2; /* 44 - 8192*/
  2790. - };
  2791. + } __packed;
  2792. u8 flags;
  2793. } __packed; /* format defined in
  2794. * IBM Shared Memory Communications Version 2
  2795. diff --git a/scripts/Makefile.build b/scripts/Makefile.build
  2796. index fcf6a574a7023..d3f5f6c1dc017 100644
  2797. --- a/scripts/Makefile.build
  2798. +++ b/scripts/Makefile.build
  2799. @@ -100,7 +100,7 @@ else ifeq ($(KBUILD_CHECKSRC),2)
  2800. cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
  2801. endif
  2802.  
  2803. -ifneq ($(KBUILD_EXTRA_WARN),)
  2804. +ifneq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
  2805. cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $(KDOCFLAGS) \
  2806. $(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \
  2807. $<
  2808. diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
  2809. index 2d3cec908154d..ed6204b9af2cd 100644
  2810. --- a/sound/core/rawmidi.c
  2811. +++ b/sound/core/rawmidi.c
  2812. @@ -1165,9 +1165,9 @@ static struct timespec64 get_framing_tstamp(struct snd_rawmidi_substream *substr
  2813. *
  2814. * Return: The size of read data, or a negative error code on failure.
  2815. */
  2816. -int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
  2817. - const unsigned char *buffer, int count)
  2818. +int snd_rawmidi_receive(void *ptr, const void *buffer, int count)
  2819. {
  2820. + struct snd_rawmidi_substream *substream = ptr;
  2821. unsigned long flags;
  2822. struct timespec64 ts64 = get_framing_tstamp(substream);
  2823. int result = 0, count1;
  2824. @@ -1195,7 +1195,7 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
  2825. } else if (count == 1) { /* special case, faster code */
  2826. substream->bytes++;
  2827. if (runtime->avail < runtime->buffer_size) {
  2828. - runtime->buffer[runtime->hw_ptr++] = buffer[0];
  2829. + runtime->buffer[runtime->hw_ptr++] = ((u8 *)buffer)[0];
  2830. runtime->hw_ptr %= runtime->buffer_size;
  2831. runtime->avail++;
  2832. result++;
  2833. diff --git a/sound/core/seq/oss/seq_oss_readq.c b/sound/core/seq/oss/seq_oss_readq.c
  2834. index f0db5d3dcba47..3679938c0ad96 100644
  2835. --- a/sound/core/seq/oss/seq_oss_readq.c
  2836. +++ b/sound/core/seq/oss/seq_oss_readq.c
  2837. @@ -86,7 +86,7 @@ snd_seq_oss_readq_clear(struct seq_oss_readq *q)
  2838. * put a midi byte
  2839. */
  2840. int
  2841. -snd_seq_oss_readq_puts(struct seq_oss_readq *q, int dev, unsigned char *data, int len)
  2842. +snd_seq_oss_readq_puts(struct seq_oss_readq *q, int dev, const unsigned char *data, int len)
  2843. {
  2844. union evrec rec;
  2845. int result;
  2846. @@ -113,7 +113,7 @@ struct readq_sysex_ctx {
  2847. int dev;
  2848. };
  2849.  
  2850. -static int readq_dump_sysex(void *ptr, void *buf, int count)
  2851. +static int readq_dump_sysex(void *ptr, const void *buf, int count)
  2852. {
  2853. struct readq_sysex_ctx *ctx = ptr;
  2854.  
  2855. diff --git a/sound/core/seq/oss/seq_oss_readq.h b/sound/core/seq/oss/seq_oss_readq.h
  2856. index 38d0c4682b298..bb99743fec7db 100644
  2857. --- a/sound/core/seq/oss/seq_oss_readq.h
  2858. +++ b/sound/core/seq/oss/seq_oss_readq.h
  2859. @@ -30,7 +30,7 @@ struct seq_oss_readq *snd_seq_oss_readq_new(struct seq_oss_devinfo *dp, int maxl
  2860. void snd_seq_oss_readq_delete(struct seq_oss_readq *q);
  2861. void snd_seq_oss_readq_clear(struct seq_oss_readq *readq);
  2862. unsigned int snd_seq_oss_readq_poll(struct seq_oss_readq *readq, struct file *file, poll_table *wait);
  2863. -int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, unsigned char *data, int len);
  2864. +int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, const unsigned char *data, int len);
  2865. int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev,
  2866. struct snd_seq_event *ev);
  2867. int snd_seq_oss_readq_put_event(struct seq_oss_readq *readq, union evrec *ev);
  2868. diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
  2869. index 174585bf59d29..00e24f99d0de8 100644
  2870. --- a/sound/core/seq/seq_memory.c
  2871. +++ b/sound/core/seq/seq_memory.c
  2872. @@ -135,7 +135,7 @@ EXPORT_SYMBOL(snd_seq_dump_var_event);
  2873. * expand the variable length event to linear buffer space.
  2874. */
  2875.  
  2876. -static int seq_copy_in_kernel(void *ptr, void *src, int size)
  2877. +static int seq_copy_in_kernel(void *ptr, const void *src, int size)
  2878. {
  2879. char **bufptr = ptr;
  2880.  
  2881. @@ -144,7 +144,7 @@ static int seq_copy_in_kernel(void *ptr, void *src, int size)
  2882. return 0;
  2883. }
  2884.  
  2885. -static int seq_copy_in_user(void *ptr, void *src, int size)
  2886. +static int seq_copy_in_user(void *ptr, const void *src, int size)
  2887. {
  2888. char __user **bufptr = ptr;
  2889.  
  2890. diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
  2891. index 44302d98950e8..eb1e78c22dc33 100644
  2892. --- a/sound/core/seq/seq_midi.c
  2893. +++ b/sound/core/seq/seq_midi.c
  2894. @@ -94,8 +94,9 @@ static void snd_midi_input_event(struct snd_rawmidi_substream *substream)
  2895. }
  2896. }
  2897.  
  2898. -static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, int count)
  2899. +static int dump_midi(void *ptr, const void *buf, int count)
  2900. {
  2901. + struct snd_rawmidi_substream *substream = ptr;
  2902. struct snd_rawmidi_runtime *runtime;
  2903. int tmp;
  2904.  
  2905. @@ -132,7 +133,7 @@ static int event_process_midi(struct snd_seq_event *ev, int direct,
  2906. pr_debug("ALSA: seq_midi: invalid sysex event flags = 0x%x\n", ev->flags);
  2907. return 0;
  2908. }
  2909. - snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)dump_midi, substream);
  2910. + snd_seq_dump_var_event(ev, dump_midi, substream);
  2911. snd_midi_event_reset_decode(msynth->parser);
  2912. } else {
  2913. if (msynth->parser == NULL)
  2914. diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c
  2915. index 1b9260108e482..ef8536408af4f 100644
  2916. --- a/sound/core/seq/seq_virmidi.c
  2917. +++ b/sound/core/seq/seq_virmidi.c
  2918. @@ -80,7 +80,7 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev,
  2919. if (ev->type == SNDRV_SEQ_EVENT_SYSEX) {
  2920. if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
  2921. continue;
  2922. - snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream);
  2923. + snd_seq_dump_var_event(ev, snd_rawmidi_receive, vmidi->substream);
  2924. snd_midi_event_reset_decode(vmidi->parser);
  2925. } else {
  2926. len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev);
  2927. diff --git a/sound/pci/aw2/aw2-saa7146.h b/sound/pci/aw2/aw2-saa7146.h
  2928. index b5c5a71c0ac38..3a3de56b9b07a 100644
  2929. --- a/sound/pci/aw2/aw2-saa7146.h
  2930. +++ b/sound/pci/aw2/aw2-saa7146.h
  2931. @@ -19,11 +19,12 @@
  2932.  
  2933. #define NUM_STREAM_CAPTURE_ANA 0
  2934.  
  2935. -typedef void (*snd_aw2_saa7146_it_cb) (void *);
  2936. +struct snd_pcm_substream;
  2937. +typedef void (*snd_aw2_saa7146_it_cb) (struct snd_pcm_substream *);
  2938.  
  2939. struct snd_aw2_saa7146_cb_param {
  2940. snd_aw2_saa7146_it_cb p_it_callback;
  2941. - void *p_callback_param;
  2942. + struct snd_pcm_substream *p_callback_param;
  2943. };
  2944.  
  2945. /* definition of the chip-specific record */
  2946. diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c
  2947. index d074727c3e21d..397900929aa65 100644
  2948. --- a/sound/pci/ctxfi/ctamixer.c
  2949. +++ b/sound/pci/ctxfi/ctamixer.c
  2950. @@ -292,7 +292,7 @@ static int put_amixer_rsc(struct amixer_mgr *mgr, struct amixer *amixer)
  2951. return 0;
  2952. }
  2953.  
  2954. -int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr)
  2955. +int amixer_mgr_create(struct hw *hw, void **ramixer_mgr)
  2956. {
  2957. int err;
  2958. struct amixer_mgr *amixer_mgr;
  2959. @@ -321,8 +321,9 @@ int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr)
  2960. return err;
  2961. }
  2962.  
  2963. -int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr)
  2964. +int amixer_mgr_destroy(void *ptr)
  2965. {
  2966. + struct amixer_mgr *amixer_mgr = ptr;
  2967. rsc_mgr_uninit(&amixer_mgr->mgr);
  2968. kfree(amixer_mgr);
  2969. return 0;
  2970. @@ -446,7 +447,7 @@ static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum)
  2971. return 0;
  2972. }
  2973.  
  2974. -int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr)
  2975. +int sum_mgr_create(struct hw *hw, void **rsum_mgr)
  2976. {
  2977. int err;
  2978. struct sum_mgr *sum_mgr;
  2979. @@ -475,8 +476,9 @@ int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr)
  2980. return err;
  2981. }
  2982.  
  2983. -int sum_mgr_destroy(struct sum_mgr *sum_mgr)
  2984. +int sum_mgr_destroy(void *ptr)
  2985. {
  2986. + struct sum_mgr *sum_mgr = ptr;
  2987. rsc_mgr_uninit(&sum_mgr->mgr);
  2988. kfree(sum_mgr);
  2989. return 0;
  2990. diff --git a/sound/pci/ctxfi/ctamixer.h b/sound/pci/ctxfi/ctamixer.h
  2991. index 4498e6139d0ef..8fc017da6bda8 100644
  2992. --- a/sound/pci/ctxfi/ctamixer.h
  2993. +++ b/sound/pci/ctxfi/ctamixer.h
  2994. @@ -43,8 +43,8 @@ struct sum_mgr {
  2995. };
  2996.  
  2997. /* Constructor and destructor of daio resource manager */
  2998. -int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr);
  2999. -int sum_mgr_destroy(struct sum_mgr *sum_mgr);
  3000. +int sum_mgr_create(struct hw *hw, void **ptr);
  3001. +int sum_mgr_destroy(void *ptr);
  3002.  
  3003. /* Define the descriptor of a amixer resource */
  3004. struct amixer_rsc_ops;
  3005. @@ -89,7 +89,7 @@ struct amixer_mgr {
  3006. };
  3007.  
  3008. /* Constructor and destructor of amixer resource manager */
  3009. -int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr);
  3010. -int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr);
  3011. +int amixer_mgr_create(struct hw *hw, void **ramixer_mgr);
  3012. +int amixer_mgr_destroy(void *amixer_mgr);
  3013.  
  3014. #endif /* CTAMIXER_H */
  3015. diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
  3016. index fbdb8a3d5b8e5..2a3e9d8ba7dbe 100644
  3017. --- a/sound/pci/ctxfi/ctatc.c
  3018. +++ b/sound/pci/ctxfi/ctatc.c
  3019. @@ -105,23 +105,20 @@ static struct {
  3020. .public_name = "Mixer"}
  3021. };
  3022.  
  3023. -typedef int (*create_t)(struct hw *, void **);
  3024. -typedef int (*destroy_t)(void *);
  3025. -
  3026. static struct {
  3027. int (*create)(struct hw *hw, void **rmgr);
  3028. int (*destroy)(void *mgr);
  3029. } rsc_mgr_funcs[NUM_RSCTYP] = {
  3030. - [SRC] = { .create = (create_t)src_mgr_create,
  3031. - .destroy = (destroy_t)src_mgr_destroy },
  3032. - [SRCIMP] = { .create = (create_t)srcimp_mgr_create,
  3033. - .destroy = (destroy_t)srcimp_mgr_destroy },
  3034. - [AMIXER] = { .create = (create_t)amixer_mgr_create,
  3035. - .destroy = (destroy_t)amixer_mgr_destroy },
  3036. - [SUM] = { .create = (create_t)sum_mgr_create,
  3037. - .destroy = (destroy_t)sum_mgr_destroy },
  3038. - [DAIO] = { .create = (create_t)daio_mgr_create,
  3039. - .destroy = (destroy_t)daio_mgr_destroy }
  3040. + [SRC] = { .create = src_mgr_create,
  3041. + .destroy = src_mgr_destroy },
  3042. + [SRCIMP] = { .create = srcimp_mgr_create,
  3043. + .destroy = srcimp_mgr_destroy },
  3044. + [AMIXER] = { .create = amixer_mgr_create,
  3045. + .destroy = amixer_mgr_destroy },
  3046. + [SUM] = { .create = sum_mgr_create,
  3047. + .destroy = sum_mgr_destroy },
  3048. + [DAIO] = { .create = daio_mgr_create,
  3049. + .destroy = daio_mgr_destroy }
  3050. };
  3051.  
  3052. static int
  3053. diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
  3054. index 7fc720046ce29..83aaf9441ef30 100644
  3055. --- a/sound/pci/ctxfi/ctdaio.c
  3056. +++ b/sound/pci/ctxfi/ctdaio.c
  3057. @@ -684,7 +684,7 @@ static int daio_mgr_commit_write(struct daio_mgr *mgr)
  3058. return 0;
  3059. }
  3060.  
  3061. -int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr)
  3062. +int daio_mgr_create(struct hw *hw, void **rdaio_mgr)
  3063. {
  3064. int err, i;
  3065. struct daio_mgr *daio_mgr;
  3066. @@ -738,8 +738,9 @@ int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr)
  3067. return err;
  3068. }
  3069.  
  3070. -int daio_mgr_destroy(struct daio_mgr *daio_mgr)
  3071. +int daio_mgr_destroy(void *ptr)
  3072. {
  3073. + struct daio_mgr *daio_mgr = ptr;
  3074. unsigned long flags;
  3075.  
  3076. /* free daio input mapper list */
  3077. diff --git a/sound/pci/ctxfi/ctdaio.h b/sound/pci/ctxfi/ctdaio.h
  3078. index bd6310f480139..15147fe5f74a0 100644
  3079. --- a/sound/pci/ctxfi/ctdaio.h
  3080. +++ b/sound/pci/ctxfi/ctdaio.h
  3081. @@ -115,7 +115,7 @@ struct daio_mgr {
  3082. };
  3083.  
  3084. /* Constructor and destructor of daio resource manager */
  3085. -int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr);
  3086. -int daio_mgr_destroy(struct daio_mgr *daio_mgr);
  3087. +int daio_mgr_create(struct hw *hw, void **ptr);
  3088. +int daio_mgr_destroy(void *ptr);
  3089.  
  3090. #endif /* CTDAIO_H */
  3091. diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c
  3092. index 4a94b4708a77e..159bd40080691 100644
  3093. --- a/sound/pci/ctxfi/ctsrc.c
  3094. +++ b/sound/pci/ctxfi/ctsrc.c
  3095. @@ -540,7 +540,7 @@ static int src_mgr_commit_write(struct src_mgr *mgr)
  3096. return 0;
  3097. }
  3098.  
  3099. -int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr)
  3100. +int src_mgr_create(struct hw *hw, void **rsrc_mgr)
  3101. {
  3102. int err, i;
  3103. struct src_mgr *src_mgr;
  3104. @@ -580,8 +580,9 @@ int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr)
  3105. return err;
  3106. }
  3107.  
  3108. -int src_mgr_destroy(struct src_mgr *src_mgr)
  3109. +int src_mgr_destroy(void *ptr)
  3110. {
  3111. + struct src_mgr *src_mgr = ptr;
  3112. rsc_mgr_uninit(&src_mgr->mgr);
  3113. kfree(src_mgr);
  3114.  
  3115. @@ -821,7 +822,7 @@ static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry)
  3116. return err;
  3117. }
  3118.  
  3119. -int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrcimp_mgr)
  3120. +int srcimp_mgr_create(struct hw *hw, void **rsrcimp_mgr)
  3121. {
  3122. int err;
  3123. struct srcimp_mgr *srcimp_mgr;
  3124. @@ -866,8 +867,9 @@ int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrcimp_mgr)
  3125. return err;
  3126. }
  3127.  
  3128. -int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr)
  3129. +int srcimp_mgr_destroy(void *ptr)
  3130. {
  3131. + struct srcimp_mgr *srcimp_mgr = ptr;
  3132. unsigned long flags;
  3133.  
  3134. /* free src input mapper list */
  3135. diff --git a/sound/pci/ctxfi/ctsrc.h b/sound/pci/ctxfi/ctsrc.h
  3136. index 1124daf50c9be..e6366cc6a7ae6 100644
  3137. --- a/sound/pci/ctxfi/ctsrc.h
  3138. +++ b/sound/pci/ctxfi/ctsrc.h
  3139. @@ -139,10 +139,10 @@ struct srcimp_mgr {
  3140. };
  3141.  
  3142. /* Constructor and destructor of SRC resource manager */
  3143. -int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr);
  3144. -int src_mgr_destroy(struct src_mgr *src_mgr);
  3145. +int src_mgr_create(struct hw *hw, void **ptr);
  3146. +int src_mgr_destroy(void *ptr);
  3147. /* Constructor and destructor of SRCIMP resource manager */
  3148. -int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrc_mgr);
  3149. -int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr);
  3150. +int srcimp_mgr_create(struct hw *hw, void **ptr);
  3151. +int srcimp_mgr_destroy(void *ptr);
  3152.  
  3153. #endif /* CTSRC_H */
  3154. diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
  3155. index 67f336a12d74a..9b96a9de913b9 100644
  3156. --- a/sound/soc/codecs/Makefile
  3157. +++ b/sound/soc/codecs/Makefile
  3158. @@ -297,9 +297,10 @@ snd-soc-uda1334-objs := uda1334.o
  3159. snd-soc-uda134x-objs := uda134x.o
  3160. snd-soc-uda1380-objs := uda1380.o
  3161. snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o
  3162. -snd-soc-wcd9335-objs := wcd-clsh-v2.o wcd9335.o
  3163. -snd-soc-wcd934x-objs := wcd-clsh-v2.o wcd934x.o
  3164. -snd-soc-wcd938x-objs := wcd938x.o wcd-clsh-v2.o
  3165. +snd-soc-wcd-clsh-objs := wcd-clsh-v2.o
  3166. +snd-soc-wcd9335-objs := wcd9335.o
  3167. +snd-soc-wcd934x-objs := wcd934x.o
  3168. +snd-soc-wcd938x-objs := wcd938x.o
  3169. snd-soc-wcd938x-sdw-objs := wcd938x-sdw.o
  3170. snd-soc-wl1273-objs := wl1273.o
  3171. snd-soc-wm-adsp-objs := wm_adsp.o
  3172. @@ -671,12 +672,12 @@ obj-$(CONFIG_SND_SOC_UDA1334) += snd-soc-uda1334.o
  3173. obj-$(CONFIG_SND_SOC_UDA134X) += snd-soc-uda134x.o
  3174. obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o
  3175. obj-$(CONFIG_SND_SOC_WCD_MBHC) += snd-soc-wcd-mbhc.o
  3176. -obj-$(CONFIG_SND_SOC_WCD9335) += snd-soc-wcd9335.o
  3177. -obj-$(CONFIG_SND_SOC_WCD934X) += snd-soc-wcd934x.o
  3178. -obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x.o
  3179. +obj-$(CONFIG_SND_SOC_WCD9335) += snd-soc-wcd9335.o snd-soc-wcd-clsh.o
  3180. +obj-$(CONFIG_SND_SOC_WCD934X) += snd-soc-wcd934x.o snd-soc-wcd-clsh.o
  3181. +obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x.o snd-soc-wcd-clsh.o
  3182. ifdef CONFIG_SND_SOC_WCD938X_SDW
  3183. # avoid link failure by forcing sdw code built-in when needed
  3184. -obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x-sdw.o
  3185. +obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x-sdw.o snd-soc-wcd-clsh.o
  3186. endif
  3187. obj-$(CONFIG_SND_SOC_WL1273) += snd-soc-wl1273.o
  3188. obj-$(CONFIG_SND_SOC_WM0010) += snd-soc-wm0010.o
  3189. diff --git a/sound/soc/codecs/mt6660.h b/sound/soc/codecs/mt6660.h
  3190. index 054a3c56ec1fe..6c40b4065f24a 100644
  3191. --- a/sound/soc/codecs/mt6660.h
  3192. +++ b/sound/soc/codecs/mt6660.h
  3193. @@ -9,7 +9,6 @@
  3194. #include <linux/mutex.h>
  3195. #include <linux/regmap.h>
  3196.  
  3197. -#pragma pack(push, 1)
  3198. struct mt6660_platform_data {
  3199. u8 init_setting_num;
  3200. u32 *init_setting_addr;
  3201. @@ -26,7 +25,6 @@ struct mt6660_chip {
  3202. struct regmap *regmap;
  3203. u16 chip_rev;
  3204. };
  3205. -#pragma pack(pop)
  3206.  
  3207. #define MT6660_REG_DEVID (0x00)
  3208. #define MT6660_REG_SYSTEM_CTRL (0x03)
  3209. diff --git a/sound/soc/codecs/wcd-clsh-v2.c b/sound/soc/codecs/wcd-clsh-v2.c
  3210. index a75db27e52055..73b99c51d48b4 100644
  3211. --- a/sound/soc/codecs/wcd-clsh-v2.c
  3212. +++ b/sound/soc/codecs/wcd-clsh-v2.c
  3213. @@ -355,6 +355,7 @@ void wcd_clsh_set_hph_mode(struct wcd_clsh_ctrl *ctrl, int mode)
  3214. wcd_clsh_v2_set_hph_mode(comp, mode);
  3215.  
  3216. }
  3217. +EXPORT_SYMBOL_GPL(wcd_clsh_set_hph_mode);
  3218.  
  3219. static void wcd_clsh_set_flyback_current(struct snd_soc_component *comp,
  3220. int mode)
  3221. @@ -869,11 +870,13 @@ int wcd_clsh_ctrl_set_state(struct wcd_clsh_ctrl *ctrl,
  3222.  
  3223. return 0;
  3224. }
  3225. +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_set_state);
  3226.  
  3227. int wcd_clsh_ctrl_get_state(struct wcd_clsh_ctrl *ctrl)
  3228. {
  3229. return ctrl->state;
  3230. }
  3231. +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_get_state);
  3232.  
  3233. struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp,
  3234. int version)
  3235. @@ -890,8 +893,12 @@ struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp,
  3236.  
  3237. return ctrl;
  3238. }
  3239. +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_alloc);
  3240.  
  3241. void wcd_clsh_ctrl_free(struct wcd_clsh_ctrl *ctrl)
  3242. {
  3243. kfree(ctrl);
  3244. }
  3245. +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_free);
  3246. +
  3247. +MODULE_LICENSE("GPL");
  3248. diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c
  3249. index da351a60df0c4..1f55519408e16 100644
  3250. --- a/sound/soc/meson/aiu.c
  3251. +++ b/sound/soc/meson/aiu.c
  3252. @@ -215,6 +215,11 @@ static const char * const aiu_spdif_ids[] = {
  3253. [MCLK] = "spdif_mclk_sel"
  3254. };
  3255.  
  3256. +static void aiu_clk_disable(void *clk)
  3257. +{
  3258. + clk_disable_unprepare(clk);
  3259. +}
  3260. +
  3261. static int aiu_clk_get(struct device *dev)
  3262. {
  3263. struct aiu *aiu = dev_get_drvdata(dev);
  3264. @@ -245,9 +250,7 @@ static int aiu_clk_get(struct device *dev)
  3265. return ret;
  3266. }
  3267.  
  3268. - ret = devm_add_action_or_reset(dev,
  3269. - (void(*)(void *))clk_disable_unprepare,
  3270. - aiu->pclk);
  3271. + ret = devm_add_action_or_reset(dev, aiu_clk_disable, aiu->pclk);
  3272. if (ret)
  3273. dev_err(dev, "failed to add reset action on pclk");
  3274.  
  3275. diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
  3276. index 9c6b4dac68932..e0f9a603a5e99 100644
  3277. --- a/sound/soc/meson/t9015.c
  3278. +++ b/sound/soc/meson/t9015.c
  3279. @@ -243,6 +243,11 @@ static const struct regmap_config t9015_regmap_config = {
  3280. .max_register = POWER_CFG,
  3281. };
  3282.  
  3283. +static void t9015_clk_disable(void *clk)
  3284. +{
  3285. + clk_disable_unprepare(clk);
  3286. +}
  3287. +
  3288. static int t9015_probe(struct platform_device *pdev)
  3289. {
  3290. struct device *dev = &pdev->dev;
  3291. @@ -270,9 +275,7 @@ static int t9015_probe(struct platform_device *pdev)
  3292. return ret;
  3293. }
  3294.  
  3295. - ret = devm_add_action_or_reset(dev,
  3296. - (void(*)(void *))clk_disable_unprepare,
  3297. - priv->pclk);
  3298. + ret = devm_add_action_or_reset(dev, t9015_clk_disable, priv->pclk);
  3299. if (ret)
  3300. return ret;
  3301.  
  3302. diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c
  3303. index 7f02f5b2c33fd..dc94a257cfd51 100644
  3304. --- a/sound/soc/qcom/qdsp6/q6apm-dai.c
  3305. +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c
  3306. @@ -99,7 +99,7 @@ static struct snd_pcm_hardware q6apm_dai_hardware_playback = {
  3307. .fifo_size = 0,
  3308. };
  3309.  
  3310. -static void event_handler(uint32_t opcode, uint32_t token, uint32_t *payload, void *priv)
  3311. +static void event_handler(uint32_t opcode, uint32_t token, void *payload, void *priv)
  3312. {
  3313. struct q6apm_dai_rtd *prtd = priv;
  3314. struct snd_pcm_substream *substream = prtd->substream;
  3315. @@ -264,7 +264,7 @@ static int q6apm_dai_open(struct snd_soc_component *component,
  3316.  
  3317. spin_lock_init(&prtd->lock);
  3318. prtd->substream = substream;
  3319. - prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler, prtd, graph_id);
  3320. + prtd->graph = q6apm_graph_open(dev, event_handler, prtd, graph_id);
  3321. if (IS_ERR(prtd->graph)) {
  3322. dev_err(dev, "%s: Could not allocate memory\n", __func__);
  3323. ret = PTR_ERR(prtd->graph);
  3324. diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
  3325. index 6d9381d60172f..67c7dadd9f773 100644
  3326. --- a/tools/testing/selftests/kvm/.gitignore
  3327. +++ b/tools/testing/selftests/kvm/.gitignore
  3328. @@ -5,3 +5,7 @@
  3329. !*.h
  3330. !*.S
  3331. !*.sh
  3332. +!.gitignore
  3333. +!Makefile
  3334. +!config
  3335. +!settings
  3336.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement