Re: [RESEND PATCH 08/10] ide-floppy: mv idefloppy_{should_,}report_error

2008-01-05 Thread Bartlomiej Zolnierkiewicz
On Thursday 03 January 2008, Borislav Petkov wrote:
> Signed-off-by: Borislav Petkov <[EMAIL PROTECTED]>
> ---
>  drivers/ide/ide-floppy.c |6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
> index 2c139e7..fd5fe7b 100644
> --- a/drivers/ide/ide-floppy.c
> +++ b/drivers/ide/ide-floppy.c
> @@ -544,7 +544,7 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t 
> *drive)
>  }
>  
>  /* Supresses error messages resulting from Medium not present */
> -static inline int idefloppy_should_report_error(idefloppy_t *floppy)
> +static inline int idefloppy_report_error(idefloppy_t *floppy)

wait, this function does indeed check if it _should_ report the error
(it doesn't report it itself)... however...

>  {
>   if (floppy->sense_key == 0x02 &&
>   floppy->asc   == 0x3a &&
> @@ -587,7 +587,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t 
> *drive, idefloppy_pc_t *pc
>*/
>   if (!test_bit(PC_ABORT, >flags)) {
>   if (!test_bit(PC_SUPPRESS_ERROR, >flags)) {
> - if (idefloppy_should_report_error(floppy))
> + if (idefloppy_report_error(floppy))
>   printk(KERN_ERR "ide-floppy: %s: I/O 
> error, "
>  "pc = %2x, key = %2x, "
>  "asc = %2x, ascq = %2x\n",
> @@ -809,7 +809,7 @@ static ide_startstop_t idefloppy_do_request(ide_drive_t 
> *drive,
>  
>   if (rq->errors >= ERROR_MAX) {
>   if (floppy->failed_pc != NULL) {
> - if (idefloppy_should_report_error(floppy))
> + if (idefloppy_report_error(floppy))
>   printk(KERN_ERR "ide-floppy: %s: I/O error,"
>   " pc = %2x, key = %2x, asc = %2x,"
>   " ascq = %2x\n",

if you move the printk() into the function the new name would suddenly
make sense! :)

it may be also worth to remove 'inline' from idefloppy_report_error()
while at it (this function is not performance critical and this should
cut some bytes from the driver binary)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND PATCH 08/10] ide-floppy: mv idefloppy_{should_,}report_error

2008-01-05 Thread Bartlomiej Zolnierkiewicz
On Thursday 03 January 2008, Borislav Petkov wrote:
 Signed-off-by: Borislav Petkov [EMAIL PROTECTED]
 ---
  drivers/ide/ide-floppy.c |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
 index 2c139e7..fd5fe7b 100644
 --- a/drivers/ide/ide-floppy.c
 +++ b/drivers/ide/ide-floppy.c
 @@ -544,7 +544,7 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t 
 *drive)
  }
  
  /* Supresses error messages resulting from Medium not present */
 -static inline int idefloppy_should_report_error(idefloppy_t *floppy)
 +static inline int idefloppy_report_error(idefloppy_t *floppy)

wait, this function does indeed check if it _should_ report the error
(it doesn't report it itself)... however...

  {
   if (floppy-sense_key == 0x02 
   floppy-asc   == 0x3a 
 @@ -587,7 +587,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t 
 *drive, idefloppy_pc_t *pc
*/
   if (!test_bit(PC_ABORT, pc-flags)) {
   if (!test_bit(PC_SUPPRESS_ERROR, pc-flags)) {
 - if (idefloppy_should_report_error(floppy))
 + if (idefloppy_report_error(floppy))
   printk(KERN_ERR ide-floppy: %s: I/O 
 error, 
  pc = %2x, key = %2x, 
  asc = %2x, ascq = %2x\n,
 @@ -809,7 +809,7 @@ static ide_startstop_t idefloppy_do_request(ide_drive_t 
 *drive,
  
   if (rq-errors = ERROR_MAX) {
   if (floppy-failed_pc != NULL) {
 - if (idefloppy_should_report_error(floppy))
 + if (idefloppy_report_error(floppy))
   printk(KERN_ERR ide-floppy: %s: I/O error,
pc = %2x, key = %2x, asc = %2x,
ascq = %2x\n,

if you move the printk() into the function the new name would suddenly
make sense! :)

it may be also worth to remove 'inline' from idefloppy_report_error()
while at it (this function is not performance critical and this should
cut some bytes from the driver binary)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RESEND PATCH 08/10] ide-floppy: mv idefloppy_{should_,}report_error

2008-01-03 Thread Borislav Petkov
Signed-off-by: Borislav Petkov <[EMAIL PROTECTED]>
---
 drivers/ide/ide-floppy.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 2c139e7..fd5fe7b 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -544,7 +544,7 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t 
*drive)
 }
 
 /* Supresses error messages resulting from Medium not present */
-static inline int idefloppy_should_report_error(idefloppy_t *floppy)
+static inline int idefloppy_report_error(idefloppy_t *floppy)
 {
if (floppy->sense_key == 0x02 &&
floppy->asc   == 0x3a &&
@@ -587,7 +587,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t 
*drive, idefloppy_pc_t *pc
 */
if (!test_bit(PC_ABORT, >flags)) {
if (!test_bit(PC_SUPPRESS_ERROR, >flags)) {
-   if (idefloppy_should_report_error(floppy))
+   if (idefloppy_report_error(floppy))
printk(KERN_ERR "ide-floppy: %s: I/O 
error, "
   "pc = %2x, key = %2x, "
   "asc = %2x, ascq = %2x\n",
@@ -809,7 +809,7 @@ static ide_startstop_t idefloppy_do_request(ide_drive_t 
*drive,
 
if (rq->errors >= ERROR_MAX) {
if (floppy->failed_pc != NULL) {
-   if (idefloppy_should_report_error(floppy))
+   if (idefloppy_report_error(floppy))
printk(KERN_ERR "ide-floppy: %s: I/O error,"
" pc = %2x, key = %2x, asc = %2x,"
" ascq = %2x\n",
-- 
1.5.3.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RESEND PATCH 08/10] ide-floppy: mv idefloppy_{should_,}report_error

2008-01-03 Thread Borislav Petkov
Signed-off-by: Borislav Petkov [EMAIL PROTECTED]
---
 drivers/ide/ide-floppy.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 2c139e7..fd5fe7b 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -544,7 +544,7 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t 
*drive)
 }
 
 /* Supresses error messages resulting from Medium not present */
-static inline int idefloppy_should_report_error(idefloppy_t *floppy)
+static inline int idefloppy_report_error(idefloppy_t *floppy)
 {
if (floppy-sense_key == 0x02 
floppy-asc   == 0x3a 
@@ -587,7 +587,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t 
*drive, idefloppy_pc_t *pc
 */
if (!test_bit(PC_ABORT, pc-flags)) {
if (!test_bit(PC_SUPPRESS_ERROR, pc-flags)) {
-   if (idefloppy_should_report_error(floppy))
+   if (idefloppy_report_error(floppy))
printk(KERN_ERR ide-floppy: %s: I/O 
error, 
   pc = %2x, key = %2x, 
   asc = %2x, ascq = %2x\n,
@@ -809,7 +809,7 @@ static ide_startstop_t idefloppy_do_request(ide_drive_t 
*drive,
 
if (rq-errors = ERROR_MAX) {
if (floppy-failed_pc != NULL) {
-   if (idefloppy_should_report_error(floppy))
+   if (idefloppy_report_error(floppy))
printk(KERN_ERR ide-floppy: %s: I/O error,
 pc = %2x, key = %2x, asc = %2x,
 ascq = %2x\n,
-- 
1.5.3.7

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/