Skip to contentSkip to conversation

drivers: devfreq: Drop unlikely before IS_ERR(_OR_NULL)

PATCH MyungJoo Ham 2 participants 2 messages Aug 3, 2015

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines

IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.

@ from include/linux/err.h
#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
...
static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)

{
	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
}

"!ptr" appears not covered with IS_ERR_OR_NULL.
(only the IS_ERR part seems covered)

Cheers,
MyungJoo

#1 lore raw
Quoted 9 lines · MyungJoo Ham
Quoted 4 lines

IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it.

@ from include/linux/err.h
#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
...
static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)

Quoted 6 lines
{
	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
}

"!ptr" appears not covered with IS_ERR_OR_NULL.
(only the IS_ERR part seems covered)

Right, the first patch of the series has fixed that.

http://permalink.gmane.org/gmane.linux.kernel/2009151

Signature · 1 line
viresh