Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp428810imm; Sat, 22 Sep 2018 03:18:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZXzVu8NaBSF1L6cBGjUtadXoFZfNpAs81ODfb3z16Z4+/RQyUZVZLUr87SsopAPcLHE/pF X-Received: by 2002:a62:b0e:: with SMTP id t14-v6mr1956064pfi.36.1537611506130; Sat, 22 Sep 2018 03:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537611506; cv=none; d=google.com; s=arc-20160816; b=HRoLEnNKfsRO+qvnWpU3kZFlBdwZuHTLTxqJoeBLwBt50uPUolE7M9HxQQLJhF1C3X cVdSmvYS8cUlVuqodEbvHqd+SV7CnNekXA5dNnrLDXOruhQPM2h6d31nyWEeRpvqpJ8s gdHJaGbYaz+ED8Fr/aPb1KiWxEVds9QMwe0lRR07z57SeR1IzVwCMO575bXsk4TRpyEz pe3MV6hesY0ZtbHvpi9uQe7+iV5q/ykdy6nD2jjTO+PzZlJ0n2xwdlLxDeiaz+qC99sQ T7YPNqOVQ0OppXmFV6nQnJNhTfo6+mAFoj4Idjm5cTznK7/KVxg5N1NygxVTb7PIHLPN bSwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wnX6xmqZS/qRx2uhtGuGSWC0VCxdoLJyyvJ1obwmwPk=; b=J7/CGuqShP81C44CmwAhAVTTrSyhIYfLT2KzA7U+GfkfzVtUCeszc+OEdYhQTdsOPu SrFELJikYGoaJ5PH9dH2atI3p0YIXFT2V0IBhuSVNRQDwXIUC5mkl/LyuTyvgk7GOniD E43rcQN0RDIdBf+i26amwLafgXxn9cEY6IFvqNChT75E6tfcjRT8175Atis+wEMyxDqV rRbWBAQrVDQhgObEOxiRYtYHJRSCODszeXMBy9FdcwOzN51W7M1WyxGN7HSEM5vS3oRG qdHBfODsD89Dm0K4DQ3cXA71BObcbGze7QB4pJCtZM2229r1LmajUZJkfbEglL7eFP/I Pnxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fEeNvgkP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21-v6si29351252pgk.418.2018.09.22.03.18.10; Sat, 22 Sep 2018 03:18:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fEeNvgkP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728049AbeIVQLJ (ORCPT + 99 others); Sat, 22 Sep 2018 12:11:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:42850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbeIVQLI (ORCPT ); Sat, 22 Sep 2018 12:11:08 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F1E0821523; Sat, 22 Sep 2018 10:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1537611485; bh=196skmytk4ds3Dl8r1FNBEGvAdmNW93w3sAv7eVOuWs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fEeNvgkPjM2XgvFJEmS8B3EfCuR0eOxSWfLUQ0MocP1xEV85OsWC7QHs/NDlwwq6A 1/iydNaiUPqKAsowa4010GCfTxh/BVqmJgLycuRiVq7HL8MGoIUIWoSxq15a44k5m8 9USHVQCVSl7Trwo7CAjbgSSfV6nnbqSs37al2lsI= Date: Sat, 22 Sep 2018 11:18:01 +0100 From: Jonathan Cameron To: Song Qiang Cc: Himanshu Jha , knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: magnetometer: hmc5843: Clean up redundant code. Message-ID: <20180922111801.73a4d969@archlinux> In-Reply-To: <20180922100419.GA25620@Eros> References: <20180920141321.15251-1-songqiang1304521@gmail.com> <201809211608.bVz8vg0N%fengguang.wu@intel.com> <20180921182616.GA2077@himanshu-Vostro-3559> <20180922100419.GA25620@Eros> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 22 Sep 2018 18:04:19 +0800 Song Qiang wrote: > On Fri, Sep 21, 2018 at 11:56:16PM +0530, Himanshu Jha wrote: > > Hi Song, > > > > On Fri, Sep 21, 2018 at 04:10:16PM +0800, kbuild test robot wrote: > > > Hi Song, > > > > > > Thank you for the patch! Yet something to improve: > > > > > > [auto build test ERROR on iio/togreg] > > > [also build test ERROR on v4.19-rc4 next-20180920] > > > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > > > > > url: https://github.com/0day-ci/linux/commits/Song-Qiang/iio-magnetometer-hmc5843-Clean-up-redundant-code/20180921-091239 > > > base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg > > > config: x86_64-randconfig-u0-09211331 (attached as .config) > > > compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010 > > > reproduce: > > > # save the attached .config to linux build tree > > > make ARCH=x86_64 > > > > > > All errors (new ones prefixed by >>): > > > > > > >> ERROR: "hmc5843_volatile_table" [drivers/iio/magnetometer/hmc5843_i2c.ko] undefined! > > > >> ERROR: "hmc5843_readable_table" [drivers/iio/magnetometer/hmc5843_i2c.ko] undefined! > > > >> ERROR: "hmc5843_writable_table" [drivers/iio/magnetometer/hmc5843_i2c.ko] undefined! > > > > You would need to export these above symbols using EXPORT_SYMBOL() > > to be used by i2c/spi modules. > > > > But on the other hand, exporting too many symbols is a bad idea since > > it is only used for this driver and not at any other place in IIO. > > So, in my opinion drop this patch and leave the code as-is. > > > > https://lkml.org/lkml/2018/7/16/566 --> worth reading > > > > > > Thanks > > -- > > Himanshu Jha > > Undergraduate Student > > Department of Electronics & Communication > > Guru Tegh Bahadur Institute of Technology > > Hi Himanshu, > > You're right, that's exactly what I was missing! > I saw the link you mentioned above and I also think that's a very good > idea to limit the scope of symbols. But I don't know when this work can > be applied to the kernel, as it seems like a not little change for the > build infrastructure. > I think this maybe a common problem for some drivers. > Divers for bmc150 in drivers/iio/accel/bmc-150-accel-core.c did the same > exporting stuff as I was prefered. So I think even if either exporting or > duplicating is not good enough, one must be choosed for now. > > I think this is a topic that I have some ideas but not experienced > enough to say what should we do is better. I would like to hear Jonathan's > ideas about this. If this patched shouldn't be applied, then maybe bmc150 > should be patched. As you say it's not a particularly clear advantage either way and will depend on the size of the repetition. So I'm afraid it's in the category of insisting on one option or the other is just overly fussy. Al, for existing cases it's also not worth the noise that changing to one or other option creates. Whilst the noise effect on things like backporting fixes is minor for patches like this, it isn't zero so there has to be a clear advantage in whatever is changed. Hence I won't be taking this one, or any patches going the other way for existing drivers. Thanks, Jonathan > > yours, > Song Qiang >