Skip to content

Commit

Permalink
FROMLIST: block: Disable -Walign-mismatch for blk-mq.c
Browse files Browse the repository at this point in the history
LLVM 13 adds a new warning, -Walign-mismatch, which has an instance in
blk_mq_complete_send_ipi():

block/blk-mq.c:630:39: warning: passing 8-byte aligned argument to
32-byte aligned parameter 2 of 'smp_call_function_single_async' may
result in an unaligned pointer access [-Walign-mismatch]
                smp_call_function_single_async(cpu, &rq->csd);
                                                    ^
1 warning generated.

This is expected after commit 4ccafe0 ("block: unalign
call_single_data in struct request"), which purposefully unaligned the
structure to save space. Given that there is no real alignment
requirement and there have been no reports of issues since that change,
it should be safe to disable the warning for this one translation unit.

Link: ClangBuiltLinux/linux#1328
Link: https://lore.kernel.org/r/20210310182307.zzcbi5w5jrmveld4@archlinux-ax161/
Link: https://lore.kernel.org/r/20210330230249.709221-1-jiancai@google.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
(am from https://lore.kernel.org/patchwork/patch/1410076/)
(also found at https://lore.kernel.org/r/20210408194458.501617-1-nathan@kernel.org)

BUG=chromium:1193732
TEST=CQ

Signed-off-by: Jian Cai <jiancai@google.com>
Change-Id: I1f9d3e04fd417058e73c67843fd8ccee60b5e64e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2831385
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
  • Loading branch information
nathanchance authored and Commit Bot committed Apr 16, 2021
1 parent aff3900 commit 1d791ea
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-sysfs.o \
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
genhd.o ioprio.o badblocks.o partitions/ blk-rq-qos.o

CFLAGS_blk-mq.o := $(call cc-disable-warning, align-mismatch)
obj-$(CONFIG_BOUNCE) += bounce.o
obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
Expand Down

0 comments on commit 1d791ea

Please sign in to comment.