Re: [PATCH v2 4/6] parse-options.c: use optbug() instead of BUG() "opts" check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Josh Steadmon <steadmon@xxxxxxxxxx> writes:

>> +			if (!opts->ll_callback) {
>> +				optbug(opts, "OPTION_LOWLEVEL_CALLBACK needs a callback");
>> +				break;
>> +			}
>> +			if (opts->callback) {
>> +				optbug(opts, "OPTION_LOWLEVEL_CALLBACK needs no high level callback");
>> +				break;
>> +			}
>>  			break;
>
> A minor point, but I'm not sure I understand why we're adding breaks for
> the two cases above. In the OPTION_CALLBACK case, the if conditions are
> mutually exclusive and are followed by an unconditional break, so adding
> additional breaks seems unnecessary.

Yeah, good thinking.  

> For the OPTION_LOWLEVEL_CALLBACK
> case, the conditions are not mutually exclusive, but isn't this exactly
> the issue that optbug() is intended to address? I.e., wouldn't the
> caller want to see both optbug()s if both are relevant?

Exactly.

Thanks for a careful reading.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux