From: "Kay Sievers" <kay.sievers@vrfy.org>
To: "David Miller" <davem@davemloft.net>
Cc: wli@holomorphy.com, greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: sparc: struct device - replace bus_id with dev_name(), dev_set_name()
Date: Fri, 7 Nov 2008 09:33:16 +0100 [thread overview]
Message-ID: <ac3eb2510811070033m108d8ed5t499c20ee02b2618f@mail.gmail.com> (raw)
In-Reply-To: <20081106.233557.193705310.davem@davemloft.net>
On Fri, Nov 7, 2008 at 08:35, David Miller <davem@davemloft.net> wrote:
> From: Kay Sievers <kay.sievers@vrfy.org>
> Date: Fri, 07 Nov 2008 01:43:59 +0100
>
>> --- a/arch/sparc/kernel/of_device.c
>> +++ b/arch/sparc/kernel/of_device.c
>> @@ -563,9 +563,9 @@ build_resources:
>> op->dev.parent = parent;
>> op->dev.bus = &of_platform_bus_type;
>> if (!parent)
>> - strcpy(op->dev.bus_id, "root");
>> + dev_set_name(&op->dev, "root");
>> else
>> - sprintf(op->dev.bus_id, "%08x", dp->node);
>> + dev_set_name(&op->dev, "%08x", dp->node);
>>
>> if (of_device_register(op)) {
>> printk("%s: Could not register of device.\n",
>
> This part is OK.
>
>> --- a/arch/sparc64/kernel/vio.c
>> +++ b/arch/sparc64/kernel/vio.c
>> @@ -224,7 +224,7 @@ static struct vio_dev *vio_create_one(st
>> if (!strcmp(type, "domain-services-port"))
>> bus_id_name = "ds";
>>
>> - if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) {
>> + if (strlen(bus_id_name) >= 20 - 4) {
>> printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
>> bus_id_name);
>> return NULL;
>>
>>
>
> But I don't like this.
>
> Could you please keep the macro around until everything is converted?
> Then you can remove the test entirely.
>
> Leaving it with just constants there is inviting confusion, no matter
> how short amount of time it will be there.
I can add a SPARC_BUS_ID_SIZE, to that file, or in a sparc header, but
the core will not provide any such value, and have to, go to catch all
remaining occurrences across the tree. Where should I add it?
Thanks,
Kay
next prev parent reply other threads:[~2008-11-07 8:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-07 0:43 Kay Sievers
2008-11-07 7:35 ` David Miller
2008-11-07 8:33 ` Kay Sievers [this message]
2008-11-07 9:38 ` David Miller
2008-11-07 9:58 ` Kay Sievers
2008-11-07 19:36 ` David Miller
2009-03-27 12:21 ` Kay Sievers
2009-03-28 0:27 ` David Miller
2009-04-16 16:21 ` Kay Sievers
2009-04-16 22:56 ` David Miller
2009-05-22 11:42 ` Kay Sievers
2009-05-26 9:30 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac3eb2510811070033m108d8ed5t499c20ee02b2618f@mail.gmail.com \
--to=kay.sievers@vrfy.org \
--cc=davem@davemloft.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wli@holomorphy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®