From patchwork Thu Jan 10 04:21:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 1022724 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rqen0wuO"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ZtCN4D1Cz9sN4 for ; Thu, 10 Jan 2019 15:23:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 075C985F2F; Thu, 10 Jan 2019 04:23:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hFySPGMNjeP4; Thu, 10 Jan 2019 04:23:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B22B985F97; Thu, 10 Jan 2019 04:23:07 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 023941C266A for ; Thu, 10 Jan 2019 04:23:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F2D288217F for ; Thu, 10 Jan 2019 04:23:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p0ShaVxgwrlY for ; Thu, 10 Jan 2019 04:23:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by hemlock.osuosl.org (Postfix) with ESMTPS id 3C0B78742F for ; Thu, 10 Jan 2019 04:23:00 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id m1so9867302wml.2 for ; Wed, 09 Jan 2019 20:23:00 -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:mime-version :content-transfer-encoding; bh=QqX0rVPHii2lBkNIAiDC7sBkxbxQR0a9q1iDJSjqxlc=; b=Rqen0wuOTZdcHwhIBQKC3NfCebb22kcMUIBKJjYOy0rNOoFf6Nzo8GE1bRSxJQjM3m u1c+YnkOTiei1YT72J8OlWnYl8wA2wiKLDW6S3byk9y0GJeVQncKnRMWsoT3pRNUePFW c27MXDbObamUa2L1kIVbFFzfk/VYKmFgmfSMV+2OGVE8Y/8IMbv4QFt48vO/jboS57+2 2Qx/Y+BGlpWQy1QoxeFWzHMs6eDAxf0/5rdVfxIm4Hd8VNA7epdgXyZ4T0M4+zweMwIm 2X6XR/5s8VHUb6TDRbVTYj6Ns05oy4+xB2/00vGNxqG5dTT9Y2dtljffhjx8V2yYV3P4 BoqQ== 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=QqX0rVPHii2lBkNIAiDC7sBkxbxQR0a9q1iDJSjqxlc=; b=p1n7YN3DCNPAC0+pyvrLFUEv47SDwWly9vH1YVp6JkRdIfOX5nLrzR/gOi7gDc2nKo +8br2ljubl1Kp8hXyvYhXIDdvqilooIu/+6azuDL8hPT/n4BISbN0BRycMMRy2slAEjz Ch1DO0QJkL2AYlYX08vTc9ZpU6eIN/2AYBXfDjiY4CcikesflT8i7bgB9ZFpxIa4bha4 uSPxszIAcEcNf0qUEgIhLJgjjBrJE5eM2SGdg7XRXi8MBhC6EVUm3VzdZuy3D+rqmHoF IigGraSnsOJaucU/J5mxWncSJARUhj98p8dSy/scXapOi8bXBb4OwBd21RC7oVxn8lSX JUIg== X-Gm-Message-State: AJcUukc20/sfe/t9d8lqci6no0p/NMfv9ShADtPsshqTS/uYbSoG7wHB qUpGvT71PX31QnD+3cj2qbo= X-Google-Smtp-Source: ALg8bN6NUzhMjMNUeJ9GUcxi661elHrpdgfTM/go1BxH+6ID8PPpiEPM6XooZkp4kkEb5Ru4kkptJw== X-Received: by 2002:a1c:2787:: with SMTP id n129mr8450620wmn.128.1547094178308; Wed, 09 Jan 2019 20:22:58 -0800 (PST) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id o17sm31424404wmg.35.2019.01.09.20.22.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 20:22:57 -0800 (PST) From: Nathan Chancellor To: Jeff Kirsher Date: Wed, 9 Jan 2019 21:21:57 -0700 Message-Id: <20190110042157.8445-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Patchwork-Bot: notify Subject: [Intel-wired-lan] [PATCH] iavf: Use printf instead of gnu_printf for iavf_debug_d X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, Miguel Ojeda , intel-wired-lan@lists.osuosl.org, Nathan Chancellor , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Clang warns: In file included from drivers/net/ethernet/intel/iavf/iavf_main.c:4: In file included from drivers/net/ethernet/intel/iavf/iavf.h:37: In file included from drivers/net/ethernet/intel/iavf/iavf_type.h:8: drivers/net/ethernet/intel/iavf/iavf_osdep.h:49:18: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes] __attribute__ ((format(gnu_printf, 3, 4))); ^ 1 warning generated. We can convert from gnu_printf to printf without any side effects for two reasons: 1. All iavf_debug instances use standard printf formats, as pointed out by Miguel Ojeda at the below link, meaning gnu_printf is not strictly required. 2. However, GCC has aliased printf to gnu_printf on Linux since at least 2010 based on git history. From gcc/c-family/c-format.c: /* Attributes such as "printf" are equivalent to those such as "gnu_printf" unless this is overridden by a target. */ static const target_ovr_attr gnu_target_overrides_format_attributes[] = { { "gnu_printf", "printf" }, { "gnu_scanf", "scanf" }, { "gnu_strftime", "strftime" }, { "gnu_strfmon", "strfmon" }, { NULL, NULL } }; The mentioned override only happens on Windows (mingw32). Changing from gnu_printf to printf is a no-op for GCC and stops Clang from warning. Link: https://github.com/ClangBuiltLinux/linux/issues/111 Suggested-by: Miguel Ojeda Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Tested-by: Andrew Bowers --- drivers/net/ethernet/intel/iavf/iavf_osdep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_osdep.h b/drivers/net/ethernet/intel/iavf/iavf_osdep.h index e6e0b0328706..c90cafb526d0 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_osdep.h +++ b/drivers/net/ethernet/intel/iavf/iavf_osdep.h @@ -46,7 +46,7 @@ struct iavf_virt_mem { #define iavf_debug(h, m, s, ...) iavf_debug_d(h, m, s, ##__VA_ARGS__) extern void iavf_debug_d(void *hw, u32 mask, char *fmt_str, ...) - __attribute__ ((format(gnu_printf, 3, 4))); + __printf(3, 4); typedef enum iavf_status_code iavf_status; #endif /* _IAVF_OSDEP_H_ */