Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp265465imd; Wed, 31 Oct 2018 18:48:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5eHMHrnCl9Ucj+osyOidfdgkolwm68AXH8Ia81Ha7xJ0S1X+OT6yPVxq32raDE80g22hEHJ X-Received: by 2002:a17:902:694c:: with SMTP id k12-v6mr2445830plt.40.1541036927098; Wed, 31 Oct 2018 18:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541036927; cv=none; d=google.com; s=arc-20160816; b=r22NEms8oJyXb764CkSOEvUEPqlSvFxPihY2bgh/jT2sDVMl+A5VAZV6XifjqAP72M Y/LzkchqkyqyIl2ik+ILOtkkux6/x7DmUs4oi20qtluJ+x/psw3roDQAO989IVIr0AxD xPh15TaCQAcXZmQu+B+SVf0n5a/+l9agpaGcsK0V85GYbFH4DsQ4Dr7Y401OhptDBVJk FpmDIzBjz092yDGsXigy88OD9MJ+gAk3zIOlQZfCDTtChu3NN2PteMCktBnVJFXoGr3l pmK1cLlyRtJlMyA4C9Qhyt64EnSCQoNETLlOWH280M1WGQnZ/fJkn7AkbQWS0ofsTvBh IVMg== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=HHzLiT9Ap/pSWhAU06QyHqArkXsKnNg8xqdtbNQegjg=; b=DlGq9JbL9orgSBIWVD80VqJgi/HpiVY+9nUFWoTsJ0HO/4YNiP0ANJaUgVb+gZcStE pTe0Fh3LOMZK23Ni8XJ5MsrHZiZ9PBHf5sRliWSS0Ck1oqAgZYkVzAxwoEZaIcnEDUgI BGpcpt+3FFa5LRGQENpYOJVWCMHqbfVunbiqXTttTt4R5S2UPLk1RBnZVi6FZS571fM8 iK42xG132aloQYfzdZBzK7FMzmisJqFP7XPXoJ/Bi5IwrXwJXEXNiSZpS5qnwObzzOwJ CmFwqg9RiBtgABTjVXgQ3ytxpu2kq/WDpz8Zz1blkCRBsL8cz4lfVRpwna+XnzsGcaMV PXCw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12-v6si3464333pgg.158.2018.10.31.18.48.31; Wed, 31 Oct 2018 18:48:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727323AbeKAKkq (ORCPT + 99 others); Thu, 1 Nov 2018 06:40:46 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34990 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbeKAKkp (ORCPT ); Thu, 1 Nov 2018 06:40:45 -0400 Received: by mail-wr1-f66.google.com with SMTP id z16-v6so610550wrv.2; Wed, 31 Oct 2018 18:39:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=HHzLiT9Ap/pSWhAU06QyHqArkXsKnNg8xqdtbNQegjg=; b=R+2G4XRwCUhshLN8UQ3mMSk8hQrmRqfUXhBdyhYhi6RfV8z0nlM/1gBC8lCvT0K93F QqvxCArYzOTVEgJr4/yUuQWXHcy/9ZLM//K+VXGFD1Jo8P+ZYSpHTgvPUN9xhPykPfs/ Ts2nWf7NQZKQ4aEjDd9KNtyDg87LgP3qzF4UYSiCph6BOiUt297yLf+LD1eNg9NBWJVn ivbdnFQCCltozY88PzjDul9z/t4eQHUpFvPsTQeWF8s7cL0LwuCUkyp9HqedjEqz6Rut p12v+H1KXoNHpcBEjdn9L1HxpBqLU87scda/afUfuGqSVB7KCU6DQH/nJPYO3vPmgg7f bXRw== X-Gm-Message-State: AGRZ1gJZRMQGdWeuXNLjVmEJGx4wxIBJjiV1AvC4/96QfEyQ6ohTiaCk cwKcu3Bzwa/AVprgpFUpBf77DBb0 X-Received: by 2002:a5d:53cd:: with SMTP id a13-v6mr4621480wrw.71.1541036396878; Wed, 31 Oct 2018 18:39:56 -0700 (PDT) Received: from [10.0.0.5] ([207.232.55.62]) by smtp.gmail.com with ESMTPSA id t17sm18039716wrx.9.2018.10.31.18.39.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 18:39:55 -0700 (PDT) Subject: Re: [PATCH] libosd: Remove ignored __weak attribute To: Nathan Chancellor , Bart Van Assche References: <20180930205448.26205-1-natechancellor@gmail.com> <10b12992-3570-4646-374b-82cbd7276839@acm.org> <1538503063.193396.6.camel@acm.org> <1538521591.193396.8.camel@acm.org> <20181025213144.GB24709@flashbox> Cc: Nick Desaulniers , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, LKML From: Boaz Harrosh Message-ID: <1c58c82f-5cfa-f483-097a-5b82904e5e9a@electrozaur.com> Date: Thu, 1 Nov 2018 03:39:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20181025213144.GB24709@flashbox> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/10/18 00:31, Nathan Chancellor wrote: > On Tue, Oct 02, 2018 at 04:06:31PM -0700, Bart Van Assche wrote: <> > > Hi Bart, > > I'm sorry if I didn't follow the conclusion of this conversation properly > but this is the below diff you were initially looking for, correct? > > If so, Boaz and Nick, do you have any objections if this is v2? I'd like > to get this patch accepted so the warning can be fixed for everyone. > ACK on both the original and below code they will all work just fine. I do like the original "just remove the _weak thingy". But this one will work as well. The "with extern" version suggested before is more cumbersome because it will need an EXPORT_SYMBOL() but will also work. The all use of osd_root_object is just. A properly C-types pointer to couple of ZEROS. but since the Interface needs a pointer, those zeros need storage somewhere. It does not matter where. (The value of the pointer is not used only its content) Do you need that I send a proper patch? Actually the original first patch is the version I like. (And again all 3 approaches will work) Thanks Boaz > Thanks, > Nathan > > ================================================================================ > > diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c > index e19fa883376f..4250f739beb3 100644 > --- a/drivers/scsi/osd/osd_initiator.c > +++ b/drivers/scsi/osd/osd_initiator.c > @@ -58,6 +58,8 @@ > > enum { OSD_REQ_RETRIES = 1 }; > > +static const struct osd_obj_id osd_root_object; > + > MODULE_AUTHOR("Boaz Harrosh "); > MODULE_DESCRIPTION("open-osd initiator library libosd.ko"); > MODULE_LICENSE("GPL"); > diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c > index eaf36ccf58db..770c758baaa9 100644 > --- a/drivers/scsi/osd/osd_uld.c > +++ b/drivers/scsi/osd/osd_uld.c > @@ -73,6 +73,7 @@ > > static const char osd_name[] = "osd"; > static const char *osd_version_string = "open-osd 0.2.1"; > +static const struct osd_obj_id osd_root_object; > > MODULE_AUTHOR("Boaz Harrosh "); > MODULE_DESCRIPTION("open-osd Upper-Layer-Driver osd.ko"); > diff --git a/include/scsi/osd_types.h b/include/scsi/osd_types.h > index 48e8a165e136..eb31357ec8b3 100644 > --- a/include/scsi/osd_types.h > +++ b/include/scsi/osd_types.h > @@ -28,8 +28,6 @@ struct osd_obj_id { > osd_id id; > }; > > -static const struct __weak osd_obj_id osd_root_object = {0, 0}; > - > struct osd_attr { > u32 attr_page; > u32 attr_id; >