Re: [PATCH v2] goldfish: Fix unused const variable 'goldfish_pipe_acpi_match'

From: Zeng Heng
Date: Wed Nov 06 2024 - 21:29:28 EST



On 2024/11/6 23:57, Andy Shevchenko wrote:
On Sat, Oct 26, 2024 at 03:01:50PM +0800, Zeng Heng wrote:
Fix the following compilation warning:

drivers/platform/goldfish/goldfish_pipe.c:925:36: warning:
‘goldfish_pipe_acpi_match’ defined but not used
[-Wunused-const-variable=]
925 | static const struct acpi_device_id goldfish_pipe_acpi_match[] = {

The complexity of config guards needed for ACPI_PTR() is not worthwhile
for the small amount of saved data. So remove the use of ACPI_PTR instead
and drop now unneeded linux/acpi.h include.
...

#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/mm.h>
-#include <linux/acpi.h>
Because header inclusions are unsorted, it's unclear if there is
mod_devicetable.h included. If not, you should replace acpi.h with
mod_devicetable.h.

Yes, I checked mod_devicetable.h had been already included in goldfish_pipe_qemu.c before.

After the patch is applied, the header files included in the source file are as follows:

~~~

#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/miscdevice.h>
#include <linux/platform_device.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/bitops.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/mm.h>
#include <linux/bug.h>
#include "goldfish_pipe_qemu.h"

~~~


Best regards,

Zeng Heng