Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2284163pxm; Fri, 4 Mar 2022 13:05:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJziArOVNxD3JD2fm6AFO2PyiGeKFSPehVxg3QtBm+4W59C9+wS5cF8ks+RlsMbo7N04Cad3 X-Received: by 2002:a65:4549:0:b0:378:c0b0:c153 with SMTP id x9-20020a654549000000b00378c0b0c153mr217280pgr.177.1646427924659; Fri, 04 Mar 2022 13:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646427924; cv=none; d=google.com; s=arc-20160816; b=DdnEDPgOvuRBSr96ILSquvNveeDa6F8hQh4B9UBSrI9Z4FCG9Hwd+X6q2RVXvITGm8 rGEpY+xxUj61hpsaBlW0wq3sBpcyi5tI/wI7nWQEJn/vVJLhPbJEqjqv/6fu8aLBXyhT UkBTKXC9OksqQzPVLKrUsPz6EePtXXZAcq7hG7GoC10+3N7s3aSkT3OlhH84Rzel8ez7 AKdnGQcQ3O8zkicoZ5d9qr8dNxsaV4JdxpxGFMLF3VU4fvTv5QZ+Sx9Hy2ExeOHzS5rG kK45O36+Z8jhjR7PyimO1X4oBwdyMSQ4Jb9Fz7pM4sntEgLOcJvHIlzeh7rbzAEVm7UO oaAg== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=CsM4DWIugZse7XNnphKPzBjg0ZMGHlfT3XxfnVPQc18=; b=qRN4Bspj2+eD7Rft2lW5cCJTHD70YPVGCT3SRe0/GFixEL+Dt6BISzfBnhdaaLchB5 ahFF38pK6TrrFwoG9q5YV76o1lKE4AD6Kj9v1XlVCRrj0SNXaGqDj88jFS/IbGzKc8Nz DuevFuSOvz64pMaxNobXdDQj8L8DmQWShh5bAlfbHOowKt7PKfICI9zYK0+MvOFXTukg SOA97wNcbf1mk3/TN3mxvMJDz09HZh7EIwW91owBFrnpB4Yf4iKvxSOpcMViweahMut9 kywI1GNdzJNE7IhaiuhVAsGzC0OBSgkrNv9J8VwpD46nm3ZQg4juAVTmDXOZY/mHlXjK setg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z11-20020a1709027e8b00b0014f61371820si5074021pla.122.2022.03.04.13.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 13:05:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 411CC137745; Fri, 4 Mar 2022 12:16:42 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229606AbiCDURU (ORCPT + 99 others); Fri, 4 Mar 2022 15:17:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231340AbiCDURG (ORCPT ); Fri, 4 Mar 2022 15:17:06 -0500 Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B66D107806 for ; Fri, 4 Mar 2022 12:13:11 -0800 (PST) Received: from omf17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id A8F9A80EAC; Fri, 4 Mar 2022 19:28:35 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA id D6DAF19; Fri, 4 Mar 2022 19:27:34 +0000 (UTC) Message-ID: <451bb2c394b05928c815f1eb349a1281a687a608.camel@perches.com> Subject: Re: [PATCH] scsi: megaraid: cleanup formatting of megaraid From: Joe Perches To: Miguel Ojeda Cc: Tom Rix , Finn Thain , Konrad Wilhelm Kleine , Bart Van Assche , kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com, Nathan Chancellor , Nick Desaulniers , megaraidlinux.pdl@broadcom.com, scsi , linux-kernel , llvm@lists.linux.dev Date: Fri, 04 Mar 2022 11:28:31 -0800 In-Reply-To: References: <20220127151945.1244439-1-trix@redhat.com> <0adde369-3fd7-3608-594c-d199cce3c936@redhat.com> <46441b86-1d19-5eb4-0013-db1c63a9b0a5@redhat.com> <8dd05afd-0bb9-c91b-6393-aff69f1363e1@redhat.com> <233660d0-1dee-7d80-1581-2e6845bf7689@linux-m68k.org> <95f5be1d-f5f3-478-5ccb-76556a41de78@linux-m68k.org> <7368bc3ea6dece01004c3e0c194abb0d26d4932b.camel@perches.com> <9dc86e74-7741-bb8e-bbad-ae96cebaaebc@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: hyg3dz78tn3se81k3zw45k8tm7sk1h45 X-Rspamd-Server: rspamout04 X-Rspamd-Queue-Id: D6DAF19 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+VgJSiCgMrlaHF7nxKS3V69xPErNMNUTw= X-HE-Tag: 1646422054-460497 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2022-03-04 at 19:48 +0100, Miguel Ojeda wrote: > On Fri, Mar 4, 2022 at 6:37 PM Joe Perches wrote: > > > > I rather doubt clang-format will ever be 'close enough'. > > > > A human's sense of 'taste' for reading code is very different than > > what an automated tool produces. > > Maybe, Hey again Miguel. Is that statement really disputable? > but it is a trade-off. If it is close enough, the benefits of > automatic formatting may overcome the downsides. IYO. I think using an SCCS with better language understanding rather than a line oriented one could be an improvement. Such a tool could allow arbitrary style reformatting at check-in/check-out. > > Also, try looking at the changes clang-format does on a file chosen > > at random: > > > > o columnarized definitions -> not columnarized > > o odd line continuation placement using spaces and not tabs before \ > > o odd array definition layouts > > o per line definitions with comments poorly laid out > > o individual line definitions rewrapped > > o enum definitions on multiple lines compressed to single lines > > o u8 array definition layouts where the first element has a separate > > meaning than the subsequent elements are compressed and made > > difficult to understand > > I am not sure what you are trying to show here -- some of these are > precisely the things that the tool could improve or have already > improved, and we may just need to use the new option. All of these existing code are more human readable than the code reformatted using clang-format. I used whatever is the latest clang-format here with today's -next. https://releases.llvm.org/download.html > For instance, for the columnarized macros case, it is possible to > align them since clang-format 9. For array of structures, there is > also a new alignment option since clang-format 13. Etc. Then perhaps you as the maintainer of the kernel's .clang-format file could update the entries for those new options. I believe the minimum clang version is already 11. Maybe higher. I don't track clang or use it very much. The clang version I use though is 13. > For the wrapping and related bits, now that the limit on 80 is a bit > more fuzzy, we could perhaps tweak the penalties to improve the > decision making. Please have at it. But perhaps tweaking will just improve some cases and worsen others. > In summary, what we should be trying to do is improve the tool > configuration and tool itself to see if we can get it to be close > enough to the kernel style to make it more widely used. > > > I think _some_ clang-format output is ok, but the concept of > > enabling/disabling specific reformatting bits would be quite useful. > > > > And sprinkling "clang-format on/off" lines in the code is not good. > > Definitely, but it is fine in some exceptional cases. I don't think so. > > Any control codes that determine when source code layout might be > > immutable or allowed to be modified could be should be tool name > > agnostic. > > I don't see why would that be a problem, and I don't understand why we > would use several different formatting tools (the point is to be > consistent, after all); but sure, we could propose an alternative > spelling. Thanks. There is no "one true editor". There will not be "one true source code formatter" either. cheers not jeers, just keep at it. Joe