public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] device-drivers: acpi: update for Linux kernel 2.6.37+
Date: Thu, 5 Sep 2013 12:03:52 +0200	[thread overview]
Message-ID: <20130905100351.GB2770@rei> (raw)
In-Reply-To: <1378318684-29558-1-git-send-email-alexey.kodanev@oracle.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 2503 bytes --]

Hi!
> +int LTPMAJOR;
>  // define the ioctl cmds
>  #define LTPDEV_CMD       _IOR( LTPMAJOR, LTP_IOCTL_NUMBER, ltpdev_cmd_t **)
> -
> diff --git a/testcases/kernel/device-drivers/acpi/LtpAcpiCmds.c b/testcases/kernel/device-drivers/acpi/LtpAcpiCmds.c
> index 26fcc15..1e85242 100644
> --- a/testcases/kernel/device-drivers/acpi/LtpAcpiCmds.c
> +++ b/testcases/kernel/device-drivers/acpi/LtpAcpiCmds.c
> @@ -28,6 +28,8 @@
>   *  01/03/2009 Márton Németh <nm127@freemail.hu>
>   *   - Updated for Linux kernel 2.6.28
>   *
> + *  09/2013 Alexey Kodanev <alexey.kodanev@oracle.com>
> + *   - Updated for Linux kernel 2.6.37
>   */

Linux-2.6.37 is quite old, does it compile with Linux-3.10?

Ideally it should work with broad range of kernels but that would likely
require great number of ifdefs...


> diff --git a/testcases/kernel/device-drivers/acpi/LtpAcpiMain.c b/testcases/kernel/device-drivers/acpi/LtpAcpiMain.c
> index c3e9c91..ed90784 100644
> --- a/testcases/kernel/device-drivers/acpi/LtpAcpiMain.c
> +++ b/testcases/kernel/device-drivers/acpi/LtpAcpiMain.c
> @@ -42,6 +42,10 @@
>  
>  #include "LtpAcpi.h"
>  
> +#include "test.h"
> +
> +char *TCID = "LTP_ACPI";
> +
>  int LTP_acpi_open_block_device(void);
>  
>  int ltp_block_dev_handle = 0;	/* handle to LTP Test block device */
> @@ -66,7 +70,6 @@ int main(int argc, char **argv)
>  			     LTP_ACPI_DEVICE_NAME, ltp_block_dev_handle, errno);
>  		} else {
>  			rc = ioctl(ltp_block_dev_handle, LTPDEV_CMD, &cmd);
> -
>  			printf("return from ioctl %d \n", rc);
>  		}
>  
> @@ -81,7 +84,7 @@ int LTP_acpi_open_block_device()
>  {
>  	dev_t devt;
>  	struct stat statbuf;
> -	int rc;
> +	int rc = -1;
>  
>  	if (ltp_block_dev_handle == 0) {
>  
> @@ -90,6 +93,11 @@ int LTP_acpi_open_block_device()
>  		 * If devfs is running and mounted on /dev, these checks will all pass,
>  		 * so a new node will not be created.
>  		 */
> +
> +		SAFE_FILE_SCANF(NULL, "/sys/devices/virtual/block/"
> +			LTP_ACPI_DEV_NAME"/dev",
> +			"%d:0", &LTPMAJOR);
> +
>  		devt = makedev(LTPMAJOR, 0);
>  
>  		rc = stat(LTP_ACPI_DEV_NODE_PATH, &statbuf);

It would be better to convert this code to full LTP test so we can drop
the ltpapci.sh script.

Also there doesn't seem to be any success/failure logic. It looks like
the program just opens the device and does some ioctls(). Do you have an
idea what is the purpose of this test?

-- 
Cyril Hrubis
chrubis@suse.cz


[-- Attachment #2: Type: text/plain, Size: 433 bytes --]

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2013-09-05 10:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 18:18 [LTP] [PATCH] device-drivers: acpi: update for Linux kernel 2.6.37+ Alexey Kodanev
2013-09-05 10:03 ` chrubis [this message]
     [not found]   ` <52286FC2.7000609@oracle.com>
2013-09-09 11:43     ` chrubis
     [not found]       ` <522DC023.2090902@oracle.com>
2013-09-09 14:04         ` chrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130905100351.GB2770@rei \
    --to=chrubis@suse.cz \
    --cc=alexey.kodanev@oracle.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vasily.isaenko@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox