From patchwork Sun Sep 30 20:54:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10621493 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E28515A7 for ; Sun, 30 Sep 2018 20:55:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41EF7292E5 for ; Sun, 30 Sep 2018 20:55:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35350292EB; Sun, 30 Sep 2018 20:55:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14859292E5 for ; Sun, 30 Sep 2018 20:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728586AbeJAD3f (ORCPT ); Sun, 30 Sep 2018 23:29:35 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51792 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728553AbeJAD3f (ORCPT ); Sun, 30 Sep 2018 23:29:35 -0400 Received: by mail-wm1-f68.google.com with SMTP id y25-v6so6701793wmi.1; Sun, 30 Sep 2018 13:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U2D71XIIQtLKUEAvdLd4evIDaeA42zh5dCO98SLM2nM=; b=LEqEC48XbjyUjlwKxcNpn6ZN5dr8eKJejtQ3eRySLCP+0AfFFilxQHGuDcNpkJ8pCV fLV+dfw5mgVdXJKjjPzYmqERbPOXVSlJS8lcc9XNqp08D6lES1oKYFpnmlJTsL47rECO eGzzLXqhUWRgnigzx4CW4E3MTd5NvT94TNF2gg2gCK7zLKAoggWivdgJAlOzMfpFXTNd Iqym7/wvxdgVQUQSFru75JGem/b85qbIBQ3wfpTclq3vrLQNosS3oTR4m2ebYD5Mtkhe +L+ssMDyY1DSLAh5GOV2sKtb3P0Mk+sAkNzgY3QZXxaxVXDF+dN1vW+XhAAiEiZbXyw1 OXgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U2D71XIIQtLKUEAvdLd4evIDaeA42zh5dCO98SLM2nM=; b=jw/k358KMH+Q1wF12ZSbX8SFB8nIHmBAC2k369c7aBYco6RImudl7G+FSLW6sI3I/I mG120je/ylwQFGnw1v+ehAdVcWwmWFspF4La6SGoR/EQqGHvkSqyLYhlIro8P2/iOSYI VHDPkA43mIO9y4ChVs0u5tKTK1CXprVk4aqVxlIqMjJxO3Uk7ChIlj31J6XdJCWqGt6h iJ9B4EIc16BNA1uuzN4+u/JJtcP7Zdnj9LUn7sDDXT5WBwoNptikijnVg6CQbfAW50b1 zxzGYnYqSo/EA/S5dE5JbdFDH5zCO2YwaW0BbEabHCKaolGjJg4Yrgyt2ii22uUpGALA QJQQ== X-Gm-Message-State: ABuFfohzQmQtxXyRU/UuFQLGFH8y3ONDVwuFg8wu2lLTmKp3Mt2ghLjW 8EdhjmhmvfBK8YxF6UoylHs= X-Google-Smtp-Source: ACcGV63oUGWnO8Wsw7fq1KY87svGX++R3gisO5QM+vlw+ZXrXZO3sdBaaEjGFDhsJTqXsLH5IGZGtQ== X-Received: by 2002:a1c:c243:: with SMTP id s64-v6mr7063894wmf.36.1538340904016; Sun, 30 Sep 2018 13:55:04 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id a105-v6sm29779858wrc.23.2018.09.30.13.55.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 13:55:03 -0700 (PDT) From: Nathan Chancellor To: Boaz Harrosh , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor Subject: [PATCH] libosd: Remove ignored __weak attribute Date: Sun, 30 Sep 2018 13:54:48 -0700 Message-Id: <20180930205448.26205-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clang warns that the __weak attribute is going to be ignored on osd_root_object because it's not in the correct location (needs to be after the type). ./include/scsi/osd_types.h:31:21: warning: 'weak' attribute only applies to variables, functions, and classes [-Wignored-attributes] static const struct __weak osd_obj_id osd_root_object = {0, 0}; ^ Turns out that GCC ignores the attribute too albeit silently because moving the attribute after either osd_obj_id or osd_root_object like all other uses of __weak on variables in the kernel causes a build error on both GCC and Clang because static variables cannot be weak since weak definitions rely on not having internal linkage: ./include/scsi/osd_types.h:31:32: error: weak declaration cannot have internal linkage static const struct osd_obj_id __weak osd_root_object = {0, 0}; ^ Just remove the attribute because it hasn't been correct since the initial addition of this file in commit de258bf5e638 ("[SCSI] libosd: OSDv1 Headers"). Reported-by: Nick Desaulniers Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- include/scsi/osd_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/scsi/osd_types.h b/include/scsi/osd_types.h index 48e8a165e136..6b6fdcafa6cc 100644 --- a/include/scsi/osd_types.h +++ b/include/scsi/osd_types.h @@ -28,7 +28,7 @@ struct osd_obj_id { osd_id id; }; -static const struct __weak osd_obj_id osd_root_object = {0, 0}; +static const struct osd_obj_id osd_root_object = {0, 0}; struct osd_attr { u32 attr_page;