[PATCH 1/12] X86: fix !CONFIG_SMP warning in processor.c - Kernel

This is a discussion on [PATCH 1/12] X86: fix !CONFIG_SMP warning in processor.c - Kernel ; Jeremy Fitzhardinge wrote: > Jeff Garzik wrote: >> arch/x86/kernel/early-quirks.c:40: warning: ‘nvidia_hpet_check’ defined but not used >> >> Signed-off-by: Jeff Garzik >> --- >> >> diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c >> index dc34acb..639e632 100644 >> --- a/arch/x86/kernel/early-quirks.c >> +++ b/arch/x86/kernel/early-quirks.c >> @@ ...

+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 21 to 40 of 43

Thread: [PATCH 1/12] X86: fix !CONFIG_SMP warning in processor.c

  1. Re: [PATCH 2/12] X86: fix nvidia HPET warning

    Jeremy Fitzhardinge wrote:
    > Jeff Garzik wrote:
    >> arch/x86/kernel/early-quirks.c:40: warning: ‘nvidia_hpet_check’ defined but not used
    >>
    >> Signed-off-by: Jeff Garzik
    >> ---
    >>
    >> diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
    >> index dc34acb..639e632 100644
    >> --- a/arch/x86/kernel/early-quirks.c
    >> +++ b/arch/x86/kernel/early-quirks.c
    >> @@ -35,12 +35,14 @@ static void __init via_bugs(void)
    >> }
    >>
    >> #ifdef CONFIG_ACPI
    >> +#ifdef CONFIG_X86_IO_APIC
    >>

    >
    > Why not #if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)? Saves
    > a line and a layer of #if(def).


    quite agreed, but I was merely duplicating (with precision ) the
    ifdef-ery used in the caller

    Jeff



    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH 4/12] riscom8: fix SMP brokenness

    On 10/24/2007 12:36 AM, Jeff Garzik wrote:
    > After analyzing the elements that save_flags/cli/sti/restore_flags were
    > protecting, convert their usages to a global spinlock (the easiest and
    > most obvious next-step). There were some usages of flags being
    > intentionally cached, because the code already knew the state of
    > interrupts. These have been taken into account.
    >
    > This allows us to remove CONFIG_BROKEN_ON_SMP. Completely untested.
    >
    > Signed-off-by: Jeff Garzik
    > ---
    >

    [...]
    > diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
    > index b37e626..45d109c 100644
    > --- a/drivers/char/riscom8.c
    > +++ b/drivers/char/riscom8.c

    [...]
    > @@ -82,6 +83,8 @@
    > static struct riscom_board * IRQ_to_board[16];
    > static struct tty_driver *riscom_driver;
    >
    > +static spinlock_t riscom_lock = SPIN_LOCK_UNLOCKED;


    This is deprecated (see linux/spinlock_types.h for details), use DEFINE_SPINLOCK
    instead, otherwise seems OK.

    Revieweved-by: Jiri Slaby

    thanks,
    --
    Jiri Slaby (jirislaby@gmail.com)
    Faculty of Informatics, Masaryk University
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [PATCH 4/12] riscom8: fix SMP brokenness

    Jiri Slaby wrote:
    > On 10/24/2007 12:36 AM, Jeff Garzik wrote:
    >> After analyzing the elements that save_flags/cli/sti/restore_flags were
    >> protecting, convert their usages to a global spinlock (the easiest and
    >> most obvious next-step). There were some usages of flags being
    >> intentionally cached, because the code already knew the state of
    >> interrupts. These have been taken into account.
    >>
    >> This allows us to remove CONFIG_BROKEN_ON_SMP. Completely untested.
    >>
    >> Signed-off-by: Jeff Garzik
    >> ---
    >>

    > [...]
    >> diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
    >> index b37e626..45d109c 100644
    >> --- a/drivers/char/riscom8.c
    >> +++ b/drivers/char/riscom8.c

    > [...]
    >> @@ -82,6 +83,8 @@
    >> static struct riscom_board * IRQ_to_board[16];
    >> static struct tty_driver *riscom_driver;
    >>
    >> +static spinlock_t riscom_lock = SPIN_LOCK_UNLOCKED;

    >
    > This is deprecated (see linux/spinlock_types.h for details), use DEFINE_SPINLOCK
    > instead, otherwise seems OK.
    >
    > Revieweved-by: Jiri Slaby


    I noticed you reviewed my other riscom8 patch... you don't have hardware
    perchance, do you?

    Jeff



    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. Re: [PATCH 4/12] riscom8: fix SMP brokenness

    On Wed, 24 Oct 2007 08:47:23 +0200 Jiri Slaby wrote:

    > > +static spinlock_t riscom_lock = SPIN_LOCK_UNLOCKED;

    >
    > This is deprecated (see linux/spinlock_types.h for details), use DEFINE_SPINLOCK
    > instead, otherwise seems OK.


    Hey, if only we had a little perl script to check stuff like that.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: [PATCH 5/12] ISDN/sc: fix longstanding warning

    On Tue, Oct 23, 2007 at 06:36:39PM -0400, Jeff Garzik wrote:
    > drivers/isdn/sc/shmem.c: In function ‘memcpy_toshmem’:
    > drivers/isdn/sc/shmem.c:54: warning: passing argument 1 of ‘memcpy_toio’ makes pointer from integer without a cast
    >
    > Also, remove some unneeded braces, and add some useful whitespace.
    >
    > Signed-off-by: Jeff Garzik


    Acked.
    > ---
    >
    > diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c
    > index 034d41a..e0331e0 100644
    > --- a/drivers/isdn/sc/shmem.c
    > +++ b/drivers/isdn/sc/shmem.c
    > @@ -28,15 +28,15 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
    > {
    > unsigned long flags;
    > unsigned char ch;
    > + unsigned long dest_rem = ((unsigned long) dest) % 0x4000;
    >
    > - if(!IS_VALID_CARD(card)) {
    > + if (!IS_VALID_CARD(card)) {
    > pr_debug("Invalid param: %d is not a valid card id\n", card);
    > return;
    > }
    >
    > - if(n > SRAM_PAGESIZE) {
    > + if (n > SRAM_PAGESIZE)
    > return;
    > - }
    >
    > /*
    > * determine the page to load from the address
    > @@ -50,8 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
    >
    > outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
    > sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
    > - memcpy_toio(sc_adapter[card]->rambase +
    > - ((unsigned long) dest % 0x4000), src, n);
    > + memcpy_toio(sc_adapter[card]->rambase + dest_rem, src, n);
    > spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
    > pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
    > ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
    > -
    > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    > the body of a message to majordomo@vger.kernel.org
    > More majordomo info at http://vger.kernel.org/majordomo-info.html
    > Please read the FAQ at http://www.tux.org/lkml/


    --
    Karsten Keil
    SuSE Labs
    ISDN and VOIP development
    SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg)
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. Re: [PATCH 4/12] riscom8: fix SMP brokenness

    On 10/24/2007 08:52 AM, Jeff Garzik wrote:
    > Jiri Slaby wrote:
    >> Revieweved-by: Jiri Slaby

    >
    > I noticed you reviewed my other riscom8 patch... you don't have hardware
    > perchance, do you?


    No, otherwise I told you so .
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  7. Re: [PATCH 4/12] riscom8: fix SMP brokenness

    On 10/24/2007 09:10 AM, Andrew Morton wrote:
    > On Wed, 24 Oct 2007 08:47:23 +0200 Jiri Slaby wrote:
    >
    >>> +static spinlock_t riscom_lock = SPIN_LOCK_UNLOCKED;

    >> This is deprecated (see linux/spinlock_types.h for details), use DEFINE_SPINLOCK
    >> instead, otherwise seems OK.

    >
    > Hey, if only we had a little perl script to check stuff like that.


    Can we integrate this into checkpatch?
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. Re: [PATCH 4/12] riscom8: fix SMP brokenness

    On Wed, 24 Oct 2007 09:44:07 +0200 Jiri Slaby wrote:

    > On 10/24/2007 09:10 AM, Andrew Morton wrote:
    > > On Wed, 24 Oct 2007 08:47:23 +0200 Jiri Slaby wrote:
    > >
    > >>> +static spinlock_t riscom_lock = SPIN_LOCK_UNLOCKED;
    > >> This is deprecated (see linux/spinlock_types.h for details), use DEFINE_SPINLOCK
    > >> instead, otherwise seems OK.

    > >
    > > Hey, if only we had a little perl script to check stuff like that.

    >
    > Can we integrate this into checkpatch?


    We already did.

    Now we need to integrate checkpatch into git...
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  9. Re: [PATCH 6/12] KVM: work around SMP requirement

    Jeff Garzik wrote:
    > Adrian Bunk wrote:
    >> On Tue, Oct 23, 2007 at 06:36:40PM -0400, Jeff Garzik wrote:
    >>> KVM is currently completely broken for the !CONFIG_SMP case.
    >>>
    >>> drivers/kvm/kvm_main.c: In function ‘kvm_flush_remote_tlbs’:
    >>> drivers/kvm/kvm_main.c:220: error: implicit declaration of function
    >>> ‘smp_call_function_mask’
    >>>
    >>> Signed-off-by: Jeff Garzik
    >>> ---
    >>> I hope the KVM maintainer can come up with a better solution...
    >>>
    >>> diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig
    >>> index 8749fa4..e35fbc6 100644
    >>> --- a/drivers/kvm/Kconfig
    >>> +++ b/drivers/kvm/Kconfig
    >>> @@ -16,7 +16,7 @@ if VIRTUALIZATION
    >>>
    >>> config KVM
    >>> tristate "Kernel-based Virtual Machine (KVM) support"
    >>> - depends on X86 && EXPERIMENTAL
    >>> + depends on X86 && EXPERIMENTAL && SMP
    >>> ...

    >>
    >> Assuming it won't get fixed soon, the pattern would be "(SMP ||
    >> BROKEN)".
    >>
    >> The effect is the same, but this makes it more obvious that KVM does
    >> not depend architecturally on SMP but just broken.
    >>
    >> Of course, the preferred solution is to simply get KVM fixed...

    >
    > In general I agree, but I specifically avoided CONFIG_BROKEN in case
    > it was an intentional choice to require an SMP kernel.
    >


    Of course SMP is not required. I'll submit a patch to make
    smp_call_function_mask() available on UP kernels. Andrew, please don't
    apply the KVM Kconfig patch.

    --
    error compiling committee.c: too many arguments to function

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  10. Re: [PATCH 2/12] X86: fix nvidia HPET warning


    * Jeff Garzik wrote:

    > arch/x86/kernel/early-quirks.c:40: warning:
    > ‘nvidia_hpet_check’ defined but not used


    thanks, applied.

    Ingo
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  11. Re: [PATCH 1/12] X86: fix !CONFIG_SMP warning in processor.c


    * Jeff Garzik wrote:

    > Fix !CONFIG_SMP warning:
    >
    > arch/x86/kernel/acpi/processor.c: In function ‘arch_acpi_processor_init_pdc’:
    > arch/x86/kernel/acpi/processor.c:65: warning: unused variable ‘cpu’


    thanks, applied.

    Ingo
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  12. [patch] kvm: fix !SMP build error


    * Avi Kivity wrote:

    > Of course SMP is not required. I'll submit a patch to make
    > smp_call_function_mask() available on UP kernels. Andrew, please
    > don't apply the KVM Kconfig patch.


    i have triggered this and fixed it the right way - see the patch below.
    This fixes the 2.6.24-rc1 build error.

    Ingo

    ------------------->
    Subject: kvm: fix !SMP build error
    From: Ingo Molnar

    fix !SMP build error:

    drivers/kvm/kvm_main.c: In function 'kvm_flush_remote_tlbs':
    drivers/kvm/kvm_main.c:220: error: implicit declaration of function 'smp_call_function_mask'

    (and also avoid unused function warning related to up_smp_call_function()
    not making use of the 'func' parameter.)

    Signed-off-by: Ingo Molnar
    ---
    include/linux/smp.h | 7 +++++--
    1 file changed, 5 insertions(+), 2 deletions(-)

    Index: linux/include/linux/smp.h
    ================================================== =================
    --- linux.orig/include/linux/smp.h
    +++ linux/include/linux/smp.h
    @@ -84,11 +84,12 @@ void smp_prepare_boot_cpu(void);
    * These macros fold the SMP functionality into a single CPU system
    */
    #define raw_smp_processor_id() 0
    -static inline int up_smp_call_function(void)
    +static inline int up_smp_call_function(void (*func)(void *), void *info)
    {
    return 0;
    }
    -#define smp_call_function(func,info,retry,wait) (up_smp_call_function())
    +#define smp_call_function(func,info,retry,wait) \
    + (up_smp_call_function(func, info))
    #define on_each_cpu(func,info,retry,wait) \
    ({ \
    local_irq_disable(); \
    @@ -107,6 +108,8 @@ static inline void smp_send_reschedule(i
    local_irq_enable(); \
    0; \
    })
    +#define smp_call_function_mask(mask,func,info,wait) \
    + (up_smp_call_function(func, info))

    #endif /* !SMP */

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  13. Re: [patch] kvm: fix !SMP build error


    * Ingo Molnar wrote:

    > i have triggered this and fixed it the right way - see the patch
    > below. This fixes the 2.6.24-rc1 build error.


    and this followup patch is needed too if my patch is applied.

    Ingo

    ------------------->
    Subject: x86: fix build error in arch/x86/kernel/cpu/mtrr/main.c
    From: Ingo Molnar

    ipi_handler() must be available on !SMP too.

    Signed-off-by: Ingo Molnar
    ---
    arch/x86/kernel/cpu/mtrr/main.c | 6 ++----
    1 file changed, 2 insertions(+), 4 deletions(-)

    Index: linux/arch/x86/kernel/cpu/mtrr/main.c
    ================================================== =================
    --- linux.orig/arch/x86/kernel/cpu/mtrr/main.c
    +++ linux/arch/x86/kernel/cpu/mtrr/main.c
    @@ -139,13 +139,12 @@ struct set_mtrr_data {
    mtrr_type smp_type;
    };

    -#ifdef CONFIG_SMP
    -
    static void ipi_handler(void *info)
    /* [SUMMARY] Synchronisation handler. Executed by "other" CPUs.
    [RETURNS] Nothing.
    */
    {
    +#ifdef CONFIG_SMP
    struct set_mtrr_data *data = info;
    unsigned long flags;

    @@ -168,9 +167,8 @@ static void ipi_handler(void *info)

    atomic_dec(&data->count);
    local_irq_restore(flags);
    -}
    -
    #endif
    +}

    static inline int types_compatible(mtrr_type type1, mtrr_type type2) {
    return type1 == MTRR_TYPE_UNCACHABLE ||
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  14. [2.6 patch] x86/kernel/acpi/processor.c: fix SMP=n warning

    On Tue, Oct 23, 2007 at 06:36:33PM -0400, Jeff Garzik wrote:
    > Fix !CONFIG_SMP warning:
    >
    > arch/x86/kernel/acpi/processor.c: In function ‘arch_acpi_processor_init_pdc’:
    > arch/x86/kernel/acpi/processor.c:65: warning: unused variable ‘cpu’
    >
    > Signed-off-by: Jeff Garzik
    > ---
    > Ideally this warning should be hidden inside a wrapper or somesuch, to
    > camouflage the unneeded argument in !SMP case.
    >
    > diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
    > index 2ed0a4c..45e262a 100644
    > --- a/arch/x86/kernel/acpi/processor.c
    > +++ b/arch/x86/kernel/acpi/processor.c
    > @@ -62,7 +62,9 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
    > /* Initialize _PDC data based on the CPU vendor */
    > void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
    > {
    > +#ifdef CONFIG_SMP
    > unsigned int cpu = pr->id;
    > +#endif
    >...


    The #ifdef is ugly.

    What about the patch below instead?

    cu
    Adrian


    <-- snip -->



    This patch fixes the following warning with CONFIG_SMP=n:

    <-- snip -->

    ....
    arch/x86/kernel/acpi/processor.c: In function `arch_acpi_processor_init_pdc':
    arch/x86/kernel/acpi/processor.c:65: warning: unused variable `cpu'
    ....

    <-- snip -->

    Based on a patch by Jeff Garzik.

    Signed-off-by: Adrian Bunk

    ---
    96d83d412fb6530173110c872f1125ae21938a99
    diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
    index 2ed0a4c..f63e5ff 100644
    --- a/arch/x86/kernel/acpi/processor.c
    +++ b/arch/x86/kernel/acpi/processor.c
    @@ -62,8 +62,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
    /* Initialize _PDC data based on the CPU vendor */
    void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
    {
    - unsigned int cpu = pr->id;
    - struct cpuinfo_x86 *c = &cpu_data(cpu);
    + struct cpuinfo_x86 *c = &cpu_data(pr->id);

    pr->pdc = NULL;
    if (c->x86_vendor == X86_VENDOR_INTEL)

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  15. Re: [patch] kvm: fix !SMP build error


    * Ingo Molnar wrote:

    > * Ingo Molnar wrote:
    >
    > > i have triggered this and fixed it the right way - see the patch
    > > below. This fixes the 2.6.24-rc1 build error.

    >
    > and this followup patch is needed too if my patch is applied.


    plus the patch below is needed too in addition.

    Ingo

    ------------->
    Subject: x86: fix build error in arch/x86/kernel/nmi_32.c
    From: Ingo Molnar

    nmi_cpu_busy() must be available on !SMP too.

    Signed-off-by: Ingo Molnar
    ---
    arch/x86/kernel/nmi_32.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    Index: linux/arch/x86/kernel/nmi_32.c
    ================================================== =================
    --- linux.orig/arch/x86/kernel/nmi_32.c
    +++ linux/arch/x86/kernel/nmi_32.c
    @@ -53,13 +53,13 @@ static int unknown_nmi_panic_callback(st

    static int endflag __initdata = 0;

    -#ifdef CONFIG_SMP
    /* The performance counters used by NMI_LOCAL_APIC don't trigger when
    * the CPU is idle. To make sure the NMI watchdog really ticks on all
    * CPUs during the test make them busy.
    */
    static __init void nmi_cpu_busy(void *data)
    {
    +#ifdef CONFIG_SMP
    local_irq_enable_in_hardirq();
    /* Intentionally don't use cpu_relax here. This is
    to make sure that the performance counter really ticks,
    @@ -69,8 +69,8 @@ static __init void nmi_cpu_busy(void *da
    care if they get somewhat less cycles. */
    while (endflag == 0)
    mb();
    -}
    #endif
    +}

    static int __init check_nmi_watchdog(void)
    {
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  16. Re: [PATCH 3/12] ACPI sbs: fix retval warning

    Jeff Garzik wrote:
    > drivers/acpi/sbs.c: In function ‘acpi_battery_add’:
    > drivers/acpi/sbs.c:811: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result
    >
    > Additional cleanups:
    > * use struct acpi_battery in acpi_battery_remove() to clean up function
    > calls, just like acpi_battery_add() already does.
    >
    > * un-indent unregister call, as it mistakenly gives the impression that
    > it belongs inside the 'if' test
    >
    > * remove unneeded braces
    >
    > Signed-off-by: Jeff Garzik
    > ---
    >
    > diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
    > index 90fd09c..c5c011b 100644
    > --- a/drivers/acpi/sbs.c
    > +++ b/drivers/acpi/sbs.c
    > @@ -113,6 +113,7 @@ struct acpi_battery {
    > u16 spec;
    > u8 id;
    > u8 present:1;
    > + u8 have_sysfs:1;
    > };
    >
    > #define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
    > @@ -808,7 +809,8 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
    > }
    > battery->bat.get_property = acpi_sbs_battery_get_property;
    > result = power_supply_register(&sbs->device->dev, &battery->bat);
    > - device_create_file(battery->bat.dev, &alarm_attr);
    > + if (device_create_file(battery->bat.dev, &alarm_attr) == 0)
    > + battery->have_sysfs = 1;
    > printk(KERN_INFO PREFIX "%s [%s]: Battery Slot [%s] (battery %s)\n",
    > ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
    > battery->name, sbs->battery->present ? "present" : "absent");
    > @@ -817,14 +819,16 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
    >
    > static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
    > {
    > - if (sbs->battery[id].bat.dev)
    > - device_remove_file(sbs->battery[id].bat.dev, &alarm_attr);
    > - power_supply_unregister(&sbs->battery[id].bat);
    > + struct acpi_battery *battery = &sbs->battery[id];
    > +
    > + if (battery->have_sysfs)
    > + device_remove_file(battery->bat.dev, &alarm_attr);
    > +
    > + power_supply_unregister(&battery->bat);
    > +
    > #ifdef CONFIG_ACPI_PROCFS
    > - if (sbs->battery[id].proc_entry) {
    > - acpi_sbs_remove_fs(&(sbs->battery[id].proc_entry),
    > - acpi_battery_dir);
    > - }
    > + if (sbs->battery[id].proc_entry)
    > + acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir);


    Len, this seems to have been missed in the recent ACPI push.

    Can you queue this, or a similar fix, for the recently-added compiler
    warning (at the top of this email)?

    Jeff


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  17. Re: [patch] kvm: fix !SMP build error

    On Wed, 24 Oct 2007 20:11:07 +0200 Ingo Molnar wrote:

    >
    > * Ingo Molnar wrote:
    >
    > > * Ingo Molnar wrote:
    > >
    > > > i have triggered this and fixed it the right way - see the patch
    > > > below. This fixes the 2.6.24-rc1 build error.

    > >
    > > and this followup patch is needed too if my patch is applied.

    >
    > plus the patch below is needed too in addition.
    >
    > Ingo


    Hi,
    I'm still hitting this build error. Are these 3 patches not yet
    merged??

    Thanks.

    > ------------->
    > Subject: x86: fix build error in arch/x86/kernel/nmi_32.c
    > From: Ingo Molnar
    >
    > nmi_cpu_busy() must be available on !SMP too.
    >
    > Signed-off-by: Ingo Molnar
    > ---
    > arch/x86/kernel/nmi_32.c | 4 ++--
    > 1 file changed, 2 insertions(+), 2 deletions(-)
    >
    > Index: linux/arch/x86/kernel/nmi_32.c
    > ================================================== =================
    > --- linux.orig/arch/x86/kernel/nmi_32.c
    > +++ linux/arch/x86/kernel/nmi_32.c
    > @@ -53,13 +53,13 @@ static int unknown_nmi_panic_callback(st
    >
    > static int endflag __initdata = 0;
    >
    > -#ifdef CONFIG_SMP
    > /* The performance counters used by NMI_LOCAL_APIC don't trigger when
    > * the CPU is idle. To make sure the NMI watchdog really ticks on all
    > * CPUs during the test make them busy.
    > */
    > static __init void nmi_cpu_busy(void *data)
    > {
    > +#ifdef CONFIG_SMP
    > local_irq_enable_in_hardirq();
    > /* Intentionally don't use cpu_relax here. This is
    > to make sure that the performance counter really ticks,
    > @@ -69,8 +69,8 @@ static __init void nmi_cpu_busy(void *da
    > care if they get somewhat less cycles. */
    > while (endflag == 0)
    > mb();
    > -}
    > #endif
    > +}
    >
    > static int __init check_nmi_watchdog(void)
    > {
    > -


    ---
    ~Randy
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  18. Re: [patch] kvm: fix !SMP build error


    * Randy Dunlap wrote:

    > > > and this followup patch is needed too if my patch is applied.

    > >
    > > plus the patch below is needed too in addition.
    > >
    > > Ingo

    >
    > Hi,
    > I'm still hitting this build error. Are these 3 patches not yet
    > merged??


    i thought we agreed it would go in via KVM. Can send it as part of the
    scheduler git tree too, these patches are working fine for me. Avi?

    Ingo
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  19. Re: [patch] kvm: fix !SMP build error

    Ingo Molnar wrote:
    > * Randy Dunlap wrote:
    >
    >
    >>>> and this followup patch is needed too if my patch is applied.
    >>>>
    >>> plus the patch below is needed too in addition.
    >>>
    >>> Ingo
    >>>

    >> Hi,
    >> I'm still hitting this build error. Are these 3 patches not yet
    >> merged??
    >>

    >
    > i thought we agreed it would go in via KVM. Can send it as part of the
    > scheduler git tree too, these patches are working fine for me. Avi?
    >
    >


    I thought you were handling it, as they aren't part of kvm proper. But
    I can send them, sure.


    --
    Any sufficiently difficult bug is indistinguishable from a feature.

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  20. Re: [patch] kvm: fix !SMP build error


    * Avi Kivity wrote:

    > I thought you were handling it, as they aren't part of kvm proper.
    > But I can send them, sure.


    i've got them in my queue already so i'll send them in the next
    scheduler batch, ok?

    Ingo
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast