2008-10-07 18:32:14

by Mark de Wever

[permalink] [raw]
Subject: [patch][repost] ide-tape build fix

I never got a reaction on this patch, but please apply it.

In order to compile the kernel with IDETAPE_DEBUG_LOG enabled I had to
apply the following build fix.

Signed-off-by: Mark de Wever <[email protected]>

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3833189..7258eca 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -978,9 +978,10 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
struct request *postponed_rq = tape->postponed_rq;
u8 stat;

- debug_log(DBG_SENSE, "sector: %ld, nr_sectors: %ld,"
+ debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %ld,"
" current_nr_sectors: %d\n",
- rq->sector, rq->nr_sectors, rq->current_nr_sectors);
+ (unsigned long long)rq->sector, rq->nr_sectors,
+ rq->current_nr_sectors);

if (!blk_special_request(rq)) {
/* We do not support buffer cache originated requests. */

Regards,
Mark de Wever


2008-10-08 06:34:18

by Borislav Petkov

[permalink] [raw]
Subject: Re: [patch][repost] ide-tape build fix

Hi,

On Tue, Oct 07, 2008 at 08:26:15PM +0200, Mark de Wever wrote:
> I never got a reaction on this patch, but please apply it.
>
> In order to compile the kernel with IDETAPE_DEBUG_LOG enabled I had to
> apply the following build fix.

Bugger, I should be getting at least warnings when compiling this but I don't.
This is because I don't have CONFIG_LBD enabled. However, the %ld and %d
format specifiers are also not entirely correct but gcc doesn't warn about them
- I guess it checks only size but not signedness...

> Signed-off-by: Mark de Wever <[email protected]>
>
> diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
> index 3833189..7258eca 100644
> --- a/drivers/ide/ide-tape.c
> +++ b/drivers/ide/ide-tape.c
> @@ -978,9 +978,10 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
> struct request *postponed_rq = tape->postponed_rq;
> u8 stat;
>
> - debug_log(DBG_SENSE, "sector: %ld, nr_sectors: %ld,"
> + debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %ld,"

the other format specifiers should be rq->nr_sectors: %lu, rq->current_nr_sectors: %u.

> " current_nr_sectors: %d\n",
> - rq->sector, rq->nr_sectors, rq->current_nr_sectors);
> + (unsigned long long)rq->sector, rq->nr_sectors,
> + rq->current_nr_sectors);
>
> if (!blk_special_request(rq)) {
> /* We do not support buffer cache originated requests. */
>

Would you like to redo your patch and add a proper comment ontop?

Thanks.

--
Regards/Gruss,
Boris.

2008-10-08 15:47:18

by Mark de Wever

[permalink] [raw]
Subject: Re: [patch][repost] ide-tape build fix

On Wed, Oct 08, 2008 at 08:33:52AM +0200, Borislav Petkov wrote:
Hi,
> Bugger, I should be getting at least warnings when compiling this but I don't.
> This is because I don't have CONFIG_LBD enabled. However, the %ld and %d
> format specifiers are also not entirely correct but gcc doesn't warn about them
> - I guess it checks only size but not signedness...

I guess so too.

> Would you like to redo your patch and add a proper comment ontop?

Here you go.

@Boris do you want to add your Signed-off-by too?

@Bart please apply this patch.

--
Subject: ide-tape: Buildfix when IDETAPE_DEBUG_LOG is set to 1.

The format specifier for rq->sector didn't specify the proper size and
signedness. Borislav Petkov discovered that the signedness for
rq->nr_sectors and rq->current_nr_sectors also were incorrect.

Signed-off-by: Mark de Wever <[email protected]>
---
drivers/ide/ide-tape.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3833189..3d5f782 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -978,9 +978,10 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
struct request *postponed_rq = tape->postponed_rq;
u8 stat;

- debug_log(DBG_SENSE, "sector: %ld, nr_sectors: %ld,"
- " current_nr_sectors: %d\n",
- rq->sector, rq->nr_sectors, rq->current_nr_sectors);
+ debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %lu,"
+ " current_nr_sectors: %u\n",
+ (unsigned long long)rq->sector, rq->nr_sectors,
+ rq->current_nr_sectors);

if (!blk_special_request(rq)) {
/* We do not support buffer cache originated requests. */
--
1.5.6.5

Regards,
Mark de Wever

2008-10-08 16:22:30

by Borislav Petkov

[permalink] [raw]
Subject: Re: [patch][repost] ide-tape build fix

On Wed, Oct 8, 2008 at 5:45 PM, Mark de Wever <[email protected]> wrote:
> On Wed, Oct 08, 2008 at 08:33:52AM +0200, Borislav Petkov wrote:
> Hi,
>> Bugger, I should be getting at least warnings when compiling this but I don't.
>> This is because I don't have CONFIG_LBD enabled. However, the %ld and %d
>> format specifiers are also not entirely correct but gcc doesn't warn about them
>> - I guess it checks only size but not signedness...
>
> I guess so too.
>
>> Would you like to redo your patch and add a proper comment ontop?
>
> Here you go.
>
> @Boris do you want to add your Signed-off-by too?

no, just

Acked-by: Borislav Petkov <[email protected]>

> @Bart please apply this patch.
>
> --
> Subject: ide-tape: Buildfix when IDETAPE_DEBUG_LOG is set to 1.
>
> The format specifier for rq->sector didn't specify the proper size and
> signedness. Borislav Petkov discovered that the signedness for
> rq->nr_sectors and rq->current_nr_sectors also were incorrect.
>
> Signed-off-by: Mark de Wever <[email protected]>
> ---
> drivers/ide/ide-tape.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
> index 3833189..3d5f782 100644
> --- a/drivers/ide/ide-tape.c
> +++ b/drivers/ide/ide-tape.c
> @@ -978,9 +978,10 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
> struct request *postponed_rq = tape->postponed_rq;
> u8 stat;
>
> - debug_log(DBG_SENSE, "sector: %ld, nr_sectors: %ld,"
> - " current_nr_sectors: %d\n",
> - rq->sector, rq->nr_sectors, rq->current_nr_sectors);
> + debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %lu,"
> + " current_nr_sectors: %u\n",
> + (unsigned long long)rq->sector, rq->nr_sectors,
> + rq->current_nr_sectors);
>
> if (!blk_special_request(rq)) {
> /* We do not support buffer cache originated requests. */
> --
> 1.5.6.5
>
> Regards,
> Mark de Wever
>

--
Regards/Gruss,
Boris

Subject: Re: [patch][repost] ide-tape build fix

On Wednesday 08 October 2008, Boris Petkov wrote:
> On Wed, Oct 8, 2008 at 5:45 PM, Mark de Wever <[email protected]> wrote:
> > On Wed, Oct 08, 2008 at 08:33:52AM +0200, Borislav Petkov wrote:
> > Hi,
> >> Bugger, I should be getting at least warnings when compiling this but I don't.
> >> This is because I don't have CONFIG_LBD enabled. However, the %ld and %d
> >> format specifiers are also not entirely correct but gcc doesn't warn about them
> >> - I guess it checks only size but not signedness...
> >
> > I guess so too.
> >
> >> Would you like to redo your patch and add a proper comment ontop?
> >
> > Here you go.
> >
> > @Boris do you want to add your Signed-off-by too?
>
> no, just
>
> Acked-by: Borislav Petkov <[email protected]>
>
> > @Bart please apply this patch.
> >
> > --
> > Subject: ide-tape: Buildfix when IDETAPE_DEBUG_LOG is set to 1.
> >
> > The format specifier for rq->sector didn't specify the proper size and
> > signedness. Borislav Petkov discovered that the signedness for
> > rq->nr_sectors and rq->current_nr_sectors also were incorrect.
> >
> > Signed-off-by: Mark de Wever <[email protected]>

applied