This removes the conversion of elements parsed by sscanf() which
are not used anyhow and eliminates a warning on x86 builds
(%lu used on size_t).
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
*/
static int warn_userspace_probe_syntax(const char *symbol)
{
*/
static int warn_userspace_probe_syntax(const char *symbol)
{
- unsigned long addr = 0;
- size_t offset = 0;
int ret;
/* Check if the symbol field is an hex address. */
int ret;
/* Check if the symbol field is an hex address. */
- ret = sscanf(symbol, "0x%lx", &addr);
+ ret = sscanf(symbol, "0x%*x");
if (ret > 0) {
/* If there is a match, print a warning and return an error. */
ERR("Userspace probe on address not supported yet.");
if (ret > 0) {
/* If there is a match, print a warning and return an error. */
ERR("Userspace probe on address not supported yet.");
}
/* Check if the symbol field is an decimal address. */
}
/* Check if the symbol field is an decimal address. */
- ret = sscanf(symbol, "%lu", &addr);
+ ret = sscanf(symbol, "%*u");
if (ret > 0) {
/* If there is a match, print a warning and return an error. */
ERR("Userspace probe on address not supported yet.");
if (ret > 0) {
/* If there is a match, print a warning and return an error. */
ERR("Userspace probe on address not supported yet.");
}
/* Check if the symbol field is symbol+hex_offset. */
}
/* Check if the symbol field is symbol+hex_offset. */
- ret = sscanf(symbol, "%*[^+]+0x%lx", &offset);
+ ret = sscanf(symbol, "%*[^+]+0x%*x");
if (ret > 0) {
/* If there is a match, print a warning and return an error. */
ERR("Userspace probe on symbol+offset not supported yet.");
if (ret > 0) {
/* If there is a match, print a warning and return an error. */
ERR("Userspace probe on symbol+offset not supported yet.");
}
/* Check if the symbol field is symbol+decimal_offset. */
}
/* Check if the symbol field is symbol+decimal_offset. */
- ret = sscanf(symbol, "%*[^+]+%lu", &offset);
+ ret = sscanf(symbol, "%*[^+]+%*u");
if (ret > 0) {
/* If there is a match, print a warning and return an error. */
ERR("Userspace probe on symbol+offset not supported yet.");
if (ret > 0) {
/* If there is a match, print a warning and return an error. */
ERR("Userspace probe on symbol+offset not supported yet.");