]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
Fix misc new gcc warnings
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Apr 2021 00:05:53 +0000 (17:05 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:32:24 +0000 (10:32 +0200)
BugLink: https://bugs.launchpad.net/bugs/1928857
commit e7c6e405e171fb33990a12ecfd14e6500d9e5cf2 upstream.

It seems like Fedora 34 ends up enabling a few new gcc warnings, notably
"-Wstringop-overread" and "-Warray-parameter".

Both of them cause what seem to be valid warnings in the kernel, where
we have array size mismatches in function arguments (that are no longer
just silently converted to a pointer to element, but actually checked).

This fixes most of the trivial ones, by making the function declaration
match the function definition, and in the case of intel_pm.c, removing
the over-specified array size from the argument declaration.

At least one 'stringop-overread' warning remains in the i915 driver, but
that one doesn't have the same obvious trivial fix, and may or may not
actually be indicative of a bug.

[ It was a mistake to upgrade one of my machines to Fedora 34 while
  being busy with the merge window, but if this is the extent of the
  compiler upgrade problems, things are better than usual    - Linus ]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrey Zhizhikin <andrey.z@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/i915/intel_pm.c
drivers/media/usb/dvb-usb/dvb-usb.h
include/scsi/libfcoe.h
net/bluetooth/ecdh_helper.h

index e53a222186a662571545bedd0044e6f519796417..717e1611ce376f9aa96bb10219682aec90f29eb9 100644 (file)
@@ -2993,7 +2993,7 @@ int ilk_wm_max_level(const struct drm_i915_private *dev_priv)
 
 static void intel_print_wm_latency(struct drm_i915_private *dev_priv,
                                   const char *name,
-                                  const u16 wm[8])
+                                  const u16 wm[])
 {
        int level, max_level = ilk_wm_max_level(dev_priv);
 
index 741be0e694471accd337a74a4506d2896db5dc88..2b8ad2bde8a480c5acfa82d1e5d0d9bd0829d388 100644 (file)
@@ -487,7 +487,7 @@ extern int __must_check
 dvb_usb_generic_write(struct dvb_usb_device *, u8 *, u16);
 
 /* commonly used remote control parsing */
-extern int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *, u8[], u32 *, int *);
+extern int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *, u8[5], u32 *, int *);
 
 /* commonly used firmware download types and function */
 struct hexline {
index 2568cb0627ec0b388aa100391179993b603c2784..fac8e89aed81dadf8b16fc058fae71f3b29c9fe4 100644 (file)
@@ -249,7 +249,7 @@ int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct fc_lport *,
                         struct fc_frame *);
 
 /* libfcoe funcs */
-u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int);
+u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], unsigned int, unsigned int);
 int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *,
                      const struct libfc_function_template *, int init_fcp);
 u32 fcoe_fc_crc(struct fc_frame *fp);
index a6f8d03d4aaf65514da3462eda3594c4795362f5..830723971cf831057816145c19aaeb804de4aef7 100644 (file)
@@ -25,6 +25,6 @@
 
 int compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pair_public_key[64],
                        u8 secret[32]);
-int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 *private_key);
+int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]);
 int generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]);
 int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]);