Actually I think it would void the warranty. I went and looked up the warranty information on laptops and it says :
"This Limited Warranty does not apply to expendable parts. This Limited Warranty does not extend to any product from which the serial number has been removed or that has been damaged or rendered defective (a) as a result of accident, misuse, abuse, or other external causes; (b) by operation outside the usage parameters stated in the user documentation that shipped with the product; (c) by the use of parts not manufactured or sold by HP; or (d) by modification or service by anyone other than (i) HP, (ii) an HP authorized service provider, or (iii) your own installation of end-user replaceable HP or HP approved parts if available for your product in the servicing country."
It would actually depend on whether they considered the hard drive to be an end-user replaceable part. I know when I worked tech support for HP for desktops (a long time ago though and things may have considerably changed) we were told to inform customers that if anything was added (video card, another HDD, another optical drive, etc.) or changed the warranty would be voided if not done by a HP service center. Of course we are talking 6 - 7 years ago though. I would definately speak to HP first.