Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1287303imu; Fri, 25 Jan 2019 22:58:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN7B8WsJkExnFFuepJNxDI1YQpVwsfS9+ym3ttjGGSyr62aWFb1UcS7pKUjx1rcp+Djrrian X-Received: by 2002:a62:7a8b:: with SMTP id v133mr14234012pfc.159.1548485897891; Fri, 25 Jan 2019 22:58:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548485897; cv=none; d=google.com; s=arc-20160816; b=T0iOAoL7v8sdzaMs8ir/44fGGYv03F8RcZZRZtQ5wlET+O9RLC70bQHQCeothE3OYi 2B8JWYgL+WlfWkPcOBb3Qj8EPhYjji7LvsTUc4LSO5uCJkkutfMqHwznn48yVETY2zt1 0wquAzTj4+0FQQXg6Cyyc59FZ/9NuNBVGATHRaDI/jILMlOfRsmXHkFOZZ2n17KDSEyK F+g7mUITRqpBNeANUSVv0OM3pyR4uC9LBxrcQYZVhzdMc9Xy6bYhn3ZqVKvN5BwxCi0p GFwXAT7Gr+GH5+zT49lwuIj9pfSxRHFnNq5Fe6goBmSICyJ+xnn4fXxGFA2rsx8lHOEH KcQQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RjwB3FtLrBsQsXuI6hyxofqxMdNfU6yzZsI8WG4Rw4w=; b=i7zFZNdcKjukKAs4gwmCmWNylD60PWGxyOrd09lZRX8dcBc1CquRH0cbAzQ3SsNW2n nUkLSmJ2qezLEyElOl8fwmjimZ3Kf7iQQ0aF/QKrRlB6n/OYKQrB1aTiGSCtYa7gkP6w 24swqj0KVpGNHdGp69j6UtkgPetGOsF5GWTkRTYJfXkskWs/K7oGNkMFdkO40vEfgTz5 SPq5y33+2Go/D9NbDLpTJ+m6LzdL6MiTMuxiq2ep9loygO3H5Mmv7YzS9Kx1cffol44M XXetuhW/X+9CPUiP6jzbkPLub7JAH3/tfXeSkiT8zOhCyJc3We7fO580tTze/qOt0vgP hL5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lax7Txn4; 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 33si28630474plh.245.2019.01.25.22.58.01; Fri, 25 Jan 2019 22:58:17 -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=lax7Txn4; 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 S1728495AbfAZGzG (ORCPT + 99 others); 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-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.20.1