* [Qemu-devel] Query about BiteSizeTasks
@ 2016-03-21 13:41 haris iqbal
2016-03-21 13:56 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: haris iqbal @ 2016-03-21 13:41 UTC (permalink / raw)
To: qemu-devel
Hello,
I saw a task which says to " Add checks for NULL return value to uses
of load_image_targphys,...". But what I saw in the codebase,
load_image_targphys() returns int. So why should it be checks for
NULL.
NULL check is for pointer which can also be changed to (void *)0.
Should the return value be checked for 0. But when I saw what the
function is doing, it basically is what lseek will return in
get_image_size() and lseek return (off_t)-1 if it fails.
--
With regards,
Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Query about BiteSizeTasks
2016-03-21 13:41 [Qemu-devel] Query about BiteSizeTasks haris iqbal
@ 2016-03-21 13:56 ` Paolo Bonzini
2016-03-21 14:09 ` haris iqbal
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2016-03-21 13:56 UTC (permalink / raw)
To: haris iqbal, qemu-devel
On 21/03/2016 14:41, haris iqbal wrote:
> Hello,
>
> I saw a task which says to " Add checks for NULL return value to uses
> of load_image_targphys,...". But what I saw in the codebase,
> load_image_targphys() returns int. So why should it be checks for
> NULL.
You're right, in the case of load_image_targphys the error value is -1.
I've fixed the wiki page.
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Query about BiteSizeTasks
2016-03-21 13:56 ` Paolo Bonzini
@ 2016-03-21 14:09 ` haris iqbal
2016-03-22 4:34 ` haris iqbal
0 siblings, 1 reply; 5+ messages in thread
From: haris iqbal @ 2016-03-21 14:09 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Mon, Mar 21, 2016 at 7:26 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 21/03/2016 14:41, haris iqbal wrote:
>> Hello,
>>
>> I saw a task which says to " Add checks for NULL return value to uses
>> of load_image_targphys,...". But what I saw in the codebase,
>> load_image_targphys() returns int. So why should it be checks for
>> NULL.
>
> You're right, in the case of load_image_targphys the error value is -1.
> I've fixed the wiki page.
Thanks.
>
> Paolo
--
With regards,
Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Query about BiteSizeTasks
2016-03-21 14:09 ` haris iqbal
@ 2016-03-22 4:34 ` haris iqbal
2016-03-22 8:30 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: haris iqbal @ 2016-03-22 4:34 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
Hello,
One more thing I noticed was that there is no function prototype for
the function get_ticks_per_sec().
I was planning to use a script to change all the used of
get_ticks_per_sec() to NANOSECONDS_PER_SECOND with an exception of the
function definition itself in include/qemu/timer.h. SO wanted to know
if there is a function prototype that should also be skipped.
On Mon, Mar 21, 2016 at 7:39 PM, haris iqbal <haris.phnx@gmail.com> wrote:
> On Mon, Mar 21, 2016 at 7:26 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 21/03/2016 14:41, haris iqbal wrote:
>>> Hello,
>>>
>>> I saw a task which says to " Add checks for NULL return value to uses
>>> of load_image_targphys,...". But what I saw in the codebase,
>>> load_image_targphys() returns int. So why should it be checks for
>>> NULL.
>>
>> You're right, in the case of load_image_targphys the error value is -1.
>> I've fixed the wiki page.
>
>
> Thanks.
>
>>
>> Paolo
>
>
>
> --
>
> With regards,
>
> Md Haris Iqbal,
> Placement Coordinator, MTech IT
> NITK Surathkal,
> Contact: +91 8861996962
--
With regards,
Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Query about BiteSizeTasks
2016-03-22 4:34 ` haris iqbal
@ 2016-03-22 8:30 ` Paolo Bonzini
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2016-03-22 8:30 UTC (permalink / raw)
To: haris iqbal; +Cc: qemu-devel
On 22/03/2016 05:34, haris iqbal wrote:
> Hello,
>
> One more thing I noticed was that there is no function prototype for
> the function get_ticks_per_sec().
>
> I was planning to use a script to change all the used of
> get_ticks_per_sec() to NANOSECONDS_PER_SECOND with an exception of the
> function definition itself in include/qemu/timer.h. SO wanted to know
> if there is a function prototype that should also be skipped.
A patch for this has already been posted, though it's not yet in qemu.git.
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-22 8:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 13:41 [Qemu-devel] Query about BiteSizeTasks haris iqbal
2016-03-21 13:56 ` Paolo Bonzini
2016-03-21 14:09 ` haris iqbal
2016-03-22 4:34 ` haris iqbal
2016-03-22 8:30 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.