From patchwork Fri Mar 22 14:08:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 160897 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp857891jan; Fri, 22 Mar 2019 07:08:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfxd31gxwjf7P2cpaIaGtPg6v1qK6YInYR4RIiBjO0UiHQ4sIPPo38H7fn9+nN3B0J9Xph X-Received: by 2002:aa7:8201:: with SMTP id k1mr9448016pfi.53.1553263710757; Fri, 22 Mar 2019 07:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553263710; cv=none; d=google.com; s=arc-20160816; b=bVdSwXmlQSXCJ1T9mZ6z3YQVmdxQIdcH0/T/6ds1kGy1eZrLZPUN3+VhQ1E8UUXLiC xSEdE7kh2TbINka7iVISXrppn1c7iqdkhwggTjqogDTAu5e70G3QoZ0B9UDTr82z6lzC g14hHWZ3mLE6fT+3uAqwTQoeaGP8mNb3nSYdEAPUpcmaSLMFakwKXmpBdWJM69tI+5RU d20mylIU3xgGOTkibCWSq8lOhzi9fm314ay7j4IQguD05dG3zjQwYkVrQcmYSvARpchk GLk+U3QgzA4n+uL6dSio+67bi13Oi3w5VwA5dRGGoUGth2Qy3rmEmhkK8sj2QwodD4gT jwIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=b90BBBhy/oL+EIW5ujTN1FXXfmSr52Io4FdNDgStVTM=; b=q0F91VBZ3SzLaeFKud/mu0SVU3ZadDObgz9Z++Nv9JVE+YXaNKSX9vQwsNz5m6XTPb Ii9mWW32ma21UKttzDIv24PrFMU34Xncdo0bvXQKy4FDPOx6bE14gUtKvsXE7MYBBWc3 OreXQFDRkqPa1A/qojbXi41y36Bvlb7yOOM8k+ZhYPlGBDEj0bcOCwnv2orwdU4ggCuz kiIwobR6p+SYotYNsmtW7NZ25d1KQCBTOzIuRo8TBE6eCJwR5m1jFOKgpnIOfnfnZA0k PH8ys6Zkbf4XF3No0IFcIMkqootZgtfLDmwN8p22bsI5wh2I8etdlDqO0N0qnEZHhAxd NU3Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g126si6233695pgc.75.2019.03.22.07.08.30; Fri, 22 Mar 2019 07:08:30 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728123AbfCVOI3 (ORCPT + 31 others); Fri, 22 Mar 2019 10:08:29 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:58071 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727487AbfCVOI2 (ORCPT ); Fri, 22 Mar 2019 10:08:28 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mqrjz-1gcevc2lvt-00mwa8; Fri, 22 Mar 2019 15:08:21 +0100 From: Arnd Bergmann To: Ilya Dryomov , "Yan, Zheng" , Sage Weil Cc: clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , Arnd Bergmann , Alex Elder , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ceph: fix clang warning for CEPH_DEFINE_OID_ONSTACK Date: Fri, 22 Mar 2019 15:08:11 +0100 Message-Id: <20190322140819.300740-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:xmzUNNjc8rjml5exAxA6yJVE0D0zQCC4pJ+goEu42NQOun028TV 6x2o0AL8lelqRC1SuI6igqzUUFxnejyhCKa9e7n4UJwheNK8NE/0Z6OdNujVaRdIZPaWhJF qRyV/0YiFWz9iqxVBpjL084CKnoNvfNyVXJWnDhMnczBXQWh29liyzBnN5yiHwMCMYSLCOi flS02ny6nUIxlgZQQimdw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:uWB2USANmXk=:4g9ePn/SIKxtGLVrQu0nMZ Bzu6OUPVPt8oFptL/OZbiJaJP0ftZ28UPRwtkzhivsP9g20f8w7flnkHJbv4410WLPkcmOMSQ BeeMkk1fnYyfZURYnMHVw3PKDi6wSTAcbmadxgWYbyN28O02vCaazi3MUK0NJnnBwiAZGM5Qk H2bpEFR6gyx8cWBddZePg0YDWLKA/1OsLzezgbXiBWbMOQo7s2YzPW82tNTgKGoS2KYD06heN ohdBkCKOdak+DdLN0TKzJD8rV5M87akdsFkPQgOImqrJExXlPi05WU1AUAOQ3CKXNorC3nNP9 sWXR+hMboWOjIGi/s5mOqmWvtneQeBOJc2hOM9El74iFEQLYH0LAKZPrlEv/ESbi+EzWvC8+Y brNWOontrWyBeqlRFnedsCML/PhtNmzGWt/BzewAoqjAquCe32BeRRQbXR9YsMG2kYLqbKX5N rUUPTTyEYGGebDrhjKIErd63L7GrfbQYQ+/t2k2FFZu/2qJPA2DEyc71tgUlb9G/gQYUy689z 2lGIHJckOXtw97JceHUtS4Xeg8n52a8Vm2W4Cu/GxTqAOcgnF6hdvYXDEv3U7vK4HFA+i7Fh9 Ep9/h6aZUIooz6m+lBs4YCDeVUfSrCE57PxJbpSk7ska75ahlYRXNput+q4WvbOslvoa8u0Yj JmA2jxLaYT6KQdAgEtgMWlGuuqqJmEzHFj93EHB8hW+Fo6aVAEG5gPqZsFKzpd/ULKIVz8t3L h94CpkEo42ZTkPAgKxaOYrRNhvROUgA6ofsW+g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clang complains about assigning a variable to itself during the declaration: fs/ceph/ioctl.c:187:26: error: variable 'oid' is uninitialized when used within its own initialization [-Werror,-Wuninitialized] CEPH_DEFINE_OID_ONSTACK(oid); ^~~ include/linux/ceph/osdmap.h:122:52: note: expanded from macro 'CEPH_DEFINE_OID_ONSTACK' struct ceph_object_id oid = CEPH_OID_INIT_ONSTACK(oid) ~~~ ^~~ include/linux/ceph/osdmap.h:120:29: note: expanded from macro 'CEPH_OID_INIT_ONSTACK' ({ ceph_oid_init(&oid); oid; }) ^~~ We use this trick in other places, but it is completely unnecessary here, as we can just use a regular struct initializer. Signed-off-by: Arnd Bergmann --- include/linux/ceph/osdmap.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.20.0 diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index 5675b1f09bc5..82f957a7a0d6 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h @@ -116,10 +116,8 @@ static inline void ceph_oid_init(struct ceph_object_id *oid) oid->name_len = 0; } -#define CEPH_OID_INIT_ONSTACK(oid) \ - ({ ceph_oid_init(&oid); oid; }) #define CEPH_DEFINE_OID_ONSTACK(oid) \ - struct ceph_object_id oid = CEPH_OID_INIT_ONSTACK(oid) + struct ceph_object_id oid = { .name = oid.inline_name } static inline bool ceph_oid_empty(const struct ceph_object_id *oid) {