No description
Find a file
Gustavo A. R. Silva 241b566e04 drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()
commit 336feb502a upstream.

Fix the following -Wstringop-overflow warnings when building with GCC-11:

drivers/gpu/drm/i915/intel_pm.c:3106:9: warning: ‘intel_read_wm_latency’ accessing 16 bytes in a region of size 10 [-Wstringop-overflow=]
 3106 |         intel_read_wm_latency(dev_priv, dev_priv->wm.pri_latency);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/intel_pm.c:3106:9: note: referencing argument 2 of type ‘u16 *’ {aka ‘short unsigned int *’}
drivers/gpu/drm/i915/intel_pm.c:2861:13: note: in a call to function ‘intel_read_wm_latency’
 2861 | static void intel_read_wm_latency(struct drm_i915_private *dev_priv,
      |             ^~~~~~~~~~~~~~~~~~~~~

by removing the over-specified array size from the argument declarations.

It seems that this code is actually safe because the size of the
array depends on the hardware generation, and the function checks
for that.

Notice that wm can be an array of 5 elements:
drivers/gpu/drm/i915/intel_pm.c:3109:   intel_read_wm_latency(dev_priv, dev_priv->wm.pri_latency);

or an array of 8 elements:
drivers/gpu/drm/i915/intel_pm.c:3131:   intel_read_wm_latency(dev_priv, dev_priv->wm.skl_latency);

and the compiler legitimately complains about that.

This helps with the ongoing efforts to globally enable
-Wstringop-overflow.

Link: https://github.com/KSPP/linux/issues/181
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06 08:33:50 +02:00
arch x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests 2022-06-06 08:33:48 +02:00
block block: return ELEVATOR_DISCARD_MERGE if possible 2022-05-25 09:14:38 +02:00
certs
crypto crypto: authenc - Fix sleep in atomic context in decrypt_tail 2022-04-15 14:18:04 +02:00
Documentation Reinstate some of "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"" 2022-05-25 09:14:38 +02:00
drivers drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency() 2022-06-06 08:33:50 +02:00
fs afs: Fix afs_getattr() to refetch file status if callback break occurred 2022-05-25 09:14:39 +02:00
include secure_seq: use the 64 bits of the siphash for port offset calculation 2022-06-06 08:33:49 +02:00
init init/main.c: return 1 from handled __setup() functions 2022-04-15 14:18:35 +02:00
ipc shm: extend forced shm destroy to support objects from several IPC nses 2021-12-01 09:23:35 +01:00
kernel lockdown: also lock down previous kgdb use 2022-06-06 08:33:48 +02:00
lib assoc_array: Fix BUG_ON during garbage collect 2022-06-06 08:33:50 +02:00
LICENSES
mm mm: userfaultfd: fix missing cache flush in mcopy_atomic_pte() and __mcopy_atomic() 2022-05-15 19:54:47 +02:00
net cfg80211: set custom regdomain after wiphy registration 2022-06-06 08:33:50 +02:00
samples samples/kretprobes: Fix return value if register_kretprobe() failed 2021-11-17 09:48:39 +01:00
scripts gcc-plugins: latent_entropy: use /dev/urandom 2022-04-20 09:19:38 +02:00
security lockdown: also lock down previous kgdb use 2022-06-06 08:33:48 +02:00
sound ALSA: wavefront: Proper check of get_user() error 2022-05-25 09:14:34 +02:00
tools x86/xen: Mark cpu_bringup_and_idle() as dead_end_function 2022-05-25 09:14:38 +02:00
usr
virt KVM: Prevent module exit until all VMs are freed 2022-04-15 14:18:27 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.4.196 2022-05-25 09:14:39 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.