From patchwork Sat Jan 26 06:47:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10782345 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 5338A746 for ; Sat, 26 Jan 2019 06:55:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C8A92F6CB for ; Sat, 26 Jan 2019 06:55:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A8B62F6C4; Sat, 26 Jan 2019 06:55:08 +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 C02222F6C4 for ; Sat, 26 Jan 2019 06:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728029AbfAZGzG (ORCPT ); Sat, 26 Jan 2019 01:55:06 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:38993 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727928AbfAZGzG (ORCPT ); Sat, 26 Jan 2019 01:55:06 -0500 Received: by mail-ed1-f65.google.com with SMTP id b14so9046111edt.6; Fri, 25 Jan 2019 22:55:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RjwB3FtLrBsQsXuI6hyxofqxMdNfU6yzZsI8WG4Rw4w=; b=lax7Txn42k6CUpHwMI+jKK7RwQYa+PlgotxriOpv9up8x+2JjYqo3BxW7VsEuHW/OJ id2IO4BOngQBo4uVR6GrqFVD+xx9HZiKEv9Z6lQylTkdObqaQQXyNH3gROzVM4OlJXdl ElEwpexfn8sZfPeMIhhkaoCXOh6+1K9LnM2s1tMq3g8tzJf+FqWhFl3rTiSoCzyVaHp2 T2KEfZADIm7RQ1HTE0pGYj1/pPSADOdWehzi+VtN6kxKO7DMsTNUeUs4gsGXVO3iwMoW i3sW2yFriFF1J72nMnVHDVCk+ibrNbD8pMBrjogHiwrnhsgE6S2EDur0ma+dVLsV4PXb LjTw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=RjwB3FtLrBsQsXuI6hyxofqxMdNfU6yzZsI8WG4Rw4w=; b=XZyuGxD/oHjPeaSQzd6p6v+w19XkEkadNJmPNTMLY+vQnbFCf2KWNKXOW9siNO3Khq BzHztxxDzPlxgzKBn6++8/pi/cVJFoRcT1QIdLdJlIZ40u/X7s/TSbU/4aN60tN7Sc+h sA+Mj3XbhGvu6BGm8XkqzKbri3j/xUa1qA3hCXRH0AdF3vXpp24RuXdt5ESOrv0VCImQ Xv1K60TuGAGMdJBp31+T+al3IoVkUjO+xWWMBK0SSlGxicejNQQB7wJiSa4ot0K7ze4N 4ASLZv3b3HezWHqBWl5XWzlmDN/Zz5FXqf8y/oFiswp/y/MZYQm3amiZr0u4AoBdHdLj k1Kg== X-Gm-Message-State: AJcUukeyoJAae1nysKMTTPyCC3pqjLuPXnhPX1Mlq8vvekS+MRLWUmoS QergjAj9k4LKvOYmwVXxRTM= X-Google-Smtp-Source: ALg8bN61ghgA73NYJZABuCcVstijQNkwjW+EEbRHBX/Ngl0qLrOgCcbYM820klR+yiDeSvSEV0lpyg== X-Received: by 2002:a50:9ac4:: with SMTP id p62mr13632896edb.179.1548485704039; Fri, 25 Jan 2019 22:55:04 -0800 (PST) Received: from localhost.localdomain ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id t26sm12486463eda.22.2019.01.25.22.55.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 22:55:03 -0800 (PST) From: Nathan Chancellor To: Boaz Harrosh , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers Subject: [PATCH RESEND] libosd: Remove ignored __weak attribute Date: Fri, 25 Jan 2019 23:47:41 -0700 Message-Id: <20190126064740.12949-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20180930205448.26205-1-natechancellor@gmail.com> References: <20180930205448.26205-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify 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 --- Resending as there was no conclusion on the removal of the OSD code and this warning is still present on mainline/next. I think it is rather unfair for this patch to be held back because of the possibility of removing this code when it is a very simple clean up patch and doesn't affect anything other than a build time warning. If this declaration or driver needs to be cleaned up in other ways, it should be done in subsequent patches. Thanks, Nathan 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;