From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756279AbbLQT6i (ORCPT ); Thu, 17 Dec 2015 14:58:38 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:51325 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755434AbbLQT5q (ORCPT ); Thu, 17 Dec 2015 14:57:46 -0500 From: Arnd Bergmann To: Wolfram Sang Cc: kbuild test robot , kbuild-all@01.org, linux-i2c@vger.kernel.org, Niklas =?ISO-8859-1?Q?S=F6derlund?= , linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: allow building emev2 without slave mode again Date: Thu, 17 Dec 2015 20:57:04 +0100 Message-ID: <7990730.tNeXHUrIig@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151217194016.GD1530@katana> References: <201512102224.cVm7Hcp0%fengguang.wu@intel.com> <7947081.psvz6dklxq@wuerfel> <20151217194016.GD1530@katana> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Qdh6m/G9WLZWR/ImRkbcj1PxwYPSBeM4GYIIeRGqirLYTUsjNKO hc370QbkEVeVl/eBiDYgPmyHI0vdRK1exG7sUYxDtp06VIrDkSLd4Q4eK7hjivv8UCdrfGX OxysAzlY6pUs1a1iDMT+eziA5MkcpPNVVrO/Tz16i0T2TrMKwEB91PtqGHoYEidYHs53M2A RwHPJA0RMvGjg78f7cfhg== X-UI-Out-Filterresults: notjunk:1;V01:K0:YPtUR9jr6wE=:SV2UBPecY/0fM7kxmYFA+a cJlRFBZkKNlL2zy03LHpmMvSfwsofk5pyMXcJdQBuaVGnv8nv+aq2EBTUNzUPzouCMQmQ9X2f 84/35/Nkb6RVTkR3fNWRlmyBAysAPwY07BqEI33X85g75Wc/l7OSPxWowkU2tSFCZk9Cjd+8s rtRuW2Vlm2TybCpFkKrJhRZE3oxs/EBCX1wtasAjXPD3/ad4IQcHYnYlDJnChsUmEeb84h78o DW0Z7KAXZKOonUed3oskWlXv/s4M9W8SpSro5A0DmHyCST6WCGlpBev0LdWFF6CxEh4OSUYU8 wLt179nqtX8pd6z5ja1mmde9vP/5nw+kFu7kN9FxXf0HvamtRFlXGoJfFJtuiXZ7Wusy34Gn7 Y1628TELUQNgCOoV9O+hTBy18077rE3PgXeA3RMIA75bYTBZq4Ngr6stVETu2b9+a1eV5OfGh z5kUADmJpjgPikJlG8R784qLrLk3UKPir7kfHc0ci1/H56mX/CjsaWhK5hB65mgnEaumQJGIb uOMdWsFppInSU+xJC9ribXCkXhVDxuQkTJqfy3DjhkDcVSPMqCN/rNPA+zJUGovsFoUJVNYex z6t7v0j7QeMo0uC8aJ6z4mz7ww+MvCMJVL95bKBwwizMIR2t4B8A+FvrFnc/+0vjcmSHgQE7O Dl9YB+mYfAS5cPwBtx0mCMRo+Z7edA88mHgK7agQM+6zbEgx0Upt2Ds99y+gX3SXp78DXTUdE ETQtptIxDnve2ypO Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 17 December 2015 20:40:17 Wolfram Sang wrote: > > > My conclusion for now is: > > > > > > There needs something to be done surely, but currently I don't have the > > > bandwidth to do it or even play around with it. I am not fully happy > > > with your patches as well because __maybe_unused has some kind of "last > > > resort" feeling to me. > > > > I generally like __maybe_unused, but it's a matter of personal preference. > > We could avoid the __maybe_unused if the reg_slave/unreg_slave callback > > pointers are always available in struct i2c_algorithm. > > Yes, I was thinking in this direction, looking at how PM does it. Needs > some playing around, though. I think PM gets it slightly wrong, the way you have to use #ifdef leads to subtle bugs all the time, and I actually have a patch that converts a few dozen drivers to use __maybe_unused to shut up build warnings and errors. What you can do though is to use a reference like #define __i2c_slave_ptr(x) (IS_ENABLED(CONFIG_I2C_SLAVE) ? (x) : NULL) ... .reg_slave = __i2c_slave_ptr(em_i2c_reg_slave), .unreg_slave = __i2c_slave_ptr(em_i2c_unreg_slave), ... This has the same effect as the __maybe_unused annotation. Arnd