There are many external factors affecting the placement of a smoke detector on the ceiling. Here we are looking at if a detector can be fitted close to a vertical wall. The formal guide is that a detector must never be placed anything less than 500mm from a wall. Therefore if you see your detector very close to a wall chances are that it has been installed incorrectly.
Reason: When smoke rises along a vertical surface at the point it contacts the ceiling the smoke rotates as its momentum due to heat cannot carry it any higher and it accelerates along the ceiling. If the detector is too close to this point the smoke has too much momentum and does not settle in the chamber. A smoke detector requires a certain amount of the smoke to gather in the chamber before activation.