From: Jean Delvare <jdelvare@suse.de>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Jean Delvare <jdelvare@suse.com>,
Wolfram Sang <wsa@the-dreams.de>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Andy Lutomirski <luto@kernel.org>,
Mario Limonciello <mario_limonciello@dell.com>,
pali.rohar@gmail.com, Matt Fleming <matt@codeblueprint.co.uk>,
linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v4] i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR
Date: Thu, 19 May 2016 11:45:46 +0200 [thread overview]
Message-ID: <20160519114546.65433c59@endymion> (raw)
In-Reply-To: <1463143555-20261-1-git-send-email-mika.westerberg@linux.intel.com>
Hi Mika,
On Fri, 13 May 2016 15:45:55 +0300, Mika Westerberg wrote:
> + if (function == ACPI_READ)
> + status = acpi_os_read_port(address, (u32 *)value, bits);
> + else
> + status = acpi_os_write_port(address, (u32)*value, bits);
Jeremy McNicoll at RedHat brought to my attention that this may not be
safe. This assumes that function is either exactly ACPI_READ or exactly
ACPI_WRITE. However function is a 32-bit bitfield if I understand
correctly.
Shouldn't it instead be:
if ((function & ACPI_IO_MASK) == ACPI_READ)
as drivers exfldio, acpi_ipmi and i2c-core do? Maybe it makes no
difference if other bits are never used, but maybe they will be in the
future.
Thanks,
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2016-05-19 9:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 12:45 [PATCH v4] i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR Mika Westerberg
2016-05-17 10:45 ` Jean Delvare
2016-05-19 9:45 ` Jean Delvare [this message]
2016-05-19 10:09 ` Mika Westerberg
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=20160519114546.65433c59@endymion \
--to=jdelvare@suse.de \
--cc=jarkko.nikula@linux.intel.com \
--cc=jdelvare@suse.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mario_limonciello@dell.com \
--cc=matt@codeblueprint.co.uk \
--cc=mika.westerberg@linux.intel.com \
--cc=pali.rohar@gmail.com \
--cc=rjw@rjwysocki.net \
--cc=wsa@the-dreams.de \
/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;
as well as URLs for NNTP newsgroup(s).