Re: [PATCH v2 4/6] drm: scrambling support in drm layer

Jose Abreu
2017-02-08T12:27:31Z

Hi Jani,

On 07-02-2017 15:09, Jani Nikula wrote:
> On Tue, 07 Feb 2017, Jose Abreu <Jose.Abreu@synopsys.com> wrote:
>> Hi Jani,
>>
>>
>> On 07-02-2017 13:35, Jani Nikula wrote:
>>> On Tue, 07 Feb 2017, Jose Abreu <Jose.Abreu@synopsys.com> wrote:
>>>>> +bool drm_scdc_check_scrambling_status(struct i2c_adapter *adapter)
>>>>> +{
>>>>> + u8 status;
>>>>> + int ret;
>>>>> +
>>>>> + ret = drm_scdc_readb(adapter, SCDC_SCRAMBLER_STATUS, &status);
>>>>> + if (ret < 0) {
>>>>> + DRM_ERROR("Failed to read scrambling status, error %d\n", ret);
>>>>> + return false;
>>>>> + }
>>>>> +
>>>>> + return status & SCDC_SCRAMBLING_STATUS;
>>>> "return (status & SCDC_SCRAMBLING_STATUS) > 0;" ?
>>> What's the point in that?
>>>
>>> BR,
>>> Jani.
>>>
>>>
>> Sorry, I didn't see the SCDC_SCRAMBLING_STATUS is BIT(0). Anyway,
>> my intention was to return either 1 or 0 or else the value of the
>> "and" would be returned. I think in x86 the bool is char, what
>> could happen if SCDC_SCRAMBLING_STATUS was BIT(>7)? Does the cast
>> work as expected?
> The implicit type conversion works just fine.

Hmm, are you sure? I'm reading this thread:
http://yarchive.net/comp/linux/bool.html (see Linus last answer).

(This is just for curiosity anyway).

Best regards,
Jose Miguel Abreu

>
> BR,
> Jani.
>
>> Best regards,
>> Jose Miguel Abreu
>>