Message ID | 20230202053113.2782-1-rdunlap@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp55862wrn; Wed, 1 Feb 2023 21:40:00 -0800 (PST) X-Google-Smtp-Source: AK7set8XG5D4KI+gUoSUBg53HukhhfQVQw3i2abRvWpWJ7BfZ2CnFsw1xZxjhhIOS2qhvBmds403 X-Received: by 2002:aa7:d9da:0:b0:4a2:593c:b95d with SMTP id v26-20020aa7d9da000000b004a2593cb95dmr4760708eds.34.1675316400819; Wed, 01 Feb 2023 21:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675316400; cv=none; d=google.com; s=arc-20160816; b=ISqcQeSaqvpCl1WRlGp5cfuGR7jDwfyX/q+T0pIDzMGe9OQd59Zl/7RvsdnxQS19x+ DbnqyIEraBiG4qWxqYCogefkG2i/GdQXaJRfAnGSbMeOzb9zkh1pgTPA7kePjE3R1YeW 2eMv3wVWsjGUjOVlj0Muq8eoNfnX33oGXiHgGQmMoTOt17KrEvN4vlDT3sjgjD9VIWRC gbOt8+XB3/fIZeBhU5sTPVXBNelXjxu9pN8Wr67NUjoDKy2ezbw0pHmUqMlm1FrXQ+HW +eTw2Ucn1r9eJpwwBj9woW1Xl8UaNRD1T0a4FTtsAG5q827ROf0URC16nbryyYgZnBqC e8Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6xrDrgd0SgpMzq7Fih7w16pMOwi04Mj1hgwk0rtIR8g=; b=dJgiap/K/iKfz+cRMblKXbJ2QtIEu2sgmsSXBrr/A95ppwClW4RRxqgJQhsxMyphSk y4NNIYhPeOFFz08Y281dKAtYOG/EV/cyPrLWa5s9hIUteI0ihKICQFG+HvwIVwzgTW7J c5+O5bV58CClb3GY3Nce4e9+Tszez0pxjpzRT7MTIK9xV3aR0XahHJw90Bu3zwEckL23 T3yVX9Gg/8xXotoIWGiy7nU9qPff/++24sVeIqGc0Iys1/ZlNn1VEACU/aJCEj7N8OcO /PCT1VYBAQFZDB1mDZNqnMFfGnlZoIpRaqXGfMhlhFRCPm7VkE8fUS81A+8DWctle8Yl KnXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=nUKgQ0CV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r4-20020aa7cb84000000b004a3f99b0a93si3845980edt.572.2023.02.01.21.39.36; Wed, 01 Feb 2023 21:40:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=nUKgQ0CV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229929AbjBBFfH (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Thu, 2 Feb 2023 00:35:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231345AbjBBFe2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Feb 2023 00:34:28 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32EC884B5C; Wed, 1 Feb 2023 21:31:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=6xrDrgd0SgpMzq7Fih7w16pMOwi04Mj1hgwk0rtIR8g=; b=nUKgQ0CVxwQVVfCTHpke6jhRT9 EeJlUfJzGwXz9zQ9oXDM6mjMK8Qkvqsj4L05sphwzyZRqCdrHMbvSec+aGB7iEo8FyqmPrmUpNQrR 5pdFie01KZqO6FIVeVsJjfwKGu+cIVj7auniHEygyvyBrnwZHokJ3RzzXMR3NHA8K7xphYFZVROVH dDsDvCxJ4RS87XDeoS1S2kOa3sN19xd9sEVO2dGjeJlGw42jmE2Y1yas8zdYrWvOldf4mOA5m+zIY wrgh7inFeNY9WmCRaNf1QHl8GUJUU0wxuWNExlsfdCtHOvh7No7vM7GnYKmh/KUs+RZRvXS45m+AW +wo07Bvw==; Received: from [2601:1c2:d00:6a60::9526] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNSBl-00ERl0-Q3; Thu, 02 Feb 2023 05:31:13 +0000 From: Randy Dunlap <rdunlap@infradead.org> To: linux-kernel@vger.kernel.org Cc: Randy Dunlap <rdunlap@infradead.org>, Al Viro <viro@zeniv.linux.org.uk>, Yoshinori Sato <ysato@users.sourceforge.jp>, Rich Felker <dalias@libc.org>, linux-sh@vger.kernel.org, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, Arnd Bergmann <arnd@arndb.de>, Andrew Morton <akpm@linux-foundation.org> Subject: [PATCH v2] sh: implicit access_ok() needs an #include Date: Wed, 1 Feb 2023 21:31:13 -0800 Message-Id: <20230202053113.2782-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756696570644463272?= X-GMAIL-MSGID: =?utf-8?q?1756696570644463272?= |
Series |
[v2] sh: implicit access_ok() needs an #include
|
|
Commit Message
Randy Dunlap
Feb. 2, 2023, 5:31 a.m. UTC
Building arch/sh/ has a build error/warning that is fixed by
adding an #include of a header file.
../arch/sh/include/asm/checksum_32.h: In function 'csum_and_copy_from_user':
../arch/sh/include/asm/checksum_32.h:53:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration]
53 | if (!access_ok(src, len))
| ^~~~~~~~~
Fixes: 7fe8970a78a1 ("sh32: convert to csum_and_copy_from_user()")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
v2: add Subject: and patch description
arch/sh/include/asm/checksum_32.h | 1 +
1 file changed, 1 insertion(+)
Comments
On Thu, Feb 2, 2023, at 06:31, Randy Dunlap wrote: > Building arch/sh/ has a build error/warning that is fixed by > adding an #include of a header file. > > ../arch/sh/include/asm/checksum_32.h: In function > 'csum_and_copy_from_user': > ../arch/sh/include/asm/checksum_32.h:53:14: error: implicit declaration > of function 'access_ok' [-Werror=implicit-function-declaration] > 53 | if (!access_ok(src, len)) > | ^~~~~~~~~ > > Fixes: 7fe8970a78a1 ("sh32: convert to csum_and_copy_from_user()") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > Cc: Al Viro <viro@zeniv.linux.org.uk> > Cc: Yoshinori Sato <ysato@users.sourceforge.jp> > Cc: Rich Felker <dalias@libc.org> > Cc: linux-sh@vger.kernel.org > Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> > Cc: Arnd Bergmann <arnd@arndb.de> > Cc: Andrew Morton <akpm@linux-foundation.org> > --- > v2: add Subject: and patch description Thanks for the fix! > > arch/sh/include/asm/checksum_32.h | 1 + > 1 file changed, 1 insertion(+) > > diff -- a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h > --- a/arch/sh/include/asm/checksum_32.h > +++ b/arch/sh/include/asm/checksum_32.h > @@ -7,6 +7,7 @@ > */ > > #include <linux/in6.h> > +#include <asm-generic/access_ok.h> This will work correctly, but it is not the intended usage of the header. Anything in asm-generic/*.h should only be included by a particular header, usually the asm/*.h with the same name or in this case the asm/uaccess.h header. I think the correct fix here is to include asm/uaccess.h instead of asm-generic/access_ok.h. Arnd
Hi Arnd, On Thu, Feb 2, 2023 at 8:52 AM Arnd Bergmann <arnd@arndb.de> wrote: > On Thu, Feb 2, 2023, at 06:31, Randy Dunlap wrote: > > Building arch/sh/ has a build error/warning that is fixed by > > adding an #include of a header file. > > > > ../arch/sh/include/asm/checksum_32.h: In function > > 'csum_and_copy_from_user': > > ../arch/sh/include/asm/checksum_32.h:53:14: error: implicit declaration > > of function 'access_ok' [-Werror=implicit-function-declaration] > > 53 | if (!access_ok(src, len)) > > | ^~~~~~~~~ > > > > Fixes: 7fe8970a78a1 ("sh32: convert to csum_and_copy_from_user()") > > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > > Cc: Al Viro <viro@zeniv.linux.org.uk> > > Cc: Yoshinori Sato <ysato@users.sourceforge.jp> > > Cc: Rich Felker <dalias@libc.org> > > Cc: linux-sh@vger.kernel.org > > Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> > > Cc: Arnd Bergmann <arnd@arndb.de> > > Cc: Andrew Morton <akpm@linux-foundation.org> > > --- > > v2: add Subject: and patch description > > Thanks for the fix! > > > > > arch/sh/include/asm/checksum_32.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff -- a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h > > --- a/arch/sh/include/asm/checksum_32.h > > +++ b/arch/sh/include/asm/checksum_32.h > > @@ -7,6 +7,7 @@ > > */ > > > > #include <linux/in6.h> > > +#include <asm-generic/access_ok.h> > > This will work correctly, but it is not the intended usage of the > header. Anything in asm-generic/*.h should only be included by > a particular header, usually the asm/*.h with the same name or in this > case the asm/uaccess.h header. > > I think the correct fix here is to include asm/uaccess.h instead > of asm-generic/access_ok.h. Which should already be there, or RSN: https://lore.kernel.org/all/167514181688.11863.771497291150527329.git-patchwork-notify@kernel.org Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
On 2/2/23 00:22, Geert Uytterhoeven wrote: > Hi Arnd, > > On Thu, Feb 2, 2023 at 8:52 AM Arnd Bergmann <arnd@arndb.de> wrote: >> On Thu, Feb 2, 2023, at 06:31, Randy Dunlap wrote: >>> Building arch/sh/ has a build error/warning that is fixed by >>> adding an #include of a header file. >>> >>> ../arch/sh/include/asm/checksum_32.h: In function >>> 'csum_and_copy_from_user': >>> ../arch/sh/include/asm/checksum_32.h:53:14: error: implicit declaration >>> of function 'access_ok' [-Werror=implicit-function-declaration] >>> 53 | if (!access_ok(src, len)) >>> | ^~~~~~~~~ >>> >>> Fixes: 7fe8970a78a1 ("sh32: convert to csum_and_copy_from_user()") >>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> >>> Cc: Al Viro <viro@zeniv.linux.org.uk> >>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> >>> Cc: Rich Felker <dalias@libc.org> >>> Cc: linux-sh@vger.kernel.org >>> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> >>> Cc: Arnd Bergmann <arnd@arndb.de> >>> Cc: Andrew Morton <akpm@linux-foundation.org> >>> --- >>> v2: add Subject: and patch description >> >> Thanks for the fix! >> >>> >>> arch/sh/include/asm/checksum_32.h | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff -- a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h >>> --- a/arch/sh/include/asm/checksum_32.h >>> +++ b/arch/sh/include/asm/checksum_32.h >>> @@ -7,6 +7,7 @@ >>> */ >>> >>> #include <linux/in6.h> >>> +#include <asm-generic/access_ok.h> >> >> This will work correctly, but it is not the intended usage of the >> header. Anything in asm-generic/*.h should only be included by >> a particular header, usually the asm/*.h with the same name or in this >> case the asm/uaccess.h header. >> >> I think the correct fix here is to include asm/uaccess.h instead >> of asm-generic/access_ok.h. > > Which should already be there, or RSN: > https://lore.kernel.org/all/167514181688.11863.771497291150527329.git-patchwork-notify@kernel.org Good to see that. And thanks to both of you.
diff -- a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h --- a/arch/sh/include/asm/checksum_32.h +++ b/arch/sh/include/asm/checksum_32.h @@ -7,6 +7,7 @@ */ #include <linux/in6.h> +#include <asm-generic/access_ok.h> /* * computes the checksum of a memory block at buff, length len,