Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp917733ybl; Wed, 8 Jan 2020 08:01:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwjMP+UOso9VvZ9fACcWuYc3lZLuXdlJ0dsE10NlElb48tnbnHIveWZ0835jueLTIwxDxGZ X-Received: by 2002:aca:bbc6:: with SMTP id l189mr3689305oif.53.1578499317451; Wed, 08 Jan 2020 08:01:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578499317; cv=none; d=google.com; s=arc-20160816; b=1H/0GRQqc85pe9Wo6UcKAhdlz1EIF0YHWVkqAwa0cpI7pStfXS1//wPpB6XesOQtJM 8zGNBMnLmA6q7dK+zUsk0vwXTNBonAsYOx1iTmvND8zNfhR5jkmYiGACeP7BM5zw5yL0 gzHDyj4FIhHhE+nDwTVpzzWSr5+ppgmmAkTpJ+vco4k8Ll8aRVu57pB8lx9SirLRz476 cUY42PrrLdlMl1RbSomSYqtwyDsBRTu3aMGtJ2VpbytrMfRJmKcz9Hek2U0QRzV2U+NI GVo4Orm9HOxNef1wdMAHKMGiYSdrlFyzGmRedURB2dNrl+EVQkbIpFnmIFnJxoV2ULO0 R7qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=X7o/cbIbWQtFq2kL2V0bbwvA4L0Ugp+mDyf5FeCjV9Y=; b=CRs/9pIlU9sxWPd61As23lyENFOLImSSVyCRL4KEUrlONg62AKcL2yjUsDsIPIhOgp gC585tSdcaJT2IYe0iNpPUpIYhPv1ncyG2AWPvRw7F9vkC7ncSN0Hu8r325NLF+HepBF GZ8qXcNvZtwgm4Jyno5FA2T3k9fCulluiOsebvSVD77o/95zi/lyMXFIu85yb+BQbFNf FlEh5rDhPGez9H90aGI7WBPz9m8vPHnw4SETcuKkGDaqlNgc/TQn3p1xstO5xrlwCm7V ruS9kQ2Z4G89fEgmVzed+3K46YraugVB5RJb03Edgxbiy0BIxnqQQ1XfJ44Lzlm122v6 Nvpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pzH6zeJa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si2019669otn.202.2020.01.08.08.01.40; Wed, 08 Jan 2020 08:01:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pzH6zeJa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728496AbgAHPbs (ORCPT + 99 others); Wed, 8 Jan 2020 10:31:48 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:45768 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726556AbgAHPbs (ORCPT ); Wed, 8 Jan 2020 10:31:48 -0500 Received: by mail-io1-f66.google.com with SMTP id i11so3570410ioi.12; Wed, 08 Jan 2020 07:31:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X7o/cbIbWQtFq2kL2V0bbwvA4L0Ugp+mDyf5FeCjV9Y=; b=pzH6zeJaZTB+65guQIjtWt9OrS+TW0egL1dGYCFmTIHGpenTiH806NyUQYIC79mO49 C8Fa9hJUcTGI4ZtrRFkjTnG0RBBe2RMBrvyAFbxlFlbLZ7Xpltr5VOXhbU8ITg7lH62Z OUGs7mIljKQ+eW/ya9De02u7zuWf9FZvGvZT78FHAUWNVwELEFCSzNtZwShhQunJPI+E 7mXgOQ/k50NurhHMFU661OVKF/nFoybb2MJlyXCb7NtMl674a6Bht+abPya5Yf/p0d1M iKH2WYcrDnD4veK9QnQi4Dp9tZbx/ujf4vIk9+J/FzDFCcuoN6FN948J4T7SHp1pKVwX r7GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X7o/cbIbWQtFq2kL2V0bbwvA4L0Ugp+mDyf5FeCjV9Y=; b=sqFxfBR4zQ8IixfwGJWUNTRERgJBMu1+NfJN1L6DrCPO92mA4JtHRAnfaDJp21CL/q nYsqMl+nYnEG/nqCWwEbh1WAjbkpC4NzYa9RskS8CDTr1Nh7mLXZGtN43xyNeCrirgdt HNMiFCkV/bHOTB2MqfaYtwf4mEdTCr88bem8HccvaLrw7TiCTWBegSvNzonS43wJjhlH 8Oi6XGN1NpqN+cbhXL8D4TU0gJFwjAUXomq32ytOpWhcobvp5ryLNsPbJzbFY83uINDT Ford0Kre4lhHod3YdnIckyBy0b0vrWUb6l3q3XxhXf7Op2FVsH4PWXwqz0aG8pSS1Apn wOtg== X-Gm-Message-State: APjAAAWujnN4Hzsj+nmYsYAAKUw3PR3SE/3AkLl/EEA+rpDla9dLm5t9 IaFf+SEfYsO9PDadjaHzUB2u7L45U1jyxXSveBM= X-Received: by 2002:a5e:8d14:: with SMTP id m20mr3593782ioj.282.1578497507212; Wed, 08 Jan 2020 07:31:47 -0800 (PST) MIME-Version: 1.0 References: <20200107210256.2426176-1-arnd@arndb.de> In-Reply-To: <20200107210256.2426176-1-arnd@arndb.de> From: Ilya Dryomov Date: Wed, 8 Jan 2020 16:31:36 +0100 Message-ID: Subject: Re: [PATCH] rbd: work around -Wuninitialized warning To: Arnd Bergmann Cc: Sage Weil , Jens Axboe , Oleksandr Natalenko , Dongsheng Yang , Jason Dillaman , David Howells , Ceph Development , linux-block , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 7, 2020 at 10:02 PM Arnd Bergmann wrote: > > gcc -O3 warns about a dummy variable that is passed > down into rbd_img_fill_nodata without being initialized: > > drivers/block/rbd.c: In function 'rbd_img_fill_nodata': > drivers/block/rbd.c:2573:13: error: 'dummy' is used uninitialized in this function [-Werror=uninitialized] > fctx->iter = *fctx->pos; > > Since this is a dummy, I assume the warning is harmless, but > it's better to initialize it anyway and avoid the warning. > > Fixes: mmtom ("init/Kconfig: enable -O3 for all arches") > Signed-off-by: Arnd Bergmann > --- > drivers/block/rbd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c > index 29be02838b67..070edc5983df 100644 > --- a/drivers/block/rbd.c > +++ b/drivers/block/rbd.c > @@ -2664,7 +2664,7 @@ static int rbd_img_fill_nodata(struct rbd_img_request *img_req, > u64 off, u64 len) > { > struct ceph_file_extent ex = { off, len }; > - union rbd_img_fill_iter dummy; > + union rbd_img_fill_iter dummy = {}; > struct rbd_img_fill_ctx fctx = { > .pos_type = OBJ_REQUEST_NODATA, > .pos = &dummy, Applied, but slightly confused. Wasn't selecting -O3/s/etc supposed to automatically disable -Wmaybe-uninitialized via Kconfig? Thanks, Ilya