Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp418082imm; Sat, 22 Sep 2018 03:05:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYk8M4o/urdhJfIF+fSvEj77n2MRI0G8Gy2MwIJlPXwwGETwHVJBs6Fa+KCCOtEE6KUsrwS X-Received: by 2002:a62:4898:: with SMTP id q24-v6mr1960461pfi.22.1537610706077; Sat, 22 Sep 2018 03:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537610705; cv=none; d=google.com; s=arc-20160816; b=P23lr0zGI6AXcXlbNA3B78DgFo455iq8wBQN4D2PHz2OcdwGUG1mWDO5+fTGinQL3Y a789iJJ8J8+mtHO7Wt57AiJ5i8080BmWdCYvW8++kxf7FLd3JZgO4TLttN7f+CvUhXQm iZ6KDXvtdH9yNPFzO0xy235CfdvcM0/yr/tzcVEYB9F3WBzQfiZj4177oiJtSl9hUF0E uLYvLx0nNxg7N6zgVTUZgqXw2B8X9e8qdGPdl9ZZhQN1qgz6n26E1tvC7H0J54qtWrDn jJEB/JM/jVFuOOwZ5ihkkmQnqQ+0e2G+ZKLZlX3Xp4n/28AKevVjVQQjizDxluPy/noI RqXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ehJBkiM5j21JwFDXV9pseglwDPQdYPC5hmCDiQAbqxM=; b=MUL2uJpPhrZST932/028yg1Q5LJ8cJuJBcZ3fm+u58IGMzMK0a59gkB2/rdTfC5xnt HkXLAmz5nranU4KjgvYywcH62roeQUyIq+QuQm+hLd2+abnKAcilsp9/j3ailuPswlvk XIdV3BsmzGutvMMp8zQWc4g7Q3lGs7m0kHWbp+5HcrIYUU37mLgK56dx7em4re0A8Zd8 imtUPXZ+aK8CdlfWzoG8SNQZlVtrW+gedYVa6HVcr2BdJlLaucOpdnJxwkOTRjj6wCG0 Q6MJ3e4KIZnSZ8gTUP8vN9QKAR2uE5wkrL2oPcJ/NgGCak+MVhVP92KmlgwGmNU5XUH6 ZLMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qeqd6tgD; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l185-v6si845217pgl.270.2018.09.22.03.04.49; Sat, 22 Sep 2018 03:05:05 -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=@gmail.com header.s=20161025 header.b=qeqd6tgD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728096AbeIVP51 (ORCPT + 99 others); Sat, 22 Sep 2018 11:57:27 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37670 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbeIVP51 (ORCPT ); Sat, 22 Sep 2018 11:57:27 -0400 Received: by mail-pl1-f195.google.com with SMTP id q1-v6so1555909plr.4; Sat, 22 Sep 2018 03:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ehJBkiM5j21JwFDXV9pseglwDPQdYPC5hmCDiQAbqxM=; b=qeqd6tgDlPmKRvtoxzBt0gZABCNEJDBhVxwdX6FoxbXWtCAUghoK1KHOp1sz9OYsQy 4EeMhu/GQaO035mx3oDQhgwwW6fnxaJu6YZntCh7BiMs5ZQnJbcB/WqtlZmMowat+Mu+ ++t9Rue5hB4V15nHVIl0gFlSjjueqdWcdcLGrKaDBOYiX7Uic764qmlUw4rqrEW0jc6P 2h5ewXgVzZqdJ203cKtuOS4rRdVap34lrmmAcfDoSLQDh1slme7ZruLDS0bnXagX9iZH 8ho+pozbyoO+AxP3l/xM+eEUkWL6ZG8LTvipBgBb0wby/tRUyxePgExg0jYm6hmLS6oS 2ZOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ehJBkiM5j21JwFDXV9pseglwDPQdYPC5hmCDiQAbqxM=; b=RR4FnVSLdRDgYZ75qs37f7jNOCHFeJKnjN1pK27QZhCnOYI6CjySdI437Gk7izGqDK m6xjOLEm44rXqgv9YQRAeH3MfmaUl16a5RHHqU491M8k85d/mQFdRZtjRaUVu867Brb8 IPY8HHmCDdkb/w7z8oHiOe1wRcMFPefzMVeBZSF2n6Qhj9WksUBA/UFnyECjTFlJczv5 2s9aPZRFpGCuKAv8qAqGn1p9EGbVNhLufWYphpTfM0ZMofnI3fPXzoZadrnU+bFueN5G 8y/tzDuKQRlKTFzzbOdCWmCCIpiydghs9cD9feuOpYZP7CdhgvZgSnWFZ4p4a5yhU0OJ 7jxw== X-Gm-Message-State: ABuFfoiRnDP7WwpE27pfkisBgSmBLf1i7Z3IIFj4xh5R+aVhEE6MrQ6Q I8iB1mU+v/gVa2VV8NZQeWY= X-Received: by 2002:a17:902:585:: with SMTP id f5-v6mr1977491plf.7.1537610666705; Sat, 22 Sep 2018 03:04:26 -0700 (PDT) Received: from Eros (104.176.229.35.bc.googleusercontent.com. [35.229.176.104]) by smtp.gmail.com with ESMTPSA id n74-v6sm43540923pfi.161.2018.09.22.03.04.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Sep 2018 03:04:26 -0700 (PDT) Date: Sat, 22 Sep 2018 18:04:19 +0800 From: Song Qiang To: Himanshu Jha Cc: jic23@kernel.org, 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: <20180922100419.GA25620@Eros> References: <20180920141321.15251-1-songqiang1304521@gmail.com> <201809211608.bVz8vg0N%fengguang.wu@intel.com> <20180921182616.GA2077@himanshu-Vostro-3559> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180921182616.GA2077@himanshu-Vostro-3559> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. yours, Song Qiang