From patchwork Tue Apr 28 04:49:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 220416 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D78BBC83004 for ; Tue, 28 Apr 2020 04:50:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3DB920661 for ; Tue, 28 Apr 2020 04:50:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UJBzdJKH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726336AbgD1EuB (ORCPT ); Tue, 28 Apr 2020 00:50:01 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:34659 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725917AbgD1EuB (ORCPT ); Tue, 28 Apr 2020 00:50:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588049399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2rnvwTU0bdcv0i2Iy3BuVSHcVapVzzi+YvkRwobbBm8=; b=UJBzdJKHrHWtae7H1FmSJq5I74zUz7sZgyJdYmImmB6ad5aNKbDY4K31MjXs1pnhxvGtjk /FarIpvCftfPrJue28enrNQUBKx99KbuAtgamiYcwy1M8uPhUXcRQ3jWjpA20uH++uIRBw 1JvTs6cKMxyCHcWn/4892aQrLsszxhk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-229-4E2djSixM5arJbl7oXv6lw-1; Tue, 28 Apr 2020 00:49:56 -0400 X-MC-Unique: 4E2djSixM5arJbl7oXv6lw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8BF051899520; Tue, 28 Apr 2020 04:49:54 +0000 (UTC) Received: from localhost.localdomain.com (vpn2-54-127.bne.redhat.com [10.64.54.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D0B31001DC2; Tue, 28 Apr 2020 04:49:51 +0000 (UTC) From: Gavin Shan To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, netanel@amazon.com, akiyano@amazon.com, gtzalik@amazon.com, davem@davemloft.net, gshan@redhat.com, shan.gavin@gmail.com Subject: [PATCH v2] net/ena: Fix build warning in ena_xdp_set() Date: Tue, 28 Apr 2020 14:49:45 +1000 Message-Id: <20200428044945.123511-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This fixes the following build warning in ena_xdp_set(), which is observed on aarch64 with 64KB page size. In file included from ./include/net/inet_sock.h:19, from ./include/net/ip.h:27, from drivers/net/ethernet/amazon/ena/ena_netdev.c:46: drivers/net/ethernet/amazon/ena/ena_netdev.c: In function \ ‘ena_xdp_set’: \ drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning: \ format ‘%lu’ \ expects argument of type ‘long unsigned int’, but argument 4 \ has type ‘int’ \ [-Wformat=] "Failed to set xdp program, the current MTU (%d) is \ larger than the maximum allowed MTU (%lu) while xdp is on", Signed-off-by: Gavin Shan --- v2: Make ENA_PAGE_SIZE to be "unsigned long" and verify on aarch64 with 4KB or 64KB page size configuration --- drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h index 97dfd0c67e84..9e1860d81908 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.h +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h @@ -69,7 +69,7 @@ * 16kB. */ #if PAGE_SIZE > SZ_16K -#define ENA_PAGE_SIZE SZ_16K +#define ENA_PAGE_SIZE (_AC(SZ_16K, UL)) #else #define ENA_PAGE_SIZE PAGE_SIZE #endif