From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753827AbeENHXv (ORCPT ); Mon, 14 May 2018 03:23:51 -0400 Received: from mail.bootlin.com ([62.4.15.54]:58547 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753544AbeENHXs (ORCPT ); Mon, 14 May 2018 03:23:48 -0400 Date: Mon, 14 May 2018 09:23:34 +0200 From: Miquel Raynal To: Boris Brezillon Cc: Geert Uytterhoeven , linux-m68k@vger.kernel.org, David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] m68k: Implement ndelay() as an inline function to force type checking/casting Message-ID: <20180514092334.43b5ee3c@xps13> In-Reply-To: <20180513140212.3961-1-boris.brezillon@bootlin.com> References: <20180513140212.3961-1-boris.brezillon@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, On Sun, 13 May 2018 16:02:12 +0200, Boris Brezillon wrote: > ndelay() is supposed to take an unsigned long, but if you define > ndelay() as a macro and the caller pass an unsigned long long instead > of an unsigned long, the unsigned long long to unsigned long cast is > not done and we end up with an "undefined reference to `__udivdi3'" > error at link time. > > Fix that by making ndelay() an inline function and then defining dummy > ndelay() macro that redirects to the ndelay() function (it's how most > archs do to implement ndelay()). > > Fixes: c8ee038bd148 ("m68k: Implement ndelay() based on the existing udelay() logic") > Signed-off-by: Boris Brezillon Thanks for fixing it. Reviewed-by: Miquel Raynal -- Miquel Raynal, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fI7pv-0004DE-4f for linux-mtd@lists.infradead.org; Mon, 14 May 2018 07:24:01 +0000 Date: Mon, 14 May 2018 09:23:34 +0200 From: Miquel Raynal To: Boris Brezillon Cc: Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] m68k: Implement ndelay() as an inline function to force type checking/casting Message-ID: <20180514092334.43b5ee3c@xps13> In-Reply-To: <20180513140212.3961-1-boris.brezillon@bootlin.com> References: <20180513140212.3961-1-boris.brezillon@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Boris, On Sun, 13 May 2018 16:02:12 +0200, Boris Brezillon wrote: > ndelay() is supposed to take an unsigned long, but if you define > ndelay() as a macro and the caller pass an unsigned long long instead > of an unsigned long, the unsigned long long to unsigned long cast is > not done and we end up with an "undefined reference to `__udivdi3'" > error at link time. > > Fix that by making ndelay() an inline function and then defining dummy > ndelay() macro that redirects to the ndelay() function (it's how most > archs do to implement ndelay()). > > Fixes: c8ee038bd148 ("m68k: Implement ndelay() based on the existing udelay() logic") > Signed-off-by: Boris Brezillon Thanks for fixing it. Reviewed-by: Miquel Raynal -- Miquel Raynal, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com