From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759621AbcIXRco (ORCPT ); Sat, 24 Sep 2016 13:32:44 -0400 Received: from smtprelay0189.hostedemail.com ([216.40.44.189]:39889 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754522AbcIXRcm (ORCPT ); Sat, 24 Sep 2016 13:32:42 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1963:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:10004:10400:10848:11026:11232:11473:11658:11914:12740:13069:13161:13229:13255:13311:13357:13439:13894:14096:14097:14180:14659:21080:21212:21324:21326:21451:30012:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: baby71_345d5fe9aa927 X-Filterd-Recvd-Size: 2800 Message-ID: <1474738358.23838.11.camel@perches.com> Subject: Re: [PATCH] realtek: Add switch variable to 'switch case not processed' messages From: Joe Perches To: Larry Finger , Jean Delvare , Jes Sorensen Cc: Chaoming Li , Kalle Valo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 24 Sep 2016 10:32:38 -0700 In-Reply-To: <49094659-662d-a902-6740-ea3d1fea6660@lwfinger.net> References: <1474654333.1849.5.camel@perches.com> <1474657363.1849.9.camel@perches.com> <20160924175555.01cae6dd@endymion> <1474733754.23838.3.camel@perches.com> <49094659-662d-a902-6740-ea3d1fea6660@lwfinger.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.21.91-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (adding Jes Sorensen to recipients) On Sat, 2016-09-24 at 11:35 -0500, Larry Finger wrote: > I have patches that makes HAL_DEF_WOWLAN be a no-op for the rest of the drivers,  > and one that sets the enum values for that particular statement to hex values. I  > also looked at the other large enums and decided that they never need the human  > lookup. Hey Larry. There are many somewhat common realtek wireless drivers. Not to step on your toes, but what do you think of rationalizing the switch/case statements of all the realtek drivers in a few steps: o Reindent all the switch/case blocks to a more normal kernel style (git diff -w would show no changes here) o cast, spacing and parenthesis reductions Lots of odd and somewhat unique styles in various drivers, looks like too many individual authors without a style guide / code enforcer using slightly different personalized code. Glancing at the code, it looks to be similar logic, just written in different styles. o Logic changes like from: if (foo) func(..., bar, ...); else func(..., baz, ...); to: func(..., foo ? bar : baz, ...); to make the case statement code blocks more consistent and emit somewhat smaller object code. o Consolidation of equivalent function spanning drivers With the style only changes minimized, where possible make the drivers use common ops/callback functions. Is there any value in that or is Jes' work going to make doing any or all of this unnecessary and futile?