Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2347412rwd; Fri, 16 Jun 2023 02:42:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4trV3pKUVzIFqFEYyXMY76Cf4zcq9+LZ8vSnoAhbod1xbxtjB8FJQektcmf7CAXZllkBqf X-Received: by 2002:a05:6a00:21ce:b0:666:64fb:b129 with SMTP id t14-20020a056a0021ce00b0066664fbb129mr1774213pfj.27.1686908548549; Fri, 16 Jun 2023 02:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686908548; cv=none; d=google.com; s=arc-20160816; b=VGw4cnULU1yxFqfndfAZCvAognUSgf0dBpl81tzFe46gH3BSJkOuUfmputjdUsm9gK qwLbqbfTG6Em20BEv1fdMJd7Xl649PEJSjBFrvq2gFhE3DXz4aytDKKe+jCcqVvoowxK /Y99TX5NrFyfBgWf3n7c7PgKZB/YWecYITQyLrzxu6wHnQNO1x3N+ayLGRzMNEM09kLQ N+IpYADdg6ezYe2iAxZDrejZ0hybWZgnU8kX4ovihAqoju4Pp7jh0bWB6Uc4d5/UwwFr XWGa81YnnXWt/hkEwGVKfj5bOpmR3tzGmOnFkkXGcdtX2aEQbpJW8dbWBjs2jr+rOlg3 YoKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SwMUNuck5BugtzVNI+U+CfvZsXcsdgfylwJ3YAYbkYo=; b=fNfLzpy7KA6PqRhftkzrJ8M7fRUJzXEkWzgZ/zYH9buvxKuiKhxEbGdXIbqC+JWZH6 3RrYnZM31xZi7g6s1tU31S1sBIVpDrGqB5DoJvxpULxnK2psavl6N662YKnQYF2bdegM 4DWyJrrIR9qWFRjA07CumdqzI60Z7eZjTU9oehQSxbXY/s92pC5b9F/Qy5TuRUY1V3V8 Kvi0P2bu/Y/wZDEkIcdpjEduXI1hjJx5IxWKOVlc1sDa8IN0kq+cemmE6VYq6z9GZ7Sg rmQm8JHqADW0MoToy++pJ3oFu6GzOnfU97qCYTxUpTHjKUtTBLlbTK5LPQdAftSa5TDk tHTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HWwpM+qf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020aa7982a000000b0065a4bc8a998si1180966pfl.385.2023.06.16.02.42.14; Fri, 16 Jun 2023 02:42:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HWwpM+qf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344105AbjFPJ0u (ORCPT + 99 others); Fri, 16 Jun 2023 05:26:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344440AbjFPJ0a (ORCPT ); Fri, 16 Jun 2023 05:26:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7561435A2; Fri, 16 Jun 2023 02:25:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ED9DB63291; Fri, 16 Jun 2023 09:25:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F689C433C8; Fri, 16 Jun 2023 09:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686907538; bh=XHQLN9nl8TdAAC8nr9pRDK1MMoc21zbzvmAMT6d+aV8=; h=From:To:Cc:Subject:Date:From; b=HWwpM+qfAVvgds/zGb334+M25YQhO4zvPLkXeZuxOO6aLId+XwaBREqJ6hREUpJo5 EJW8rExR4qi4/YMSgUPGdgdWX9LiWvs9E8h31BS7/iqKGuUwDq/eOEVcJ/d/lug0dv wG1DCN7/T8kEpgumUCGYp8bCZ5VHOmBQ7p5GT12nvk0ehAzrIb8OmoRodmdbYtVQqo v+xlbGgGnylf+NqrZqYjX7GFMUXoQYr0QQ4gA3SmlCRguzjhLxaW8EDIo11R1fEMF2 06F5f0v+u3x1AdpNHCrTxPc2PFnAWWJpU3wsxZ7x7vjNdXPo/IKWKUV/0qbB1gH7H4 1BcDrDR0d8d8w== From: Arnd Bergmann To: Song Liu , Yu Kuai Cc: Arnd Bergmann , Damien Le Moal , Jens Axboe , Johannes Thumshirn , linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] md/raid1-10: shut up randstruct warning again Date: Fri, 16 Jun 2023 11:24:48 +0200 Message-Id: <20230616092532.3307719-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann A code reorganization brought back a warning when structure randomization is enabled: drivers/md/raid1-10.c:119:25: error: casting from randomized structure pointer type 'struct block_device *' to 'struct md_rdev *' struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev; ^ Before the rework, this used a (void*) cast, so go back to that in order to avoid the warning. Casting between pointers to incompatible types is clearly something that is dangerous, but this driver has always done so, and it's not made any worse by the struct randomization in this case. Fixes: 8295efbe68c08 ("md/raid1-10: factor out a helper to submit normal write") Signed-off-by: Arnd Bergmann --- drivers/md/raid1-10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index 169ebe296f2d0..3f22edec70e78 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -116,7 +116,7 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, static inline void raid1_submit_write(struct bio *bio) { - struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev; + struct md_rdev *rdev = (void *)bio->bi_bdev; bio->bi_next = NULL; bio_set_dev(bio, rdev->bdev); -- 2.39.2