Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757406AbcKXRSY (ORCPT ); Thu, 24 Nov 2016 12:18:24 -0500 Received: from mail-db5eur01on0130.outbound.protection.outlook.com ([104.47.2.130]:17820 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757219AbcKXRSV (ORCPT ); Thu, 24 Nov 2016 12:18:21 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH v2] i2c: i2c-mux-gpio: update mux with gpiod_set_array_value_cansleep To: Wolfram Sang References: <1479908035-18284-1-git-send-email-peda@axentia.se> <20161124151420.GF4271@katana> CC: , Peter Korsgaard , Wolfram Sang , From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <46be889f-a558-0174-f638-c685b23c8ed9@axentia.se> Date: Thu, 24 Nov 2016 16:45:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161124151420.GF4271@katana> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: AM5PR0201CA0021.eurprd02.prod.outlook.com (10.169.248.31) To DB6PR0201MB2309.eurprd02.prod.outlook.com (10.169.222.148) X-MS-Office365-Filtering-Correlation-Id: ce1299ca-6269-4811-2c58-08d41480fb0b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DB6PR0201MB2309; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0201MB2309;3:EENUJC//udZ1rFqtIRD0ymdHv/hYdKYucPk9skrl9uzS9rWZS8o3ukTkTscKDXTGX+VZp7fTfnV9615mXDDjKQxIT/pHQ8sZwzGRppJ9Xb8R33+lwhoq9jDRECubWBfeaSKR3j9Z/JZPdfCnHimnZ1JH5ge4qu33xSSP04dxQJ7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Kdbs9/2tjKl2gUCY2frA/95Hy3ADyhYkn1yM71ziY2jTjYdlDvavy2q3Jg87gnZ3YpKnTzOQUYbCk2FNRRP3KCgd/qtNiyqbQfzIv/OJ8qfUWHO2mxV82RoXQNxMERMWUQ7rT25JAa+kYe2pvluNd3bFCcRWaWQm+JQlALMXtwzGW4lshKOYaq1mumH3fpRSSkRs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6045199)(6060326)(6040361)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6061324)(6041248)(20161123555025)(2016111802025)(20161123564025)(20161123560025)(20161123562025)(6043046);SRVR:DB6PR0201MB2309;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0201MB2309; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0201MB2309;4:Vp+yLll45ar6RVnWVGqCKAyy3yXHv0Ls77TDq0t+ucxX5ydjccniOElY7BP2N1oqp7z9oRLn2MBH6TnxzP25tCxJdxysh6x9pG4qeleTT/Zx3mLWW+Fc12l5ldRBf0CfPiszfG0XUdoJqep/2OPUzWX2otxaR/sqoa2F8PX9Hmj8yYI5SvnuOvixeIIj4VTXPBGQVkDyQJ5q0ku0HtwiLBRvUJCV7mTKyIinVRvhoy6Zbs552nxsm4TF7NKkGqgrrd5v5Jrna4aQAAkyNfZ2AAWCuo+X7buRtxkqbh7An1OsAX03Z1p23tvsRObyx7otxKUcJmxLCvs2L5V0oC/KtpCiAMWTemisBg36z5d9hzcL296mpAqEU5CnIrornr/88hgl1tD4zna0U8QCyql/Tv3jX0CZzYj65+TLxIkoqu1xGPh8w6qEDLDD0lySiRGECfBk4+rqAiA2Y/n63+TbkLm+3Q0Mj2sehsiSqWIR/WrdDGV18vhtJOkChxa9p4pYdES0Tq6qsTE815nUurWJH4oARoUF19P3eF7lTt5Wb2JWLZ+gr+DicPm99wYNsXdaRpwkkEGGcE+vUzgppqWfPV0uwAn9FbtFtvtJlARHJM78dryHAt4drb7zKYJDn95DU+WsbnYhwnTFa1EmQ32miLKYkyKbmA9I/s20A8jJU12JKkGBRsDMjKKAzCYDr7r2DNynYiwpFpEhMmliSAgeOw== X-Forefront-PRVS: 0136C1DDA4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(189002)(199003)(377424004)(24454002)(74482002)(38730400001)(42186005)(6666003)(5660300001)(83506001)(64126003)(31686004)(4326007)(3846002)(39400400001)(47776003)(65806001)(39380400001)(65826007)(39410400001)(229853002)(305945005)(7736002)(6916009)(2906002)(66066001)(7846002)(65956001)(6116002)(189998001)(4001350100001)(92566002)(97736004)(31696002)(2950100002)(86362001)(4001150100001)(77096005)(2870700001)(33646002)(50986999)(76176999)(54356999)(81166006)(81156014)(110136003)(8676002)(117156001)(101416001)(230783001)(36756003)(106356001)(105586002)(23676002)(68736007)(50466002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DB6PR0201MB2309;H:[192.168.0.125];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjZQUjAyMDFNQjIzMDk7MjM6QkN4REJQQ0J0NVZqa29HMXlrdHJKbEZv?= =?utf-8?B?Sy9EVDhRd01ldmlFRjNYbGkrVmxsUXFCdkV4ZkUxNTc2NzlGNGdJMDgzajFt?= =?utf-8?B?TmpQdDFkUzFGSmVINERaMVZxcDRoT1ZFUUpxcHYrdURPZ0o4eG9RVEU1WVdj?= =?utf-8?B?eUdqTXhURms3NEtIc21sWnFMdFNra3ZTY2VVNXZLVi9iaS9DUkxJb3BUS0Ew?= =?utf-8?B?U0poY3ZiU3ZTdGw1cDREKzJsajhld1lNTmJ4RkdIUjdsdWNRUS9tWTlXS0pN?= =?utf-8?B?UndRMkM3Yk91VThieU01cHRaVHY3anErM1BDaHV6QXZVNXhtdDFvcHo1Q05o?= =?utf-8?B?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HYww9EDG7+IdZI/H8SiPnVepo5a2nzww/Zx6kndLs9MrXdnvmz5rRkWg1i7Okwy7GypmlfqNq51yFS6lumSznyTJ6c4w5La8QkK93/2uIm9FoWC3tQ== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2016 15:45:55.9429 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0201MB2309 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1306 Lines: 43 On 2016-11-24 16:14, Wolfram Sang wrote: > Hi Peter, > >> + int values[mux->data.n_gpios]; > > Hmm, my code checkers complain about this line: > > CHECK drivers/i2c/muxes/i2c-mux-gpio.c > SPARSE > drivers/i2c/muxes/i2c-mux-gpio.c:29:29: warning: Variable length array is used. > SMATCH > drivers/i2c/muxes/i2c-mux-gpio.c:29:29: warning: Variable length array is used. > > Worth to fix it? Yes, especially since I spotted an unrelated bug in my patch. Regarding this though, I just thought (smallish) variable length arrays were ok. But I guess smallish isn't very exact... > BTW (unrelated to your patch), the compiler complains about: > > In file included from drivers/i2c/muxes/i2c-mux-gpio.c:18:0: > drivers/i2c/muxes/../../gpio/gpiolib.h:88:27: warning: ‘gpio_suffixes’ defined but not used [-Wunused-const-variable=] > static const char * const gpio_suffixes[] = { "gpios", "gpio" }; > > which pointed out this line to me: > > 18 #include "../../gpio/gpiolib.h" > > which is probably worth fixing, too? Yes, I never liked that include, but I don't know how to get from struct gpio_desc * to the relevant struct device * without it... It's this line that needs it: gpio_dev = &gpio_dec->gdev->dev; If you can replace it with something neater, go for it! Cheers, Peter