From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 0A6937D912 for ; Fri, 23 Aug 2019 19:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732849AbfHWTnQ (ORCPT ); Fri, 23 Aug 2019 15:43:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:45400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731763AbfHWTnQ (ORCPT ); Fri, 23 Aug 2019 15:43:16 -0400 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98F41204EC; Fri, 23 Aug 2019 19:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566589395; bh=A5eeAEPetBRLMvoXmWpeJWVupdyZjGQb5uqPUxSopRE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Lp0kgTaL2ER1ikXu9l5+TknQpBRLVfc4BleH5oF+NdBkxB+c5LFY/2x7o82/KSivI T2zrEDSyzyNekmuNL6JiduReArBzQm9I4NzNK3pfgxz77LI6LzJ40njjfbD25tI8Sf 8bH3aLvOlHHgvixhW1XFYsbJ5xt34UdIwlMptUtI= Subject: Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core To: Brendan Higgins Cc: Frank Rowand , Greg KH , Josh Poimboeuf , Kees Cook , Kieran Bingham , Luis Chamberlain , Peter Zijlstra , Rob Herring , Stephen Boyd , Theodore Ts'o , Masahiro Yamada , devicetree , dri-devel , kunit-dev@googlegroups.com, "open list:DOCUMENTATION" , linux-fsdevel@vger.kernel.org, linux-kbuild , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , linux-nvdimm , linux-um@lists.infradead.org, Sasha Levin , "Bird, Timothy" , Amir Goldstein , Dan Carpenter , Daniel Vetter , Jeff Dike , Joel Stanley , Julia Lawall , Kevin Hilman , Knut Omang , Logan Gunthorpe , Petr Mladek , Randy Dunlap , Richard Weinberger , David Rientjes , Steven Rostedt , wfg@linux.intel.com, shuah References: <20190820232046.50175-1-brendanhiggins@google.com> <20190820232046.50175-2-brendanhiggins@google.com> <7f2c8908-75f6-b793-7113-ad57c51777ce@kernel.org> <4513d9f3-a69b-a9a4-768b-86c2962b62e0@kernel.org> <42c6235c-c586-8de1-1913-7cf1962c6066@kernel.org> <54f3c011-d666-e828-5e77-359b7a7374e7@kernel.org> From: shuah Message-ID: <6cb3a6b5-8570-07b2-dffb-eeca5a1c663b@kernel.org> Date: Fri, 23 Aug 2019 13:43:11 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 8/23/19 1:20 PM, Brendan Higgins wrote: > On Fri, Aug 23, 2019 at 12:04 PM shuah wrote: >> >> On 8/23/19 12:56 PM, Brendan Higgins wrote: >>> On Fri, Aug 23, 2019 at 11:32 AM shuah wrote: >>>> >>>> On 8/23/19 11:54 AM, Brendan Higgins wrote: >>>>> On Fri, Aug 23, 2019 at 10:34 AM shuah wrote: >>>>>> >>>>>> On 8/23/19 11:27 AM, Brendan Higgins wrote: >>>>>>> On Fri, Aug 23, 2019 at 10:05 AM shuah wrote: >>>>>>>> >>>>>>>> On 8/23/19 10:48 AM, Brendan Higgins wrote: >>>>>>>>> On Fri, Aug 23, 2019 at 8:33 AM shuah wrote: >>>>>>>>>> >>>>>>>>>> Hi Brendan, >>>>>>>>>> >>>>>>>>>> On 8/20/19 5:20 PM, Brendan Higgins wrote: >>>>>>>>>>> Add core facilities for defining unit tests; this provides a common way >>>>>>>>>>> to define test cases, functions that execute code which is under test >>>>>>>>>>> and determine whether the code under test behaves as expected; this also >>>>>>>>>>> provides a way to group together related test cases in test suites (here >>>>>>>>>>> we call them test_modules). >>>>>>>>>>> >>>>>>>>>>> Just define test cases and how to execute them for now; setting >>>>>>>>>>> expectations on code will be defined later. >>>>>>>>>>> >>>>>>>>>>> Signed-off-by: Brendan Higgins >>>>>>>>>>> Reviewed-by: Greg Kroah-Hartman >>>>>>>>>>> Reviewed-by: Logan Gunthorpe >>>>>>>>>>> Reviewed-by: Luis Chamberlain >>>>>>>>>>> Reviewed-by: Stephen Boyd >>>>>>>>>>> --- >>>>>>>>>>> include/kunit/test.h | 179 ++++++++++++++++++++++++++++++++++++++++ >>>>>>>>>>> kunit/Kconfig | 17 ++++ >>>>>>>>>>> kunit/Makefile | 1 + >>>>>>>>>>> kunit/test.c | 191 +++++++++++++++++++++++++++++++++++++++++++ >>>>>>>>>>> 4 files changed, 388 insertions(+) >>>>>>>>>>> create mode 100644 include/kunit/test.h >>>>>>>>>>> create mode 100644 kunit/Kconfig >>>>>>>>>>> create mode 100644 kunit/Makefile >>>>>>>>>>> create mode 100644 kunit/test.c >>>>>>>>>>> >>>>>>>>>>> diff --git a/include/kunit/test.h b/include/kunit/test.h >>>>>>>>>>> new file mode 100644 >>>>>>>>>>> index 0000000000000..e0b34acb9ee4e >>>>>>>>>>> --- /dev/null >>>>>>>>>>> +++ b/include/kunit/test.h >>>>>>>>>>> @@ -0,0 +1,179 @@ >>>>>>>>>>> +/* SPDX-License-Identifier: GPL-2.0 */ >>>>>>>>>>> +/* >>>>>>>>>>> + * Base unit test (KUnit) API. >>>>>>>>>>> + * >>>>>>>>>>> + * Copyright (C) 2019, Google LLC. >>>>>>>>>>> + * Author: Brendan Higgins >>>>>>>>>>> + */ >>>>>>>>>>> + >>>>>>>>>>> +#ifndef _KUNIT_TEST_H >>>>>>>>>>> +#define _KUNIT_TEST_H >>>>>>>>>>> + >>>>>>>>>>> +#include >>>>>>>>>>> + >>>>>>>>>>> +struct kunit; >>>>>>>>>>> + >>>>>>>>>>> +/** >>>>>>>>>>> + * struct kunit_case - represents an individual test case. >>>>>>>>>>> + * @run_case: the function representing the actual test case. >>>>>>>>>>> + * @name: the name of the test case. >>>>>>>>>>> + * >>>>>>>>>>> + * A test case is a function with the signature, ``void (*)(struct kunit *)`` >>>>>>>>>>> + * that makes expectations (see KUNIT_EXPECT_TRUE()) about code under test. Each >>>>>>>>>>> + * test case is associated with a &struct kunit_suite and will be run after the >>>>>>>>>>> + * suite's init function and followed by the suite's exit function. >>>>>>>>>>> + * >>>>>>>>>>> + * A test case should be static and should only be created with the KUNIT_CASE() >>>>>>>>>>> + * macro; additionally, every array of test cases should be terminated with an >>>>>>>>>>> + * empty test case. >>>>>>>>>>> + * >>>>>>>>>>> + * Example: >>>>>>>>>> >>>>>>>>>> Can you fix these line continuations. It makes it very hard to read. >>>>>>>>>> Sorry for this late comment. These comments lines are longer than 80 >>>>>>>>>> and wrap. >>>>>>>>> >>>>>>>>> None of the lines in this commit are over 80 characters in column >>>>>>>>> width. Some are exactly 80 characters (like above). >>>>>>>>> >>>>>>>>> My guess is that you are seeing the diff added text (+ ), which when >>>>>>>>> you add that to a line which is exactly 80 char in length ends up >>>>>>>>> being over 80 char in email. If you apply the patch you will see that >>>>>>>>> they are only 80 chars. >>>>>>>>> >>>>>>>>>> >>>>>>>>>> There are several comment lines in the file that are way too long. >>>>>>>>> >>>>>>>>> Note that checkpatch also does not complain about any over 80 char >>>>>>>>> lines in this file. >>>>>>>>> >>>>>>>>> Sorry if I am misunderstanding what you are trying to tell me. Please >>>>>>>>> confirm either way. >>>>>>>>> >>>>>>>> >>>>>>>> WARNING: Avoid unnecessary line continuations >>>>>>>> #258: FILE: include/kunit/test.h:137: >>>>>>>> + */ \ >>>>>>>> >>>>>>>> total: 0 errors, 2 warnings, 388 lines checked >>>>>>> >>>>>>> Ah, okay so you don't like the warning about the line continuation. >>>>>>> That's not because it is over 80 char, but because there is a line >>>>>>> continuation after a comment. I don't really see a way to get rid of >>>>>>> it without removing the comment from inside the macro. >>>>>>> >>>>>>> I put this TODO there in the first place a Luis' request, and I put it >>>>>>> in the body of the macro because this macro already had a kernel-doc >>>>>>> comment and I didn't think that an implementation detail TODO belonged >>>>>>> in the user documentation. >>>>>>> >>>>>>>> Go ahead fix these. It appears there are few lines that either longer >>>>>>>> than 80. In general, I keep them around 75, so it is easier read. >>>>>>> >>>>>>> Sorry, the above is the only checkpatch warning other than the >>>>>>> reminder to update the MAINTAINERS file. >>>>>>> >>>>>>> Are you saying you want me to go through and make all the lines fit in >>>>>>> 75 char column width? I hope not because that is going to be a pretty >>>>>>> substantial change to make. >>>>>>> >>>>>> >>>>>> There are two things with these comment lines. One is checkpatch >>>>>> complaining and the other is general readability. >>>>> >>>>> So for the checkpatch warning, do you want me to move the comment out >>>>> of the macro body into the kernel-doc comment? I don't really think it >>>>> is the right place for a comment of this nature, but I think it is >>>>> probably better than dropping it entirely (I don't see how else to do >>>>> it without just removing the comment entirely). >>>>> >>>> >>>> Don't drop the comments. It makes perfect sense to turn this into a >>>> kernel-doc comment. >>> >>> I am fine with that. I will do that in a subsequent revision once we >>> figure out the column limit issue. >>> >>>> We are going back forth on this a lot. I see several lines 81+ in >>>> this file. I am at 5.3-rc5 and my commit hooks aren't happy. I am >>>> fine with it if you want to convert these to kernel-doc comments. >>>> I think it makes perfect sense. >>> >>> Okay, so this is interesting. When I look at the applied patches in my >>> local repo, I don't see any 81+ lines. So it seems that something >>> interesting is going on here. >>> >>> To be clear (sorry for the stupid question) you are seeing the issue >>> after you applied the patch, and not in the patch file itself? >>> >> >> I am using my normal workflow. My pre-commit check is catching this. >> Just this patch. > > Okay, *that* is super strange! > > So I have lines in this patch (01/18) that are exactly 80 char wide > and I was thinking that it might be an off by one issue on either my > workflow or your workflow, but I have lines in other patches that are > exactly 80 char wide and our setups agree that they are fine, so I > really am not sure what's going on here. > > It sounds like you are only seeing the issue in only a couple places, > do you mind calling out the specific lines that are problematic? Take a look at the comment blocks. That is where the problem are. > >> All others are good other than the 9/18 BUG() issue. >>> Since we are still at OSS, would you mind if we meet up this afternoon >>> so I can see this issue you are seeing? I imagine we should get this >>> figured out pretty quickly. >>> >> >> Yeah. Would have been nice. I am not at oss today. > > Dang. > thanks, -- Shuah From mboxrd@z Thu Jan 1 00:00:00 1970 From: shuah Subject: Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core Date: Fri, 23 Aug 2019 13:43:11 -0600 Message-ID: <6cb3a6b5-8570-07b2-dffb-eeca5a1c663b@kernel.org> References: <20190820232046.50175-1-brendanhiggins@google.com> <20190820232046.50175-2-brendanhiggins@google.com> <7f2c8908-75f6-b793-7113-ad57c51777ce@kernel.org> <4513d9f3-a69b-a9a4-768b-86c2962b62e0@kernel.org> <42c6235c-c586-8de1-1913-7cf1962c6066@kernel.org> <54f3c011-d666-e828-5e77-359b7a7374e7@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Brendan Higgins Cc: Petr Mladek , "open list:DOCUMENTATION" , Peter Zijlstra , Amir Goldstein , dri-devel , Sasha Levin , Masahiro Yamada , "open list:KERNEL SELFTEST FRAMEWORK" , Frank Rowand , linux-nvdimm , Kevin Hilman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MgdG9kYXkuCj4gCj4gRGFuZy4KPiAKCnRoYW5rcywKLS0g U2h1YWgKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJp LWRldmVsIG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBz Oi8vbGlzdHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i1FSt-00070m-S7 for linux-um@lists.infradead.org; Fri, 23 Aug 2019 19:43:17 +0000 Subject: Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core References: <20190820232046.50175-1-brendanhiggins@google.com> <20190820232046.50175-2-brendanhiggins@google.com> <7f2c8908-75f6-b793-7113-ad57c51777ce@kernel.org> <4513d9f3-a69b-a9a4-768b-86c2962b62e0@kernel.org> <42c6235c-c586-8de1-1913-7cf1962c6066@kernel.org> <54f3c011-d666-e828-5e77-359b7a7374e7@kernel.org> From: shuah Message-ID: <6cb3a6b5-8570-07b2-dffb-eeca5a1c663b@kernel.org> Date: Fri, 23 Aug 2019 13:43:11 -0600 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Brendan Higgins Cc: Petr Mladek , "open list:DOCUMENTATION" , Peter Zijlstra , Amir Goldstein , dri-devel , Sasha Levin , Masahiro Yamada , "open list:KERNEL SELFTEST FRAMEWORK" , Frank Rowand , Rob Herring , linux-nvdimm , Kevin Hilman , Knut Omang , Kieran Bingham , wfg@linux.intel.com, Joel Stanley , David Rientjes , Jeff Dike , Dan Carpenter , devicetree , shuah , linux-kbuild , "Bird, Timothy , linux-um@lists.infradead.org, Steven Rostedt" , Julia Lawall , Josh Poimboeuf , kunit-dev@googlegroups.com, Theodore Ts'o , Richard Weinberger , Stephen Boyd , Greg KH , Randy Dunlap , Linux Kernel Mailing List , Luis Chamberlain , Daniel Vetter , Kees Cook , linux-fsdevel@vger.kernel.org, Logan Gunthorpe On 8/23/19 1:20 PM, Brendan Higgins wrote: > On Fri, Aug 23, 2019 at 12:04 PM shuah wrote: >> >> On 8/23/19 12:56 PM, Brendan Higgins wrote: >>> On Fri, Aug 23, 2019 at 11:32 AM shuah wrote: >>>> >>>> On 8/23/19 11:54 AM, Brendan Higgins wrote: >>>>> On Fri, Aug 23, 2019 at 10:34 AM shuah wrote: >>>>>> >>>>>> On 8/23/19 11:27 AM, Brendan Higgins wrote: >>>>>>> On Fri, Aug 23, 2019 at 10:05 AM shuah wrote: >>>>>>>> >>>>>>>> On 8/23/19 10:48 AM, Brendan Higgins wrote: >>>>>>>>> On Fri, Aug 23, 2019 at 8:33 AM shuah wrote: >>>>>>>>>> >>>>>>>>>> Hi Brendan, >>>>>>>>>> >>>>>>>>>> On 8/20/19 5:20 PM, Brendan Higgins wrote: >>>>>>>>>>> Add core facilities for defining unit tests; this provides a common way >>>>>>>>>>> to define test cases, functions that execute code which is under test >>>>>>>>>>> and determine whether the code under test behaves as expected; this also >>>>>>>>>>> provides a way to group together related test cases in test suites (here >>>>>>>>>>> we call them test_modules). >>>>>>>>>>> >>>>>>>>>>> Just define test cases and how to execute them for now; setting >>>>>>>>>>> expectations on code will be defined later. >>>>>>>>>>> >>>>>>>>>>> Signed-off-by: Brendan Higgins >>>>>>>>>>> Reviewed-by: Greg Kroah-Hartman >>>>>>>>>>> Reviewed-by: Logan Gunthorpe >>>>>>>>>>> Reviewed-by: Luis Chamberlain >>>>>>>>>>> Reviewed-by: Stephen Boyd >>>>>>>>>>> --- >>>>>>>>>>> include/kunit/test.h | 179 ++++++++++++++++++++++++++++++++++++++++ >>>>>>>>>>> kunit/Kconfig | 17 ++++ >>>>>>>>>>> kunit/Makefile | 1 + >>>>>>>>>>> kunit/test.c | 191 +++++++++++++++++++++++++++++++++++++++++++ >>>>>>>>>>> 4 files changed, 388 insertions(+) >>>>>>>>>>> create mode 100644 include/kunit/test.h >>>>>>>>>>> create mode 100644 kunit/Kconfig >>>>>>>>>>> create mode 100644 kunit/Makefile >>>>>>>>>>> create mode 100644 kunit/test.c >>>>>>>>>>> >>>>>>>>>>> diff --git a/include/kunit/test.h b/include/kunit/test.h >>>>>>>>>>> new file mode 100644 >>>>>>>>>>> index 0000000000000..e0b34acb9ee4e >>>>>>>>>>> --- /dev/null >>>>>>>>>>> +++ b/include/kunit/test.h >>>>>>>>>>> @@ -0,0 +1,179 @@ >>>>>>>>>>> +/* SPDX-License-Identifier: GPL-2.0 */ >>>>>>>>>>> +/* >>>>>>>>>>> + * Base unit test (KUnit) API. >>>>>>>>>>> + * >>>>>>>>>>> + * Copyright (C) 2019, Google LLC. >>>>>>>>>>> + * Author: Brendan Higgins >>>>>>>>>>> + */ >>>>>>>>>>> + >>>>>>>>>>> +#ifndef _KUNIT_TEST_H >>>>>>>>>>> +#define _KUNIT_TEST_H >>>>>>>>>>> + >>>>>>>>>>> +#include >>>>>>>>>>> + >>>>>>>>>>> +struct kunit; >>>>>>>>>>> + >>>>>>>>>>> +/** >>>>>>>>>>> + * struct kunit_case - represents an individual test case. >>>>>>>>>>> + * @run_case: the function representing the actual test case. >>>>>>>>>>> + * @name: the name of the test case. >>>>>>>>>>> + * >>>>>>>>>>> + * A test case is a function with the signature, ``void (*)(struct kunit *)`` >>>>>>>>>>> + * that makes expectations (see KUNIT_EXPECT_TRUE()) about code under test. Each >>>>>>>>>>> + * test case is associated with a &struct kunit_suite and will be run after the >>>>>>>>>>> + * suite's init function and followed by the suite's exit function. >>>>>>>>>>> + * >>>>>>>>>>> + * A test case should be static and should only be created with the KUNIT_CASE() >>>>>>>>>>> + * macro; additionally, every array of test cases should be terminated with an >>>>>>>>>>> + * empty test case. >>>>>>>>>>> + * >>>>>>>>>>> + * Example: >>>>>>>>>> >>>>>>>>>> Can you fix these line continuations. It makes it very hard to read. >>>>>>>>>> Sorry for this late comment. These comments lines are longer than 80 >>>>>>>>>> and wrap. >>>>>>>>> >>>>>>>>> None of the lines in this commit are over 80 characters in column >>>>>>>>> width. Some are exactly 80 characters (like above). >>>>>>>>> >>>>>>>>> My guess is that you are seeing the diff added text (+ ), which when >>>>>>>>> you add that to a line which is exactly 80 char in length ends up >>>>>>>>> being over 80 char in email. If you apply the patch you will see that >>>>>>>>> they are only 80 chars. >>>>>>>>> >>>>>>>>>> >>>>>>>>>> There are several comment lines in the file that are way too long. >>>>>>>>> >>>>>>>>> Note that checkpatch also does not complain about any over 80 char >>>>>>>>> lines in this file. >>>>>>>>> >>>>>>>>> Sorry if I am misunderstanding what you are trying to tell me. Please >>>>>>>>> confirm either way. >>>>>>>>> >>>>>>>> >>>>>>>> WARNING: Avoid unnecessary line continuations >>>>>>>> #258: FILE: include/kunit/test.h:137: >>>>>>>> + */ \ >>>>>>>> >>>>>>>> total: 0 errors, 2 warnings, 388 lines checked >>>>>>> >>>>>>> Ah, okay so you don't like the warning about the line continuation. >>>>>>> That's not because it is over 80 char, but because there is a line >>>>>>> continuation after a comment. I don't really see a way to get rid of >>>>>>> it without removing the comment from inside the macro. >>>>>>> >>>>>>> I put this TODO there in the first place a Luis' request, and I put it >>>>>>> in the body of the macro because this macro already had a kernel-doc >>>>>>> comment and I didn't think that an implementation detail TODO belonged >>>>>>> in the user documentation. >>>>>>> >>>>>>>> Go ahead fix these. It appears there are few lines that either longer >>>>>>>> than 80. In general, I keep them around 75, so it is easier read. >>>>>>> >>>>>>> Sorry, the above is the only checkpatch warning other than the >>>>>>> reminder to update the MAINTAINERS file. >>>>>>> >>>>>>> Are you saying you want me to go through and make all the lines fit in >>>>>>> 75 char column width? I hope not because that is going to be a pretty >>>>>>> substantial change to make. >>>>>>> >>>>>> >>>>>> There are two things with these comment lines. One is checkpatch >>>>>> complaining and the other is general readability. >>>>> >>>>> So for the checkpatch warning, do you want me to move the comment out >>>>> of the macro body into the kernel-doc comment? I don't really think it >>>>> is the right place for a comment of this nature, but I think it is >>>>> probably better than dropping it entirely (I don't see how else to do >>>>> it without just removing the comment entirely). >>>>> >>>> >>>> Don't drop the comments. It makes perfect sense to turn this into a >>>> kernel-doc comment. >>> >>> I am fine with that. I will do that in a subsequent revision once we >>> figure out the column limit issue. >>> >>>> We are going back forth on this a lot. I see several lines 81+ in >>>> this file. I am at 5.3-rc5 and my commit hooks aren't happy. I am >>>> fine with it if you want to convert these to kernel-doc comments. >>>> I think it makes perfect sense. >>> >>> Okay, so this is interesting. When I look at the applied patches in my >>> local repo, I don't see any 81+ lines. So it seems that something >>> interesting is going on here. >>> >>> To be clear (sorry for the stupid question) you are seeing the issue >>> after you applied the patch, and not in the patch file itself? >>> >> >> I am using my normal workflow. My pre-commit check is catching this. >> Just this patch. > > Okay, *that* is super strange! > > So I have lines in this patch (01/18) that are exactly 80 char wide > and I was thinking that it might be an off by one issue on either my > workflow or your workflow, but I have lines in other patches that are > exactly 80 char wide and our setups agree that they are fine, so I > really am not sure what's going on here. > > It sounds like you are only seeing the issue in only a couple places, > do you mind calling out the specific lines that are problematic? Take a look at the comment blocks. That is where the problem are. > >> All others are good other than the 9/18 BUG() issue. >>> Since we are still at OSS, would you mind if we meet up this afternoon >>> so I can see this issue you are seeing? I imagine we should get this >>> figured out pretty quickly. >>> >> >> Yeah. Would have been nice. I am not at oss today. > > Dang. > thanks, -- Shuah _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um