mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Zwickel <martin.zwickel@technotrend.de>
To: Matthew Wilcox <willy@debian.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] reimplement pci proc name
Date: Fri, 20 Jun 2003 16:02:28 +0200	[thread overview]
Message-ID: <20030620160228.654e181c.martin.zwickel@technotrend.de> (raw)
In-Reply-To: <20030620134811.GR24357@parcelfarce.linux.theplanet.co.uk>

[-- Attachment #1: Type: text/plain, Size: 1729 bytes --]

Hi Matthew!

Just one question:
If pci_name_bus copies the bus' hex to name and always returns 0,
the "if (!pci_name_bus(name, bus)) return -EEXIST;" would always be true, right?

Or did I miss something?

Regards,
Martin

On Fri, 20 Jun 2003 14:48:11 +0100
Matthew Wilcox <willy@debian.org> bubbled:

> 
> Index: drivers/pci/proc.c
> ===================================================================
> RCS file: /var/cvs/linux-2.5/drivers/pci/proc.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 proc.c
> --- drivers/pci/proc.c	14 Jun 2003 22:15:29 -0000	1.9
> +++ drivers/pci/proc.c	17 Jun 2003 19:36:50 -0000
> @@ -383,7 +383,8 @@ int pci_proc_attach_device(struct pci_de
>  		return -EACCES;
>  
>  	if (!(de = bus->procdir)) {
> -		sprintf(name, "%02x", bus->number);
> +		if (!pci_name_bus(name, bus))
> +			return -EEXIST;
>  		de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
>  		if (!de)
>  			return -ENOMEM;

> Index: include/linux/pci.h
> ===================================================================
> RCS file: /var/cvs/linux-2.5/include/linux/pci.h,v
> retrieving revision 1.17
> diff -u -p -r1.17 pci.h
> --- include/linux/pci.h	14 Jun 2003 22:16:01 -0000	1.17
> +++ include/linux/pci.h	19 Jun 2003 00:55:35 -0000
> @@ -808,6 +815,11 @@ extern int pci_pci_problems;
>  
>  #ifndef CONFIG_PCI_DOMAINS
>  static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
> +static inline int pci_name_bus(char *name, struct pci_bus *bus)
> +{
> +	sprintf(name, "%02x", bus->number);
> +	return 0;
> +}
>  #endif
>  
>  #endif /* __KERNEL__ */
> 


-- 
MyExcuse:
Backbone adjustment

Martin Zwickel <martin.zwickel@technotrend.de>
Research & Development

TechnoTrend AG <http://www.technotrend.de>

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2003-06-20 13:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-20 13:48 Matthew Wilcox
2003-06-20 14:02 ` Martin Zwickel [this message]
2003-06-20 14:11   ` Matthew Wilcox
2003-06-20 14:06 ` Ivan Kokshaysky
2003-06-20 21:24 ` Greg KH
2003-06-21 11:53   ` Ivan Kokshaysky
2003-06-23  2:44     ` Greg KH

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=20030620160228.654e181c.martin.zwickel@technotrend.de \
    --to=martin.zwickel@technotrend.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@debian.org \
    /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®