All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon/coretemp: requires CONFIG_PCI
@ 2017-11-28 17:39 Randy Dunlap
  2017-11-28 21:41 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2017-11-28 17:39 UTC (permalink / raw)
  To: linux-hwmon, Jean Delvare, Guenter Roeck
  Cc: LKML, Rudolf Marek, Thomas Gleixner, Fenghua Yu

From: Randy Dunlap <rdunlap@infradead.org>

Fix coretemp.c build when CONFIG_PCI is not enabled.
Fixes these build errors:

../drivers/hwmon/coretemp.c: In function 'adjust_tjmax':
../drivers/hwmon/coretemp.c:250:9: error: implicit declaration of function 'pci_get_domain_bus_and_slot' [-Werror=implicit-function-declaration]
  struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);
../drivers/hwmon/coretemp.c:250:32: warning: initialization makes pointer from integer without a cast [enabled by default]
  struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/hwmon/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-415-rc1.orig/drivers/hwmon/Kconfig
+++ lnx-415-rc1/drivers/hwmon/Kconfig
@@ -631,7 +631,7 @@ config SENSORS_I5500
 
 config SENSORS_CORETEMP
 	tristate "Intel Core/Core2/Atom temperature sensor"
-	depends on X86
+	depends on X86 && PCI
 	help
 	  If you say yes here you get support for the temperature
 	  sensor inside your CPU. Most of the family 6 CPUs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwmon/coretemp: requires CONFIG_PCI
  2017-11-28 17:39 [PATCH] hwmon/coretemp: requires CONFIG_PCI Randy Dunlap
@ 2017-11-28 21:41 ` Guenter Roeck
  2017-11-28 22:32   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2017-11-28 21:41 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-hwmon, Jean Delvare, LKML, Rudolf Marek, Thomas Gleixner,
	Fenghua Yu

On Tue, Nov 28, 2017 at 09:39:02AM -0800, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix coretemp.c build when CONFIG_PCI is not enabled.
> Fixes these build errors:
> 
> ../drivers/hwmon/coretemp.c: In function 'adjust_tjmax':
> ../drivers/hwmon/coretemp.c:250:9: error: implicit declaration of function 'pci_get_domain_bus_and_slot' [-Werror=implicit-function-declaration]
>   struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);
> ../drivers/hwmon/coretemp.c:250:32: warning: initialization makes pointer from integer without a cast [enabled by default]
>   struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);
> 

nack, sorry.

The dependency is artificial, and the code using it is only needed for old
CPUs. There should be a dummy function for pci_get_domain_bus_and_slot()
if PCI is disabled, similar to pci_get_bus_and_slot() and all the other
pci functions. If that is unacceptable for some reason, I rather revert
the patch introducing the use of pci_get_domain_bus_and_slot().
After all, it doesn't add any real value to enforce the use of
pci_get_domain_bus_and_slot() in the driver, a dummy function for
pci_get_bus_and_slot() _is_ available, and the new function is quite
obviously not a 1:1 replacement of pci_get_bus_and_slot().

Guenter

> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Rudolf Marek <r.marek@assembler.cz>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: linux-hwmon@vger.kernel.org
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  drivers/hwmon/Kconfig |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- lnx-415-rc1.orig/drivers/hwmon/Kconfig
> +++ lnx-415-rc1/drivers/hwmon/Kconfig
> @@ -631,7 +631,7 @@ config SENSORS_I5500
>  
>  config SENSORS_CORETEMP
>  	tristate "Intel Core/Core2/Atom temperature sensor"
> -	depends on X86
> +	depends on X86 && PCI
>  	help
>  	  If you say yes here you get support for the temperature
>  	  sensor inside your CPU. Most of the family 6 CPUs
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwmon/coretemp: requires CONFIG_PCI
  2017-11-28 21:41 ` Guenter Roeck
@ 2017-11-28 22:32   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2017-11-28 22:32 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-hwmon, Jean Delvare, LKML, Rudolf Marek, Thomas Gleixner,
	Fenghua Yu

On 11/28/2017 01:41 PM, Guenter Roeck wrote:
> On Tue, Nov 28, 2017 at 09:39:02AM -0800, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Fix coretemp.c build when CONFIG_PCI is not enabled.
>> Fixes these build errors:
>>
>> ../drivers/hwmon/coretemp.c: In function 'adjust_tjmax':
>> ../drivers/hwmon/coretemp.c:250:9: error: implicit declaration of function 'pci_get_domain_bus_and_slot' [-Werror=implicit-function-declaration]
>>   struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);
>> ../drivers/hwmon/coretemp.c:250:32: warning: initialization makes pointer from integer without a cast [enabled by default]
>>   struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);
>>
> 
> nack, sorry.

No problem.

> The dependency is artificial, and the code using it is only needed for old
> CPUs. There should be a dummy function for pci_get_domain_bus_and_slot()
> if PCI is disabled, similar to pci_get_bus_and_slot() and all the other
> pci functions. If that is unacceptable for some reason, I rather revert
> the patch introducing the use of pci_get_domain_bus_and_slot().

I sent a patch with that function stub addition.

> After all, it doesn't add any real value to enforce the use of
> pci_get_domain_bus_and_slot() in the driver, a dummy function for
> pci_get_bus_and_slot() _is_ available, and the new function is quite
> obviously not a 1:1 replacement of pci_get_bus_and_slot().
> 
> Guenter
> 
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Rudolf Marek <r.marek@assembler.cz>
>> Cc: Jean Delvare <jdelvare@suse.com>
>> Cc: Guenter Roeck <linux@roeck-us.net>
>> Cc: linux-hwmon@vger.kernel.org
>> Cc: Fenghua Yu <fenghua.yu@intel.com>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> ---
>>  drivers/hwmon/Kconfig |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)


-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-28 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 17:39 [PATCH] hwmon/coretemp: requires CONFIG_PCI Randy Dunlap
2017-11-28 21:41 ` Guenter Roeck
2017-11-28 22:32   ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.