Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3204662ybn; Fri, 27 Sep 2019 02:48:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqysaLrTWdtbhm1OxzNrNL/pfguORxbyZeFBUNTsCMbOq8miyjWkLXUY0jMr2P7rVSgJBWxL X-Received: by 2002:aa7:dd8e:: with SMTP id g14mr3379655edv.233.1569577682237; Fri, 27 Sep 2019 02:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569577682; cv=none; d=google.com; s=arc-20160816; b=Hj4OrPFkSpZ9LwkLm3n0sr9CoSPFbqOkBl0WxF3NdB9vPPqvyIFJwDCVBAlZvIl6cz Yn3EpsbDpV/pbA6YN990dHCIYwSt0x5sjneCJDC36s2quEY95nlcFey2RBtojzz4c0lG ihienHX7P17P89ePAdRmyUk9ZC00SKTHMhTNdEqfzJebM3DM6TDPumdPHwq/ifqCsS9J OjLOe1d2mF/QCSCSDAVLM05NK8BdJf7K6x6cEZ8EHR3QWC4Srz/3j7RQqbcYbNPnyhUt THRjSyOubYERGqBEYrRtHzV38eKyJ66QSi3SLhZ9uvKPQjRu+yf5PB+TOctuVWTtJ+9L 7ppQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=9ocLLYoklleC51ClE0R7ZILp7brOFPIUtz+Zkz+5Aec=; b=sKAa5jIMI2EqZi3mK7twhyYK0w3lVLNcN6ozlFrzRA4Fpc6epmvIEzqZXpNl5pHXxu 6Lk8+w5OlQEkSMCHFHxuLNCoWGCKJq06EUp0mrwNHOlR/I/L4iGf0Mt6jFZSblNZf5RY KpzEEFlCvm4NIvgoes/AN+xTSfbYV6XJzM1zICI7Yn6eV5sJDAiBpZVgb0i9pw3YS71U X9vB/GSc+NL/RogsV4TJffVGZYsDe13fSXZLwS5XwJdqevjG6IUj7XlrSrgNhLRDoNDc e93T8o52v87iC/kvy7rlm88+6bKy5hhMk+uVXvbyodYtapBdxPMhWohnScl2ctw7//JT 8RVA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i40si1118498eda.225.2019.09.27.02.47.36; Fri, 27 Sep 2019 02:48:02 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726473AbfI0JrM (ORCPT + 99 others); Fri, 27 Sep 2019 05:47:12 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:33894 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbfI0JrM (ORCPT ); Fri, 27 Sep 2019 05:47:12 -0400 Received: from ramsan ([84.194.98.4]) by laurent.telenet-ops.be with bizsmtp id 6ZnA2100Q05gfCL01ZnA3C; Fri, 27 Sep 2019 11:47:10 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iDmqE-0000jM-A5; Fri, 27 Sep 2019 11:47:10 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iDmqE-00031E-70; Fri, 27 Sep 2019 11:47:10 +0200 From: Geert Uytterhoeven To: Bartlomiej Zolnierkiewicz , Masahiro Yamada , Andrew Morton Cc: Nick Desaulniers , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2] fbdev: c2p: Fix link failure on non-inlining Date: Fri, 27 Sep 2019 11:47:08 +0200 Message-Id: <20190927094708.11563-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the compiler decides not to inline the Chunky-to-Planar core functions, the build fails with: c2p_planar.c:(.text+0xd6): undefined reference to `c2p_unsupported' c2p_planar.c:(.text+0x1dc): undefined reference to `c2p_unsupported' c2p_iplan2.c:(.text+0xc4): undefined reference to `c2p_unsupported' c2p_iplan2.c:(.text+0x150): undefined reference to `c2p_unsupported' Fix this by marking the functions __always_inline. While this could be triggered before by manually enabling both CONFIG_OPTIMIZE_INLINING and CONFIG_CC_OPTIMIZE_FOR_SIZE, it was exposed in the m68k defconfig by commit ac7c3e4ff401b304 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly"). Fixes: 9012d011660ea5cf ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING") Reported-by: noreply@ellerman.id.au Signed-off-by: Geert Uytterhoeven Reviewed-by: Masahiro Yamada --- This is a fix for v5.4-rc1. v2: - Add Reviewed-by, - Fix Fixes, - Add more explanation. --- drivers/video/fbdev/c2p_core.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/c2p_core.h b/drivers/video/fbdev/c2p_core.h index e1035a865fb945f0..45a6d895a7d7208e 100644 --- a/drivers/video/fbdev/c2p_core.h +++ b/drivers/video/fbdev/c2p_core.h @@ -29,7 +29,7 @@ static inline void _transp(u32 d[], unsigned int i1, unsigned int i2, extern void c2p_unsupported(void); -static inline u32 get_mask(unsigned int n) +static __always_inline u32 get_mask(unsigned int n) { switch (n) { case 1: @@ -57,7 +57,7 @@ static inline u32 get_mask(unsigned int n) * Transpose operations on 8 32-bit words */ -static inline void transp8(u32 d[], unsigned int n, unsigned int m) +static __always_inline void transp8(u32 d[], unsigned int n, unsigned int m) { u32 mask = get_mask(n); @@ -99,7 +99,7 @@ static inline void transp8(u32 d[], unsigned int n, unsigned int m) * Transpose operations on 4 32-bit words */ -static inline void transp4(u32 d[], unsigned int n, unsigned int m) +static __always_inline void transp4(u32 d[], unsigned int n, unsigned int m) { u32 mask = get_mask(n); @@ -126,7 +126,7 @@ static inline void transp4(u32 d[], unsigned int n, unsigned int m) * Transpose operations on 4 32-bit words (reverse order) */ -static inline void transp4x(u32 d[], unsigned int n, unsigned int m) +static __always_inline void transp4x(u32 d[], unsigned int n, unsigned int m) { u32 mask = get_mask(n); -- 2.17.1